discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Rendering fails (difference between F5 and F6)

JJ
Johan Jonker
Tue, Dec 8, 2015 9:54 PM

A strange problem.
F5 gives a good result (see first image).
F6 seems to forget the main part of the object.

This is my code:
/
difference()
{
union()
{
difference()
{
import("C:\Users\Eigenaar\Documents\Mijn 3D
design\basklarinetbeker buiten v4.stl", convexity = 5);
import("C:\Users\Eigenaar\Documents\Mijn 3D
design\basklarinetbeker binnen v4.stl", convexity = 5);

    }
    translate([0,0,-155]) 
    {
        cylinder(5,(d_btm_inside +d_btm_wall/2)/2, (d_btm_inside

+d_btm_wall/2)/2);
}
}
translate([0,0,-160]) cylinder(11,d_btm_inside/2, d_btm_inside/2);
}/

F5 result:
http://forum.openscad.org/file/n15041/render2.jpg
F6 result:
http://forum.openscad.org/file/n15041/render3.jpg

--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

A strange problem. F5 gives a good result (see first image). F6 seems to forget the main part of the object. This is my code: / difference() { union() { difference() { import("C:\\Users\\Eigenaar\\Documents\\Mijn 3D design\\basklarinetbeker buiten v4.stl", convexity = 5); import("C:\\Users\\Eigenaar\\Documents\\Mijn 3D design\\basklarinetbeker binnen v4.stl", convexity = 5); } translate([0,0,-155]) { cylinder(5,(d_btm_inside +d_btm_wall/2)/2, (d_btm_inside +d_btm_wall/2)/2); } } translate([0,0,-160]) cylinder(11,d_btm_inside/2, d_btm_inside/2); }/ F5 result: <http://forum.openscad.org/file/n15041/render2.jpg> F6 result: <http://forum.openscad.org/file/n15041/render3.jpg> -- View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041.html Sent from the OpenSCAD mailing list archive at Nabble.com.
JJ
Johan Jonker
Tue, Dec 8, 2015 9:56 PM

When I change convexity into 6 (don't now why, just trying something.

I get the following error messages:

ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion
violation! Expr: pe_prev->is_border() ||
!internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate()
File:
/data/OpenSCAD/libraries-mingw64-master/mxe-w64/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h
Line: 251
ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion
violation! Expr: pe_prev->is_border() ||
!internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate()
File:
/data/OpenSCAD/libraries-mingw64-master/mxe-w64/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h
Line: 251

--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15042.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

When I change convexity into 6 (don't now why, just trying something. I get the following error messages: ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: pe_prev->is_border() || !internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate() File: /data/OpenSCAD/libraries-mingw64-master/mxe-w64/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h Line: 251 ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: pe_prev->is_border() || !internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate() File: /data/OpenSCAD/libraries-mingw64-master/mxe-w64/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h Line: 251 -- View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15042.html Sent from the OpenSCAD mailing list archive at Nabble.com.
NH
nop head
Tue, Dec 8, 2015 10:02 PM

Odd because AFAIK convexity is only used by OpenCSG and F5. It should not
affect F6.

On 8 December 2015 at 21:56, Johan Jonker johangjonker@zonnet.nl wrote:

When I change convexity into 6 (don't now why, just trying something.

I get the following error messages:

ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion
violation! Expr: pe_prev->is_border() ||

!internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate()
File:

/data/OpenSCAD/libraries-mingw64-master/mxe-w64/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h
Line: 251
ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion
violation! Expr: pe_prev->is_border() ||

!internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate()
File:

/data/OpenSCAD/libraries-mingw64-master/mxe-w64/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h
Line: 251

--
View this message in context:
http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15042.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Odd because AFAIK convexity is only used by OpenCSG and F5. It should not affect F6. On 8 December 2015 at 21:56, Johan Jonker <johangjonker@zonnet.nl> wrote: > When I change convexity into 6 (don't now why, just trying something. > > I get the following error messages: > > ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion > violation! Expr: pe_prev->is_border() || > > !internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate() > File: > > /data/OpenSCAD/libraries-mingw64-master/mxe-w64/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h > Line: 251 > ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion > violation! Expr: pe_prev->is_border() || > > !internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate() > File: > > /data/OpenSCAD/libraries-mingw64-master/mxe-w64/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h > Line: 251 > > > > -- > View this message in context: > http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15042.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
JJ
Johan Jonker
Tue, Dec 8, 2015 11:22 PM

I tried to see if the two imported files need repair.
Meshlab detects some holes and other things, but I can't find and fix them.

--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15044.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I tried to see if the two imported files need repair. Meshlab detects some holes and other things, but I can't find and fix them. -- View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15044.html Sent from the OpenSCAD mailing list archive at Nabble.com.
MK
Marius Kintel
Wed, Dec 9, 2015 5:30 AM

Hi Johan,

This could be related to this FAQ entry, which describes how to repair such things in Meshlab:
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#Why_is_my_imported_STL_file_only_showing_up_with_F5_but_not_F6.3F

-Marius

Hi Johan, This could be related to this FAQ entry, which describes how to repair such things in Meshlab: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#Why_is_my_imported_STL_file_only_showing_up_with_F5_but_not_F6.3F -Marius
JJ
Johan Jonker
Wed, Dec 9, 2015 7:17 AM

Hi Kintel,

Thanks for that. It help a lot,. Not I am half way:

One part of the imports is giving an error:

ERROR: CGAL error in CGALUtils::applyBinaryOperator difference: CGAL ERROR:
assertion violation! Expr: itl != it->second.end() File:
/data/OpenSCAD/libraries-mingw64-master/mxe-w64/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102

http://forum.openscad.org/file/n15057/f5f6.jpg

--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15057.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hi Kintel, Thanks for that. It help a lot,. Not I am half way: One part of the imports is giving an error: ERROR: CGAL error in CGALUtils::applyBinaryOperator difference: CGAL ERROR: assertion violation! Expr: itl != it->second.end() File: /data/OpenSCAD/libraries-mingw64-master/mxe-w64/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/SNC_external_structure.h Line: 1102 <http://forum.openscad.org/file/n15057/f5f6.jpg> -- View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15057.html Sent from the OpenSCAD mailing list archive at Nabble.com.
JJ
Johan Jonker
Wed, Dec 9, 2015 8:02 AM

Also an attempt with nettfab did not work.
But that tool is completely new to me, maybe I don't use it in the right
way.

I see some coloured parts on the object. It that a problem? What to do with
that?
http://forum.openscad.org/file/n15058/netfabb.jpg

--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15058.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Also an attempt with nettfab did not work. But that tool is completely new to me, maybe I don't use it in the right way. I see some coloured parts on the object. It that a problem? What to do with that? <http://forum.openscad.org/file/n15058/netfabb.jpg> -- View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15058.html Sent from the OpenSCAD mailing list archive at Nabble.com.
MK
Marius Kintel
Wed, Dec 9, 2015 3:51 PM

Looks like the object imported OK now, which is good.
I don’t know what the next problem is - this is an internal error thrown from a 3rd party library.
We could investigate it if you share your files.

Even better: If you could modify the STL files into the smallest possible files still exhibiting this behavior, that would greatly increase the changes for someone looking at it, as such debugging is very time consuming.

-Marius

On Dec 9, 2015, at 02:17 AM, Johan Jonker johangjonker@zonnet.nl wrote:

Hi Kintel,

Thanks for that. It help a lot,. Not I am half way:

One part of the imports is giving an error:

ERROR: CGAL error in CGALUtils::applyBinaryOperator difference: CGAL ERROR:
assertion violation! Expr: itl != it->second.end() File:
/data/OpenSCAD/libraries-mingw64-master/mxe-w64/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102

http://forum.openscad.org/file/n15057/f5f6.jpg

--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15057.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Looks like the object imported OK now, which is good. I don’t know what the next problem is - this is an internal error thrown from a 3rd party library. We could investigate it if you share your files. Even better: If you could modify the STL files into the smallest possible files still exhibiting this behavior, that would greatly increase the changes for someone looking at it, as such debugging is very time consuming. -Marius > On Dec 9, 2015, at 02:17 AM, Johan Jonker <johangjonker@zonnet.nl> wrote: > > Hi Kintel, > > Thanks for that. It help a lot,. Not I am half way: > > One part of the imports is giving an error: > > ERROR: CGAL error in CGALUtils::applyBinaryOperator difference: CGAL ERROR: > assertion violation! Expr: itl != it->second.end() File: > /data/OpenSCAD/libraries-mingw64-master/mxe-w64/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/SNC_external_structure.h > Line: 1102 > > <http://forum.openscad.org/file/n15057/f5f6.jpg> > > > > -- > View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15057.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
JJ
Johan Jonker
Wed, Dec 9, 2015 10:31 PM

Hello Kintel,

The files can be found here:
http://sax.jonker.co/techniek/288-ontwerpen-van-de-beker-van-een-bas-klarinet.html

I change fn to 10 and then increased it until the problem occured.
When fn was 60 the problem occured.
I am sorry these files are 6M bytes.

The first file is the Openscad file producing the outside en inside of the
bell.
The last file is the one I use to substract them.

The error I now get is:
ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion
violation! Expr: pe_prev->is_border() ||
!internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate()
File:
/data/OpenSCAD/libraries-mingw64-master/mxe-w64/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h
Line: 293

thanks

Johan

--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15070.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hello Kintel, The files can be found here: http://sax.jonker.co/techniek/288-ontwerpen-van-de-beker-van-een-bas-klarinet.html I change fn to 10 and then increased it until the problem occured. When fn was 60 the problem occured. I am sorry these files are 6M bytes. The first file is the Openscad file producing the outside en inside of the bell. The last file is the one I use to substract them. The error I now get is: ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: pe_prev->is_border() || !internal::Plane_constructor::get_plane(pe_prev->facet(),pe_prev->facet()->plane()).is_degenerate() File: /data/OpenSCAD/libraries-mingw64-master/mxe-w64/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h Line: 293 thanks Johan -- View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15070.html Sent from the OpenSCAD mailing list archive at Nabble.com.
JJ
Johan Jonker
Wed, Dec 9, 2015 10:43 PM

Another thing:

I tried Meshlab.
and used the filter Remove T-vertices by Edge Collapse.
That did not help.

--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15071.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Another thing: I tried Meshlab. and used the filter Remove T-vertices by Edge Collapse. That did not help. -- View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15071.html Sent from the OpenSCAD mailing list archive at Nabble.com.
JJ
Johan Jonker
Wed, Dec 9, 2015 10:52 PM

I also tried filteringe the STL- files in Meshlab with the Remove T-vertices
etc.
That worked in that way that the error message changes into this:

S/aved backup file: C:/Users/Eigenaar/Documents/OpenSCAD/backups/basklarinet
alles-backup-aOk10684.scad
Compiling design (CSG Tree generation)...
Rendering Polygon Mesh using CGAL...
ERROR: CGAL error in CGALUtils::applyBinaryOperator difference: CGAL ERROR:
assertion violation! Expr: itl != it->second.end() File:
/data/OpenSCAD/libraries-mingw64-master/mxe-w64/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/SNC_external_structure.h
Line: 1102
Geometries in cache: 3637
Geometry cache size in bytes: 41353920
CGAL Polyhedrons in cache: 7
CGAL cache size in bytes: 82756208
Total rendering time: 0 hours, 2 minutes, 43 seconds
Top level object is a 3D object:
Simple:        yes
Vertices:    16551
Halfedges:  98478
Edges:      49239
Halffacets:  65382
Facets:      32691
Volumes:        2
Rendering finished./

--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15072.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I also tried filteringe the STL- files in Meshlab with the Remove T-vertices etc. That worked in that way that the error message changes into this: S/aved backup file: C:/Users/Eigenaar/Documents/OpenSCAD/backups/basklarinet alles-backup-aOk10684.scad Compiling design (CSG Tree generation)... Rendering Polygon Mesh using CGAL... ERROR: CGAL error in CGALUtils::applyBinaryOperator difference: CGAL ERROR: assertion violation! Expr: itl != it->second.end() File: /data/OpenSCAD/libraries-mingw64-master/mxe-w64/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/SNC_external_structure.h Line: 1102 Geometries in cache: 3637 Geometry cache size in bytes: 41353920 CGAL Polyhedrons in cache: 7 CGAL cache size in bytes: 82756208 Total rendering time: 0 hours, 2 minutes, 43 seconds Top level object is a 3D object: Simple: yes Vertices: 16551 Halfedges: 98478 Edges: 49239 Halffacets: 65382 Facets: 32691 Volumes: 2 Rendering finished./ -- View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15072.html Sent from the OpenSCAD mailing list archive at Nabble.com.
MK
Marius Kintel
Thu, Dec 10, 2015 1:21 AM

On Dec 9, 2015, at 17:31 PM, Johan Jonker johangjonker@zonnet.nl wrote:

The first file is the Openscad file producing the outside en inside of the
bell.

I got a 404 on the first file.
Are you saying that the STL files are modelled and exported from OpenSCAD as well?

-Marius

> On Dec 9, 2015, at 17:31 PM, Johan Jonker <johangjonker@zonnet.nl> wrote: > > The first file is the Openscad file producing the outside en inside of the > bell. I got a 404 on the first file. Are you saying that the STL files are modelled and exported from OpenSCAD as well? -Marius
N
Neon22
Thu, Dec 10, 2015 5:22 AM

The STL files are fine. no problem with them.
This suggests the load is causng a problem.
E.g. There are many very small step-like ridges around the flare of the
bell.
Its probable that the decimal points are being truncated and the vertices
that are very close together are not staying unique.

--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15078.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

The STL files are fine. no problem with them. This suggests the load is causng a problem. E.g. There are many very small step-like ridges around the flare of the bell. Its probable that the decimal points are being truncated and the vertices that are very close together are not staying unique. -- View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15078.html Sent from the OpenSCAD mailing list archive at Nabble.com.
JJ
Johan Jonker
Thu, Dec 10, 2015 7:26 AM

@ Kintel

Oh I am sorry, a type in the filename. It is modified now.
Because rendering became too slow i modelled the outside and inside in
OpenSCAD and used the difference function of the import of them in a
separate OpenSCAD file.

--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15080.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

@ Kintel Oh I am sorry, a type in the filename. It is modified now. Because rendering became too slow i modelled the outside and inside in OpenSCAD and used the difference function of the import of them in a separate OpenSCAD file. -- View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15080.html Sent from the OpenSCAD mailing list archive at Nabble.com.
JJ
Johan Jonker
Thu, Dec 10, 2015 7:29 AM

@neon,

That is interesting. What tool do you use to visualize that?

The only reason can be the thickness of the cylinders I use for the top and
bottom of the segments of the bell. I changed it into a very small value. In
MeshLab that looks better, but I can't see it as clear as in your picture.

module cylinder_pie(angle1, angle2, dx1,dx2,dy1,dy2,r1,r2,top,dr)
{
// draw top and bottom cylinders
// rotate the cylinder
// hull the cylinders
// trick: draw an extra thick and large cylinder when the top is
reached and
d=0.00001;
hull()
{

             translate([ 0,dx1,dy1])
             rotate( angle1, ([1,0,0]))
             translate([0,0,-d])
             cylinder(d,r1, r1, center=false);
             echo("top:", dx1,dy1,angle1,d,r1);
           
             translate([ 0,dx2,dy2])
             rotate( angle2, ([1,0,0]))
             translate([0,0,d])  
             cylinder(d+top,r2, r2, center=false);
             echo("bottom:", dx2,dy2,angle2,d+top,r2);
          

      }
      if (top > 0)
      {
             translate([ 0,dx2,dy2])
             rotate( angle2, ([1,0,0]))
             translate([0,0,d])  
             cylinder(d+top,r2+dr, r2+dr, center=false);
          
}

}

--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15081.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

@neon, That is interesting. What tool do you use to visualize that? The only reason can be the thickness of the cylinders I use for the top and bottom of the segments of the bell. I changed it into a very small value. In MeshLab that looks better, but I can't see it as clear as in your picture. module cylinder_pie(angle1, angle2, dx1,dx2,dy1,dy2,r1,r2,top,dr) { // draw top and bottom cylinders // rotate the cylinder // hull the cylinders // trick: draw an extra thick and large cylinder when the top is reached and d=0.00001; hull() { translate([ 0,dx1,dy1]) rotate( angle1, ([1,0,0])) translate([0,0,-d]) cylinder(d,r1, r1, center=false); echo("top:", dx1,dy1,angle1,d,r1); translate([ 0,dx2,dy2]) rotate( angle2, ([1,0,0])) translate([0,0,d]) cylinder(d+top,r2, r2, center=false); echo("bottom:", dx2,dy2,angle2,d+top,r2); } if (top > 0) { translate([ 0,dx2,dy2]) rotate( angle2, ([1,0,0])) translate([0,0,d]) cylinder(d+top,r2+dr, r2+dr, center=false); } } -- View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15081.html Sent from the OpenSCAD mailing list archive at Nabble.com.
JJ
Johan Jonker
Thu, Dec 10, 2015 7:39 AM

This is the result now: a lot of non-manifold edges detected in MeshLab.
Later this day I will see how to fix that. Suggestions are welcome (I am new
to Meshlab).
http://forum.openscad.org/file/n15082/manifold.jpg

--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15082.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

This is the result now: a lot of non-manifold edges detected in MeshLab. Later this day I will see how to fix that. Suggestions are welcome (I am new to Meshlab). <http://forum.openscad.org/file/n15082/manifold.jpg> -- View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15082.html Sent from the OpenSCAD mailing list archive at Nabble.com.
N
Neon22
Thu, Dec 10, 2015 9:01 AM

OK problem appears to definately be caused by the way you're hulling.
What's happening is the very small slices (0.01 or smaller) are creating
artifacts.
Ideally you should be able to use a value of 0.1 (say) for thickness and not
see much visual difference.

The trick to make this happen is to step through the loop in a different
way.
You want the parameterization to be by looping through i, i+1 and hulling
between them.

  • where "i" creates each step in the curve. This way the hull() of "i+1"
    perfectly matches when it is "i" the next time through the loop.

IMHO This means altering your entire procedure of calculating. You're using
separate calcs for dx, dx2 (etc) pairs of all your variables.
These do not always overlap - so you get cracks.

Ideally re-parameterize so that each time through the loop the same value is
calculated.
Basically drop the second calc entirely and just make one. Increment your
index to get each profile.

So form of result could be something like this but does not have to be in
list form. (I'm just trying to make code clear)...
diameters = list_of_inner_diameters(); // a list generated somehow
radii = list_of_radii(); // a list generated somehow - same length
positions = list_of_translations(); //  - same length
angles = list_of_rotations(); //  - same length

for (i=[0:1:len(diameters)-1])
hull() {
translate(positions[i])
rotate(angles[i])
cylinder(diameters[i], r=radii[i], center=false);
// next step
translate(positions[i+1])
rotate(angles[i+1])
cylinder(diameters[i+1], r=radii[i+1], center=false);
}

You can see what's wrong if you change the following to larger numbers like
these

  • delta = 16; // in module calyx()
  • d=1; // in module cylinder_pie()

// object: bass clarinet bell
// version: 4
// design: J.G.Jonker
// website: sax.jonker.co
// date: 7-12-2015
$fn=14;
maxheight = 160;    // Height
d_btm_inside = 25;  // dia at base
d_btm_wall =  10;    // outer base dia (added to d_btm_inside)
d_top_inside = 144;  // dia of flare
d_top_wall = 16;      // notional thickness...
rotatie_top = 65;    // angle of flare
mildfactor = 0.25;  // Z-move at middle

// ---------------
astraal = maxheight/sin(rotatie_top);

// rotate([180-rotatie_top,0,0])
difference()  {
// translate([0,0,-150]) calyx(buiten=true);
translate([0,0,-150]) calyx(buiten=false);
//
// translate([0,0,-maxheight/2])
// cube(size=[20,60,maxheight*2], center=true);
}

module calyx(buiten) {
delta = 16;
delta2 = delta/2;
delta3 = delta2/2;
delta4 = delta3/2;
// Main body of bell
for (height = [0:delta:maxheight-4delta])
calyx_segment(height, delta, buiten,0);
// start lip curve
for (height = [maxheight-8
delta2:delta2:maxheight-4delta2])
calyx_segment(height, delta2, buiten,0);
// mid lip curve
for (height = [maxheight-7
delta3:delta3:maxheight-4delta3])
calyx_segment(height, delta3, buiten,0);
// end lip curve
for (height = [maxheight-7
delta4:delta4:maxheight-2*delta4])
calyx_segment(height, delta4, buiten,0);
// final flare
for (height = [maxheight-delta4:delta4:maxheight-delta4])
calyx_segment(height, delta4, buiten,d_top_wall);
}

module calyx_segment(height, delta, buiten, top) {
percentage = height/maxheight;
percentage2 = (height+delta)/maxheight;
//
d_inside  = d_top_inside - pow((1-percentage),0.25)  * (d_top_inside -
d_btm_inside);
d_inside2 = d_top_inside - pow((1-percentage2),0.25) * (d_top_inside -
d_btm_inside);
rc        = atan(4maxheightpow((d_top_inside - d_btm_inside),-4) *
pow(d_top_inside - d_inside,3));
rc2      = atan(4maxheightpow((d_top_inside - d_btm_inside),-4) *
pow(d_top_inside-d_inside2,3));
//-------------------------------------------------------------
// determine wall thickness
// keep the outside straight until d_top_wall is reached
//------------------------------------------------------------
d_wall  = ((d_inside + d_top_wall) < (d_btm_inside+d_btm_wall) ?
(d_btm_inside+d_btm_wall - d_inside):
d_top_wall)/2;
d_wall2 = ((d_inside2 + d_top_wall) < (d_btm_inside+d_btm_wall) ?
(d_btm_inside+d_btm_wall - d_inside2):
d_top_wall)/2;

dx_raw = (d_inside2-d_inside)/2;
s_raw  = sqrt(dx_raw*dx_raw+delta*delta);
dx1    = d_wall * sin(rc);
dx2    = d_wall2 * sin(rc2);
dy1    = d_wall * cos(rc);
dy2    = d_wall2 * cos(rc2);
// echo("delta's", rc,rc2,dx1,dx2,dy1,dy2);
// echo("y x", d_inside, d_inside2, height, height+delta);
// echo("hoek", hoek, hoek2);
hoek = rotatie_top*percentage;
hoek2 = rotatie_top*percentage2;

if (buiten == true)  {                      
	cylinder_pie(hoek, hoek2, 
			-astraal*(1-cos(hoek*percentage))*mildfactor,
			-astraal*(1-cos(hoek2*percentage2))*mildfactor,
			height-dy1, height+delta-dy2, d_inside/2+dx1, d_inside2/2+dx2, top, 0);
} else  {
	cylinder_pie(hoek, hoek2, 
			-astraal*(1-cos(hoek*percentage))*mildfactor,
			-astraal*(1-cos(hoek2*percentage2))*mildfactor,
			height, height+delta, d_inside/2, d_inside2/2, top, 10);
}

}

module cylinder_pie(angle1, angle2, dx1,dx2,dy1,dy2,r1,r2,top,dr) {
// draw top and bottom cylinders
// rotate the cylinder
// hull the cylinders
// trick: draw an extra thick and large cylinder when
// the top is reached and
d=1;
//echo("top", top,dr);
hull()  {
translate([ 0,dx1,dy1])
rotate( angle1, ([1,0,0]))
translate([0,0,-d])
cylinder(d,r1, r1, center=false);
//
translate([ 0,dx2,dy2])
rotate( angle2, ([1,0,0]))
translate([0,0,d])
cylinder(d+top,r2, r2, center=false);
}
if (top > 0)  {
translate([ 0,dx2,dy2])
rotate( angle2, ([1,0,0]))
translate([0,0,d])
cylinder(d+top,r2+dr, r2+dr, center=false);
}
}

--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15083.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

OK problem appears to definately be caused by the way you're hulling. What's happening is the very small slices (0.01 or smaller) are creating artifacts. Ideally you should be able to use a value of 0.1 (say) for thickness and not see much visual difference. The trick to make this happen is to step through the loop in a different way. You want the parameterization to be by looping through i, i+1 and hulling between them. - where "i" creates each step in the curve. This way the hull() of "i+1" perfectly matches when it is "i" the next time through the loop. IMHO This means altering your entire procedure of calculating. You're using separate calcs for dx, dx2 (etc) pairs of all your variables. These do not always overlap - so you get cracks. Ideally re-parameterize so that each time through the loop the same value is calculated. Basically drop the second calc entirely and just make one. Increment your index to get each profile. So form of result could be something like this but does not have to be in list form. (I'm just trying to make code clear)... diameters = list_of_inner_diameters(); // a list generated somehow radii = list_of_radii(); // a list generated somehow - same length positions = list_of_translations(); // - same length angles = list_of_rotations(); // - same length for (i=[0:1:len(diameters)-1]) hull() { translate(positions[i]) rotate(angles[i]) cylinder(diameters[i], r=radii[i], center=false); // next step translate(positions[i+1]) rotate(angles[i+1]) cylinder(diameters[i+1], r=radii[i+1], center=false); } You can see what's wrong if you change the following to larger numbers like these - delta = 16; // in module calyx() - d=1; // in module cylinder_pie() // object: bass clarinet bell // version: 4 // design: J.G.Jonker // website: sax.jonker.co // date: 7-12-2015 $fn=14; maxheight = 160; // Height d_btm_inside = 25; // dia at base d_btm_wall = 10; // outer base dia (added to d_btm_inside) d_top_inside = 144; // dia of flare d_top_wall = 16; // notional thickness... rotatie_top = 65; // angle of flare mildfactor = 0.25; // Z-move at middle // --------------- astraal = maxheight/sin(rotatie_top); // rotate([180-rotatie_top,0,0]) difference() { // translate([0,0,-150]) calyx(buiten=true); translate([0,0,-150]) calyx(buiten=false); // // translate([0,0,-maxheight/2]) // cube(size=[20,60,maxheight*2], center=true); } module calyx(buiten) { delta = 16; delta2 = delta/2; delta3 = delta2/2; delta4 = delta3/2; // Main body of bell for (height = [0:delta:maxheight-4*delta]) calyx_segment(height, delta, buiten,0); // start lip curve for (height = [maxheight-8*delta2:delta2:maxheight-4*delta2]) calyx_segment(height, delta2, buiten,0); // mid lip curve for (height = [maxheight-7*delta3:delta3:maxheight-4*delta3]) calyx_segment(height, delta3, buiten,0); // end lip curve for (height = [maxheight-7*delta4:delta4:maxheight-2*delta4]) calyx_segment(height, delta4, buiten,0); // final flare for (height = [maxheight-delta4:delta4:maxheight-delta4]) calyx_segment(height, delta4, buiten,d_top_wall); } module calyx_segment(height, delta, buiten, top) { percentage = height/maxheight; percentage2 = (height+delta)/maxheight; // d_inside = d_top_inside - pow((1-percentage),0.25) * (d_top_inside - d_btm_inside); d_inside2 = d_top_inside - pow((1-percentage2),0.25) * (d_top_inside - d_btm_inside); rc = atan(4*maxheight*pow((d_top_inside - d_btm_inside),-4) * pow(d_top_inside - d_inside,3)); rc2 = atan(4*maxheight*pow((d_top_inside - d_btm_inside),-4) * pow(d_top_inside-d_inside2,3)); //------------------------------------------------------------- // determine wall thickness // keep the outside straight until d_top_wall is reached //------------------------------------------------------------ d_wall = ((d_inside + d_top_wall) < (d_btm_inside+d_btm_wall) ? (d_btm_inside+d_btm_wall - d_inside): d_top_wall)/2; d_wall2 = ((d_inside2 + d_top_wall) < (d_btm_inside+d_btm_wall) ? (d_btm_inside+d_btm_wall - d_inside2): d_top_wall)/2; dx_raw = (d_inside2-d_inside)/2; s_raw = sqrt(dx_raw*dx_raw+delta*delta); dx1 = d_wall * sin(rc); dx2 = d_wall2 * sin(rc2); dy1 = d_wall * cos(rc); dy2 = d_wall2 * cos(rc2); // echo("delta's", rc,rc2,dx1,dx2,dy1,dy2); // echo("y x", d_inside, d_inside2, height, height+delta); // echo("hoek", hoek, hoek2); hoek = rotatie_top*percentage; hoek2 = rotatie_top*percentage2; if (buiten == true) { cylinder_pie(hoek, hoek2, -astraal*(1-cos(hoek*percentage))*mildfactor, -astraal*(1-cos(hoek2*percentage2))*mildfactor, height-dy1, height+delta-dy2, d_inside/2+dx1, d_inside2/2+dx2, top, 0); } else { cylinder_pie(hoek, hoek2, -astraal*(1-cos(hoek*percentage))*mildfactor, -astraal*(1-cos(hoek2*percentage2))*mildfactor, height, height+delta, d_inside/2, d_inside2/2, top, 10); } } module cylinder_pie(angle1, angle2, dx1,dx2,dy1,dy2,r1,r2,top,dr) { // draw top and bottom cylinders // rotate the cylinder // hull the cylinders // trick: draw an extra thick and large cylinder when // the top is reached and d=1; //echo("top", top,dr); hull() { translate([ 0,dx1,dy1]) rotate( angle1, ([1,0,0])) translate([0,0,-d]) cylinder(d,r1, r1, center=false); // translate([ 0,dx2,dy2]) rotate( angle2, ([1,0,0])) translate([0,0,d]) cylinder(d+top,r2, r2, center=false); } if (top > 0) { translate([ 0,dx2,dy2]) rotate( angle2, ([1,0,0])) translate([0,0,d]) cylinder(d+top,r2+dr, r2+dr, center=false); } } -- View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15083.html Sent from the OpenSCAD mailing list archive at Nabble.com.
JJ
Johan Jonker
Thu, Dec 10, 2015 6:11 PM

great Neon22, many thanks!!!

I modified the code according to your suggestions. Only I could not find a
way to fill a list, but it could be all done by functions. The result was
the rendering went much faster. Maybe that is already a sign that there are
no very complex things anymore. F6 rendering

The code is now as follows:

// bass clarinet bell
// version 6
// J.G.Jonker
// date: 10-12-2015
$fn=80;
maxheight = 160;
d_btm_inside = 41;      // binnendiameter onderzjde
d_btm_wall =17.5;      // dubbele van wanddikte onderzijde
d_top_inside = 138;    // binnendiameter bovenzijde
d_top_wall = 4;        // dubbele van wanddikte bovenzijde
t_top = 60;
rotatie_top = 45;
mildfactor = 0.5;
h_tenon = 5;
//---------------
astraal = maxheight/sin(rotatie_top);

outside = true;
both    = false;
//---------------------------
// functions
function height(i) = imaxheight/100;
function d_inside(i) = d_top_inside
- pow((1-i/100),0.25)
(d_top_inside - d_btm_inside);
function rc(i) = atan(4maxheightpow((d_top_inside - d_btm_inside),-4)*
pow(d_top_inside - d_inside(i),3));
function d_wall(i) = (d_inside(i) + d_top_wall) < (d_btm_inside+d_btm_wall)
?
(d_btm_inside+d_btm_wall - d_inside(i))/2:
(d_top_wall)/2;
function dx(i) = d_wall(i)* sin(rc(i));
function dy(i) = d_wall(i) * cos(rc(i));
function rotation(i) = rotatie_top*i/100;
function shift(i) = height(i) < h_tenon? 0
:-((height(i)-h_tenon)/maxheight)10;
function cshift(i)  =
-astraal
(1-cos(rotation(i)*i/100))*mildfactor+shift(i);

delta = 4; //
delta2 = delta/2;
delta3 = delta2/2;
delta4 = delta3/2;
delta5 = delta4/2;
// Main body of bell
union()
{
calyx_segments(0, delta, 100 - 4delta);      // moet veelvoud van delta
zijn
calyx_segments(100-3
delta, delta2, 100-4delta2);
calyx_segments(100-3
delta2, delta3, 100-4delta3);
calyx_segments(100-3
delta3, delta4, 100-4delta4);
calyx_segments(100-3
delta4, delta5, 100-delta5);
// add the tenon to connect to the bow
if (outside==true)
{
translate([0,0,-5])
cylinder(5.1,(d_btm_inside +d_btm_wall/2)/2, (d_btm_inside
+d_btm_wall/2)/2);
}
else
{
translate([0,0,-10]) cylinder(11,d_btm_inside/2,
d_btm_inside/2);
}
}

module calyx_segments(i_start, delta,i_end)
{
echo(";;", i_start, delta, i_end);
if (outside == false)
{
for (i=[i_start:delta:i_end])
{
top_d = ((i+delta)==100)? 4:0;
echo("in i:",i, delta, i+delta, top_d);
hull()
{
translate([0,cshift(i),height(i)])
rotate(rotation(i), ([1,0,0]) )
cylinder(0.1, d_inside(i)/2,d_inside(i)/2, center=false);
// next step
translate([0,cshift(i+delta),height(i+delta)])
rotate(rotation(i+delta), ([1,0,0]) )
cylinder(0.1+top_d, d_inside(i+delta)/2,d_inside(i+delta)/2,
center=false);
}
}
}
else
{
for (i=[i_start:delta:i_end])
{
echo("out i:",i, delta, i+delta);
hull()
{
top_d = ((i+delta)==100)? 4:0;
echo("in i:",i, delta, i+delta, top_d);
translate([0,cshift(i),height(i)-dy(i)])
rotate(rotation(i), ([1,0,0]))
cylinder(0.1, d_inside(i)/2+d_wall(i),d_inside(i)/2+d_wall(i),
center=false);
// next step
translate([0,cshift(i+delta),height(i+delta)-dy(i+delta)])
rotate(rotation(i+delta), ([1,0,0]) )
cylinder(0.1+top_d,
d_inside(i+delta)/2+d_wall(i+delta),d_inside(i+delta)/2+d_wall(i+delta),
center=false);
}
}
}
}

--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15093.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

great Neon22, many thanks!!! I modified the code according to your suggestions. Only I could not find a way to fill a list, but it could be all done by functions. The result was the rendering went much faster. Maybe that is already a sign that there are no very complex things anymore. F6 rendering The code is now as follows: // bass clarinet bell // version 6 // J.G.Jonker // date: 10-12-2015 $fn=80; maxheight = 160; d_btm_inside = 41; // binnendiameter onderzjde d_btm_wall =17.5; // dubbele van wanddikte onderzijde d_top_inside = 138; // binnendiameter bovenzijde d_top_wall = 4; // dubbele van wanddikte bovenzijde t_top = 60; rotatie_top = 45; mildfactor = 0.5; h_tenon = 5; //--------------- astraal = maxheight/sin(rotatie_top); outside = true; both = false; //--------------------------- // functions function height(i) = i*maxheight/100; function d_inside(i) = d_top_inside - pow((1-i/100),0.25)* (d_top_inside - d_btm_inside); function rc(i) = atan(4*maxheight*pow((d_top_inside - d_btm_inside),-4)* pow(d_top_inside - d_inside(i),3)); function d_wall(i) = (d_inside(i) + d_top_wall) < (d_btm_inside+d_btm_wall) ? (d_btm_inside+d_btm_wall - d_inside(i))/2: (d_top_wall)/2; function dx(i) = d_wall(i)* sin(rc(i)); function dy(i) = d_wall(i) * cos(rc(i)); function rotation(i) = rotatie_top*i/100; function shift(i) = height(i) < h_tenon? 0 :-((height(i)-h_tenon)/maxheight)*10; function cshift(i) = -astraal*(1-cos(rotation(i)*i/100))*mildfactor+shift(i); delta = 4; // delta2 = delta/2; delta3 = delta2/2; delta4 = delta3/2; delta5 = delta4/2; // Main body of bell union() { calyx_segments(0, delta, 100 - 4*delta); // moet veelvoud van delta zijn calyx_segments(100-3*delta, delta2, 100-4*delta2); calyx_segments(100-3*delta2, delta3, 100-4*delta3); calyx_segments(100-3*delta3, delta4, 100-4*delta4); calyx_segments(100-3*delta4, delta5, 100-delta5); // add the tenon to connect to the bow if (outside==true) { translate([0,0,-5]) cylinder(5.1,(d_btm_inside +d_btm_wall/2)/2, (d_btm_inside +d_btm_wall/2)/2); } else { translate([0,0,-10]) cylinder(11,d_btm_inside/2, d_btm_inside/2); } } module calyx_segments(i_start, delta,i_end) { echo(";;", i_start, delta, i_end); if (outside == false) { for (i=[i_start:delta:i_end]) { top_d = ((i+delta)==100)? 4:0; echo("in i:",i, delta, i+delta, top_d); hull() { translate([0,cshift(i),height(i)]) rotate(rotation(i), ([1,0,0]) ) cylinder(0.1, d_inside(i)/2,d_inside(i)/2, center=false); // next step translate([0,cshift(i+delta),height(i+delta)]) rotate(rotation(i+delta), ([1,0,0]) ) cylinder(0.1+top_d, d_inside(i+delta)/2,d_inside(i+delta)/2, center=false); } } } else { for (i=[i_start:delta:i_end]) { echo("out i:",i, delta, i+delta); hull() { top_d = ((i+delta)==100)? 4:0; echo("in i:",i, delta, i+delta, top_d); translate([0,cshift(i),height(i)-dy(i)]) rotate(rotation(i), ([1,0,0])) cylinder(0.1, d_inside(i)/2+d_wall(i),d_inside(i)/2+d_wall(i), center=false); // next step translate([0,cshift(i+delta),height(i+delta)-dy(i+delta)]) rotate(rotation(i+delta), ([1,0,0]) ) cylinder(0.1+top_d, d_inside(i+delta)/2+d_wall(i+delta),d_inside(i+delta)/2+d_wall(i+delta), center=false); } } } } -- View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15093.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Thu, Dec 10, 2015 10:32 PM

Johan Jonker wrote

@neon,

That is interesting. What tool do you use to visualize that?

It looks like  Netfabb http://www.netfabb.com/downloadcenter.php?basic=1
to me.


Newly minted Admin - PM me if you need anything, or if I've done something stupid...

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.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15097.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Johan Jonker wrote > @neon, > > That is interesting. What tool do you use to visualize that? It looks like Netfabb <http://www.netfabb.com/downloadcenter.php?basic=1> to me. ----- Newly minted Admin - PM me if you need anything, or if I've done something stupid... 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. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15097.html Sent from the OpenSCAD mailing list archive at Nabble.com.
N
Neon22
Fri, Dec 11, 2015 12:27 AM

sorry - its the last version of Deep Exploration which got sold to SAP and
therefore is no longer available to mere mortals. I don't like to tell
people what it is because they just can't get it anymore :(
For polygonal 3D modelling I prefer wings3d as it produces watertight models
by default. Its internal structure is edge based and not face based like
most modellers.

--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15099.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

sorry - its the last version of Deep Exploration which got sold to SAP and therefore is no longer available to mere mortals. I don't like to tell people what it is because they just can't get it anymore :( For polygonal 3D modelling I prefer wings3d as it produces watertight models by default. Its internal structure is edge based and not face based like most modellers. -- View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15099.html Sent from the OpenSCAD mailing list archive at Nabble.com.