# module [maybe later function] spiral(rev, hfac, wfac, base_r, sp_r)

6 messages
Open this post in threaded view
|

## module [maybe later function] spiral(rev, hfac, wfac, base_r, sp_r)

 I need a little help finishing this function to be exact I would like hfac to be just spiral height in mm from center wire to center wire, but somehow I endup fraking it up algebra can suck at times but I think I just not seeing the solution as the germans' say "can't see the forest because of all the trees" here is my budding function with instructions :     module spiral(rev,hfac,wfac,base_r,sp_r){     for (i=[0:0.5:rev*360]){     translate([0,0,i/hfac])     rotate([90,0,i])     translate([base_r-(i/wfac),0,0])     cylinder(r=sp_r, h=0.4, \$fn=32);     } }  /*spiral module instructions rev= revolutions the spiral makes hfac= height factor derived by (360*rev)/height in mm) wfac= incline of the spiral minimum about 15% of rev*360 play with it to get your best approximate shape) anything under 15% gives you wierd inverted results before the top base_r= radius of the bottom spiral sp_r= radius of the "wire" in mm  */ // example spiral(4,60,170,8.75,0.9); help terramir _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: module [maybe later function] spiral(rev, hfac, wfac, base_r, sp_r)

 This one might make more sense. coil.scad   There may be some other way to do things, but this calculates the path the spring is on and then 'extrudes' along that path. -- Sent from: http://forum.openscad.org/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: module [maybe later function] spiral(rev, hfac, wfac, base_r, sp_r)

 Yes it makes more sense in someways, but it does not have clear instructions.The angles are needed instead of the amount of rotations.terramirOn Sep 8, 2018 4:11 PM, "NateTG" <[hidden email]> wrote:This one might make more sense. coil.scad   There may be some other way to do things, but this calculates the path the spring is on and then 'extrudes' along that path. -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: module [maybe later function] spiral(rev, hfac, wfac, base_r, sp_r)

 If you want to do the angles in degrees instead, you can just replace 360 with 1. Lines 42-46 and then 63-72 make the tapered windings. It's possible to do fancier stuff to get something that looks better, but I'm not sure what application you have in mind. -- Sent from: http://forum.openscad.org/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org