Clashes... any such plugin?
-
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.
-
Maybe ?
SU Solid by Tak2hata
Solid Inspector By Thomthom
Solid Solver by TIg -
@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.
-
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
-
@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
-
@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. -
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..
-
SU "knows" when faces intersect--wouldn't that be a better indicator for this analysis?
-
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
-
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.
Advertisement