Forum archiveIssue archiveModeling Data and Algorithms

Archived discussion

Extract shape parameters from TopoDS_Solid or TopoDS_Shape?

Modeling Data and AlgorithmsSat, 06/10/2017 - 02:527 replies

Browse this forum
QuestionAuthor

Hi, All

 

Got on my hands STEP file, which I was able to read and retrieve TopoDS_Shape(TopoDS_Solid). It looks like small tube bent along complex path.

I'm able to display it, check flags etc, so far so good. But how I could extract actual solid parameters (radii, bending path)?

Any help would be greatly appreciated

Discussion

7 archived replies

Posts are displayed in their archived order.

01Commenter-1

All features, such as bends, whatever, are lost once the model is saved to STEP (or any other neutral) format. Generally speaking, what you need is automatic feature recognition. In a simple setting, you can just traverse through the faces of your model and check the host surface types. A cylindrical surface may mean bend. Its radius will be the radius you're looking for. Can you share your file to have better idea on kind of features it contains?

02Author

thank you for the reply.

Yes, I have several faces etc inside the solid, but they all are of TopoDS_Face type, so question how to get data from that is still open.

Please find attached STEP file

03Commenter-1

I will have a look, thanks. In the meanwhile, you can refer to BRep_Tool::Surface() method which gives access to the host geometry of your topological faces.

04Author

Thank you , will try

Just in case I've attached Python code I used to read and display it - works for me on Anaconda2, python-2.7, python OCC binding

regards

SP

05Commenter-2

Hi Author 

I have made a small script that shows your step-data,

and loops over the edges.: ExtractShape

​In the log file you can see all curve types.

Best regards, Commenter-2

06Author

Thank you, Guido

looks like what I needed

sincerely

SP

07Commenter-3

Hi Team,
By any chance can you still share the Extract Shape script? It's not opening now in 2024.