Extract shape parameters from TopoDS_Solid or TopoDS_Shape?

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

Qr Qr's picture

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?

Severin Pappadeux's picture

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

Attachments: 
Qr Qr's picture

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.

Severin Pappadeux's picture

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

Attachments: 
Guido van Hilst not specified's picture

Hi Severin 

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, Guido

Severin Pappadeux's picture

Thank you, Guido

looks like what I needed

sincerely

SP