BRepFaces and Cylinders - two questions...

BRepFaces and Cylinders - two questions...

william-c-anderson
Advocate Advocate
689 Views
5 Replies
Message 1 of 6

BRepFaces and Cylinders - two questions...

william-c-anderson
Advocate
Advocate

First question: When using a selection filter of 'CylindricalFaces', why does app.userInterface.selectEntity allow the selection of a conical surface? Is a cone considered a cylinder in the API?

 

Second question: Given the selection of a BRepFace which is known to be cylindrical (by using the aforementioned filter or by user discretion), what is the simplest way to derive the axis? I've scoured the SurfaceEvaluator man pages and while I might come up with a procedure that uses the edges and normal, etc, there must be a more straightforward way.

 

Thanks in advance for any relevant info,

 

Willie

 

 

0 Likes
Accepted solutions (1)
690 Views
5 Replies
Replies (5)
Message 2 of 6

william-c-anderson
Advocate
Advocate

Well, I'm answering my own question (I do that a lot on fora). This code example pretty much answers my second question - I'll just use an edge of the BRepFace to get the arc or circle parameters, and therefrom the axis. However, my first questions still stands - is a conical surface a cylinder?

0 Likes
Message 3 of 6

JesusFreke
Advocate
Advocate

If you have the BRepFace of a cylindrical face, then you can get the underlying Cylinder object via face.geometry, which has the axis.

 

 

Message 4 of 6

BrianEkins
Mentor
Mentor
Accepted solution

Answering your first question, this is a bug in the API.  When you use "CylindricalFaces" as the selection filter in the selectEntity method, it should only be returning cylinders.  There is also a "ConicalFaces" filter that is intended for cones but I see that it's also allowing the selection of cylinders, which is incorrect.  I also found that both of them are also allowing the selection of elliptical cylinders, but not elliptical cones.  Hopefully, @goyals can log and fix this.

 

Unfortunately, I see the same behavior when using a SelectionInput in a command.  However, in a command, you can use the SelectionEvent associated with the command to do dynamic filtering so you can filter out non-cylindrical faces.

 

For your second question, the previous answer is correct.  The BRepFace object supports the geometry property which will return a specific type of geometry, depending on what shape the face is.  If the face is cylindrical, the geometry property will return a Cylinder object and from it, you can get its position, axis, and radius.

 

 

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 5 of 6

william-c-anderson
Advocate
Advocate

Thanks! I'm still getting used to OOP in Python, but your answer showed me the way. I appreciate it.

0 Likes
Message 6 of 6

goyals
Autodesk
Autodesk

Created FUS-45181 in our bug tracking system. I already made the fix but it would make to the production only after Jan  release of Fusion. 



Shyam Goyal
Sr. Software Dev. Manager