How do I find the face I just created with add_circle?
-
I modified a component definition using entites.add_circle, now how do I find the disc-shaped face I just created?
-
Are you maybe drawing on a face? Or using
edge.find_faces
afterwards?In any case, if you investigate one of the edges you create with
.add_circle
, check out it's attached faces. There might be multiple faces, but your face should be the one with the edge as part of the outer loop and have a matching normal to the circle you created. -
.add_circle
only creates edges... -
@daiku said:
I modified a component definition using entites.add_circle, now how do I find the disc-shaped face I just created?
a = entities.add_circle ... # a is an array of edges f = entities.add_face a
-
@martinrinehart said:
@daiku said:
I modified a component definition using entites.add_circle, now how do I find the disc-shaped face I just created?
> a = entities.add_circle ... # a is an array of edges > f = entities.add_face a >
Which of course is a much more sane version to do this than my rambling....
-
Or how about this brillaint (late) insight: I used the center point of the circle to add it, so I suppose I could now look for the face that point is on (DOH!). CB.
-
@daiku said:
Or how about this brillaint (late) insight: I used the center point of the circle to add it, so I suppose I could now look for the face that point is on (DOH!). CB.
? How is looking for the face that way easier than Martin's method? AFAIK there isn't a method that returns a face from a given point. You'd have to loop through lots of geometry for that.
Question still remains, are you drawing the circle edges ontop of an existing face?
-
Why not make all of this new geometry - both the circle's edges and its face - inside a temporary group. Then it's easy to find the face - it's the only face in the group's entities. Afterwards explode the group back to the base entities and the face stays the same 'face-entity'...
-
I guess Martin's way is fine. It won't create a second face, will it? Yes, I'm creating it on an exisiting face. Looping through the geometry was straightforward - it's not that large a component.
-
@daiku said:
I guess Martin's way is fine. It won't create a second face, will it? Yes, I'm creating it on an exisiting face. Looping through the geometry was straightforward - it's not that large a component.
In that case you should only need to check the faces collection of one of the returned edges.
Advertisement