Request for Pentagons and Hexagons

  • updated
  • Completed

Hey!
It would be nice if the shapes library also supported regular pentagons and regular hexagons out of the box instead of having to construct them out of quads (I know, I'm lazy!).

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Pinned replies
Freya Holmér
  • Answer
  • Completed

this has now been added in the version after 2.2.0!

Freya Holmér
  • Planned

yeah!

so, gets a little complicated because there are like three routes I can go with this

  • I can make this a feature of the disc, where you can either have it be a circle, or, an n-sided regular polygon
    • this is nice because they are very similar in the features they should have
    • a downside of this though, is that hollow dashed polygons might get very complicated
  • I can make it a separate component similar to the disc
    • this is neat because I don't have to make sure to support all disc features (start/end angle, dashed, etc)
    • I could also add specialized things like corner radius
  • I can make it a separate component similar to the quad
    • The quad/triangle primitives are specifically per-vertex positioned stuff
    • this means it'd basically be a convex polygon component
    • although, this is a bit of a different thing. it's more flexible, but it's also something people would expect to also support being non-convex
    • also harder to anti-alias (for the same reason the quad and triangle don't have LAA

I'll likely go for the second option! with the last one coming at some later point, since triangulation in and of itself is a whole can of worms~

Andy M

Related - you can easily break the quad by making it non-convex given it only splits one-way.

So in time you may have to allow any number of points polygons!

Freya Holmér
  • Answer
  • Completed

this has now been added in the version after 2.2.0!