DiscussionsIssue archiveModeling Data and Algorithms

Archived discussion

Is it possible to split a complex Solid into elementary solids?

Modeling Data and AlgorithmsTue, 09/14/2021 - 20:296 replies

Browse this forum
QuestionAuthor

I have a complex TopoDS_Solid geometry. It consists of several elementary geometries. Is there any way to split the complex solid into some elementary shapes?

additional comments:
When I do shp.ShapeType(), it gives me TopoDs_Solid
Also, NbChildren() is 1, so I dont think TopoDS_Iterator will work.

Discussion

6 archived replies

Posts are displayed in their archived order.

01Commenter-1

Hi Author,
CompSolid is a shape consisting of Solids. So, the simplest and the most natural way is to use TopoDS_Iterator on Comsolid to get access to its direct children.
To know shared faces you may use the method TopExp::MapShapesAndAncestors, which will allow you to iterate by faces and see in which solids each face is contained.
Commenter-1

02Author

Thank you for your answers. But I feel I made some mistakes. My part is actually recognized as a solid, not compsolid, but the geometry is pretty complex. Is there any way to split it into some elementary shapes?

03Author

For example, I have a geometry like the one in the figure. I want to split it into two cylinders. Is it possible?
Right now, the shape type is TopoDS_Solid.

04Commenter-1

If your shape is a solid then it contains a shell composed of faces. You can only explore it on faces and recognize if the underlying surface is a cylindrical one.

05Author

Hi, Mikhail, thanks for your response. In this case, is it possible to determine if two faces are connected? like connected with face and edge? Any suggestion on what function should I looking for? Thanks a lot!!!

06Commenter-1

Connected faces have at least one common edge.