How to find concave fillet faces via API?

How to find concave fillet faces via API?

mzhukovin
Explorer Explorer
961 Views
3 Replies
Message 1 of 4

How to find concave fillet faces via API?

mzhukovin
Explorer
Explorer

I have existed model and I'm wondering if there is a way to find all concave faces created with fillet feature using API? I found out how to take all the fillet features and their faces, then I was expecting something like a property that says whether it's concave or not, but I couldn't find it. Also, is this possible in case of full round / face fillets and edge fillet with variable radius? 

mzhukovin_0-1712753461566.png

 

0 Likes
Accepted solutions (1)
962 Views
3 Replies
Replies (3)
Message 2 of 4

WCrihfield
Mentor
Mentor

Hi @mzhukovin.  That's a relatively complex thing to figure out, because as far as I know, there is no simple, built-in way to make that determination by code.  In order to know if a Face is concave or convex, you must know if the 'Normal' (direction) of that Face is pointing towards the interior, or the exterior of the SurfaceBody it belongs to.  I believe the 'normal' of most faces will naturally point towards the exterior of the body, when first created by normal means, but there are definitely exceptions to that.  The SurfaceBody object does have properties named ConcaveEdges & ConvexEdges which will return EdgeCollection type objects, but they do not have properties for concave or convex faces.

 

There is an API sample (in VBA) showing you how to determine if a cylindrical Face is a hollow hole, or a solid protrusion.  The code in that sample may give you an idea about the types of code needed for a task like this.  The link to that sample is below.

https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=Line_IsColinearTo_Sample 

That sample seem to depend on the assumption that the face's Normal will be pointing towards its axis if it is internal/hollow, otherwise it is external/solid.  This may work 'most' of the time for a complete cylindrical faces in solid bodies, but faces created by fillet features, which do not form a complete cylinder, will likely be more complicated to figure out.  This is because a concave fillet applied to an inward edge produces a face that is partially cylindrical, where the axis of that cylinder is on the exterior of the body.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 4

WCrihfield
Mentor
Mentor
Accepted solution

Hi @mzhukovin.  I looked at this again a bit later, then decided that this might be 'fun' to look into further, just to see how accurate of results I could get by code.  I quickly found out that this task was even more complicated than what I previously had in mind.  At first, I was only inspecting faces that were created by fillet features, and were cylindrical in shape, but I saw that this was only highlighting a fraction of all the faces that were created by fillet features.  Some of the faces were not cylindrical, such as at corner intersections between two or more fillet features.  So, I had to greatly expand my 'inspection' code to 'deal with' all the other possible face shapes that I would commonly expect (Cylinder, Cone, EllipticalCylinder, EllipticalCone, Torus, Sphere).  Once I included code for all of these, I was getting much better results.  However, there are still apparently some face shapes that I did not cover there, because some of the more complex faces at complex intersections between multiple fillets did not seem to match any of those descriptions, and looked more like 'lofts'.  Not super sure how to proceed to check those right now, and frankly do not really want to put that much more time into this project right now, since I do not really have an immediate use for this.

 

Attached is a text file containing 'a lot' of code that can be used as a single iLogic rule for this task.  Right now it just highlights them by their category (concave, or convex), and shows a message while each group is highlighted, so you can pause to review them (for accuracy & functionality).  However, the code within the latter half of the Sub Main area could be modified to do something else with them.  I included an extra 'Class' block of code, and an extra 'Enum' block of code, in an attempt to shorten, and simplify the code needed within the Sub Main block of code as much as possible.

Whew.😅

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 4 of 4

mzhukovin
Explorer
Explorer

Thanks a bunch! Looks like this task is trickier than I thought and can't just be solved with a couple of API calls like I was hoping. Maybe I'll brainstorm some other ideas later, but it seems like making it that easy just isn't gonna happen.

0 Likes