sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Draw on face

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 2 Posters 245 Views 2 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.
    • voljankoV Offline
      voljanko
      last edited by

      I'm not trying to make a tattoo on my face πŸ˜„ ,just want to detect ,if the line (edge) that I draw,is on the face.
      Example:

       model.active_entities.add_line( start, end )  
      

      Now I want an information if this entire line is on some face.

      SuSolid.com - solid check - solid repair- solid intersection check - weight plugin

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

        http://code.google.com/apis/sketchup/docs/ourdoc/face.html#classify_point
        If you have a reference to the face use:
        face.classify_point(point) for start and end points
        What's returned depends on where the point is, thus:

        0: Sketchup::Face::PointUnknown (indicates an error),
        1: Sketchup::Face::PointInside (point is on the face, not in a hole),
        2: Sketchup::Face::PointOnVertex (point touches a vertex),
        4: Sketchup::Face::PointOnEdge (point is on an edge),
        16: Sketchup::Face::PointOutside (point outside the face or in a hole),
        32: Sketchup::Face::PointNotOnPlane (point off the face's plane).It is important that return value comparisons be made against the symbolic constants (i.e. Sketchup::Face::PointUnknown, Sketchup::Face::PointInside, Sketchup::Face::PointOnVertex, etc.) rather than the absolute integer values as these values may change from one release to the next. You can't combine integer values so a point that is 'on an edge' might be true while 'on the face might be false'; and vice versa... of course you can take 'on face', 'on edge' and 'on vertex' all as good results - but the rest as bad if that's what you want...
        πŸ˜‰

        TIG

        1 Reply Last reply Reply Quote 0
        • voljankoV Offline
          voljanko
          last edited by

          Uff,I missed this one,thanks.
          The only problem that I see is that I need a reference to the face.So ,if I don't have it,I have to loop all faces.That is not very nice πŸ˜‰
          I have another solution in my mind,but didn't test jet: edge.faces.length should be more than 0.
          But I'm not shure if the line that I draw on the face will be somehow connected with the face.
          I remember the old versions of sketchup,where the line was floating on the face (bold).

          SuSolid.com - solid check - solid repair- solid intersection check - weight plugin

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

            A line added in code will NOT split a face/edges unless you call some sort of entities.intersect_with() method...
            If the line is being added in in code you can check the picked points with a pick_helper to see if a face is picked under the point. Then you know the face is under a point, what the face is and then check that both points are on the same face ?
            http://code.google.com/apis/sketchup/docs/ourdoc/pickhelper.html#picked_face

            TIG

            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