hull()

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

hull()

jose tav
what I have to add to the code to make rounded edges at the top?

$fa = 5;
$fs = 0.1;

height = 60;
length = 90 / 2;
width = 55;
wall = 2.2;
irad = 8;
orad = irad + wall;

hull() //interior module
for(end = [-1,1])
for(side = [-1,1])
translate([end * (length / 2 - wall - irad), side * (width / 2 - wall - irad), wall + irad])
{
cylinder(r = irad, h = height);
sphere(irad); //makes a nice interior concave edge
}

Thanks for your help


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

Re: hull()

hagen
by not using the cylinder and having a sphere at the 8 corners.

hull() for(x=[0,1]) for(y=[0,1]) for(z=[0,1]) translate(30*[x,y,z]) sphere(10);
Reply | Threaded
Open this post in threaded view
|

Re: hull()

MichaelAtOz
Administrator
Admin - email* me if you need anything, or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.
Reply | Threaded
Open this post in threaded view
|

Re: hull()

MichaelAtOz
Administrator
In reply to this post by hagen
oops again... :(

hagen wrote
hull() for(x=[0,1]) for(y=[0,1]) for(z=[0,1]) translate(30*[x,y,z]) sphere(10);
That takes an unduly long time to F5 for me, 23s.
Admin - email* me if you need anything, or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.
Reply | Threaded
Open this post in threaded view
|

Re: hull()

kintel
Administrator
On Feb 25, 2015, at 16:58 PM, MichaelAtOz <[hidden email]> wrote:
>
> That takes an unduly long time to F5 for me, 23s.
>
Yes, unfortunately, the implicit union strikes back.
Using the issue350 branch, it’s down to < 1 second.
Unrolling the loop is a good workaround for now.

 -Marius


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

Re: hull()

hagen
In reply to this post by MichaelAtOz
certainly not fast. F5 16sec for me (2014.03)
tp3
Reply | Threaded
Open this post in threaded view
|

Re: hull()

tp3
On 02/25/2015 11:32 PM, hagen wrote:
> certainly not fast. F5 16sec for me (2014.03)
>
As Marius mentioned, it's the for() that's causing the performance hit.
Unrolling the loop will make it render instantly:

hull() {
     translate(30*[0,0,0]) sphere(10);
     translate(30*[0,0,1]) sphere(10);
     translate(30*[0,1,0]) sphere(10);
     translate(30*[0,1,1]) sphere(10);
     translate(30*[1,0,0]) sphere(10);
     translate(30*[1,0,1]) sphere(10);
     translate(30*[1,1,0]) sphere(10);
     translate(30*[1,1,1]) sphere(10);
}

ciao,
   Torsten.


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

Re: hull()

jose tav
In reply to this post by hagen
wow!!  that simple and short!
I thought I am taken baby steps on openscad, now you make me feel like I am still in the womb
thanks a lot Hagen,


On Tuesday, February 24, 2015 10:31 PM, hagen <[hidden email]> wrote:


by not using the cylinder and having a sphere at the 8 corners.

hull() for(x=[0,1]) for(y=[0,1]) for(z=[0,1]) translate(30*[x,y,z])
sphere(10);



--
View this message in context: http://forum.openscad.org/hull-tp11755p11756.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
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: hull()

stonysmith
In reply to this post by tp3
I too am getting the 16 seconds versus < 1.

That's ugly!
Reply | Threaded
Open this post in threaded view
|

Re: hull()

kintel
Administrator
On Feb 25, 2015, at 21:51 PM, stonysmith <[hidden email]> wrote:

> I too am getting the 16 seconds versus < 1.
> That's ugly!
>
It will stil be relatively slow in 2014.03.
It’s optimized to <1 sec in 2015.02.

 -Marius


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