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

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

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

terramir
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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

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

NateTG
This one might make more sense.

coil.scad <http://forum.openscad.org/file/t2140/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
Reply | Threaded
Open this post in threaded view
|

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

terramir
Yes it makes more sense in someways, but it does not have clear instructions.
The angles are needed instead of the amount of rotations.
terramir


On Sep 8, 2018 4:11 PM, "NateTG" <[hidden email]> wrote:
This one might make more sense.

coil.scad <http://forum.openscad.org/file/t2140/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
Reply | Threaded
Open this post in threaded view
|

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

NateTG
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
Reply | Threaded
Open this post in threaded view
|

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

Ronaldo
In reply to this post by NateTG
NateTG wrote
> This one might make more sense.
>
> coil.scad &lt;http://forum.openscad.org/file/t2140/coil.scad&gt; 
>
> There may be some other way to do things, but this calculates the path the
> spring is on and then 'extrudes' along that path.

The coil code is indeed a specific sweep of a circle along a path. It has
however many cracks and it is inadequate for 3d printing for instance. There
are many codes out there aiming to sweep a planar section along a path. The
following is one more version that resorts to the heterodox hull of a
degenerated polyhedron that some people would argue against but which
simplifies the code a lot. For simplicity, this sweep does not avoid
undesirable twists along the path as can be seen by running

sweep(coilpath(), 3dsquare(1));

coil_sweep.scad <http://forum.openscad.org/file/t1275/coil_sweep.scad>  



 



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

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

terramir
In reply to this post by NateTG
Well what I did is actually working albeit I had to change some stuff to negative cause it was winding in the wrong direction. I got the cutout for the spring I did a wall test print and with a little prep it worked. 
So now just design the battery box to go with it. 
terramir

On Sep 8, 2018 7:06 PM, "NateTG" <[hidden email]> wrote:
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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org