Rendering fails (difference between F5 and F6)

classic Classic list List threaded Threaded
47 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

Neon22
@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_top*i/100 ];
delta=4;
echo(calc_rotation(0, delta, 100 - 4*delta));

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]
Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

Johan Jonker
In reply to this post by Parkinbot
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?
Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

RobWLakes
In reply to this post by Johan Jonker
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
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Rob W
Lake Tyers Beach,
Victoria, Australia
Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

Johan Jonker
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
Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

RobWLakes
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
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Rob W
Lake Tyers Beach,
Victoria, Australia
Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

Parkinbot
In reply to this post by Johan Jonker
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.

1. 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.

2. 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:

 

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?
Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

kintel
Administrator
In reply to this post by Johan Jonker
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


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

Neon22
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 ?
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

tp3
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.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

Parkinbot
In reply to this post by kintel
 
kintel wrote
..it could be easier to use than doing a sweep.
This heavily depends on what kind of sweep() or skin() you use. Don't know whether you have looked at the code?
I am using an own version from NacaSweep.scad described here, which is much more basic than the "official" one you might know, as it knits just a matrix (a vector of vectors describing a series of non-intersecting polygons already placed in 3D space) into a polyhedron.
Before I decided to implement this version, I tried out the "official" one and found it too complicated and restricted for my purposes - beside the lack of documentation also in code.

Rudolf

Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

kintel
Administrator
> On Dec 13, 2015, at 08:18 AM, Parkinbot <[hidden email]> wrote:

> Before I decided to implement this version, I tried out the "official" one
> and found it too complicated and restricted for my purposes - beside the
> lack of documentation also in code.
>
Nice - I’ll try to have a look.
The purpose of the “official” sweep and skin is to explore the functionality and interface of such functions, in order to make better decision when eventually creating built-in and long-term supported implementations of it.

If you could provide some insights into what you need, what was missing in the original implementation etc., that would be very helpful.

 -Marius


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

Parkinbot
kintel wrote
If you could provide some insights into what you need, what was missing in the original implementation etc., that would be very helpful.
I never played around with skin(). But as far as I remember, I didn't like the interface of sweep(), as its prototyp was too restricting. I'm talking about this one

module sweep(shape, path_transforms, closed=false)
1. It doesn't allow for a parametrization of *shape*,
2. It restricts *path-transforms* to finite operations
3. I'm not a friend of multmatrix and representations of similar complexity

So I decided to reimplement it, just demanding a regular matrix - which represents a series of polygons in 3D-space as already mentioned. This series may be freely composed: using any kind of transformations, finite and non-linear in any order, interpolation schemes (e.g. nSpline()) and unlimitedly parametrized shapes (e.g. airfoils with non-linear transitions along the path).
See my example of a loop propeller (also just a fast scetch for this post), using a 7D interpolation. I guess you can read my shortcuts: R, Rx, Tx and so on operate over objects, Rx_ Tz_ and so operate over vectors (shapes)



and without interpolation
C = gen_dat(A, 100);   // generate data
you'll still get this




Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

kintel
Administrator
On Dec 13, 2015, at 15:34 PM, Parkinbot <[hidden email]> wrote:

> So I decided to reimplement it, just demanding a regular matrix - which
> represents a series of polygons in 3D-space as already mentioned.

This sounds exactly like skin(), as used here:
https://github.com/openscad/list-comprehension-demos#forma-candle-holderscad

Does that differ in any way, if so, what are you missing from skin()?
(I didn’t have the chance to read your code yet)

 -Marius


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

jpmendes
In reply to this post by Johan Jonker
Hi

Maybe you are interested in this:

https://www.youtube.com/watch?v=MWa8sEgpOrM
Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

Parkinbot
In reply to this post by kintel
kintel wrote
Does that differ in any way, if so, what are you missing from skin()?
(I didn’t have the chance to read your code yet)
Meanwhile I had a look at your skin() example. You are right, obviously skin() and my sweep() are at least syntactically interchangeable and give the same results on my examples - however the implementations differ a lot. Is/was it part of any libary? Anyway, in environments without debugging facilities I always prefer to use my own code :-)

