Nabble removed Mailing-list integration from the Forum.
This killed the Forum. This is now an ARCHIVE.
It is likely Nabble will shutdown in the future.

So basically the Forum is now out of date, we are looking into migrating the history.

OpenSCAD support is now provided by the Mailing List.
See the first pinned post here for instructions on subscribing to the mailing list.

Spiral with not-stretched cross-section?

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

Spiral with not-stretched cross-section?

benjaminhill
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.

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

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?

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

for(z = [-0.35 : 0.05: 0.35])
translate([0,0,z])
linear_extrude(height=10*sin($t*360)+14, twist=360*5)
translate([10.5,0])
scale([1,0.5])
circle(0.5);

Maybe a star is possible with some extra tricky manipulations.
Reply | Threaded
Open this post in threaded view
|

Re: Spiral with not-stretched cross-section?

Caddiy
Something like this?

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion#Twist

(Scroll down to -500° of Twist)