Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to XbimTessellator #299

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

bekraft
Copy link
Contributor

@bekraft bekraft commented Dec 5, 2019

I've got the same trouble as mentioned in xBimTeam/XbimGeometry#96. So I've started to investigate the problem and found the reason. The former orientation alignment / reverse algorithm wasn't stable for all types of bodies (especially with concave shapes near the boundaries).

Improves the tessellation and especially the orientation alignment algorithm of the triangulations. It now computes the approximated tetrahedral volume and reverse the mesh orientation, if the volume is negative. It also refactors the implementation. It also adds a volume value to the shape data holder for validation purpose.
Will also require a PR on geometry side.

marked simple volumes as nullable, if not closed and set having an additional prop to identify partially closed volumes
Improves the mesh validation and a more stable alignment of orientation
In case of an empty IfcTriangulatedFaceSet
@bekraft
Copy link
Contributor Author

bekraft commented Dec 19, 2019

Here's some more context of the change:

First, sorry for this heavy PR!
The previous logic of normal's alignment was based on an "extreme" triangle near the boundary. For non-convex bodies (and other abitrary, too), this doesn't work in some cases. So the change adopted a (to my opinion only) stable detection of inverted closed meshes by computing the tetrahedral volume. If it's negative, the algorithm simply inverts the value and reverses the orientation of all triangles. In prior the orientation of all triangles is aligned by an abitrary initial triangle.

Additionally, a flag is delivered to propagate issues easily. If an already triangulated face set is marked as closed, orientation alignment and reverse-orientation-detection is done, too. If not, the mesh is wrapped as it is (since alignment of intentionally non-closed meshes makes no sense).

There's also a nullable volume flag shipped with this PR. If null, the geometry engine (OCC) isn't able to close the body geometrically. If it holds some value, it's the volume in model units. For sets, two values exist. A nullable wich is handled the same way: if there's an unclosed body in the collection, nullify the whole volume. The other flag named "VolumeValid" will only return the volume of closed volumes (and therefore might be only a portion of the "real" volume).

@bekraft
Copy link
Contributor Author

bekraft commented Aug 4, 2020

Is there a chance to get this fix into develop?

@andyward
Copy link
Member

@martin1cerny would be good to review this PR

@martin1cerny
Copy link
Member

This merge needs to be aligned with PR in geometry engine. @SteveLockley, can you handle both?

@martin1cerny
Copy link
Member

@SteveLockley , can you check this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants