discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Complex model - reducing render time

S
superaorta@gmail.com
Fri, Apr 9, 2021 7:09 AM

I've a model that takes ~1s to preview but I cannot render as it requires

32Gb RAM.

It consists of one part which is made of lots of intersecting shapes.  This
one part is repeated with simple transformations many times.

I can render the one part quickly but rendering the many copies is proving
impossible.

I'm looking for simple ways to divide and conquer the problem.

My approach is to generate the basic part and save to stl (easily doable and
takes a few seconds) and then I generate my array using import("part.stl").

If I import and render a single object it previews fast and renders fast.

If I import and render multiple parts or I import and render a single part and
and intersecting object (simple cylinder) then it previews fast but will not
render because it throws the following error:

ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation!
Expr: e->incident_sface() != SFace_const_handle() File: /usr/include/CGAL/
Nef_S2/SM_const_decorator.h Line: 321

So...

(1) Can anyone explain what has gone wrong with this approach? openscad
generated the stl without error and I can't see any reason why two (or more
copies) of the same stl file should fail.

(2) Can anyone suggest a sensible alternative?*

  • reducing the number of facets or component parts isn't possible - it has to
    render smoothly to be functional.

Thanks!

I've a model that takes ~1s to preview but I cannot render as it requires >>32Gb RAM. It consists of one part which is made of lots of intersecting shapes. This one part is repeated with simple transformations many times. I can render the one part quickly but rendering the many copies is proving impossible. I'm looking for simple ways to divide and conquer the problem. My approach is to generate the basic part and save to stl (easily doable and takes a few seconds) and then I generate my array using import("part.stl"). If I import and render a single object it previews fast and renders fast. If I import and render multiple parts or I import and render a single part and and intersecting object (simple cylinder) then it previews fast but will not render because it throws the following error: ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: e->incident_sface() != SFace_const_handle() File: /usr/include/CGAL/ Nef_S2/SM_const_decorator.h Line: 321 So... (1) Can anyone explain what has gone wrong with this approach? openscad generated the stl without error and I can't see any reason why two (or more copies) of the same stl file should fail. (2) Can anyone suggest a sensible alternative?* * reducing the number of facets or component parts isn't possible - it has to render smoothly to be functional. Thanks!
M
MichaelAtOz
Fri, Apr 9, 2021 7:18 AM

OpenSCAD can export bad STLs.
Importing one and doing CSG operations on it will call CGAL.
CGAL checks internal geometry consistency, and produces such errors when it finds a problem.

Can you share your scad code? And the STLs.

Unfortunately if you hit 32GB, it probably means you have too many triangles.

-----Original Message-----
From: superaorta@gmail.com [mailto:superaorta@gmail.com]
Sent: Fri, 9 Apr 2021 17:09
To: discuss@lists.openscad.org
Subject: [OpenSCAD] Complex model - reducing render time

I've a model that takes ~1s to preview but I cannot render as it requires

32Gb RAM.

It consists of one part which is made of lots of intersecting shapes.  This
one part is repeated with simple transformations many times.

I can render the one part quickly but rendering the many copies is proving
impossible.

I'm looking for simple ways to divide and conquer the problem.

My approach is to generate the basic part and save to stl (easily doable and
takes a few seconds) and then I generate my array using import("part.stl").

If I import and render a single object it previews fast and renders fast.

If I import and render multiple parts or I import and render a single part and
and intersecting object (simple cylinder) then it previews fast but will not
render because it throws the following error:

ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation!
Expr: e->incident_sface() != SFace_const_handle() File: /usr/include/CGAL/
Nef_S2/SM_const_decorator.h Line: 321

So...

(1) Can anyone explain what has gone wrong with this approach? openscad
generated the stl without error and I can't see any reason why two (or more
copies) of the same stl file should fail.

(2) Can anyone suggest a sensible alternative?*

  • reducing the number of facets or component parts isn't possible - it has to
    render smoothly to be functional.

Thanks!


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

--
This email has been checked for viruses by AVG.
https://www.avg.com

