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

r.d. terramir terramircomputers at gmail.com
Sat Sep 8 18:05:32 EDT 2018


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 :
<code>

    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);
</code>
help
terramir



More information about the Discuss mailing list