discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Rendering fails (difference between F5 and F6)

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.