Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

calculate total angle between selected faces

calculate total angle between selected faces

stigatle
Enthusiast Enthusiast
402 Views
3 Replies
Message 1 of 4

calculate total angle between selected faces

stigatle
Enthusiast
Enthusiast
Hi,

I have a framework for selecting holes in objects.
Right now it works by manually clicking inside the hole (with "by angle" option on), it then selects the inside of the hole.
I then delete the faces, select "open edge" then cap it.
This is what my script does now.

All of this works fine, but I do not want to click each hole separately.

To put it into perspective:
I've got 10 models (engineering models, hardsurface), each
model is at least 5000 separate parts, which I now have to go through
and remove the holes by using the above way of doing it.

So this is what I think might do the trick:

1) Select each face 1 by 1 with softselection.
2) each time check what the angles are in the selection.
3) if it's a hole, then it's a ~360 angle, I then know that this is
something I want to remove.

The part I need help with, is getting the total angle of the selected faces.

the rest of it is already done.

the case would be a simple box,with a cylinder through it, which you use boolean to create the hole in the box.
0 Likes
403 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Anyone?
0 Likes
Message 3 of 4

Anonymous
Not applicable
You can loop every face, get face edges (polyop.getFaceEdges <Poly poly> <int face>), for each edge get edge face (polyop.getEdgeFaces <Poly poly> <int edge>), then compare each face normal with the first one (polyop.getFaceNormal).

You can use dot product to compare normals, if dot < 1.0 then it is not flat, but i don't see how to tell if it's a hole or bump.
0 Likes
Message 4 of 4

stigatle
Enthusiast
Enthusiast
We are working intensively on how to solve it,
we are very close, currently detecting any "360" hole,
problem now is that it detects "outside" of meshes too.

Let's say you have a tube, it should only detect the inside faces, but right now
it detects the outside too. This is because using the normal always return it as a positive value.
But there seems to be ways of figuring out if it's a positive or negative "angle" by using vector math etc.

Either way; I'll post some more info when we've got it solved.

thank you for the pointers by the way.
0 Likes