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

    Make SU heal faces and edges?

    Scheduled Pinned Locked Moved Developers' Forum
    8 Posts 3 Posters 2.8k 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.
    • thomthomT Offline
      thomthom
      last edited by

      See the video for visual presentation of the problem:

      [flash=480,390:10izlq5q]http://www.youtube.com/v/IMFb8OGVLo4?fs=1&hl=en_GB[/flash:10izlq5q]

      At first I use the native Move tool to move a vertex to another vertex so the triangular face disappear. The mesh automatically heals.

      However, when I do the same operation using the Ruby API, moving the same vertex. But then mesh doesn't heal. The triangle doesn't disappear, it becomes a zero area face, and the related edges becomes zero length edges. And this also produce errors when you use the Fix Problems feature in SU.

      I have tried intersecting connected edges and faces afterwards - but that did not help.

      I have tried erasing the zero size faces and edges, but erasing the zero length edges cause neighbouring faces to disappear.

      Anyone got any ideas of how SU's native Move tool is doing it?

      Thomas Thomassen β€” SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        After I use the Ruby API to merge two vertices, if I use the native Line tool to draw an edge from the point where they merged, the geometry heals.
        But if I use the Ruby API to draw an edge - it doesn't heal... x_X

        Thomas Thomassen β€” SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • G Offline
          gulcanocali
          last edited by

          Hi,

          A clean way to merge coincident vertices would be as follows:

          1. create a dummy group containing a non-zero length edge emerging from one of the vertices to be merged
          2. explode that group

          This forces the SketchUp geometry engine to repair connections.

          Gulcan Ocali
          Product Manager
          http://www.Tgi3D.com

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            Don't think you can create zero length edges via Ruby.

            model.active_entities.add_line( ORIGIN, ORIGIN ) <- returns nil

            Thomas Thomassen β€” SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

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

              When the vertex is moved add a short edge to it in a direction that is not parallel to any of its edges.
              Then erase that edge when the move is done - it should then force the geometry to reform and remove the spurious zero length edges/faces etc...

              TIG

              1 Reply Last reply Reply Quote 0
              • thomthomT Offline
                thomthom
                last edited by

                @tig said:

                When the vertex is moved add a short edge to it in a direction that is not parallel to any of its edges.
                Then erase that edge when the move is done - it should then force the geometry to reform and remove the spurious zero length edges/faces etc...

                Tried that: http://forums.sketchucation.com/viewtopic.php?f=180&t=35470#p312799

                Thomas Thomassen β€” SketchUp Monkey & Coding addict
                List of my plugins and link to the CookieWare fund

                1 Reply Last reply Reply Quote 0
                • G Offline
                  gulcanocali
                  last edited by

                  @thomthom said:

                  Don't think you can create zero length edges via Ruby.

                  model.active_entities.add_line( ORIGIN, ORIGIN ) <- returns nil

                  The first step in my note should have been "move the vertex on top of the other vertex you want to merge with" (then there may be an edge with zero length). After that follow the next two steps.

                  Gulcan Ocali
                  Product Manager
                  http://www.Tgi3D.com

                  1 Reply Last reply Reply Quote 0
                  • thomthomT Offline
                    thomthom
                    last edited by

                    @gulcanocali said:

                    @thomthom said:

                    Don't think you can create zero length edges via Ruby.

                    model.active_entities.add_line( ORIGIN, ORIGIN ) <- returns nil

                    The first step in my note should have been "move the vertex on top of the other vertex you want to merge with" (then there may be an edge with zero length). After that follow the next two steps.

                    That seem to have worked. πŸ‘

                    Though temp groups and edges feels a big hacky - I wonder if there's a cleaner way. Would be interesting to get some insight to how SU does this internally.

                    But thank you very much for this working method!

                    Thomas Thomassen β€” SketchUp Monkey & Coding addict
                    List of my plugins and link to the CookieWare fund

                    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