Common face of two edges
-
Hello everybody, I would like to inquire about details of the method common_face.
According to documentaton, it should return the Face object that is common to the two edges, which is true, but it is not the whole truth - in situations, where two edges considered have more than one common Face, it still returns one of them, but somehow uncontrollably (or lets say with logic not obvious to newbie like me)For better illustration, consider two marked edges drawn on an existing face. I would like to have a way to reference the shaded area. Sometimes I succeed, sometimes I get the second L-shaped reminder (I do this on different faces of a cube, so it clearly depends on orientation of the face, I am just clueless how). Can the selection of the return face of this funcion be somehow influenced?
Thanks for help with this one, BTW, if there is some better way of referencing objects created by drawing on face, I will drop this one imediately, I am flexible and open to suggestions
-
Every Face has a list of Edges.
Every Edge has a list of Faces.face = edge1.common_face edge2
returns an edge1 face shared with edge2...
.
-
I came into the problem.
The best is to find the intersection of the faces of each edge, so that you get all of them.list_common_faces = edge1.faces & edge2.faces
Fredo
-
TIG:
@unknownuser said:
face = edge1.common_face edge2
returns an edge1 face shared with edge2...
yes, I use exactly this method ... but the point of my question is how does ruby determines, which face will it be, if there are more candidates, see my picture please, there are two common faces for two marked edges, and common_face returns one of them (and only in certain circumstances the one I want), I just do not know how to influence which one
Fredo:
I like that approach, as it happens, I might use this code in some other place of my silly program, it just does not solve my initial problem - to be able to select one particular face. I am trying to avoid drawing one more edge (on one of the unmarked edges of shaded face in my picture) - so I wil have unambiguos common face - but that lacks elegance a lot. -
@plha said:
Fredo:
I like that approach, as it happens, I might use this code in some other place of my silly program, it just does not solve my initial problem - to be able to select one particular face. I am trying to avoid drawing one more edge (on one of the unmarked edges of shaded face in my picture) - so I wil have unambiguos common face - but that lacks elegance a lot.You have to figure out an additional criterion then to say which face you like to have. For instance, the fact that the normals to each edge crosses within the surface, or any other condition.
Advertisement