Cage opened this issue on Dec 20, 2006 · 1232 posts
Spanki posted Thu, 08 February 2007 at 2:49 AM
Quote - If needed, we can come up with some screening for concave polygons (I assume you mean concave polygons and not non-planar polygons... right? Either way, we can screen for them, but I'd need to know which you mean).
I'll assume that you do mean concave polygons, because if you mean non-planar, then we're in trouble (a huge percentage of Poser mesh quads are non-planar).
To test for concavity, it's much like the old check_bounds() code.. First, you only need to check polygons with 4 or more vertices. Next, you walk around the vertices, computing a normal at each one (a cross-product of the two edges that end in that vertex), as you do this, you compare signs of the Z axis of that normal and fail if they differ (the Z axis will flip from positive to negative or vise-versa if the polygon is concave... if they are all positive or all negative, it's convex).
Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.