We offer fast, reliable, high quality and feature rich 3D Boolean Library.
See WebGL Demo.
Features
- Basic operations: A SUB B, A OR
B, A AND B.
- Intermediate operations like CUT.
- Highly optimised in terms of speed and memory.
- Multithread, single boolean operation may use all cores.
Extremely helpful with complex 3D models.
- Any per vertex or per face attribute can be ignored or preserved:
Normals, UV, materials or material ids.
- Optimization of produced geometry.
- Polygon reconstruction.
- Fast, compact.
- Windows/Mac versions.
Background
How it may work
Concept of boolean algorithm looks easy. For instance A SUB B.
- All polyogons not intrescting with another polgong may go directly
to output - in case if boolean condition is met.
- Rest polygons must be cut and some parts should go to output,
rest ones rejected.
- That's it.
There are many problems on the way:
- It's time consuming to check each polygon and all rest ones. Probably
some optimizations should be used. KD tree, BSP tree, Space Subdivision.
- How to decide which polygon should go to output and which ones
should be rejected?
- How to cut polygons?
- How to handle polygons which touching this polygon on the edge?
Probably we should recreate topolgy of source objects.
- Floating point errors and precisions. This sounds easy, just
define and use tolerance. Unfortunatelly this is dead loop.
Highlights
We are very proud of our results. When everything works good, it looks
natural.
Intersections
Simple test scene with tube and torus. Just five segments tube and
torus. Torus pipe has 6 segments. Scene is simple but just right for
demonstration. In this particular case polygons of torus are fully inside
or outside of tube. We should cut only polygons of tube. Problem here that
there is no direct intersection of polygons - points of torus (marked with
red) are eaxctly on edges. Of course floating point calculations may show
intersection, but not always. BTW, how to use tolerance here?
Points marked with green shows another advantage. Let's explain. Side
of tube was made from quad (or two triangles) diagonal goes from top-left
to bottom-right and intersects torus at green points. As you may see on
the right image - former surface of torus also has this point and
additional triangle is added. This means no holes in the output.
Additional, optional optimization may remove these green points by
combining triangles on the both sides of edge.
Normals
One image below two objects (torus and cylinder) are combined. Surfaces
are intersecting on obtuse angles and everything looks perfect.
In order to achieve such look, special treatment was applied.
|
Default, high quality normals processing.
Click on image for bigger version.
|
Normal treatment is switched off.
Click on image for bigger version. |
Group of Objects
Just an ability to handle many objects as single operand.
From another point of view, this is tought case - many small objects
penetrate one face. We have special code which detects such situation
and process it in a best possible way.
Samples
API and Technical Information
- C++
- 32 or 64-bit.
- Windows/Apple Mac.
- Multithreaded.
Library supports two usage scenarios.
- First is just a boolean, it can process only triangles and can
output triangles.
- Second can process polygons, even with holes and optimize output.
Optimizations may include: remove holes, remove extra points, generate
polygons from triangles.
#1
- Input - objects made of triangles.
- Each input channel
A or B may contain unlimited number of objects.
- Single and double precision versions.
- Optional per object matrix.
- Triangles with any per
triangle information.
- Output:
- Vertices, compacted and indexed.
- Triangles. Optional tags to source triangles and points.
- Final dll is tiny small.
- There are no external dependencies.
- Processing callback.
#2
- Input - objects made of polygons.
- Each input channel
A or B may contain unlimited number of objects.
- Single precision.
- Optional per object matrix.
- Vertices, UV, Normals,Colors.
- Polygons with any per
triangle information.
- Output optimization
- Remove extra points
- Edge optimizations
- Remove small holes
- Join points
- Output:
- Vertices, compacted, collapsed and indexed.
- UV, Normals, Colors.
- Triangles or Polygons.
- Dlls are parts of FinalMesh product. Can be used directly via
FinalMesh SDK or via simplified wrapper.
- There are no external dependencies.
How to check 3d booleans?
- With Programming: Download test version of 3D booleans library,
incorporate it into your application and test how it works.
- Without Programming: Save your objects to 3d file (STL for
instance), download FinalMesh and load your files. If each operand is
in separate file, load first one and
merge second file. Create
boolean modifier and play with options. At
least, select required boolean mode.
See boolean API documentation.