@jpmendes
Hey, this film shows only E-guitars. No 3D-acoustics involved :-(



Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

RobWLakes
In reply to this post by jpmendes
Thanks jpmendes, most impressive demonstration.
While I can see a lot of debate goes into refining the power of the
openSCAD programming language and how it is rendered, I am also
privileged to observe the evolution of extremely powerful design tools
that smart people will apply to solve many problems.  Creating a really
good musical instrument in conventional materials is very hard, and not
to be dismissed lightly, but, when design software, for example
openSCAD, and material improvements are accumulated over time, then the
gap will be gradually closed.  I hope the conventional instruments
continue to be made, but I think the understanding of how what makes a
good instrument 'good' will be understood so much better when 3-D
productions tools allow experimentation inside well defined parameters
to be made reliably.
The idea of creating the "formula" for a bell horn of a bass clarinet is
a step in that direction.
I am sure if there was time, the "back-end" stories to most of the
openSCAD forum discussions, would be equally inspiring.
Cheers, Rob

On 15/12/15 06:54, jpmendes wrote:

> Hi
>
> Maybe you are interested in this:
>
> https://www.youtube.com/watch?v=MWa8sEgpOrM
>
>
>
> --
> View this message in context: http://forum.openscad.org/Rendering-fails-difference-between-F5-and-F6-tp15041p15164.html
> Sent from the OpenSCAD mailing list archive at Nabble.com.
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Rob W
Lake Tyers Beach,
Victoria, Australia
Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

Neon22
@jpmendes
Thingiverse user mechadense has done some great work on horns.
http://www.thingiverse.com/thing:218241
Just needs a bit mor ework to finish it up for general OpenSCAD use... (hint :))
Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

kintel
Administrator
In reply to this post by Parkinbot
> On Dec 14, 2015, at 15:53 PM, Parkinbot <[hidden email]> wrote:
>
> Meanwhile I had a look at your skin() example. […]
> Is/was it part of any libary?

It’s part of the exploration of new functionality. I’m interested in whether this is a good function to offer, what sort of added/changed features are needed and interface ideas.

 -Marius


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

Parkinbot
kintel wrote
.... I’m interested in whether this is a good function to offer,
I guess you know that my answer will be yes. Connected with an interpolation scheme it is really powerful.

kintel wrote
what sort of added/changed features are needed and interface ideas.
I just had a look, how skin() behaves when it has to connect polygons with different number of points (mine doesn't do that at all for a good reason). The result is somehow unexpected.

use <scad-utils/transformations.scad>
use <scad-utils/lists.scad>
use <scad-utils/shapes.scad>
use <skin.scad>

r=50;
height=140;
layers = 2;
  skin([for (i=[0:layers-1])
        transform(translation([0,0,i*height/layers]) * rotation([0,0,-0*i]), circle($fn=6+2*i,r=r))]);


Why would one split the lines of a polygon? Is this semantics a hack? I'd expect unpaired triangles as natural semantics. And I would also expect the result to be convex (at least in this case).

And an immediate feature request would be: adding furcations like a bifurcation and an inverse (anastomosis) to it.
a bifurcation matrix would be
[... [...], [...], [[...], [...]], ...]

and the inverse:
[... [[...], [...]], [...], [...], ... ]

It is easy to calculate furcations, but hard to connect them in a proper way using OpenSCAD language means.

- Rudolf -
Reply | Threaded
Open this post in threaded view
|

Re: Rendering fails (difference between F5 and F6)

kintel
Administrator
> On Dec 14, 2015, at 20:44 PM, Parkinbot <[hidden email]> wrote:
>
> I just had a look, how skin() behaves when it has to connect polygons with
> different number of points (mine doesn't do that at all for a good reason).
> The result is somehow unexpected.
>
Yes, the Steiner point insertion is a bit automagic. Not sure I would call it unexpected though - the screenshot you posted is dominated by effects of polygon tessellation. Since we cannot represent non-planar polygons like that, we have to make a tessellation discussion. The actual Steiner point insertion kind of makes sense. Ideas are welcome.

> And an immediate feature request would be: adding furcations like a
> bifurcation and an inverse (anastomosis) to it.

That would be cool - perhaps something to leave for the future.
As always, if we can prototype partial functionality in user-space, that would help understand it.
If there are missing features in the OpenSCAD language which makes this hard, we could address that in a separate project.

 -Marius


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
123