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

[Plugin] Solid Inspector

Scheduled Pinned Locked Moved Plugins
302 Posts 98 Posters 260.1k Views
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.
  • T Online
    TIG Moderator
    last edited by 26 Sept 2011, 10:32

    @thomthom said:

    There are cases where a solid has tiny holes, where SketchUp fails to create a face because the edges are too small.
    But aren't these then capable of 'healing'... any !edge.faces[1] can be tested for tiny length [say <= 0.5mm ?] and then its end vertex transformed to be over its start vertex so it then ceases to exist...
    a long thin hole with one or more tiny sides becomes an edge with no hole, a hole with all tiny sides simply ceases to exist at all.
    I have tested some code and I admit that making the ends of a tiny edge coincident isn't working - as you are left with an edge of zero length [!] with two coincident edges too! Moving vertices to become coincident must be possible - the TT-vertex-tools ? I am stumped πŸ˜•

    TIG

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 26 Sept 2011, 10:46

      @tig said:

      I have tested some code and I admit that making the ends of a tiny edge coincident isn't working - as you are left with an edge of zero length [!] with two coincident edges too! Moving vertices to become coincident must be possible - the TT-vertex-tools ? I am stumped πŸ˜•

      The only way I found, was a method similar to how you heal edges, you make a temp edge and then erase it. That will merge the vertices located at the same position and remove the zero length edge.

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

      1 Reply Last reply Reply Quote 0
      • T Offline
        thomthom
        last edited by 26 Sept 2011, 10:47

        Actually, there is some more to it. Here are a few methods I use in Vertex Tools 1.1 to heal geometry after manipulating vertices:

        <span class="syntaxdefault"><br />  </span><span class="syntaxcomment"># Heal geoemtry<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># (i) When vertices are merged into one point it one end up with zero size<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># faces and edges. These produce a messy mesh and cause errors to be<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># reported when Su validates the model.<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment">#<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># If one draw a dummy edge with SU's native edge tool it heals the <br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># geometry. But if one does the same with the Ruby API it doesn't.<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment">#<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># Thanks to Gulcan Ocali from Tgi3D for suggesting a workaround where<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># the edge is created in a dummy group - then exploded. This appear to<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># make SU heal the geometry. The dummy edge is turned into a zero length<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># edge before exploding so it's automatically cleaned up when the group<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># is exploded.<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment">#<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># http://forums.sketchucation.com/viewtopic.php?f=180&t=35470#p312814<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment">#<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># This does however feel too much like a dirty hack. Would be nice to<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># know how to correctly do this.<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment">#<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># (?) Turn into a reusable method accepting an array of vertices to heal.<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment">#<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># (?) Is it nessesary to also do the same to soft-selected vertices?<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment">#<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># @since 1.1.0<br /></span><span class="syntaxdefault">  def self</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">heal_vertex</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> entities</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> point </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">    point </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> point</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">position if point</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">is_a</span><span class="syntaxkeyword">?(</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Vertex </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">    temp_group </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> entities</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_group<br />    temp_edge </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> temp_group</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">entities</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_line</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> point</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> point</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">offset</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> Z_AXIS </span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">    temp_group</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">entities</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">transform_by_vectors</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">[</span><span class="syntaxdefault">temp_edge</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">end</span><span class="syntaxkeyword">],</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">[</span><span class="syntaxdefault">Z_AXIS</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">reverse</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">    temp_group</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">explode<br />  end<br />  <br />  </span><span class="syntaxcomment"># @since 1.1.0<br /></span><span class="syntaxdefault">  def self</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">heal_vertices</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> entities</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> points </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">    if points</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">is_a</span><span class="syntaxkeyword">?(</span><span class="syntaxdefault"> Enumerable </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">      for point in points<br />        self</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">heal_vertex</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> entities</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> point </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">      end<br />    else<br />      self</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">heal_vertex</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> entities</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> points </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">    end<br />  end<br />  <br />  </span><span class="syntaxcomment"># Tries to heal all zero length edges in the given set of entities. This<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># should also heal zero size faces since they are bound by zero length edges.<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment">#<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># @since 1.1.0<br /></span><span class="syntaxdefault">  def self</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">heal_entities</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> entities </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">    return if entities</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">length </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> 0<br />    parent </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> entities</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">first</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">parent<br />    for entity in entities<br />      next unless entity</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">is_a</span><span class="syntaxkeyword">?(</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Edge </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">      if entity</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">length </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> 0<br />        self</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">heal_vertex</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> parent</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> entity</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">start </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">      end<br />    end<br />  end<br /></span>
        

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

        1 Reply Last reply Reply Quote 0
        • T Online
          TIG Moderator
          last edited by 26 Sept 2011, 10:55

          So that method[s] run after any tiny [0.5mm?] edges are shrunk to be zero by transforming the end vertex to be over the start vertex will then heal any 'small [zero width] holes' ?

          TIG

          1 Reply Last reply Reply Quote 0
          • T Offline
            thomthom
            last edited by 26 Sept 2011, 10:58

            @tig said:

            So that method run after any tiny [0.5mm?] edges are shrunk to zero will heal the 'small [zero width] holes' ?

            Any zero length edge and zero size face should be healed (read: removed by SU's auto-merge feature).

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

            1 Reply Last reply Reply Quote 0
            • T Online
              TIG Moderator
              last edited by 26 Sept 2011, 11:04

              But if you find some edges ~0.5mm long and merge the vertices that edge still exists as a zero length edge - SUp doesn't auto-merge them - also the previously separated other sides of the hole are now coincident and not auto-merged either!
              So your code would remove the zero length edge by forcing an auto-merge BUT do the coincident edges then merge too? I don't have time to test it - but if it works it's the basis of having a tool to 'make solid' groups etc that have tiny holes πŸ˜•

              TIG

              1 Reply Last reply Reply Quote 0
              • V Offline
                VeniVidiVici
                last edited by 2 Oct 2011, 02:56

                OMG, THANK YOU THANK YOU THANK YOU!
                I cant wait to use this too...combined with Artisan...OMG...FINALLY, I can do 3D
                modeling without countless hours of error fixing (even when working large scale).
                This is going to save days of my life...lol. πŸ˜„

                CHEERS!

                <---swigs a brewski in your honor!

                1 Reply Last reply Reply Quote 0
                • P Offline
                  PapaBear60
                  last edited by 8 Oct 2011, 15:29

                  OK, I'm having the same problem as another user, Solid Inspector doesn't show up in the menu. I'm using Sketchup 8 (7 is gone), put the .rb in the plugins folder and also the library2 folder in the plugins folder. (In fact, now that I look at it, several plugins don't show up?) What am I doing wrong:


                  Sketchup Plugins.jpg


                  Plugins Directory.jpg

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    thomthom
                    last edited by 8 Oct 2011, 16:21

                    @papabear60 said:

                    What am I doing wrong:

                    You ain't looking at the description of the plugin. πŸ˜‰ Not all plugins add menus to the Plugins menu. Check the info in the first post for how to use.

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

                    1 Reply Last reply Reply Quote 0
                    • T Online
                      TIG Moderator
                      last edited by 8 Oct 2011, 16:22

                      As TT said... not all scripts appear in the Plugins Menu - this one is set to load in the Tools Menu as explained on the tool's download page Capture.PNG that is UNLESS the " ThomThom's Plugins" menu is loaded by the script tt_0000_menu.rb - then that submenu is added in Plugins and TT's tools all collect there ! [but that's academic as you don't appear to have file that in Plugins folder, or the submenu it would make...]
                      So look in the Tools Menu...
                      If it's still not there come back to us...

                      TIG

                      1 Reply Last reply Reply Quote 0
                      • Dave RD Offline
                        Dave R
                        last edited by 8 Oct 2011, 16:38

                        @papabear60 said:

                        OK, I'm having the same problem as another user, Solid Inspector doesn't show up in the menu. I'm using Sketchup 8 (7 is gone), put the .rb in the plugins folder and also the library2 folder in the plugins folder. (In fact, now that I look at it, several plugins don't show up?) What am I doing wrong:

                        FWIW, you don't have the current cutlist plugin either.

                        Etaoin Shrdlu

                        %

                        (THERE'S NO PLACE LIKE)

                        G28 X0.0 Y0.0 Z0.0

                        M30

                        %

                        1 Reply Last reply Reply Quote 0
                        • P Offline
                          PapaBear60
                          last edited by 8 Oct 2011, 16:41

                          OK, that worked ... as did the Solid Inspector, when I first clicked on the tool then used the controls. My bad. Still learning this great product. This tool solves a big problem that I've encountered creating solids - and will save me hours of time spent recreating solids that aren't really solids.

                          Thank you both.

                          Dave

                          1 Reply Last reply Reply Quote 0
                          • P Offline
                            PapaBear60
                            last edited by 8 Oct 2011, 17:01

                            OK, thanks for the heads-up on Cut List, but how could you tell from the picture I sent?

                            1 Reply Last reply Reply Quote 0
                            • Dave RD Offline
                              Dave R
                              last edited by 8 Oct 2011, 17:02

                              By the name. The current version would show as "cutlist.rb".

                              Etaoin Shrdlu

                              %

                              (THERE'S NO PLACE LIKE)

                              G28 X0.0 Y0.0 Z0.0

                              M30

                              %

                              1 Reply Last reply Reply Quote 0
                              • E Offline
                                eraeya
                                last edited by 25 Oct 2011, 08:48

                                Just wanted to say: this plugin is the biggest thing to happen since hotdogs. Hurray for workflow!

                                1 Reply Last reply Reply Quote 0
                                • K Offline
                                  KJGC
                                  last edited by 30 Jan 2012, 22:31

                                  Very, VERY impressive application! Thom you've made my work so much easier, and for that I am truly grateful. This "Error GPS" is remarkable, thank you so much for the amount of time and effort you've put into this plugin, in order of making everyone elses life T-H-A-T M-U-C-H easier. Merci mon amis !

                                  Sincerely,

                                  Kyle James

                                  1 Reply Last reply Reply Quote 0
                                  • T Offline
                                    thomthom
                                    last edited by 30 Jan 2012, 23:21

                                    πŸ˜„

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

                                    1 Reply Last reply Reply Quote 0
                                    • GaieusG Offline
                                      Gaieus
                                      last edited by 30 Jan 2012, 23:23

                                      Now thatwas a proper "thank you". πŸ˜‰

                                      Gai...

                                      1 Reply Last reply Reply Quote 0
                                      • I Offline
                                        ik2012
                                        last edited by 26 Feb 2012, 00:46

                                        Hi, kind of a sketchup newbie here. I am using this plugin to check my model for water tightness, but I am having trouble understanding the output. Would anyone mind looking at these screen shots and giving me some tips? Thanks!


                                        bottle base top.skp


                                        solid inspector output.JPG

                                        1 Reply Last reply Reply Quote 0
                                        • GaieusG Offline
                                          Gaieus
                                          last edited by 26 Feb 2012, 09:46

                                          In order to build a solid object, there cannot be inner faces (amopng other conditions). You have some - and that's still not the only reason as deleting the face in the screenshot below still does not fix it.

                                          InnerFaces.png
                                          (Note that I have reversed some faces and smoothed the group generally...)


                                          As it turns out, it was all inner faces. Did not take too long to fix: when you have some time, send ThomThom a cookie.


                                          bottle base top.skp

                                          Gai...

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 3
                                          • 4
                                          • 5
                                          • 6
                                          • 7
                                          • 15
                                          • 16
                                          • 5 / 16
                                          • First post
                                            Last post
                                          Buy SketchPlus
                                          Buy SUbD
                                          Buy WrapR
                                          Buy eBook
                                          Buy Modelur
                                          Buy Vertex Tools
                                          Buy SketchCuisine
                                          Buy FormFonts

                                          Advertisement