Adding random points to existing Polygon

Avatar
  • updated
  • Under Review

Hi! Can i add random points to existing Polygon without manual mesh triangulation? Seems like something wrong (or not) happening with triangulation when points not sorted in Points list.


I have this simple setup:

Image 539

Image 540

Code:

Image 541

After AddPoint() done:

Image 542

I've tried to use meshOutOfDate and UpdateMesh, but result always the same.

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Avatar
Freya Holmér creator
  • Under Review

I'm not sure what the desired result is - what do you mean by manual mesh triangulation?

the polygon will always have to be defined in the order of the points, and if that polygon is self-intersecting there's no valid triangulation it can do. If the points are completely random and unsorted, more often than not it can't triangulate because it's ambiguous what you would want it to do