Tue, 03/22/2022 - 08:46
Forums:
Hi Bros, I just get TopoDS_Shape from AIS_InteractiveContext through mouse click, I try to get some geometric information from it, such as location, orient,radius of a Cylindrical surface,I was try to achieve it through BRepAdaptor_Surface, However, I have no idea with how to convert TopoDS_Shape to TopoDS_Face. I'm new in OCCT (maybe new in C++).
I hope my childish question didn't bother you.
Tue, 03/22/2022 - 12:21
Hi Linbei,
Please, use TopoDS::Face() method to convert any shape to face, but be careful, it throws an exception if you convert a shape of wrong type.
And also, take a look at BRep_Tool class, it could provide you the most of information you described.
Regards,
Artem
Tue, 03/22/2022 - 15:41
You are so nice, and I slove it, thanks for your help.
My technical route is : AIS_InteractiveContext→TopoDS_Shape→TopoDS_Face→BRepAdaptor_Surface→gp_Cylinder
It's just for Cylinder, other entity maybe can try in the same way.
Thu, 04/28/2022 - 06:25
Hi Linbei,
I have observed that you are also from China. The project I am working on has similar problems. I hope I can communicate with you, this is my wechat 17866628059.
Best regards