π‘ LightUp 7.1 | SketchUp's only real-time renderer that uses object-based rendering
Download Trial
Detect object intersect
-
Hello everyone
mod = Sketchup.active_model
ent = mod.entities
grp = ent.grep(Sketchup::ComponentInstance)
for i in 0...grp.length - 1
grp.each{ |g| next if g == grp[i]
bb = Geom::BoundingBox.new.add(g.bounds.intersect(grp[i].bounds))
if bb.valid?
puts "#{g.name.to_s} and #{grp[i].name.to_s} intersect"
else
puts "#{g.name.to_s} and #{grp[i].name.to_s} do not intersect"
end
bb.clear
}
endI want to know how to calculate the model of dynamic properties of all objects (such as "Lenx", "Leny" ,"Lenz"...etc) after the object intersected the other object.
The case description like this:
First, detect all objects intersect situations like the above code
Second, if name = "column" objects intersect name = "beam" objects(just a simple example)
then, "column" objects dynamic properties("Lenx") deduction "beam" objects dynamic properties("Leny")Thank you for your advice and help
Advertisement