Hi all,
I’m new to Sketchup, new to ruby, new to this forum, but I like it all a lot!
I can’t figure this one out though: I am trying to figure out a way to project an odd-shaped object to a 2D surface and take the outer most edges only. Think of it as the shadow an object casts on the ground when the sun is exactly above it.
I can do this using Sandbox’s Drape tool and then erasing all the inner edges, but I feel like I’m missing an obvious method to code this. I have a messy work around to recreate some of the Drape tool when I’ve selected a group:
model = Sketchup.active_model
model.start_operation('Test', true)
group = model.selection[0]
group.entities.each{|e|
if e.is_a? Sketchup::Edge
p1 = e.start.position.clone
p1.z = 0
p2 = e.end.position.clone
p2.z = 0
model.entities.add_edges p1, p2
end
}
model.commit_operation
Could anybody point me in the right direction and help me out?
Thanks!
Bob