• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

Detect object intersect

Scheduled Pinned Locked Moved Dynamic Components
sketchup
1 Posts 1 Posters 1.9k 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.
  • C Offline
    CEIT81729
    last edited by 26 Oct 2015, 04:15

    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
    }
    end

    I 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 👍


    Collision detection


    Objects dynamic properties

    1 Reply Last reply Reply Quote 0
    • 1 / 1
    1 / 1
    • First post
      1/1
      Last post
    Buy SketchPlus
    Buy SUbD
    Buy WrapR
    Buy eBook
    Buy Modelur
    Buy Vertex Tools
    Buy SketchCuisine
    Buy FormFonts

    Advertisement