Seemingly simple object apparently isn't

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

Seemingly simple object apparently isn't

Manuel
The attached file is a kind of stopper with a hole in it I recently
constructed. To me, this seemed rather simple. However, my admittedly aging
laptop (~2GHz Core 2 Duo, 8GB RAM) struggles to render it. It's been at it
for over 2 hours now and the last try last night crashed after an unknown
amount of time.

So, here's a couple of questions:

- Can anybody who understands more about OpenSCAD's internal workings than I
do explain why this seemingly simple form makes OpenSCAD struggle so much?

- Is there any better/more efficient way to create that same shape?

- If anybody tries this out and finds their machine copes better, would you
share the STL with me? I'd really like to print that thing... ;)

Thanks in advance for any help and insights!

Cheers,

Manuel

test.scad <http://forum.openscad.org/file/t2095/test.scad>  



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

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

Re: Seemingly simple object apparently isn't

tp3
Using $fa = .1 and $fs = .1 is generating a *HUGE* amount of vertices.

Maybe try with

$fa = 5;     # minimum angle = 5°
$fs = 0.5;   # minimum segment length = 0.5

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: Seemingly simple object apparently isn't

Manuel
tp3 wrote
> $fa = 5;     # minimum angle = 5°
> $fs = 0.5;   # minimum segment length = 0.5

Thank you. That does of course help, but it also results in a rather ugly
model with a very visible flattened area on the top rather than the nice
dome shape I was aiming for.




--
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: Seemingly simple object apparently isn't

kintel
Administrator
> On Nov 30, 2017, at 6:02 AM, Manuel <[hidden email]> wrote:
>
> Thank you. That does of course help, but it also results in a rather ugly
> model with a very visible flattened area on the top rather than the nice
> dome shape I was aiming for.
>
OpenSCAD trades exactness and robustness for speed. We also started out on the scale needed for personal 3D printing, so in some cases, smooth curves may be time-consuming to achieve.
There are other software which do the trade-off the other way around; speed first, exactness/robustness second, see e.g. http://openjscad.org.

 -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: Seemingly simple object apparently isn't

TLC123
In reply to this post by Manuel
I would do this as an rotate_extrude .
2D sub system is very fast.
 
$fa =  0.1;
$fs =  0.5;

r_globus = 130;
r_loch = 11.35;
ueberlapp = 2;
r_zapfen = 2.8;

z=3;

d_deckel = .2;
h_d_deckel = d_deckel*0.5;

h_2=sqrt(pow(r_globus,2)-pow(r_loch+ueberlapp,2));

module hohlkugel(radius,dicke)
{
  difference()
  {
    circle(radius);
    circle(radius-dicke);
  }
}

module kugelschale(r_kugel,d_kugel,r_scheibe)
{
  intersection()
  {
    hohlkugel(r_kugel,d_kugel);
    polygon([[0,0],[r_scheibe,r_kugel],[-r_scheibe,r_kugel]]);
  }
}

module test()
{
  intersection()
  {
        union() {
           translate([ 0,-z])
            difference()
            {
              square([r_loch,r_globus]);
               square( [r_zapfen*2,2*r_globus],center=true);
            }
       
        }
    translate([ 0,-h_2]) circle(r=r_globus);
  }
    intersection()
  { difference()
                {
                  translate([  0,-h_2])
                  kugelschale(r_globus,d_deckel,(r_loch+ueberlapp)*r_globus/h_2);
          square( [r_zapfen*2,2*r_globus],center=true);

}      translate([ 0,-z])square([r_globus,r_globus]);
}}

rotate_extrude() offset(-h_d_deckel)offset(h_d_deckel) test();



--
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: Seemingly simple object apparently isn't

Manuel
In reply to this post by kintel
kintel wrote
> OpenSCAD trades exactness and robustness for speed.

Thank you. I can understand this approach.

FWIW, I tried to render my original file from the command line on a 128GB
RAM machine - it crashed with a failed malloc. Well, I'll know what to
expect and not be surprised in the future.



--
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: Seemingly simple object apparently isn't

Manuel
In reply to this post by TLC123
TLC123 wrote
> I would do this as an rotate_extrude .

Wow, perfect, thank you! Works like a charm and is lightning fast even with
both $fa and $fs at .1. Good to know that trick for the future.



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

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

Re: Seemingly simple object apparently isn't

tp3
On 01.12.2017 15:50, Manuel wrote:
> TLC123 wrote
>> I would do this as an rotate_extrude .
>
> Wow, perfect, thank you! Works like a charm and is lightning fast
> even with both $fa and $fs at .1. Good to know that trick for the
> future.
>
Yes, good point, generating vertices by extrusion is pretty fast.

You need to make sure there's no additional (3D) CSG operation with
that object. As soon as you simply put another cube(); in there, it
will blow up again.

ciao,
  Torsten.

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