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

    Detect object intersect

    Scheduled Pinned Locked Moved Developers' Forum
    1 Posts 1 Posters 396 Views 1 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.
    • C Offline
      CEIT81729
      last edited by

      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
      • First post
        Last post
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement