Spiral with not-stretched cross-section?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

Spiral with not-stretched cross-section?

When you make a spiral, the shape that is extruded is facing upwards, so it kinda gets "smeared" depending on how many twists you do.

linear_extrude(height = 10, center = true, convexity = 10, twist = 360*2)
translate([2, 0, 0])
circle(r = 1);

Is there a way to make this more of a "spring" shape with a cross-section that is perpendicular to the twisted extrusion?  Like if I wanted a wire with a star-shaped cross section wound in a spiral, doing it with the above way would make a very smeared star, especially if I had twist=360*5.

I think it would involve rotating and scaling the cross section shape in a way that counteracts the angle of the linear_extrude twist value, based on the height and translation.  But I'm not sure...
Reply | Threaded
Open this post in threaded view

Re: Spiral with not-stretched cross-section?

You can get a square cross section spring by stacking spirals:

for(z = [-0.35 : 0.05: 0.35])
linear_extrude(height=10*sin($t*360)+14, twist=360*5)

Maybe a star is possible with some extra tricky manipulations.