
Wed, 03/12/2025 - 14:32
OBJ files do not contain BRep data; instead, they represent tessellated geometric data consisting of triangular information.
I want to enable HLR mode for this, but when I run it, I get all the edges from the triangles. (First picture in Image "Sewing_before_after.jpg")
To create a face from the triangulation data:
I extract the points from the triangulation and use them to create TopoDS_Face.
Then, I use BRepBuilderAPI_Sewing to sew all the faces together.
However, the sewing algorithm only works when the faces are oriented in same direction. For curved surfaces, I am unable to merge multiple triangles into a single smooth surface.
You can refer to Image "Sewing_before_after.jpg" for reference.
The expected output I am aiming for is shown in Image 2.
Thu, 05/08/2025 - 10:44
I moved to using ASSIMP for importing objects, then used Poly_Triangulation to convert them to TopoDS_Shape.
Was getting too many 'oddities' when trying to use the OpenCascade internal importers.
Thu, 05/08/2025 - 12:20
In your context of Mesh To CAD operation I do not see relation with Obj import. Obj reader generates relevant structure and correct from Obj specification.
Converting mesh to CAD and operation with it - is not a stable and usual task. For that case need to find HLR based on mesh calculation.
Could you please specify which exactly "oddities" for Obj import did you find.
Wed, 05/14/2025 - 23:00
Using OC loader the OBJ files I loaded and attempted HLR with apparently only contained one valid edge - which was the seam of the closed shape, not the actual shape. They displayed fine in 3D, even as complex wireframes, but the HLR just couldn't detect proper edges. Add to that the extreme randomless of loading materials (sometimes it worked, sometimes it didn't, but without error), added to that the different code functionality for loading STL, etc, I just gave up and used ASSIMP: one set of functions to do everything and generally it worked without incident. Admittedly, I haven't implemented material loading yet!!!