OpenSCAD can export bad STLs. Importing one and doing CSG operations on it will call CGAL. CGAL checks internal geometry consistency, and produces such errors when it finds a problem. Can you share your scad code? And the STLs. Unfortunately if you hit 32GB, it probably means you have too many triangles. > -----Original Message----- > From: superaorta@gmail.com [mailto:superaorta@gmail.com] > Sent: Fri, 9 Apr 2021 17:09 > To: discuss@lists.openscad.org > Subject: [OpenSCAD] Complex model - reducing render time > > I've a model that takes ~1s to preview but I cannot render as it requires > >>32Gb RAM. > > It consists of one part which is made of lots of intersecting shapes. This > one part is repeated with simple transformations many times. > > I can render the one part quickly but rendering the many copies is proving > impossible. > > I'm looking for simple ways to divide and conquer the problem. > > My approach is to generate the basic part and save to stl (easily doable and > takes a few seconds) and then I generate my array using import("part.stl"). > > If I import and render a single object it previews fast and renders fast. > > If I import and render multiple parts or I import and render a single part and > and intersecting object (simple cylinder) then it previews fast but will not > render because it throws the following error: > > ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! > Expr: e->incident_sface() != SFace_const_handle() File: /usr/include/CGAL/ > Nef_S2/SM_const_decorator.h Line: 321 > > > > So... > > (1) Can anyone explain what has gone wrong with this approach? openscad > generated the stl without error and I can't see any reason why two (or more > copies) of the same stl file should fail. > > (2) Can anyone suggest a sensible alternative?* > > * reducing the number of facets or component parts isn't possible - it has to > render smoothly to be functional. > > Thanks! > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org -- This email has been checked for viruses by AVG. https://www.avg.com
S
superaorta@gmail.com
Fri, Apr 9, 2021 7:46 AM

On Friday, 9 April 2021 08:18:16 BST MichaelAtOz wrote:

OpenSCAD can export bad STLs.
Importing one and doing CSG operations on it will call CGAL.
CGAL checks internal geometry consistency, and produces such errors when it
finds a problem.

Can you share your scad code? And the STLs.

  • I produced the stl using openscad (no errors)
  • It renders a single copy (on its own) just fine even transformed
  • Multiple copies throws the error
  • One copy and another object throws an error

Unfortunately if you hit 32GB, it probably means you have too many
triangles.

Sadly I've no way around this the design has to be smooth to be functional...

STL enclosed and these highlight the problem:

// preview and render OK
translate([0,10,0])rotate([0,0,90])import("test.stl");
//translate([0,-10,0])rotate([0,0,90])import("test.stl");
//translate([0,0,-20])cylinder(r=12.5,h=10,$fn=120);


// preview OK and render fail
translate([0,10,0])rotate([0,0,90])import("test.stl");
translate([0,-10,0])rotate([0,0,90])import("test.stl");
//translate([0,0,-20])cylinder(r=12.5,h=10,$fn=120);


// preview OK and render fail
translate([0,10,0])rotate([0,0,90])import("test.stl");
//translate([0,-10,0])rotate([0,0,90])import("test.stl");
translate([0,0,-20])cylinder(r=12.5,h=10,$fn=120);

I should also mention I'm using V2019.05

Thanks!

On Friday, 9 April 2021 08:18:16 BST MichaelAtOz wrote: > OpenSCAD can export bad STLs. > Importing one and doing CSG operations on it will call CGAL. > CGAL checks internal geometry consistency, and produces such errors when it > finds a problem. > > Can you share your scad code? And the STLs. - I produced the stl using openscad (no errors) - It renders a single copy (on its own) just fine even transformed - Multiple copies throws the error - One copy and another object throws an error > Unfortunately if you hit 32GB, it probably means you have too many > triangles. Sadly I've no way around this the design has to be smooth to be functional... STL enclosed and these highlight the problem: // preview and render OK translate([0,10,0])rotate([0,0,90])import("test.stl"); //translate([0,-10,0])rotate([0,0,90])import("test.stl"); //translate([0,0,-20])cylinder(r=12.5,h=10,$fn=120); ---- // preview OK and render fail translate([0,10,0])rotate([0,0,90])import("test.stl"); translate([0,-10,0])rotate([0,0,90])import("test.stl"); //translate([0,0,-20])cylinder(r=12.5,h=10,$fn=120); ---- // preview OK and render fail translate([0,10,0])rotate([0,0,90])import("test.stl"); //translate([0,-10,0])rotate([0,0,90])import("test.stl"); translate([0,0,-20])cylinder(r=12.5,h=10,$fn=120); I should also mention I'm using V2019.05 Thanks!
M
MichaelAtOz
Fri, Apr 9, 2021 8:28 AM

That STL is badly broken.
http://forum.openscad.org/file/t359/Capture-td32604-bad-stl.jpg

Those white lines are holes, ie gaps in the 3D shell.

Multiple copies throws the error

Yes you need more than one to cause a union, that calls CGAL, checks the
geometry, it's bad, error.

That doesn't look like to many triangles, it is probably that badness
causing problems.


OpenSCAD Admin - email* me if you need anything,  or if I've done something stupid...

  • on the Forum, 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.

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

That STL is badly broken. <http://forum.openscad.org/file/t359/Capture-td32604-bad-stl.jpg> Those white lines are holes, ie gaps in the 3D shell. > Multiple copies throws the error Yes you need more than one to cause a union, that calls CGAL, checks the geometry, it's bad, error. That doesn't look like to many triangles, it is probably that badness causing problems. ----- OpenSCAD Admin - email* me if you need anything, or if I've done something stupid... * on the Forum, 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. -- Sent from: http://forum.openscad.org/
S
superaorta@gmail.com
Fri, Apr 9, 2021 8:52 AM

On Friday, 9 April 2021 09:28:52 BST MichaelAtOz wrote:

That STL is badly broken.
http://forum.openscad.org/file/t359/Capture-td32604-bad-stl.jpg

Those white lines are holes, ie gaps in the 3D shell.

Multiple copies throws the error

Yes you need more than one to cause a union, that calls CGAL, checks the
geometry, it's bad, error.

That doesn't look like to many triangles, it is probably that badness
causing problems.

I don't see any white holes and the stl renders fine in meshlab.

The original object is just an intersection of spheres and cylinders in
openscad, something like

$fn=30;
cylinder(r=1,h=10);
sphere(r=1);
rotate([0,180+15,0])cylinder(r=1,h=10);

but with ~35 segments

The "white" lines don't appear as holes to me - when I zoom in I can see
faces.  I think they are the tops of the cylinders where the spheres are
intersecting them (in the complete smooth limit when $fn->infinity these
wouldn't appear).

so...

If the problem is in the stl that openscad is producing, and there isn't
really a problem with the model how do I fix it?

I'm after a smooth, bendy tube and at the moment I'm using a chain of
cylinders and adding spheres at the corners to heal the fillets. I've tried
several other techniques but they tend to be very cumbersome or slow in
comparison.

On Friday, 9 April 2021 09:28:52 BST MichaelAtOz wrote: > That STL is badly broken. > <http://forum.openscad.org/file/t359/Capture-td32604-bad-stl.jpg> > > Those white lines are holes, ie gaps in the 3D shell. > > > Multiple copies throws the error > > Yes you need more than one to cause a union, that calls CGAL, checks the > geometry, it's bad, error. > > That doesn't look like to many triangles, it is probably that badness > causing problems. I don't see any white holes and the stl renders fine in meshlab. The original object is just an intersection of spheres and cylinders in openscad, something like $fn=30; cylinder(r=1,h=10); sphere(r=1); rotate([0,180+15,0])cylinder(r=1,h=10); but with ~35 segments The "white" lines don't appear as holes to me - when I zoom in I can see faces. I think they are the tops of the cylinders where the spheres are intersecting them (in the complete smooth limit when $fn->infinity these wouldn't appear). so... If the problem is in the stl that openscad is producing, and there isn't really a problem with the model how do I fix it? I'm after a smooth, bendy tube and at the moment I'm using a chain of cylinders and adding spheres at the corners to heal the fillets. I've tried several other techniques but they tend to be very cumbersome or slow in comparison.
M
MichaelAtOz
Fri, Apr 9, 2021 9:09 AM

That image was from Netfabb, it says it's bad 77 shells (ie discrete separate
parts) and 138 holes.

This is meshlab
http://forum.openscad.org/file/t359/Capture-td32604-bad-stl-meshlab.jpg

We can't help if you don't share the complete scad code.


OpenSCAD Admin - email* me if you need anything,  or if I've done something stupid...

  • on the Forum, 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.

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

That image was from Netfabb, it says it's bad 77 shells (ie discrete separate parts) and 138 holes. This is meshlab <http://forum.openscad.org/file/t359/Capture-td32604-bad-stl-meshlab.jpg> We can't help if you don't share the complete scad code. ----- OpenSCAD Admin - email* me if you need anything, or if I've done something stupid... * on the Forum, 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. -- Sent from: http://forum.openscad.org/
S
superaorta@gmail.com
Fri, Apr 9, 2021 9:49 AM

On Friday, 9 April 2021 10:09:03 BST MichaelAtOz wrote:

That image was from Netfabb, it says it's bad 77 shells (ie discrete
separate parts) and 138 holes.

This is meshlab
http://forum.openscad.org/file/t359/Capture-td32604-bad-stl-meshlab.jpg

We can't help if you don't share the complete scad code.


OpenSCAD Admin - email* me if you need anything,  or if I've done something
stupid...

  • on the Forum, 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.

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

Just hold on a bit - the maths describing the shape is a bit complicated and
half in / half out of the scad file that produces the problem.  I'm just
tidying it up so the scad will just do the rendering and this should be easier
to read.

On Friday, 9 April 2021 10:09:03 BST MichaelAtOz wrote: > That image was from Netfabb, it says it's bad 77 shells (ie discrete > separate parts) and 138 holes. > > This is meshlab > <http://forum.openscad.org/file/t359/Capture-td32604-bad-stl-meshlab.jpg> > > We can't help if you don't share the complete scad code. > > > > > ----- > OpenSCAD Admin - email* me if you need anything, or if I've done something > stupid... > > * on the Forum, 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. > > -- > Sent from: http://forum.openscad.org/ Just hold on a bit - the maths describing the shape is a bit complicated and half in / half out of the scad file that produces the problem. I'm just tidying it up so the scad will just do the rendering and this should be easier to read.
S
superaorta@gmail.com
Fri, Apr 9, 2021 10:55 AM

We can't help if you don't share the complete scad code.

Below: scad to generate the object and a test case that fails:

