Closed varlxw closed 1 year ago
Can you point us to the part of the code where it interfaces with the native module to pass such options?
Check out this file: https://github.com/kovacsv/occt-import-js/blob/main/occt-import-js/src/importer.cpp. Triangulation quality is defined by linear and angular deflection (see this page for details). Now there is a kind of heuristics for these values based on the model size, but I think these two parameters should be available on the JavaScript interface.
static bool TriangulateShape (TopoDS_Shape& shape)
{
Bnd_Box boundingBox;
BRepBndLib::Add (shape, boundingBox, false);
if (boundingBox.IsVoid ()) {
return false;
}
Standard_Real xMin, yMin, zMin, xMax, yMax, zMax;
boundingBox.Get (xMin, yMin, zMin, xMax, yMax, zMax);
Standard_Real avgSize = ((xMax - xMin) + (yMax - yMin) + (zMax - zMin)) / 3.0;
Standard_Real linDeflection = avgSize / 1000.0;
Standard_Real angDeflection = 0.5;
BRepMesh_IncrementalMesh mesh (shape, linDeflection, Standard_False, angDeflection);
return true;
}
Triangulation parameters are available in version 0.0.14
.
Probably it's the triangulation. Adding parameters to define the quality of the result mesh (#5) should solve this.