[OpenSCAD] more sweep() issues

jon jon at jonbondy.com
Fri Jan 5 15:07:31 EST 2018


Thanks so much for your time!  I was able to get a solid object out of 
this, but when I changed the path to be the one that I am working on, 
the top flattened again.  I imagine that I need to rotate the slices 
better.  Your example had a fairly simple rotation, one that was easy to 
specify.  I guess I need to write code to take two points along the path 
and compute the rotations necessary to get the disks oriented properly.


On 1/5/2018 2:08 PM, Parkinbot wrote:
> Jon,
> let me remark some things before giving you advice.
> 1. your code produces self-intersection. Check this with F12. It will never
> pass CGAL
> <http://forum.openscad.org/file/t887/jon1.png>
> 2. I have noticed that current dev snapshots have a bug concerning the use
> of rotated polygons as start/end shapes of sweeps. Unavoidable non-planarity
> leads to CGAL-errors. https://github.com/openscad/openscad/issues/2246
> 3. some years ago I have played with the version of sweep you are currently
> using, but felt finally that its implicit restriction to using a certain
> basic shape is too restrictive for my purposes. Therefore I developed my own
> version, which you should know. It expects a vector of polygons placed in 3D
> and skins it, just like skin().
> 4. here a simple animation showing a bulb walking through a pipe.
> Uncommenting the first call showes, how the polygons are constructed and
> placed in 3D space. Uncommenting the second call and enabling animation
> (e.g. 10/100) shows the animation of a bubble wandering through a pipe.
> use <Naca_sweep.scad> // https://www.thingiverse.com/thing:900137
> w = 40;
> // sweep(trajectory(10), showslices = true); // view polygons as slices
> // w = $t*90-10; animated();
> module animated()
> {
>    difference()
>    {
>      sweep(trajectory(10));
>      sweep(trajectory(9, 14));
>    }
> }
> function trajectory(r0 = 10, r1=15, N = 20) =  [for(i=[0:N-1])
>     let(angle = 90/N*i)
>     let(r = max(r0, bulb(r1, 1.9, w-angle)))
>     Ry_(angle, Tx_(100, vec3D(circle(r))))];
> function circle(r, N=20) = [for(i=[0:N-1]) r*[sin(360/N*i), cos(360/N*i)]];
> function bulb(r, scale=1, x) =  abs(x)<r?scale*sqrt(r*r-x*x):0;
> --
> Sent from: http://forum.openscad.org/
> _______________________________________________
> OpenSCAD mailing list
> Discuss at lists.openscad.org
> 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.

More information about the Discuss mailing list