Has anyone ever noticed that quite a few objects from the library of objects in Archicad are made of parts with polygons with the wrong winding order?
In theory, front-facing polygons should have vertices in counter-clockwise order, but some objects seems to specify them in clockwise order.
I'm showing an example of a bathtub here (from the Hillside House found here:
https://helpcenter.graphisoft.com/knowledgebase/103415/ )
You can see in the archicad 3D view that there's some sort of shading discontinuity in the corners of the tub. And when I export these sections, the polygons are in the wrong winding order, which makes the viewer cull the polygons that I should see, and draws the polygons that should be hidden.
These objects are GDL objects, and procedurally defined (eg: sections made of panels, cylinders, etc) and to say that the GDL language is opaque would be an understatement.
Anyway, I really, really want to avoid making all objects in the scene double-sided geometry (eg: disable backface culling) as this would really kill performance.
If I could somehow detect which polygons are in the wrong winding order, I could simply reverse the vertex order and everything would be fine.
So far, I've detected this issue with the clock (digits and arrows), toilets (the base), the bathtub (corners), and a couple of others objects. Seems like every other object has such a problem -- don't have to search far to find such polygon ordering issues.
Any ideas how I can either detect and/or fix this at export time?
The classical way of detecting this is to check if shared edges (sharing two vertices) are in the same order (eg: poly #1 has an edge from vertex A-B, and the neighbor polygon should have an edge from B-A, but if both have a shared edge from A-B, then one of the two polys is in the wrong order. However, I still can't know which polygon has the incorrect order.
BTW I use the modeler API to parse the geometry