[Closed] How to find the faces inside an outline ?
Let’s say I have an outline and I search the faces inside this outline.
I search a method or ideas…
I’ll be thankful for any answer.
Compute the averaged center of all the points in the circle.
Then calculate the distance of each circular point from the central point, and also calculate the angle that is formed by a ray extending from the center point to each outside point.
Then, go through all the verts on the shape…calculate the angle of the line from the center-point to that vert, and from this angle you know which line segment of the region you are dealing with…calculate the point on that line, and if the distance to that point is greater than the distance to the vertex then the point is within the selected region. Collect all the faces that have all 3 verts in the region
Interesting method based on the distance.
I think this kind of method has a problem: what does it occur if the form is concave ?
Maybe It exists methods completely different ?
thomas: exact…
We can find the faces of the outline.
It is easy : something like this:
polyOp.getFacesUsingEdges $ outlineEdges
But this collect the faces inside and outside…
The first problem is to select only the faces inside. How to do that ?
After that, a routine could fill the last faces.
The matID fill plugin in my signature does this. All you have to do is select one face that’s inside, and then get all the adjacent faces. Then remove any faces that are outside the border. Continue this process until you aren’t selecting new faces.
Well a dirty hack could be to make a tmp shape do a 0.1 extrude of the shape, then collapse that extruded face and read the face count, then delete the tmp shape.
eek
stuh505: how to get that one face? imagine the outline is not a simple convex shape.
eek: what if the geo is not flat, what does the 0.1 extrude do? what does knowing the face count do?
My thoughts were not far from eeks as far as using a temp object to get internal faces.
[ol]
[li]generate the linear spline from the outline[/li][li]generate a mesh from the spline with sufficient volume to pass through the souce geo in the area of the selection[/li][li]use a volume select mod to select the faces that are within the temp mesh geo[/li][li]discard temp mesh after list of faces are made[/li][/ol]This is a hack as well, but it’s all I have at the moment More thinking to do to get a proper answer.
Things that could make this more complicated would be geo that loop back on themselves like a torus, outlines that loop, outlines that overlap but dont self intersect, outlines that have an average normal that is not up in Z, if there is more than one contiguous outlines, and a few more that I’m sure I just haven’t thought out yet.
Ok Blue,
eek: what if the geo is not flat, what does the 0.1 extrude do? what does knowing the face count do?
Ok, make a tmp shape, put an extrude modifier on it of 0.1, convert it to whatever (probably poly),collapse the extruded face, and do a $.faces on the tmp. Append to an array and delete the tmp.
I wont matter whether the shape is off because the extrude is only 0.1.
If this a shapepoly, then its even simplier do an extrude of the face by 0.1 then collapse. Then you can do whatever you want with the faces. Get how many, etc etc You could do a make planar on the poly/mesh before extude as your only working with a tmp.
There’s more ways of understanding convex/concave hulls and stuff – but i cant discuss it here.(nda)
eek
I still don’t understand your method eek, and I have no real idea of what the face count will do for you, it’s not like the temp geo will have the same triangulation or even the same interior vert count.
prettyPixel: this should work on your example but it is a hack
DisableSceneRedraw
try(
polyOp.createShape $ #selection name:"tempSplineShape"
max create mode
$tempSplineShape.pos.z = $tempSplineShape.pos.z - 10
addModifier $tempSplineShape (extrude ())
addModifier $tempSplineShape (push push_value:0.01)
addModifier $ (Vol__Select level:2 volume:3 node:$tempSplineShape) ui:on
addModifier $ (Edit_Poly()) ui:on
subobjectlevel=4
max modify mode
selectedFacesList = $.modifiers[1].GetSelection #Face node:$
max create mode
polyOp.setFaceSelection $ selectedFacesList
delete $tempSplineShape
deleteModifier $ 1
deleteModifier $ 1
max modify mode
subobjectlevel=4
)catch(try(delete $tempSplineShape)catch())
EnableSceneRedraw