another sweep() question

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

another sweep() question

jon_bondy

I am unclear why this code results in a pristine cylindrical extrusion EXCEPT for one small place where it seems to twist frantically...



include <sweep.scad>

function f(a) = [18*sin(360*a), 18-18*cos(360*a*0.7),     36*sin(360*a/2)];

function shape(d) = let (dd = 5 * (1.2 - d/steps))
    [for (i=[1:10:360]) [dd*sin(i), dd*cos(i)]];

step = 0.005;
steps = 1/step;
path = [for (t=[step:step:1-step]) f(t)];
path_transforms = construct_transform_path(path);
sweep(shape(1), path_transforms);



-- 
Sent from my desktop computer.  
I do not receive emails while away from my desk, 
nor do I receive texts on my main phone number 
(which is a land line).  
If you know that I am on the road, please text me.  
If you know that I am home, please email me.

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

Re: another sweep() question

Ronaldo
@jon The original sweep.scad may show wild twists when the path gets a vertical (along z) step. This is discussed in http://forum.openscad.org/Twisty-problem-with-scad-utils-quot-sweep-quot-tc9775.html. There you will find also change suggestions to overcome that behavior. I have implemented those suggestions in a fork of sweep.scad and the results are far better. You may find my fork in https://github.com/RonaldoCMP/list-comprehension-demos

2018-01-05 12:55 GMT-02:00 jon <[hidden email]>:

I am unclear why this code results in a pristine cylindrical extrusion EXCEPT for one small place where it seems to twist frantically...



include <sweep.scad>

function f(a) = [18*sin(360*a), 18-18*cos(360*a*0.7),     36*sin(360*a/2)];

function shape(d) = let (dd = 5 * (1.2 - d/steps))
    [for (i=[1:10:360]) [dd*sin(i), dd*cos(i)]];

step = 0.005;
steps = 1/step;
path = [for (t=[step:step:1-step]) f(t)];
path_transforms = construct_transform_path(path);
sweep(shape(1), path_transforms);



-- 
Sent from my desktop computer.  
I do not receive emails while away from my desk, 
nor do I receive texts on my main phone number 
(which is a land line).  
If you know that I am on the road, please text me.  
If you know that I am home, please email me.

_______________________________________________
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: another sweep() question

jon_bondy

Thank you for recalling the thread so clearly!  Very helpful.  I did notice more than one "sweep.scad" on my computer, but was not able to recall why I should use one over the other.

Jon


On 1/5/2018 10:05 AM, Ronaldo Persiano wrote:
@jon The original sweep.scad may show wild twists when the path gets a vertical (along z) step. This is discussed in http://forum.openscad.org/Twisty-problem-with-scad-utils-quot-sweep-quot-tc9775.html. There you will find also change suggestions to overcome that behavior. I have implemented those suggestions in a fork of sweep.scad and the results are far better. You may find my fork in https://github.com/RonaldoCMP/list-comprehension-demos

2018-01-05 12:55 GMT-02:00 jon <[hidden email]>:

I am unclear why this code results in a pristine cylindrical extrusion EXCEPT for one small place where it seems to twist frantically...



include <sweep.scad>

function f(a) = [18*sin(360*a), 18-18*cos(360*a*0.7),     36*sin(360*a/2)];

function shape(d) = let (dd = 5 * (1.2 - d/steps))
    [for (i=[1:10:360]) [dd*sin(i), dd*cos(i)]];

step = 0.005;
steps = 1/step;
path = [for (t=[step:step:1-step]) f(t)];
path_transforms = construct_transform_path(path);
sweep(shape(1), path_transforms);



-- 
Sent from my desktop computer.  
I do not receive emails while away from my desk, 
nor do I receive texts on my main phone number 
(which is a land line).  
If you know that I am on the road, please text me.  
If you know that I am home, please email me.

_______________________________________________
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

-- 
Sent from my desktop computer.  
I do not receive emails while away from my desk, 
nor do I receive texts on my main phone number 
(which is a land line).  
If you know that I am on the road, please text me.  
If you know that I am home, please email me.

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