Hey there.
I’m trying to draw a 3D helix. Specifically, the helix is a staircase stringer. So it has width. Part of the script that draws this is attached below:
step = step-(1.0/@detail)
entities.add_line(Geom::Point3d.new(-p3, p4, rise1-stringerz+(@rise/@detail)),Geom::Point3d.new(-p1, p2, rise1-stringerz+(@rise/@detail)))
rise1 = rise1-(@rise/@detail)
rise2 = rise2-(@rise/@detail)
p1 = stringe1
p2 = stringe2
p3 = stringe3
p4 = stringe4
end
entities.add_line(Geom::Point3d.new(-irad+@stringt, 0, rise1),Geom::Point3d.new(-irad+@stringt, 0, rise2-stringerz))
entities.add_line(Geom::Point3d.new(-lp3, lp4, rise2-stringerz+(@rise/@detail)), Geom::Point3d.new(-irad, 0, rise1-stringerz+(@rise/@detail)))
entities.add_line(Geom::Point3d.new(-irad, 0, rise1-stringerz+(@rise/@detail)), Geom::Point3d.new(-lp1, lp2, rise2-stringerz+(@rise/@detail)))
entities.add_line(Geom::Point3d.new(-irad+@stringt, 0, rise1-stringerz+(@rise/@detail)), Geom::Point3d.new(-lp3, lp4, rise2-stringerz+(@rise/@detail)))
model.active_layer = threed
add = group.entities.add_instance(new_comp_def, IDENTITY)
Please note, I have referred to this as a ‘script’. I use the Ruby Code Editor to automate my drawings, and this is not an extension.
Anyways, at the end of the code, I have a wireframe stringer. I’m having difficulty with find the exact code I need to create the faces on this. I’ve tried a variety of different things already, including progressively drawing the faces as the lines are drawn, but there’s issues with everything I’ve tried so far. I know the answer lies in grepping the lines and the selection tools, but the exact answer escapes me.
Using Eneroth’s Face Creator seems like a simple solution, but it’s not ideal as it creates too many faces (finding all the internal ones as well), which slows things down and you can’t soften the lines.
Thanks.