sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Any Plugin to count "Endpoints" in a selection??

    Scheduled Pinned Locked Moved SketchUp Discussions
    sketchup
    14 Posts 8 Posters 496 Views 8 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.
    • mitcorbM Offline
      mitcorb
      last edited by

      What about Cleanup by ThomThom? It highlights open ends and gives a count.

      I take the slow, deliberate approach in my aimless wandering.

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

        To think of it the other way...
        You want to find all lines that have no faces and can't have faces, because a line with a 'free' vertex can't have a face...
        So to find unfaceable-edges use this one-liner...
        First Select the geometry in question [no need to be too careful as only the unfaceable-edges are left selected].

        Copy/Paste code + <enter> in the Ruby Console...

        This version highlights unfaceable edges.

        s=Sketchup.active_model.selection;s.each{|e|s.remove(e)unless e.is_a?(Sketchup;;Edge) && (e.start.edges.length==1 || e.end.edges.length==1)}
        

        Now only lines are in the selection than could never have a face...

        This version highlights unfaced edges.

        s=Sketchup.active_model.selection;s.each{|e|s.remove(e)unless e.is_a?(Sketchup;;Edge) && e.faces.length==0}
        

        This version highlights edges with < 2 faces [unfaced and flaps/hole-edges].

        s=Sketchup.active_model.selection;s.each{|e|s.remove(e)unless e.is_a?(Sketchup;;Edge) && e.faces.length<2}
        

        This version highlights edges with just 1 face [flaps/hole-edges].

        s=Sketchup.active_model.selection;s.each{|e|s.remove(e)unless e.is_a?(Sketchup;;Edge) && e.faces.length==1}
        

        This version highlights edges with > 2 faces [internal-partitions/coincident-edges/coincident-faces-overlaid].

        s=Sketchup.active_model.selection;s.each{|e|s.remove(e)unless e.is_a?(Sketchup;;Edge) && e.faces.length>2}
        

        TIG

        1 Reply Last reply Reply Quote 0
        • jgbJ Offline
          jgb
          last edited by

          Tig,

          Interesting stuff to try. Any chance you could make that into a plugin?

          But the attached drawing is what I am trying to solve, where there is a gap between vertices/endpoints that is minute (less than .001 inch) and cannot be seen unless zoomed in very close, perspective off. Doing this is tedious as it has to be done on any suspected vertex or line segment.

          Unless I'm missing something, I can think of no simpler way than to just count endpoints and easily deduce where the problem lies.


          Tiny gaps can be found by counting endpoints


          jgb

          1 Reply Last reply Reply Quote 0
          • Chris FullmerC Offline
            Chris Fullmer
            last edited by

            Its hard (VERY hard) to write a tool that selects ONLY vertices. SketchUp doesn't do that natively so you have to rewrite the selection lasso tool which is a major undertaking.

            TIG's one liners are awesome and useful.

            But if you'd rather use full plugins, Todd Burch wrote a plugin called label stray edges. It will point out the errors in the right box of your image. I wrote the plugin that labels "open faces" (maybe its poorly named) but it will point out the errors in the other 2 boxes. Between our 2 plugins, I think you will find it easy to fix all of the scenarios in your image. Try them, see if there is still a case that is not covered.

            Label Stray Lines:
            http://www.smustard.com/script/StrayLines

            Label Open Faces:
            http://sketchucation.com/forums/viewtopic.php?t=17876

            Lately you've been tan, suspicious for the winter.
            All my Plugins I've written

            1 Reply Last reply Reply Quote 0
            • wind-borneW Offline
              wind-borne
              last edited by

              @jgb said:

              Is there a plugin that will count Endpoints in a selection?

              FredoTools? Marks and counts vertices in selection


              Screen Shot 2012-12-14 at 9.53.55 AM.png

              "To read between the lines was easier than to follow the text."OSX 10.11.6

              %(#BF80BF)[SU 8 pro

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

                The gap on the right is easy to trap, as there are two edges with one vertex that has other edges.
                My first one-liner finds that.

                However, the other examples are more difficult to trap.
                You'd need to inspect very edge.
                Then process each of that edge's vertices.
                Then inspect each of the other's edges' vertices, and check the distance between the tested-edge's vertex and the other vertices.
                Label [or highlight or count] any that are within that distance...

                d=0.01; m=Sketchup.active_model; a=m.active_entities; s=m.selection; vs=[]; m.start_operation('*'); s.each{|e|vs<<e.vertices if e.is_a?(Sketchup;;Edge)}; s.clear; vs.flatten!; vs.uniq!; us=[]; vs.each{|v|(vs-[v]).each{|u|us<<u if v.position.distance(u.position)<=d;};};us.uniq!; us.each{|v|a.add_text('*',v.position,[6,6,6])};m.commit_operation;puts 'Near Vertices='<<us.length.to_s;
                

                Set d=0.01 to any size/unit you like... Adjust it to something easy to test...
                It adds a '*' text label to each vertex that is near to another vertex by 'd' or less, and reports the 'count', 1 gap == 2 vertices...
                Get TT's 'Vertex Tools' to do this / fix this issue for you - it's worth it !

                TIG

                1 Reply Last reply Reply Quote 0
                • Chris FullmerC Offline
                  Chris Fullmer
                  last edited by

                  I think Wind-borne's idea is about as close as you get. It will not be quite as simple as you will have to do the math to figure out how many vertices the selected faces should have vs how many they do have. But it could be the closest thing to what your brain is expecting.

                  @TIG, I see what you mean. I am easily oversimplifying the problem in my brain. my plugin would label EVERY line with anything more or less than 2 faces attached. So it would also label every line around the outsides of those shapes - every single line shown would be labeled as bordering an "open face", which is not ideal.

                  It does seem like vertex proximity would have to come into play on some level here.

                  EDIT: Approximately 10 typos fixed, hopefully my post now makes some sense....

                  Lately you've been tan, suspicious for the winter.
                  All my Plugins I've written

                  1 Reply Last reply Reply Quote 0
                  • jgbJ Offline
                    jgb
                    last edited by

                    I'll revisit this on Mon or Tues. Going out of town for w/e.


                    jgb

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

                      @chris fullmer said:

                      Its hard (VERY hard) to write a tool that selects ONLY vertices. SketchUp doesn't do that natively so you have to rewrite the selection lasso tool which is a major undertaking.

                      This is exactly what Vertex Tools does.
                      And it had functions to bulk-close near-connected vertices:
                      http://www.thomthom.net/software/vertex_tools/manual/tools#merge_close_vertices

                      http://sketchucation.com/forums/viewtopic.php?t=24593#p210736

                      But a free alternative is the Close Gaps feature in Edge Tools:
                      http://sketchucation.com/forums/viewtopic.php?f=323&t=24593&p=210736#close-gaps
                      It lets you visually inspect all the open end points in a mesh.

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

                      1 Reply Last reply Reply Quote 0
                      • panixiaP Offline
                        panixia
                        last edited by

                        @jgb said:

                        Vertex Tools looks great but a bit overkill for me at this time.

                        i can't figure out in wich way a piece of software that effective and with that price is an overkill..
                        just the merge vertex feature is about 245234533613644734% worth the money.. and the problem of small vertex gap is gone forever.. 😒

                        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