#Any way to draw a self-intersecting polygon?

1 messages · Page 1 of 1 (latest)

wind star
#

Whenever a polygon I'm drawing intersects itself, it flickers and doesn't display correctly.
Does godot have any Geometry functions that would help? I don't see an easy set of methods to use and I'd prefer not having to implement something like the Bentley-Ottman algo to test if its self intersecting and divide it manually
I've tried drawing using a polygon node and with the _draw() method

upbeat briar
#

Polygon2D is an outline draw tool, outlines can not overlap or intersect, else their conversion step to actual "real" polygons does not work. You can use the Geometry2D class polygon clipping functions to merge outlines upfront to new outlines that do not overlap or intersect.

wind star
#

Thanks! thankfully my polygon was simple enough to break into smaller chunks that can't intersect

tawdry glen
#

Did you watch that procedural animation video? Just saw it yesterday lol