sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Common face of two edges

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 3 Posters 361 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      plha
      last edited by

      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?

      http://img155.imageshack.us/img155/3522/edgesbo2.jpg

      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 😄

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        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...

        .

        TIG

        1 Reply Last reply Reply Quote 0
        • fredo6F Offline
          fredo6
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • P Offline
            plha
            last edited by

            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.

            1 Reply Last reply Reply Quote 0
            • fredo6F Offline
              fredo6
              last edited by

              @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.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement