Skip to content

New cork options "-first" and "-second" to produce A U (A^B) and B U (A^B) - #32

Open
fangq wants to merge 7 commits into
gilbo:masterfrom
fangq:master
Open

New cork options "-first" and "-second" to produce A U (A^B) and B U (A^B)#32
fangq wants to merge 7 commits into
gilbo:masterfrom
fangq:master

Conversation

@fangq

@fangq fangq commented Jul 13, 2016

Copy link
Copy Markdown

two changes were found necessary in order to use cork in my project:

  1. I had to bump the output precision in the off file higher to avoid topological errors due to floating-point errors when using the output off files for tetrahedral mesh generation (using tetgen). see commit 971cb94
  2. I added boolFirst() method to generate surface A U (A^B), and added -first option in the cork binary. see commit 3faf80d. -first outputs surface input#1 cut by surface input#2.
  3. I also added -second to create B U (A^B), but may have some issues.

I also included the modified cork binary in my mesh generator project iso2mesh to replace the outdated libgts boolean operator.

fangq/iso2mesh@2acea45

fangq and others added 7 commits July 13, 2016 15:51
…iangulation

Triangle (triangle.c/triangle.h) is free for personal use only and may
not be redistributed as part of a commercial or open-source product,
which prevented bundling cork into iso2mesh.  Replace it with the
header-only CDT library v1.4.5 (https://github.com/artem-ogre/CDT),
licensed under the Mozilla Public License 2.0; its bundled robust
geometric predicates are BSD 3-Clause.

triangulatePolygon() in mesh.isct.tpp now performs the 2d constrained
Delaunay triangulation via CDT: insert projected vertices and
constraint edges, then eraseOuterTriangles() to discard triangles
outside the closed boundary loop.  eraseOuterTriangles (rather than
eraseSuperTriangle) is required because quantized intersection points
may fall slightly outside the original triangle, and keeping the full
convex hull produces overlapping sliver triangles.  CDT outputs CCW
triangles indexed in insertion order, matching Triangle's conventions,
so no other changes are needed.

Verified against the Triangle-based build: -resolve, -isct, -union,
-diff and -xor on the sample meshes (plus a rotated self-overlap
stress test) produce identical vertex/face/edge counts, watertight
manifold output, matching volumes, and a clean valgrind run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant