Hello there
I am still working on the design of 3D mouthpieces for sax and bass
clarinet.
The programme is improving, but I spend 80% of the time on F5 F6 issues.
I mean the issues that cause f5 to succeed and f6 to fail.
By the way: I generate all my objects inside one scad file (off almost 1000
lines) and no imports of stl are used.
The main route I follow to solve it is
Finding the error is not easy. These are the ways I tried:
Finding the cause is easy depending the length and structure of your
programme and the quality of your memory (mine is not very good) to remember
why you made it that way?
The first question is if there is another way to find errors?
--
View this message in context: http://forum.openscad.org/getting-craxy-from-f5-f6-issues-tp17323.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Seconc question:
An illustration of one of the problems I encounter.
This is my main programme:
/module mouthpiece ()
{
//translate([-5,0,z_window_round-2]) cube([100,100,0.1]);
difference()
{
union()
{
// generate the basic round shape of the outside
// including the flat table side
outside_base($fn); echo("Generated Outside");
}
// subtract all other parts
chamber($fn); echo("Generated Chamber");
//bore($fn); echo("Generated Bore");
//tip($fn); echo("Generated Tip");
//beak(3*$fn); echo("Generated Beak");
//roundwindow($fn); echo("Generated Roundwindow");
//serialnumber(17); echo("Generated Serial");
//type(Type); echo("Generated Type");
//logo($fn); echo("Generated Logo");
}
}/
I disabled a lot of objects now. The chamber gives problems.
When I increase $fn above 68 f6 does not work anymore.
When I generate chamber separately and check the stl of it with meshlab of
nettfab it is OK.
mouthpiece_v23part0.rar
http://forum.openscad.org/file/n17324/mouthpiece_v23part0.rar
The file of this part is enclosed.
So I do not know a way anymore to find the bug.
Who can help me?
--
View this message in context: http://forum.openscad.org/getting-craxy-from-f5-f6-issues-tp17323p17324.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
This is the outside mouthpiece_v23part1.rar
http://forum.openscad.org/file/n17325/mouthpiece_v23part1.rar
--
View this message in context: http://forum.openscad.org/getting-craxy-from-f5-f6-issues-tp17323p17325.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Looks like you do some nonlinear extrusion for the core shape - and thus it
smells like home-made meshing problems. If you are using my interpolation
scheme try to lower N or use a different extrusion trajectory to avoid self
intersection.
http://forum.openscad.org/file/n17326/mouthpiece.png
--
View this message in context: http://forum.openscad.org/getting-craxy-from-f5-f6-issues-tp17323p17326.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
On May 16, 2016, at 14:27 PM, Johan Jonker johangjonker@zonnet.nl wrote:
By the way: I generate all my objects inside one scad file (off almost 1000
lines) and no imports of stl are used.
The first question is if there is another way to find errors?
Since these are most likely bugs in OpenSCAD, it would be helpful to have access to the failing .scad files.
As usual, the smaller the files are, the easier it is for us to collect them, analyze them and add automated tests for them.
-Marius
Hello Parkinbot,
What do you mean with non lineair extrusion and how do you come to that
conclusion. I mean, what tool do you use to detect that.
This is a part of the code. I am afraid it's a little too complex.
module chamber(fn=80)
{
xbore = r_bore(z_bore_round);
z_rooftop = fz_rooftop();
x_rooftop = fx_rooftop(xbore);
//----------------------------------------------------------------------------------------
// prepare curved ramp
delta_z_ramp = z_window_round-z_ramp;
delta_x_ramp = 0.1+x_table(z_window_round)-r_bore(z_ramp);
radius_ramp = delta_z_ramp/sin(ramp_curve);
xref_ramp = r_bore(z_ramp) + radius_ramp;
x_factor = radius_ramp * (1-cos(ramp_curve))/delta_x_ramp;
x_bottom = [for (n = [0:1:i_ch_w_tip])
(n_to_z(n)<z_ramp)? r_bore(n_to_z(n)): // bottom of bore
top not rounded
// stepped ramp
(n_to_z(n)<z_window_round) && (stepped_ramp)?
ip2(n_to_z(n),z_ramp,z_window_round,r_bore(z_ramp),r_bore(z_ramp)+0.1):
(n_to_z(n)<z_window_round) && (lineair_ramp)?
ip2(n_to_z(n),z_ramp,z_window_round,r_bore(z_ramp),x_table(z_window_round))+0.1:
(n_to_z(n)<z_window_round) && (curved_ramp)?
r_bore(z_ramp) -
(r_bore(z_ramp)-(xref_ramp-radius_ramp*cos(asin((n_to_z(n)-z_ramp)/radius_ramp))))/x_factor:
// plus straal van de boring
0.1 + x_table(n_to_z(n)) ];
// + r_baffle - sqrt(pow(r_baffle,2)
-pow(w_window_tip/2,2)) ];
//-----------------------------------------------
z_bottom = [for (n = [0:1:i_ch_w_tip]) n_to_z(n)];
//------------------------------------------------ radius rooftop
r_rooftop = [for (n = [0:1:i_ch_w_tip])
(n_to_z(n)<=z_bore_round)? r_bore(n_to_z(n)):
// straal van de boring
(n_to_z(n)<z_window_round)? r_bore(z_bore_round):
1/ip2(n_to_z(n),z_window_round,zb,1/r_bore(z_bore_round),1/r_baffle)
];
// interpolatie van straal bring naar baffle
//------------------------------------------------ radius of the bottom
r_bottom = [for (n = [0:1:i_ch_w_tip])
(n_to_z(n)<=z_ramp)? r_bore(n_to_z(n)):
// straal van de boring
(n_to_z(n)<z_window_round)?
1/ip2(n_to_z(n),z_bore_round,z_window_round,
1/r_bore(z_bore_round),0.00001):
10000]; //
//------------------------------------------------ breedte van de top
van de kamer
w_rooftop = [for (n = [0:1:i_ch_w_tip])
(n_to_z(n)<=z_bore_round)? sqrt(2)*r_bore(n_to_z(n)):
// de 45 graden hoek van de
(n_to_z(n)<ze)? ((chamber_straight_into_bore==true)?
ip2(n_to_z(n),z_bore_round,ze, //
interpolatie
sqrt(2)*r_bore(z_bore_round),w_chamber_bore):
ip2(n_to_z(n),z_bore_round,ze, //
interpolatie
sqrt(2)*r_bore(z_bore_round),w_chamber_bore)):
(n_to_z(n)<z_window_round_tip)?
ip2(n_to_z(n),ze,z_window_round_tip,w_chamber_bore,w_window_tip):
(r_rail-DRail+(n_to_z(n)-z_window_round_tip))>r_rail? 0:
2r_railsin(acos((r_rail-DRail+(n_to_z(n)-z_window_round_tip))/r_rail))];
//----------------------------------------------- breedte van de bodem
van de kamer
echo(chamber_straight_into_bore=chamber_straight_into_bore);
w_bottom = [ for (n = [0:1:i_ch_w_tip])
// bore part "wortel2 * r_bore
(n_to_z(n)<=z_ramp)?
((chamber_straight_into_bore==true)?
w_window_barrel:
sqrt(2)*r_bore(n_to_z(n))):
// overgang tot onderzijde window:lineaire overgang naar
w_window_barrel
(n_to_z(n)<z_window_round)?
((chamber_straight_into_bore==true)?
w_window_barrel:
ip2(n_to_z(n),z_ramp,z_window_round,
sqrt(2)*r_bore(z_ramp),w_window_barrel)):
// tot aan de ronding van de tip: lineaire overgang naar
z_window_round_tip
(n_to_z(n)<z_window_round_tip)?
ip2(n_to_z(n),z_window_round,z_window_round_tip,
w_window_barrel,w_window_tip):
// boog met straal r_rail
(r_rail-DRail+(n_to_z(n)-z_window_round_tip))>r_rail? 0:
2r_railsin(acos((r_rail-DRail+(n_to_z(n)-z_window_round_tip))/r_rail))];
//----------------------------------------------- percentage van de
hoogte met een ronde kamerwand
curved_bottom = [ for (n = [0:1:i_ch_w_tip])
(n_to_z(n)<n_to_z(i_ch_w_bottom))? 1:0];
curved_side = [ for (n = [0:1:i_ch_w_tip])
((has_rounded_chamber)&&(n<i_ch_w_base))? 1:0]; // hulp variabele
die aangeeft of er een ronde kamer is
//----------------------------------------------- alfa van de side ten
bate van curved side
alfa_side = [ for (n = [0:1:i_ch_w_tip])
(n_to_z(n)<=z_ramp)? 90:
ip2(n_to_z(n),z_ramp,z_window_tip,90,10)];
// kamer zijde
chamberdata = gen_chamber(
x_rooftop,
z_rooftop,
r_rooftop,
w_rooftop,
x_bottom,
z_bottom,
r_bottom,
w_bottom,
curved_bottom,
curved_side,
alfa_side);
sweep(chamberdata);
zcircle = z_window_round;
rcircle = w_window_barrel/2;
}
function chamber_area(i,x_rooftop,
z_rooftop,
r_rooftop,
w_rooftop,
x_bottom,
z_bottom,
r_bottom,
w_bottom,
curved_bottom,
curved_side,
alfa_side) = (
let (w = (w_rooftop[i]+w_bottom[i])/2)
let (dx_rooftop = r_rooftop[i] - sqrt(pow(r_rooftop[i],2) - 0.25*
pow(w_rooftop[i],2)))
let (dx_bottom = (curved_bottom[i])? r_bottom[i]-
sqrt(pow(r_bottom[i],2) - 0.25* pow(w_bottom[i],2)):0)
let (h = abs((x_rooftop[i]+dx_rooftop) - (x_bottom[i]-dx_bottom)))
let (A_4 = hw)
let (alfa_rt = 2 asin(0.5* w_rooftop[i]/r_rooftop[i]))
let (A_curve_rt = 3.14pow(r_rooftop[i],2) * alfa_rt/360)
let (A_triangle_rt =
r_rooftop[i]cos(alfa_rt/2)r_rooftop[i]sin(alfa_rt/2))
let (A_rt = A_curve_rt-A_triangle_rt)
let (alfa_bt = 2 asin(0.5 w_bottom[i]/r_bottom[i]))
let (A_curve_bt = 3.14pow(r_bottom[i],2) * alfa_bt/360)
let (A_triangle_bt =
r_bottom[i]cos(alfa_bt/2)r_bottom[i]sin(alfa_bt/2))
let (A_bt = (curved_bottom[i])? A_curve_bt-A_triangle_bt:0)
let (l_side = sqrt(hh+pow((w_rooftop[i]/2 - w_bottom[i]/2),2)))
let (r_side = (l_side/2)/sin(alfa_side[i]/2))
let (A_curve_sd = 3.14pow(r_side,2) * alfa_side[i]/360)
let (A_triangle_sd =
r_sidecos(alfa_side[i]/2)r_sidesin(alfa_side[i]/2))
let (A_side = (curved_side[i])? A_curve_sd-A_triangle_sd:0)
A_4+A_rt+A_bt+2A_side);
m
--
View this message in context: http://forum.openscad.org/getting-craxy-from-f5-f6-issues-tp17323p17328.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
You are right. This is how the corners look enlarged in nett_fab.
But the problem is how to detect that without your kind help ;-).
http://forum.openscad.org/file/n17329/Naamloos2.jpg
--
View this message in context: http://forum.openscad.org/getting-craxy-from-f5-f6-issues-tp17323p17329.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
@parkinbot.
Can you explain a little more about the causes you suspect, or give some
references?
Maybe unknowingly I violate some design rules.
By the way what do you mean with self intersection?
--
View this message in context: http://forum.openscad.org/getting-craxy-from-f5-f6-issues-tp17323p17330.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
How did I suspect?
F5 is done in GPU, F6 uses CGAL. F6 typically fails if some self
intersection (SI) occurs or mesh problems are detected. F5 is more tolerant
with both.
Also I know that the scheme I've coded works as long self intersection (SI)
is avoided. So:
your shape generator function must create simple polygons for any
parametrisation used during the sweep. Indeed, if you use my sweep() instead
of skin()) it has to be quasi-symmetric like an airfoil because I used a
lazy triangulation scheme - another caveat and say, another 'bug' I'll have
to address one day.
the trajectory used must avoid SI during extrusion. This needs some more
explanation. Let's define a trajectory as the polygon along which the origin
[0,0] will 'move' during a sweep. Then you can find many different (indeed
in theory: infinitely many) trajectories for extruding the 'same' shape.
Some of them might lead to self intersection, others not. Trajectories are
only granted to be non-SI when they are linear. With non-linear ones you
better take very good care, what you are doing.
So, what is the trick? Imagine you want to sweep a ring. Usually you would
tend to sweep along the skeleton line which is the circle with radius
(R+r)/2. But that is not wise for narrow curvatures because it favors SI for
small (!) N. If you use the small radius as trajectory and sweep along the
inner circle no SI can happen.
If SI during a sweep is unavoidable at some point, you can always use
piecewise sweeps and a union(). Your shape looks like you're doing this
already.
BTW. Meanwhile I'm stumbling more and more over people in Thingiverse who
publish fancy things having copied large parts of my library code into their
own code without giving reference or attribution. Some projects even look
like they have a commercial dimension. So, please let me remind you, that I
am publishing my libraries for non-commercial use only. Other purpose has to
be licensed.
Rudolf
--
View this message in context: http://forum.openscad.org/getting-craxy-from-f5-f6-issues-tp17323p17331.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Hello Parkinbot,
I will try to describe what I understand.
Self intersection is that the situation that the cross section of an object
is not s simple polygon like a circle but one like an 8 wich has an
intersection? So can that be caused when my object has a very sharp tip that
does not end in one point but has some kind of overshoot?
The objects I make have a shape like this:
http://forum.openscad.org/file/n17334/shape1.jpg .
They are symmetric in one of the horizontal directions. Is that good enough
for the sweep function?
I suppose the trajectory of the extrusion is line through the centers of the
sweeped polygons. I my case this is the z-axis. So there is no risk for SI?
And is this (left is OK, right is wrong) what you mean with the ring
example:
http://forum.openscad.org/file/n17334/shape2.png
Another thing is that I like to sweep from a pylogon with 16 points to 14 to
12 etc.
I suppose that is not possible so what I do is increase the number of
coinciding points from 0 to 2 4 etc.
Is that the right way?
Is there a tool that can detect problematic SI?
I can understand that you like to be referred or whatever. I will try to
respect that. I do not intend to go commercial with the mouthpieces, but
you'll never know. Do you have any idea how you want to be referred. Of
course tha same applies with the development team of Openscad of course.
--
View this message in context: http://forum.openscad.org/getting-craxy-from-f5-f6-issues-tp17323p17334.html
Sent from the OpenSCAD mailing list archive at Nabble.com.