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

    [Plugin] CleanUp

    Planifier Épinglé Verrouillé Déplacé Plugins
    974 Messages 217 Publieurs 788.7k Vues 217 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • thomthomT Hors-ligne
      thomthom
      dernière édition par thomthom

      Overview
      This plugin does it best at optimize and clean up a model.

      [flash=640,385:21095i6n]http://www.youtube.com/v/seJYub0LCmQ?fs=1&hl=en_US[/flash:21095i6n]

      Access
      Plugins > CleanUp
      CleanUp3_1_Menus.png

      Features

      • Fixes duplicate component definition names ( When in model scope )
      • Purge unused items
      • Erase hidden geometry
      • Erase duplicate faces
      • Erase lonely edges ( Except edges on cut plane )
      • Remove edge material
      • Repair split edges
      • Smooth & soft edges
      • Put edges and faces to Layer0
      • Merge identical materials
      • Merge connected co-planar faces

      Requirements

      • SketchUp 7.1 or newer - You can run it on older versions, but it will not yield a predictable result - you will be warned about this.
      • TT_Lib2 (v2.7.0)

      Guide: How to install RBZ Files
      http://sketchucation.com/resources/pluginstore?pln=tt_cleanup

      Footprint

      http://forums.sketchucation.com/download/file.php?id=53762
      <Sketchup>/Plugins/
      +-
      http://forums.sketchucation.com/download/file.php?id=53763
      tt_cleanup.rb

      History
      Both the Sketchup Importers option too remove coplanar edges and the deletecoplanaredges plugin have given me mixed result. Geometry tend to disappear in some cases. Part of that is due to a Sketchup bug: http://forums.sketchucation.com/viewtopic.php?f=180%26amp;t=10599%26amp;start=30#p164501 and another part is due to what seem to be some inconstancy with the way Sketchup and the Ruby API deal with numbers.
      As of 7.1 the first issue appear to have been fixed. (Yay! ) And I have found a work around for the other issue.
      If you experience geometry to be lost, while using SU 7.1- please let me know so I can look into it.

      If you have geometry selected it will work on those only. Otherwise it will iterate over the current context.

      Technical Jabber
      Prior to SU 7.1 there was a bug where in some cases deleting an coplanar edge, either via Ruby or the Eraser tool, would make its connected faces disappear. See this thread for more info and samples: http://forums.sketchucation.com/viewtopic.php?f=180%26amp;t=10599%26amp;start=30#p164496
      I tried to work around that previously, but the code ended up stupidly complex trying to keep track of all the edges I couldn't erase, and no matter what I did I always ended up loosing geometry, or not managing to remove everything. With this issue fixed in SU 7.1 it's now dead easy; Find'em and Erase'em!

      Update — 22 April 2010
      New and improved method to detect coplanar faces. No more messing about with tolerances.

      http://forums.sketchucation.com/download/file.php?id=53761


      CleanUp 2 UI

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

      1 réponse Dernière réponse Répondre Citer 0
      • E Hors-ligne
        Ecuadorian
        dernière édition par

        Thank you, man. I have the perfect file to test it. 😄

        -Miguel Lescano
        Subscribe to my house plans YouTube channel! (30K+ subs)

        1 réponse Dernière réponse Répondre Citer 0
        • thomthomT Hors-ligne
          thomthom
          dernière édition par

          @ecuadorian said:

          Thank you, man. I have the perfect file to test it. 😄

          A particular troublesome file? Please let me know how it goes. Not sure if I've got it fully tuned in yet.

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

          1 réponse Dernière réponse Répondre Citer 0
          • R Hors-ligne
            remus
            dernière édition par

            Cheers thom, a very useful script.

            http://remusrendering.wordpress.com/

            1 réponse Dernière réponse Répondre Citer 0
            • E Hors-ligne
              Ecuadorian
              dernière édition par

              😲 Wow... no more lost faces (as happened with other cleanup scripts), and cleanup is top-notch.
              before.jpg
              after.jpg

              Here it is applied only to the horizontal white borders:
              before2.jpg
              after2.jpg

              You do realize the importance of this script in the history of SketchUp, do you? Thanks again! 👍

              -Miguel Lescano
              Subscribe to my house plans YouTube channel! (30K+ subs)

              1 réponse Dernière réponse Répondre Citer 0
              • thomthomT Hors-ligne
                thomthom
                dernière édition par

                Good to see it working on other complex models. I only tried it against one complex one, large triangulated terrain with 80K+ faces. (Though that model had all the potential problems you could run into AFIK.)

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

                1 réponse Dernière réponse Répondre Citer 0
                • J Hors-ligne
                  Jim
                  dernière édition par

                  Ack! it doesn't look at materials?

                  Oh, and thank you! 👍

                  Hi

                  1 réponse Dernière réponse Répondre Citer 0
                  • thomthomT Hors-ligne
                    thomthom
                    dernière édition par

                    @jim said:

                    Ack! it doesn't look at materials?

                    Oh, and thank you! 👍

                    No, but that's a very good suggestion.

                    Ecuadorian did find some issues with some geometry, so I'll push an update when I've gotten around to look at it.

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

                    1 réponse Dernière réponse Répondre Citer 0
                    • thomthomT Hors-ligne
                      thomthom
                      dernière édition par

                      Ecuadorian:
                      I had a look at your sample file. I see the issues. I think it's a tolerance issue. I'll have to investigate a little more to tune in the tolerance.

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

                      1 réponse Dernière réponse Répondre Citer 0
                      • E Hors-ligne
                        Ecuadorian
                        dernière édition par

                        Thanks! I think I now remember what the problem might be, also. The model is scaled a lot. 😕

                        -Miguel Lescano
                        Subscribe to my house plans YouTube channel! (30K+ subs)

                        1 réponse Dernière réponse Répondre Citer 0
                        • thomthomT Hors-ligne
                          thomthom
                          dernière édition par

                          This is strange. When I compare the dot product of various faces, I find an overlap in the return value for faces where you can erase the connecting edge:

                          
                          	# Not coplanar
                          	# 0.999999999898786
                          	# 0.999999999901467
                          	# 0.99999999992968
                          	# 0.99999999995352
                          	# 0.999999999959393
                          	# 0.999999999974808
                          	#
                          	# Coplanar
                          	# 0.999999999917881
                          	# 0.999999999918562
                          	# 0.999999999984962
                          	# 0.999999999999148
                          	# 0.999999999999408
                          
                          

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

                          1 réponse Dernière réponse Répondre Citer 0
                          • thomthomT Hors-ligne
                            thomthom
                            dernière édition par

                            @ecuadorian said:

                            Thanks! I think I now remember what the problem might be, also. The model is scaled a lot. 😕

                            I did notice that - but I exploded it and it still occurs...

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

                            1 réponse Dernière réponse Répondre Citer 0
                            • Chris FullmerC Hors-ligne
                              Chris Fullmer
                              dernière édition par

                              Could you take the edge, find its connected faces. Then get the object id for those faces, and get all their vertices positions. Then delete the edge if it is planar. Then test to see if those faces still exist. If they do, move on. If they do not, then rebuild them using their vertices' positions? Painful yes, but maybe useful?

                              Chris

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

                              1 réponse Dernière réponse Répondre Citer 0
                              • thomthomT Hors-ligne
                                thomthom
                                dernière édition par

                                @chris fullmer said:

                                Could you take the edge, find its connected faces. Then get the object id for those faces, and get all their vertices positions. Then delete the edge if it is planar. Then test to see if those faces still exist. If they do, move on. If they do not, then rebuild them using their vertices' positions? Painful yes, but maybe useful?

                                Chris

                                I did that kind of stuff in my previous version, prior to 7.1 - wasn't stable. So many cases to take into account. Faces with inner holes etc...

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

                                1 réponse Dernière réponse Répondre Citer 0
                                • thomthomT Hors-ligne
                                  thomthom
                                  dernière édition par

                                  I think I might have misunderstood this whole DOT product from vectors... will have to look deeper into it.

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

                                  1 réponse Dernière réponse Répondre Citer 0
                                  • Chris FullmerC Hors-ligne
                                    Chris Fullmer
                                    dernière édition par

                                    Can you hit ctrl-z in ruby? 😄

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

                                    1 réponse Dernière réponse Répondre Citer 0
                                    • R Hors-ligne
                                      remus
                                      dernière édition par

                                      @thomthom said:

                                      I think I might have misunderstood this whole DOT product from vectors... will have to look deeper into it.

                                      What do you think is not working? from my quick browse of your script the dot product should do what you want.

                                      http://remusrendering.wordpress.com/

                                      1 réponse Dernière réponse Répondre Citer 0
                                      • thomthomT Hors-ligne
                                        thomthom
                                        dernière édition par

                                        @chris fullmer said:

                                        Can you hit ctrl-z in ruby? 😄

                                        Yea, http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/sketchup.html#undo
                                        But that would ruin any kind of possibility to undo the whole erase coplanar operation.

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

                                        1 réponse Dernière réponse Répondre Citer 0
                                        • thomthomT Hors-ligne
                                          thomthom
                                          dernière édition par

                                          ...could create a temp group and use that to replicate the two faces (when within a range where we can't be certain.)

                                          but I'd still try to avoid that if I can calculate this.

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

                                          1 réponse Dernière réponse Répondre Citer 0
                                          • honoluludesktopH Hors-ligne
                                            honoluludesktop
                                            dernière édition par

                                            Hi Thomas, I lost a texture from a face in a 61k faces model. BTW what happens when you have coplaner faces with different textures, or images placed on textured faces (say a run on a wood floor). Didn't read all the post, so sorry if already covered.

                                            1 réponse Dernière réponse Répondre Citer 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 48
                                            • 49
                                            • 1 / 49
                                            • Premier message
                                              Dernier message
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement