I am not convinced that you are using the right approach. Using hull() for
nonlinear stuff like this will not make you happy.
Tried to model it using my sweep() function, just for fun, and without
having a closer look at your data.
The code renders very fast - also in CGAL. Seems like this a good show case
for my nSpline() function, which I still haven't published. It interpolates
the coordinates, the radius and the angle.
Instead of using nSpline() you can compose the data yourself, using your
functions.
// not yet published
use
<splines.scad>
// http://www.thingiverse.com/thing:900137
use
<Naca_sweep.scad>
A = [//x, y,z, r, angle // data outer skin
[0, 0,0, 20, 0],
[20, 0,200, 40, -10],
[60, 0,300, 70, -60],
[68, 0,310, 100, -62],
[68+1,0,310+.6, 100, -62],
];
d = 1; // thickness
A1 = [ // data inner skin
[-0.001,0,-0.001, 20-d, 0],
[20, 0,200, 40-d, -10],
[60, 0,300, 70-d, -60],
[68, 0,310, 100-d, -62],
[68+1.1,0,310+.7, 100-d, -62],
];
B = nSpline(A,100); // outer skin
B1 = nSpline(A1,100); // inner skin
C = gen_dat(B, 100); // generate data
C1 = gen_dat(B1, 100); // generate data
difference()
{
sweep(C);
sweep(C1);
}
function circle_(r, N) = [
for(i=[0:N-1]) let(w = i360/N)
[rsin(w), r*cos(w)]];
function gen_dat(S, N) =
[ for (i=[0:len(S)-1])
let(dat = Ry_(S[i][4], vec3D(circle_(S[i][3], N))))
T_(S[i][0], S[i][1], S[i][2], dat)];
--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15100.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
@Johan list comprehensions are what you're looking for.
Special section on cheatsheet - http://www.openscad.org/cheatsheet/ look at
"Generate"
more info here: https://github.com/openscad/list-comprehension-demos
For rotation you could do something like this:
function calc_rotation(from, step, to) = [ for (i = [from : step : to])
rotatie_topi/100 ];
delta=4;
echo(calc_rotation(0, delta, 100 - 4delta));
giving:
ECHO: [0, 1.8, 3.6, 5.4, 7.2, 9, 10.8, 12.6, 14.4, 16.2, 18, 19.8, 21.6,
23.4, 25.2, 27, 28.8, 30.6, 32.4, 34.2, 36, 37.8]
--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15103.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
This looks good.
I hope they start printing now, but because I plan some other non lineaur
stuff like mouthpieces I will try to find out how I get your functions doing
my object. I will let you now.
But maybe good to understand.
What you do is define some points and rotation of one side of the object in
A.
Then you calculate a spline. Do I understand that a spline is an
interpolation curve between the points in A. Is B then only an interpolated
line? And does 100 mean the number of point you generate?
Then you generate data. Does this make all the points of the object?
Then you do a sweep. Does this fill the area between the points?
--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15122.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Probably on a totally different tangent, why do you want to model the
horn/bell of a Bass Clarinet??
I am interested in music and play in a community orchestra. The Bass
Clarinetist has probably THE most expensive instrument and it a really
interesting instrument so for all the "non SCAD" reasons I am interested
in your aims. Could you elaborate please (in a quick way that does not
clog up this discussion) what the project is about, or is it just a
theoretical investigation???
Cheers, Rob
On 09/12/15 08:54, Johan Jonker wrote:
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.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
--
Rob Ward
Lake Tyers Beach, 3909
Lake Tyers Beach Website http://www.laketyersbeach.net.au
XP to XUbuntu - The journey, join me!
http://www.laketyersbeach.net.au/XP2XU.html
Hello Rob,
I am repairing saxophone for a few years now and was interested in repairing
bass clarinets too because I started to play the instrument a year ago. I
practice repairing by buying cheap instruments and fix them and then sell
them. I bought a bass clarinet without a bell and neck a mounth ago. Because
it was a plastic bass clarinet I thought that it would interesting to print
the quite expensive bell and see what the results would be. When I tried to
make the first designs I was infected by the 3D virus. I don't know how to
cure from that ;-).
I have a lot of other things in mind: a bass clarinet extension from low Eb
to low C for instance.
regards,
Johan
--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15126.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
We may need to start a new thread Johan, but that is very interesting to
me. The technicalities of rendering an instrument that has been worked
out by people with exquisite musical sensory faculties eg Stradivarius,
just to quote one very famous one, is very intriguing. It is also
tantalising to think, if the experts of old could be paralleled by
modern technology, and especially the recent trigonometric precision of
the combination of a software package like 'openSCAD' and a 3-D printer,
whether anything can be improved, or maybe just happy to be replicated?
My fascination with the shapes of instruments and a fairly primitive
knowledge of trigonometry and other functions etc makes me wonder what
is possible?
OpenSCAD may have to start a 'counseling' thread for people trying to
not think of their daily lives being consumed by the thought "now, if
only I could print.....".
Returning to your challenge. Changing the tuning would be awesome, and
a huge challenge (mainly for the challenges mentioned above). To alter
the bell and still rely on the established keying structure of the rest
of the instrument, ie not have to rebuild the whole thing, would be very
difficult would it not???
<jest> Maybe one day in openSCAD one could produce the Stradivarius.stl
and make one! </jest>
Cheers Rob
On 12/12/15 23:07, Johan Jonker wrote:
Hello Rob,
I am repairing saxophone for a few years now and was interested in repairing
bass clarinets too because I started to play the instrument a year ago. I
practice repairing by buying cheap instruments and fix them and then sell
them. I bought a bass clarinet without a bell and neck a mounth ago. Because
it was a plastic bass clarinet I thought that it would interesting to print
the quite expensive bell and see what the results would be. When I tried to
make the first designs I was infected by the 3D virus. I don't know how to
cure from that ;-).
I have a lot of other things in mind: a bass clarinet extension from low Eb
to low C for instance.
regards,
Johan
--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15126.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
--
Rob Ward
Lake Tyers Beach, 3909
Lake Tyers Beach Website http://www.laketyersbeach.net.au
XP to XUbuntu - The journey, join me!
http://www.laketyersbeach.net.au/XP2XU.html
Yes, yes and yes. You got it!
what sweep() does is meshing a N-series of (non-self-intersecting)
M-polygons moved along a trajectory into a polyhedron - just like
linear_extrude(). Leaving linear_extrude() behind you gain a lot of freedom,
while taking full responsibility in avoiding self-intersection.
You can compose your own trajectory using affine operations (scale,
rotation and translation) and apply it to any series of M-polygons (a series
of circle shapes with growing radii in your case). Usually you chose a chord
line (e.g. the path the mass point would follow in 3D space) as basic
trajectory and then apply your operations (in any order) to the polygons.
Also the function that generates your slices may have parameters (e.g.
your radius) – more generally think of a windmill blade being composed from
a series of airfoil data each being described with 5 or more parameters, and
translated and rotated in space.
As all this needs a lot data to be carefully arranged. To do this in an
"organic" way I use a trick. Interpolation with nSpline(). It works
multidimensional (P) and interpolates a given LxP-polygon (L point sets of
dimension P) into a more or less "equally" spaced KxP-polygon. In effect it
transforms a LxP into a KxP Matrix by filling in the missing rows in
between. So, each P-vector comprises your translation, rotation, scale
parameters (the so called finite operation space, which may be restricted to
a subspace like a 3D-translation followed by a 1D-rotation in your case)
plus any parameters (e.g. your radius) you need to generate the M-polygon
for a single slice.
For your application case, I would say, interpolation is the royal road. You
measure the thing at some characteristic positions and with only a few
points you'll get a perfecty organic looking hull.
Of course one would be better off using “known” functions to generate the
rows in a more precise descriptive way, but finding these functions can be
quite tedious, depending on the problem and the dimensionality. The more
"organic" freedom you want, the more dimensions you get, the harder your
work.
nSpline() is based on the natural cubic spline and not always the best
approach. There are many other interpolation schemes known, like other
spline types and/or with different order, Beziérs and so on. This is a large
field in Mathematics.
Here's another example showing the support points as spheres in red and the
inserted points in yellow:
http://forum.openscad.org/file/n15129/showcase2.png
Please let me know, whether the sound resulting from your printed instrument
part is acceptable. The application field is enormous! I'll publish
nSpline() as soon as I have fully tested it and implemented some convincing
show cases. I'd send you a "beta" via PM, if you wanna play with it.
Johan Jonker wrote
This looks good.
I hope they start printing now, but because I plan some other non lineaur
stuff like mouthpieces I will try to find out how I get your functions
doing my object. I will let you now.
But maybe good to understand.
What you do is define some points and rotation of one side of the object
in A.
Then you calculate a spline. Do I understand that a spline is an
interpolation curve between the points in A. Is B then only an
interpolated line? And does 100 mean the number of point you generate?
Then you generate data. Does this make all the points of the object?
Then you do a sweep. Does this fill the area between the points?
--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15129.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Hi all,
I haven’t had the time to digest the last long email threads, but in this particular case, has anyone looked at the skin() function in list-comprehension-demos?
https://github.com/openscad/list-comprehension-demos#extrusionscad
..it could be easier to use than doing a sweep.
-Marius
Things like skin.scad look really interesting but I can't figure out how they
are supposed to be used, by just looking at the code. (e.g. augment_profile
augments the profile with Steiner points. but what...?)
Is it possible to make some samples files which exercise all the aspects of
each of these files in the list_comprehensions folder ?
--
View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15132.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
On 12/13/2015 07:19 AM, Neon22 wrote:
Is it possible to make some samples files which exercise all the aspects of
each of these files in the list_comprehensions folder ?
Some examples are a bit hidden in:
https://github.com/openscad/list-comprehension-demos/blob/master/extrusion.scad
ciao,
Torsten.