I can make the problem disappear but at the expense of lumpiness in the final model, this involves extending
the rods by .1 so the significantly overlap. (0.05 doesn't work, the test case warns that result may not be
2-manifold and the real case fails with these errors.

ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: e_below != SHalfedge_handle() File: /usr/include/CGAL/Nef_3/SNC_FM_decorator.h Line: 418
ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: e->incident_sface() != SFace_const_handle() File: /usr/include/CGAL/Nef_S2/SM_const_decorator.h Line: 321

The construction is =o=o=o=o= where = is a cylinder and o is a sphere used to fill the fillet between the cylinders.

The full model requires hundreds of these objects and I can't render it directly due to memory constraints.

Having a significant overlap might solve the rendering problem but it does not produce an acceptable result because of
the extra features it produces.

It occurs to me this is a rounding problem in openscad and one solution might be to render everything 10x bigger and
then scale the stl it before use

---- test case:

import("test.stl");
translate([0,10,0])import("test.stl");

---- object - save stl to "test.stl"

// sm=0.000000
$fn=30;
// rod sections to make up the main body
translate([0.000000,0,10.593750])rotate([0,180.000000,0])cylinder(r=.2,h=0.187500);
translate([0.000000,0,10.406250])rotate([0,181.080924,0])cylinder(r=.2,h=0.207068);
translate([-0.003906,0,10.199219])rotate([0,181.974934,0])cylinder(r=.2,h=0.226697);
translate([-0.011719,0,9.972656])rotate([0,182.726311,0])cylinder(r=.2,h=0.246373);
translate([-0.023438,0,9.726562])rotate([0,183.366461,0])cylinder(r=.2,h=0.266084);
translate([-0.039062,0,9.460938])rotate([0,183.918249,0])cylinder(r=.2,h=0.285824);
translate([-0.058594,0,9.175781])rotate([0,184.398705,0])cylinder(r=.2,h=0.305588);
translate([-0.082031,0,8.871094])rotate([0,184.820766,0])cylinder(r=.2,h=0.325370);
translate([-0.109375,0,8.546875])rotate([0,185.194429,0])cylinder(r=.2,h=0.345168);
translate([-0.140625,0,8.203125])rotate([0,185.527540,0])cylinder(r=.2,h=0.364978);
translate([-0.175781,0,7.839844])rotate([0,185.826342,0])cylinder(r=.2,h=0.384800);
translate([-0.214844,0,7.457031])rotate([0,186.095862,0])cylinder(r=.2,h=0.404632);
translate([-0.257812,0,7.054688])rotate([0,186.340192,0])cylinder(r=.2,h=0.424471);
translate([-0.304688,0,6.632812])rotate([0,186.562699,0])cylinder(r=.2,h=0.444318);
translate([-0.355469,0,6.191406])rotate([0,186.766175,0])cylinder(r=.2,h=0.464170);
translate([-0.410156,0,5.730469])rotate([0,186.952957,0])cylinder(r=.2,h=0.484028);
translate([-0.468750,0,5.250000])rotate([0,187.125016,0])cylinder(r=.2,h=0.503891);
translate([-0.531250,0,4.750000])rotate([0,186.082337,0])cylinder(r=.2,h=0.479260);
translate([-0.582031,0,4.273438])rotate([0,184.927110,0])cylinder(r=.2,h=0.454806);
translate([-0.621094,0,3.820312])rotate([0,183.641185,0])cylinder(r=.2,h=0.430557);
translate([-0.648438,0,3.390625])rotate([0,182.202598,0])cylinder(r=.2,h=0.406550);
translate([-0.664062,0,2.984375])rotate([0,180.584631,0])cylinder(r=.2,h=0.382832);
translate([-0.667969,0,2.601562])rotate([0,178.754636,0])cylinder(r=.2,h=0.359460);
translate([-0.660156,0,2.242188])rotate([0,176.672596,0])cylinder(r=.2,h=0.336505);
translate([-0.640625,0,1.906250])rotate([0,174.289407,0])cylinder(r=.2,h=0.314059);
translate([-0.609375,0,1.593750])rotate([0,171.544972,0])cylinder(r=.2,h=0.292239);
translate([-0.566406,0,1.304688])rotate([0,168.366366,0])cylinder(r=.2,h=0.271196);
translate([-0.511719,0,1.039062])rotate([0,164.666715,0])cylinder(r=.2,h=0.251127);
translate([-0.445312,0,0.796875])rotate([0,160.346176,0])cylinder(r=.2,h=0.232282);
translate([-0.367188,0,0.578125])rotate([0,155.297570,0])cylinder(r=.2,h=0.214986);
translate([-0.277344,0,0.382812])rotate([0,149.420773,0])cylinder(r=.2,h=0.199640);
translate([-0.175781,0,0.210938])rotate([0,142.650651,0])cylinder(r=.2,h=0.186725);
translate([-0.062500,0,0.062500])rotate([0,135.000000,0])cylinder(r=.2,h=0.176777);
// spheres to fill the fillets
translate([0.000000,0,10.406250])sphere(r=.2);
translate([-0.003906,0,10.199219])sphere(r=.2);
translate([-0.011719,0,9.972656])sphere(r=.2);
translate([-0.023438,0,9.726562])sphere(r=.2);
translate([-0.039062,0,9.460938])sphere(r=.2);
translate([-0.058594,0,9.175781])sphere(r=.2);
translate([-0.082031,0,8.871094])sphere(r=.2);
translate([-0.109375,0,8.546875])sphere(r=.2);
translate([-0.140625,0,8.203125])sphere(r=.2);
translate([-0.175781,0,7.839844])sphere(r=.2);
translate([-0.214844,0,7.457031])sphere(r=.2);
translate([-0.257812,0,7.054688])sphere(r=.2);
translate([-0.304688,0,6.632812])sphere(r=.2);
translate([-0.355469,0,6.191406])sphere(r=.2);
translate([-0.410156,0,5.730469])sphere(r=.2);
translate([-0.468750,0,5.250000])sphere(r=.2);
translate([-0.531250,0,4.750000])sphere(r=.2);
translate([-0.582031,0,4.273438])sphere(r=.2);
translate([-0.621094,0,3.820312])sphere(r=.2);
translate([-0.648438,0,3.390625])sphere(r=.2);
translate([-0.664062,0,2.984375])sphere(r=.2);
translate([-0.667969,0,2.601562])sphere(r=.2);
translate([-0.660156,0,2.242188])sphere(r=.2);
translate([-0.640625,0,1.906250])sphere(r=.2);
translate([-0.609375,0,1.593750])sphere(r=.2);
translate([-0.566406,0,1.304688])sphere(r=.2);
translate([-0.511719,0,1.039062])sphere(r=.2);
translate([-0.445312,0,0.796875])sphere(r=.2);
translate([-0.367188,0,0.578125])sphere(r=.2);
translate([-0.277344,0,0.382812])sphere(r=.2);
translate([-0.175781,0,0.210938])sphere(r=.2);
translate([-0.062500,0,0.062500])sphere(r=.2);

> We can't help if you don't share the complete scad code. Below: scad to generate the object and a test case that fails: I can make the problem disappear but at the expense of lumpiness in the final model, this involves extending the rods by .1 so the significantly overlap. (0.05 doesn't work, the test case warns that result may not be 2-manifold and the real case fails with these errors. ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: e_below != SHalfedge_handle() File: /usr/include/CGAL/Nef_3/SNC_FM_decorator.h Line: 418 ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: e->incident_sface() != SFace_const_handle() File: /usr/include/CGAL/Nef_S2/SM_const_decorator.h Line: 321 The construction is =o=o=o=o= where = is a cylinder and o is a sphere used to fill the fillet between the cylinders. The full model requires hundreds of these objects and I can't render it directly due to memory constraints. Having a significant overlap might solve the rendering problem but it does not produce an acceptable result because of the extra features it produces. It occurs to me this is a rounding problem in openscad and one solution might be to render everything 10x bigger and then scale the stl it before use ---- test case: import("test.stl"); translate([0,10,0])import("test.stl"); ---- object - save stl to "test.stl" // sm=0.000000 $fn=30; // rod sections to make up the main body translate([0.000000,0,10.593750])rotate([0,180.000000,0])cylinder(r=.2,h=0.187500); translate([0.000000,0,10.406250])rotate([0,181.080924,0])cylinder(r=.2,h=0.207068); translate([-0.003906,0,10.199219])rotate([0,181.974934,0])cylinder(r=.2,h=0.226697); translate([-0.011719,0,9.972656])rotate([0,182.726311,0])cylinder(r=.2,h=0.246373); translate([-0.023438,0,9.726562])rotate([0,183.366461,0])cylinder(r=.2,h=0.266084); translate([-0.039062,0,9.460938])rotate([0,183.918249,0])cylinder(r=.2,h=0.285824); translate([-0.058594,0,9.175781])rotate([0,184.398705,0])cylinder(r=.2,h=0.305588); translate([-0.082031,0,8.871094])rotate([0,184.820766,0])cylinder(r=.2,h=0.325370); translate([-0.109375,0,8.546875])rotate([0,185.194429,0])cylinder(r=.2,h=0.345168); translate([-0.140625,0,8.203125])rotate([0,185.527540,0])cylinder(r=.2,h=0.364978); translate([-0.175781,0,7.839844])rotate([0,185.826342,0])cylinder(r=.2,h=0.384800); translate([-0.214844,0,7.457031])rotate([0,186.095862,0])cylinder(r=.2,h=0.404632); translate([-0.257812,0,7.054688])rotate([0,186.340192,0])cylinder(r=.2,h=0.424471); translate([-0.304688,0,6.632812])rotate([0,186.562699,0])cylinder(r=.2,h=0.444318); translate([-0.355469,0,6.191406])rotate([0,186.766175,0])cylinder(r=.2,h=0.464170); translate([-0.410156,0,5.730469])rotate([0,186.952957,0])cylinder(r=.2,h=0.484028); translate([-0.468750,0,5.250000])rotate([0,187.125016,0])cylinder(r=.2,h=0.503891); translate([-0.531250,0,4.750000])rotate([0,186.082337,0])cylinder(r=.2,h=0.479260); translate([-0.582031,0,4.273438])rotate([0,184.927110,0])cylinder(r=.2,h=0.454806); translate([-0.621094,0,3.820312])rotate([0,183.641185,0])cylinder(r=.2,h=0.430557); translate([-0.648438,0,3.390625])rotate([0,182.202598,0])cylinder(r=.2,h=0.406550); translate([-0.664062,0,2.984375])rotate([0,180.584631,0])cylinder(r=.2,h=0.382832); translate([-0.667969,0,2.601562])rotate([0,178.754636,0])cylinder(r=.2,h=0.359460); translate([-0.660156,0,2.242188])rotate([0,176.672596,0])cylinder(r=.2,h=0.336505); translate([-0.640625,0,1.906250])rotate([0,174.289407,0])cylinder(r=.2,h=0.314059); translate([-0.609375,0,1.593750])rotate([0,171.544972,0])cylinder(r=.2,h=0.292239); translate([-0.566406,0,1.304688])rotate([0,168.366366,0])cylinder(r=.2,h=0.271196); translate([-0.511719,0,1.039062])rotate([0,164.666715,0])cylinder(r=.2,h=0.251127); translate([-0.445312,0,0.796875])rotate([0,160.346176,0])cylinder(r=.2,h=0.232282); translate([-0.367188,0,0.578125])rotate([0,155.297570,0])cylinder(r=.2,h=0.214986); translate([-0.277344,0,0.382812])rotate([0,149.420773,0])cylinder(r=.2,h=0.199640); translate([-0.175781,0,0.210938])rotate([0,142.650651,0])cylinder(r=.2,h=0.186725); translate([-0.062500,0,0.062500])rotate([0,135.000000,0])cylinder(r=.2,h=0.176777); // spheres to fill the fillets translate([0.000000,0,10.406250])sphere(r=.2); translate([-0.003906,0,10.199219])sphere(r=.2); translate([-0.011719,0,9.972656])sphere(r=.2); translate([-0.023438,0,9.726562])sphere(r=.2); translate([-0.039062,0,9.460938])sphere(r=.2); translate([-0.058594,0,9.175781])sphere(r=.2); translate([-0.082031,0,8.871094])sphere(r=.2); translate([-0.109375,0,8.546875])sphere(r=.2); translate([-0.140625,0,8.203125])sphere(r=.2); translate([-0.175781,0,7.839844])sphere(r=.2); translate([-0.214844,0,7.457031])sphere(r=.2); translate([-0.257812,0,7.054688])sphere(r=.2); translate([-0.304688,0,6.632812])sphere(r=.2); translate([-0.355469,0,6.191406])sphere(r=.2); translate([-0.410156,0,5.730469])sphere(r=.2); translate([-0.468750,0,5.250000])sphere(r=.2); translate([-0.531250,0,4.750000])sphere(r=.2); translate([-0.582031,0,4.273438])sphere(r=.2); translate([-0.621094,0,3.820312])sphere(r=.2); translate([-0.648438,0,3.390625])sphere(r=.2); translate([-0.664062,0,2.984375])sphere(r=.2); translate([-0.667969,0,2.601562])sphere(r=.2); translate([-0.660156,0,2.242188])sphere(r=.2); translate([-0.640625,0,1.906250])sphere(r=.2); translate([-0.609375,0,1.593750])sphere(r=.2); translate([-0.566406,0,1.304688])sphere(r=.2); translate([-0.511719,0,1.039062])sphere(r=.2); translate([-0.445312,0,0.796875])sphere(r=.2); translate([-0.367188,0,0.578125])sphere(r=.2); translate([-0.277344,0,0.382812])sphere(r=.2); translate([-0.175781,0,0.210938])sphere(r=.2); translate([-0.062500,0,0.062500])sphere(r=.2);
S
superaorta@gmail.com
Fri, Apr 9, 2021 11:21 AM

Scaling the model doesn't appear to fix anything

Scaling the model doesn't appear to fix anything
AC
A. Craig West
Fri, Apr 9, 2021 12:10 PM

Try this, it is more likely to get the results you need (all of those
spheres and cylinders of matching radius and position are far too likely to
cause degenerate polygons of various types)
// sm=0.000000
$fn=30;

pts = [
[0.000000,0,10.593750],
[0.000000,0,10.406250],
[-0.003906,0,10.199219],
[-0.011719,0,9.972656],
[-0.023438,0,9.726562],
[-0.039062,0,9.460938],
[-0.058594,0,9.175781],
[-0.082031,0,8.871094],
[-0.109375,0,8.546875],
[-0.140625,0,8.203125],
[-0.175781,0,7.839844],
[-0.214844,0,7.457031],
[-0.257812,0,7.054688],
[-0.304688,0,6.632812],
[-0.355469,0,6.191406],
[-0.410156,0,5.730469],
[-0.468750,0,5.250000],
[-0.531250,0,4.750000],
[-0.582031,0,4.273438],
[-0.621094,0,3.820312],
[-0.648438,0,3.390625],
[-0.664062,0,2.984375],
[-0.667969,0,2.601562],
[-0.660156,0,2.242188],
[-0.640625,0,1.906250],
[-0.609375,0,1.593750],
[-0.566406,0,1.304688],
[-0.511719,0,1.039062],
[-0.445312,0,0.796875],
[-0.367188,0,0.578125],
[-0.277344,0,0.382812],
[-0.175781,0,0.210938],
[-0.062500,0,0.062500],
[0, 0, 0]
];

angles = [
[0,180.000000,0],
[0,181.080924,0],
[0,181.974934,0],
[0,182.726311,0],
[0,183.366461,0],
[0,183.918249,0],
[0,184.398705,0],
[0,184.820766,0],
[0,185.194429,0],
[0,185.527540,0],
[0,185.826342,0],
[0,186.095862,0],
[0,186.340192,0],
[0,186.562699,0],
[0,186.766175,0],
[0,186.952957,0],
[0,187.125016,0],
[0,186.082337,0],
[0,184.927110,0],
[0,183.641185,0],
[0,182.202598,0],
[0,180.584631,0],
[0,178.754636,0],
[0,176.672596,0],
[0,174.289407,0],
[0,171.544972,0],
[0,168.366366,0],
[0,164.666715,0],
[0,160.346176,0],
[0,155.297570,0],
[0,149.420773,0],
[0,142.650651,0],
[0,135.000000,0],
[0,135.000000,0]
];

module section(pts, angles, i, r, t) {
hull() {
translate(pts[i])
rotate(angles[i])
cylinder(r = r, h = t, center = true);
translate(pts[i + 1])
rotate(angles[i + 1])
cylinder(r = r, h = t, center = true);
}
}

for (i = [0 : len(pts) - 2])
section(pts, angles, i, 0.2, 0.01);

On Fri, Apr 9, 2021 at 7:21 AM superaorta@gmail.com wrote:

Scaling the model doesn't appear to fix anything


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Try this, it is more likely to get the results you need (all of those spheres and cylinders of matching radius and position are far too likely to cause degenerate polygons of various types) // sm=0.000000 $fn=30; pts = [ [0.000000,0,10.593750], [0.000000,0,10.406250], [-0.003906,0,10.199219], [-0.011719,0,9.972656], [-0.023438,0,9.726562], [-0.039062,0,9.460938], [-0.058594,0,9.175781], [-0.082031,0,8.871094], [-0.109375,0,8.546875], [-0.140625,0,8.203125], [-0.175781,0,7.839844], [-0.214844,0,7.457031], [-0.257812,0,7.054688], [-0.304688,0,6.632812], [-0.355469,0,6.191406], [-0.410156,0,5.730469], [-0.468750,0,5.250000], [-0.531250,0,4.750000], [-0.582031,0,4.273438], [-0.621094,0,3.820312], [-0.648438,0,3.390625], [-0.664062,0,2.984375], [-0.667969,0,2.601562], [-0.660156,0,2.242188], [-0.640625,0,1.906250], [-0.609375,0,1.593750], [-0.566406,0,1.304688], [-0.511719,0,1.039062], [-0.445312,0,0.796875], [-0.367188,0,0.578125], [-0.277344,0,0.382812], [-0.175781,0,0.210938], [-0.062500,0,0.062500], [0, 0, 0] ]; angles = [ [0,180.000000,0], [0,181.080924,0], [0,181.974934,0], [0,182.726311,0], [0,183.366461,0], [0,183.918249,0], [0,184.398705,0], [0,184.820766,0], [0,185.194429,0], [0,185.527540,0], [0,185.826342,0], [0,186.095862,0], [0,186.340192,0], [0,186.562699,0], [0,186.766175,0], [0,186.952957,0], [0,187.125016,0], [0,186.082337,0], [0,184.927110,0], [0,183.641185,0], [0,182.202598,0], [0,180.584631,0], [0,178.754636,0], [0,176.672596,0], [0,174.289407,0], [0,171.544972,0], [0,168.366366,0], [0,164.666715,0], [0,160.346176,0], [0,155.297570,0], [0,149.420773,0], [0,142.650651,0], [0,135.000000,0], [0,135.000000,0] ]; module section(pts, angles, i, r, t) { hull() { translate(pts[i]) rotate(angles[i]) cylinder(r = r, h = t, center = true); translate(pts[i + 1]) rotate(angles[i + 1]) cylinder(r = r, h = t, center = true); } } for (i = [0 : len(pts) - 2]) section(pts, angles, i, 0.2, 0.01); On Fri, Apr 9, 2021 at 7:21 AM <superaorta@gmail.com> wrote: > Scaling the model doesn't appear to fix anything > > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >