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!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Clashes... any such plugin?

    Scheduled Pinned Locked Moved Plugins
    16 Posts 8 Posters 1.1k 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.
    • sdmitchS Offline
      sdmitch
      last edited by

      mod = Sketchup.active_model
      ent = mod.active_entities
      sel = mod.selection
      sel.empty? ? ents=ent.to_a ; ents=sel.to_a
      grp = ents.grep(Sketchup;;Group); sel.clear
      for i in 0...grp.length-1
        bounds1 = [grp[i].bounds.min.to_a,grp[i].bounds.max.to_a]
        for j in i+1...grp.length
          # bb=grp[i].bounds.intersect(grp[j].bounds)
          bounds2 = [grp[j].bounds.min.to_a,grp[j].bounds.max.to_a]
          intersectBounds = [[0,0,0],[0,0,0]]
          validBounds = true
          (0..2).each do |index|
            if(bounds1[1][index] <= bounds2[1][index])
              intersectBounds[1][index] = bounds1[1][index]
            else
              intersectBounds[1][index] = bounds2[1][index]
            end
      
            if(bounds1[0][index] >= bounds2[0][index])
              intersectBounds[0][index] = bounds1[0][index]
            else
              intersectBounds[0][index] = bounds2[0][index]
            end
      
            if(intersectBounds[0][index] > intersectBounds[1][index])
              validBounds = false
            end
          end
          if validBounds
            puts "#{grp[i].name} and #{grp[j].name} intersect"
            sel.add grp[i],grp[j]
          end
        end
      end
      
      

      Checks all components for "clashes". Adds both components to the selection when overlap or contact is found.

      Nothing is worthless, it can always be used as a bad example.

      http://sdmitch.blogspot.com/

      1 Reply Last reply Reply Quote 0
      • pilouP Offline
        pilou
        last edited by

        Maybe ?
        SU Solid by Tak2hata
        Solid Inspector By Thomthom
        Solid Solver by TIg

        Frenchy Pilou
        Is beautiful that please without concept!
        My Little site :)

        1 Reply Last reply Reply Quote 0
        • bazB Offline
          baz
          last edited by

          @sdmitch said:

          Checks all components for "clashes". Adds both components to the selection when overlap or contact is found.

          Wow, thanks sdmitch. Now I have to figure out how to use the ruby console 😞 I usually stay well away from it.

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

            this code detects clashes of parallelepipedic volumes, when the bounding box of the object and the object, are in the same volume

            if the objects are not parallelepipedics, you might have false positives

            1 Reply Last reply Reply Quote 0
            • D Offline
              driven
              last edited by

              @baz, can you post an example model, before the sheet thickness change...

              How it's made will dictate if a 'intersect with model' can be used to make life easier...

              john

              learn from the mistakes of others, you may not live long enough to make them all yourself...

              1 Reply Last reply Reply Quote 0
              • sdmitchS Offline
                sdmitch
                last edited by

                @glro said:

                this code detects clashes of parallelepipedic volumes, when the bounding box of the object and the object, are in the same volume

                if the objects are not parallelepipedics, you might have false positives

                Unfortunately this is true given the way Sketchup defines bounding boxes.

                Baz
                To use, copy and paste into Ruby Console window and press Enter.

                Nothing is worthless, it can always be used as a bad example.

                http://sdmitch.blogspot.com/

                1 Reply Last reply Reply Quote 0
                • D Offline
                  driven
                  last edited by

                  If you have used components properly [flipped copies etc...]
                  and are prepared to pre paint faces to be adjusted...
                  a plugin can adjust the material thickness and the 'clashing' edges...

                  here's a test..
                  like this...

                  learn from the mistakes of others, you may not live long enough to make them all yourself...

                  1 Reply Last reply Reply Quote 0
                  • pbacotP Offline
                    pbacot
                    last edited by

                    SU "knows" when faces intersect--wouldn't that be a better indicator for this analysis?

                    MacOSX MojaveSketchUp Pro v19 Twilight v2 Thea v3 PowerCADD

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      driven
                      last edited by

                      Peter, you can use intersect to find them, but SU won't know in which direction or which faces to move...

                      it's a bit like Solid Tools and would need many options for a semi-automated result...

                      You would also need to manually thicken everything first...

                      with cabinetry, it's easier if you use a material only on the items to adjust, then let ruby run using pushpull, when done you can repaint if needed...

                      it would not be too hard to wrap my code as a plugin...

                      john

                      learn from the mistakes of others, you may not live long enough to make them all yourself...

                      1 Reply Last reply Reply Quote 0
                      • pbacotP Offline
                        pbacot
                        last edited by

                        I was thinking of the general use where you want to see if a duct is intersecting a beam. You'd just want the tool to show you where so you can fix it yourself.

                        MacOSX MojaveSketchUp Pro v19 Twilight v2 Thea v3 PowerCADD

                        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