First contact with the OpenSCAD community

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

First contact with the OpenSCAD community

Lou_Papet
Hi All,

Being a brand new subscriber to the OpenSCAD forum, I come with this message to present myself and also to test thee access since the procedure is very different from other sites.

I wrote two small applications to evaluate the product. It was revealed to me by FreeCAD which has a workshop bearing its name.

1°) -  the epicyclic train :
After the theorical study under FreeCAD with animation, a small crank's machine was produced in 3D printing. The illustration below details all its components.

eclate.png

This marvelous gear is very old since James Watt used it in the 1780s. For me it has always been the ideal gear that can replace at good profit gearboxes and clutches in cars.
2°) -  the model of the motor-glider Fournier RF4 D :
This single engine, single seat airplane was my favorite aircraft on which I flown the grea tmajority of my flying hours in paralel with gliding. So I simply tried to make the model in order to 3D print it when the time will come.

F-BORA.png
This project interested me because it required the development of profiles for which I favored the Bézier curves not foreseen by OpenSCAD, treatment that I had difficulties to find on the forum.
Due to the somewhat limited language of OpenSCAD, I didn't want to process Bézier surfaces. I made a simplified approach to generating volumes with the tools of the software.

These two applications were not very difficult in programming writing. They were rather difficult in terms of entering digital data. Indeed, I am desperately to search for a graphic editor of technical drawings other than the clones of AutoCAD having the great default of not being intuitive. Interrupted use during several weeks leads to relearning the software. It's a great pity that my old "microCADAM" program, that I had for over twenty years when I retired, is obsolete even with the help of the virtualization application "Oracle VM VirtualBox".

Maybe someone knows of a other type of technical drawing graphic editor ?... Thank you in advance.

Best Regards
Lou Papet

--
"Pourquoi faire simple quand on peut faire encore plus simple..."
"Le plus simple est de ne pas faire.....seulement si c'est possible !..."

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
"Pourquoi faire simple quand on peut faire encore plus simple !..."
"Why keep it simple when you can make it even simpler ! ..."
"Le plus simple est de ne pas faire.....seulement si c'est possible !..."
"The easiest way is not to do ..... only if it is possible ! ..."
Reply | Threaded
Open this post in threaded view
|

Re: First contact with the OpenSCAD community

MichaelAtOz
Administrator
Thank you Lou,

That is very impressive.

For others, note that there was a registration issue that lead to the
repeated post.
But that is now cleared up.



-----
OpenSCAD Admin - email* me if you need anything,  or if I've done something stupid...

* on the Forum, click on my MichaelAtOz label, there is a link to email me.

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.

--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me.

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

Re: First contact with the OpenSCAD community

Gadgetman!
In reply to this post by Lou_Papet
Great test!

Yes, adding data can be a bit of a pain in OpenSCAD. 
but the way I see it is that that means we haven't really studied the subject we're modelling. 

The Eiffel tower isn't symmetrical just because that looks better, but also because they only had to draw a portion of it, then mirror it about. 

Nice website. Just wish I could understand it. 
(I'm not going to debase it by using Google Translate)
I drive the modern day equivalent of the 2CV myself(first gen Berlingo. Yes, with the large 'ragtop')
But I fear I have bad news for you.
There's only ONE Renault ever worth owning or driving, and that's the FT. 
It's like it was designed for the Paris traffic... 

;-)
Trygve
In snowed down Norway!

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

Re: First contact with the OpenSCAD community

Ronaldo
In reply to this post by Lou_Papet
Jean-Pierre,

Nice work!

I have not had a recent experience with any drawing graphic editor so I can't help you with that. But certainly you will find suggestions on that from the forum people.

I have just scratched your airplane code. And I have a few comments about the evaluation conclusions about OpenSCAD in your referred site. As I barely read french, I based my comments on a Google translation of them to english.

First of all, hull() is not a linear interpolation of two shapes. It is the minimal convex shape that includes all the shapes. The technical name of that operation is convex hull. That means that hull() is unable to produce holed shapes because its result is always convex. There is no primitive operation in OpenSCAD that provides a linear interpolation of two shapes. 

Second, functions may be much more complex than a simple algebraic expression as you suggest. Thanks to list comprehension and conditional expressions, you can code iterations, recursions, tests and pre-calculations inside a function. Here is a simple example that uses your formule_Bezier() function:

// evaluates the points in a Bezier curve for a given list of parameter values.
// if t is a list of numbers returns a list of points
// if t is a number returns a point
// ctl_pts should be a path, that is a list of pts with the same dimension
function Bezier_curve_sample(ctl_pts, t) =
    is_num(t)
    ? formule_Bezier(t, ctl_pts)
    : [for(ti=t)  formule_Bezier (ti, ctl_pts)] ;

To get a display of the curve we may use a module similar to your Bezier() module:

// draws a polygonal through pts
module line(pts,width) {
    for(i=[0:len(pts)-2])
      hull() {
        translate(pts[i])   sphere(width);
        translate(pts[i+1]) sphere(width);
      }
}

// 2D curve example
pts = [ [0,0], [10,5], [20,-2], 30,20]];
curve = Bezier_curve_sample(pts, [for(i=[0:20]) i/20]);
polygon( curve );
color("red") line( curve, .3);
echo( curve = curve );

Note that above I don't call formule_Bezier() at each individual coordinate as you do because OpenSCAD is not a typed language and the expression inside is valid for both numerical control values and vector control points. It is valid even for matricial control points, that is lists of vector control points and suitable to sample Bezier Patches!

Finally, you mention the miss of a C-like break in OpenSCAD language. There are many ways to deal with the need of premature interruptions in a sequence of computations in OpenSCAD. Breaks are unavoidable in recursion, an invaluable language tool. Here is an example:

// computes the list of Fibonacci numbers up to a limiting value greater than 0
function Fibonacci(limit, _result) =
    is_undef(_result) 
    ? Fibonacci(limit,[0,1])
    : let( n = len(_result) )
       _result[n-1]+_result[n-2] > limit 
       ? _result
       : Fibonacci(limit, concat(_result, _result[n-1]+_result[n-2] ) );

Besides recursion, you have C-like for as a tool that can interrupt iterations. A break() clause is not the only way to interrupt iterations.

Jean-Pierre Rousset <[hidden email]> wrote:
2°) -  the model of the motor-glider Fournier RF4 D :
This single engine, single seat airplane was my favorite aircraft on which I flown the grea tmajority of my flying hours in paralel with gliding. So I simply tried to make the model in order to 3D print it when the time will come.

F-BORA.png
This project interested me because it required the development of profiles for which I favored the Bézier curves not foreseen by OpenSCAD, treatment that I had difficulties to find on the forum.
Due to the somewhat limited language of OpenSCAD, I didn't want to process Bézier surfaces. I made a simplified approach to generating volumes with the tools of the software.


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

Re: First contact with the OpenSCAD community

Lou_Papet
In reply to this post by Gadgetman!
Very happy to know that you were interested. Thank you.

Data entry was a bit tedious for modeling half of the plane since it is symmetrical. But, for the interpolation squares to be the least visible possible, it was necessary to enter the ribs and especially the frames for the fuselage.
 How to do it the easiest ?... I don't have a "CATIA" type software to generate mathematically perfect shapes.
Personally, I do not master the spoken English language, I understand it by reading, and I do not hesitate to use "Google Translate" which I sometimes correct otherwise I would do nothing. It is not a dishonor to ignore a language ! ...

Regarding the Renault FT tank, you are right ! ..

Today's manufacturers are especially interested in this kind of vehicle, SUVs, "ox cart" in French "char à bœufs" that I find very ugly and very old-fashioned, invented before the war ! ...
For everyone to his own tastes ! ...
There are too many unnecessary things in a car, which is why I prefer real old vehicles without digital. They have a soul that I can't find now.

Greetings,
under a beautiful sun of Cannes / Nice

Le jeu. 28 janv. 2021 à 15:11, <[hidden email]> a écrit :
Great test!

Yes, adding data can be a bit of a pain in OpenSCAD. 
but the way I see it is that that means we haven't really studied the subject we're modelling. 

The Eiffel tower isn't symmetrical just because that looks better, but also because they only had to draw a portion of it, then mirror it about. 

Nice website. Just wish I could understand it. 
(I'm not going to debase it by using Google Translate)
I drive the modern day equivalent of the 2CV myself(first gen Berlingo. Yes, with the large 'ragtop')
But I fear I have bad news for you.
There's only ONE Renault ever worth owning or driving, and that's the FT. 
It's like it was designed for the Paris traffic... 

;-)
Trygve
In snowed down Norway!
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


--
"Pourquoi faire simple quand on peut faire encore plus simple..."
"Le plus simple est de ne pas faire.....seulement si c'est possible !..."

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
"Pourquoi faire simple quand on peut faire encore plus simple !..."
"Why keep it simple when you can make it even simpler ! ..."
"Le plus simple est de ne pas faire.....seulement si c'est possible !..."
"The easiest way is not to do ..... only if it is possible ! ..."
Reply | Threaded
Open this post in threaded view
|

Re: First contact with the OpenSCAD community

JordanBrown
On 1/28/2021 9:43 AM, Jean-Pierre Rousset wrote:
 How to do it the easiest ?... I don't have a "CATIA" type software to generate mathematically perfect shapes.

You do have OpenSCAD to generate mathematically perfect shapes.  You have to supply your own math, or there are libraries available, but one of the huge advantages of OpenSCAD is that if you can describe the shape using math, you can model it.



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

Re: First contact with the OpenSCAD community

tsingi
In reply to this post by Lou_Papet
There are too many unnecessary things in a car, which is why I prefer real old vehicles without digital. They have a soul that I can't find now.

This is true for motorcycles as well.  I have a newer (2015) BMW F800GS that didn't run right for 5 years because of a sensor glitch in the electronic ignition intake manifold that has another name.
While that was in the shop for a year I bought a 1988 'Bumblebee' R100GS.  Technically it's an inferior bike so why do I love it more?
I can fix it, that's why.  And it has soul.


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

Re: First contact with the OpenSCAD community

OpenSCAD mailing list-2
In reply to this post by Lou_Papet
Jean-Pierre Rousset <[hidden email]>

>I am desperately to search for a graphic editor of technical drawings other than the clones of AutoCAD having the great default of not being intuitive

Bézier curve / vector drawing program might work well.

Inkscape is the free/opensource option (if you're on Mac OS X/Linux you could try Cenon), or for ChromeOS GraviT.

An affordable commercial option is Serif's Affinity Designer available for Mac OS X and Windows.

A programmatic option is METAPOST (or see Processing or Nodebox, though I had precision issues when I tried to use them for CAM).

William


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

Re: First contact with the OpenSCAD community

Lou_Papet
In reply to this post by tsingi
I agree with you. I will perhaps surprise you but I do not appreciate what is done today, especially in the automobile sector without taking the electric ones which are, for me of course, an hoax against the planet! ... My 2CV is 42 yeaers old !...
"Pourquoi faire simple quand on peut faire encore plus simple !..."
"Why keep it simple when you can make it even simpler ! ..."
"Le plus simple est de ne pas faire.....seulement si c'est possible !..."
"The easiest way is not to do ..... only if it is possible ! ..."


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
"Pourquoi faire simple quand on peut faire encore plus simple !..."
"Why keep it simple when you can make it even simpler ! ..."
"Le plus simple est de ne pas faire.....seulement si c'est possible !..."
"The easiest way is not to do ..... only if it is possible ! ..."
Reply | Threaded
Open this post in threaded view
|

Re: First contact with the OpenSCAD community

acwest
On the subject of bezier's, I implemented them in my own libraries with:

function linearBezier(p0, p1, t) = p0 + (p1 - p0) * t;

function quadraticBezier(p0, p1, p2, t) = linearBezier(linearBezier(p0, p1, t), linearBezier(p1, p2, t), t);

function cubicBezier(p0, p1, p2, p3, t) = linearBezier(quadraticBezier(p0, p1, p2, t), quadraticBezier(p1, p2, p3, t), t);

where all 3 functions take an argument t which is between 0 and 1, the fraction of the path along the curve.
linearBezier (only named that for consistency, and I thought it was funny) finds a linear interpretation between two points,  quadraticBezier finds the point along the parabolic segment defined by the 3 points, and cubicBezier (the one normally used in most graphical applications) finds the point along the cubic curve defined by the 4 points.

On Thu, Jan 28, 2021 at 6:49 PM Lou_Papet <[hidden email]> wrote:
I agree with you. I will perhaps surprise you but I do not appreciate what is done today, especially in the automobile sector without taking the electric ones which are, for me of course, an hoax against the planet! ... My 2CV is 42 yeaers old !...
"Pourquoi faire simple quand on peut faire encore plus simple !..."
"Why keep it simple when you can make it even simpler ! ..."
"Le plus simple est de ne pas faire.....seulement si c'est possible !..."
"The easiest way is not to do ..... only if it is possible ! ..."


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

Re: First contact with the OpenSCAD community

adrianv
On the matter of beziers I found that the fastest way to calculate them in
OpenSCAD is using the matrix representation, which isn't commonly discussed.
If you can do something with matrices it will almost always be the fastest
method in OpenSCAD.   I changed the BOSL2 general order N bezier from the
recursive de Casteljau method (that you have below) to the matrix method and
got a 10-20 times speed improvement, which can make a difference when doing
bezier surfaces with lots of points.   The continuous curvature rounding
stuff I did required 4th order beziers.  


acwest wrote

> On the subject of bezier's, I implemented them in my own libraries with:
>
> function linearBezier(p0, p1, t) = p0 + (p1 - p0) * t;
>>
>> function quadraticBezier(p0, p1, p2, t) = linearBezier(linearBezier(p0,
>> p1, t), linearBezier(p1, p2, t), t);
>>
>> function cubicBezier(p0, p1, p2, p3, t) =
>> linearBezier(quadraticBezier(p0,
>> p1, p2, t), quadraticBezier(p1, p2, p3, t), t);
>>
>
> where all 3 functions take an argument t which is between 0 and 1, the
> fraction of the path along the curve.
> linearBezier (only named that for consistency, and I thought it was funny)
> finds a linear interpretation between two points,  quadraticBezier finds
> the point along the parabolic segment defined by the 3 points, and
> cubicBezier (the one normally used in most graphical applications) finds
> the point along the cubic curve defined by the 4 points.
>
> On Thu, Jan 28, 2021 at 6:49 PM Lou_Papet &lt;

> loupapetjpr@

> &gt; wrote:
>
>> I agree with you. I will perhaps surprise you but I do not appreciate
>> what
>> is done today, especially in the automobile sector without taking the
>> electric ones which are, for me of course, an hoax against the planet!
>> ...
>> My 2CV is 42 yeaers old !...
>> "Pourquoi faire simple quand on peut faire encore plus simple !..."
>> *"Why keep it simple when you can make it even simpler ! ..."*
>> "Le plus simple est de ne pas faire.....seulement si c'est possible !..."
>> *"The easiest way is not to do ..... only if it is possible ! ..."*
>>
>> ------------------------------
>> Sent from the OpenSCAD mailing list archive
>> &lt;http://forum.openscad.org/&gt;
>> at Nabble.com.
>> _______________________________________________
>> OpenSCAD mailing list
>>

> Discuss@.openscad

>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>>
>
> _______________________________________________
> OpenSCAD mailing list

> Discuss@.openscad

> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org





--
Sent from: http://forum.openscad.org/

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

Re: First contact with the OpenSCAD community

Lou_Papet
In reply to this post by acwest
Yes, it is a mathematical game allowed by the formulation of Bézier curves but I believe that the most used are cubic Bézier curves to concatenate, easier to handle especially for Bézier surfaces and used in a large part of 3D softwares with the B-splines.

Le ven. 29 janv. 2021 à 03:12, A. Craig West <[hidden email]> a écrit :
On the subject of bezier's, I implemented them in my own libraries with:

function linearBezier(p0, p1, t) = p0 + (p1 - p0) * t;

function quadraticBezier(p0, p1, p2, t) = linearBezier(linearBezier(p0, p1, t), linearBezier(p1, p2, t), t);

function cubicBezier(p0, p1, p2, p3, t) = linearBezier(quadraticBezier(p0, p1, p2, t), quadraticBezier(p1, p2, p3, t), t);

where all 3 functions take an argument t which is between 0 and 1, the fraction of the path along the curve.
linearBezier (only named that for consistency, and I thought it was funny) finds a linear interpretation between two points,  quadraticBezier finds the point along the parabolic segment defined by the 3 points, and cubicBezier (the one normally used in most graphical applications) finds the point along the cubic curve defined by the 4 points.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


--
"Pourquoi faire simple quand on peut faire encore plus simple..."
"Le plus simple est de ne pas faire.....seulement si c'est possible !..."

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
"Pourquoi faire simple quand on peut faire encore plus simple !..."
"Why keep it simple when you can make it even simpler ! ..."
"Le plus simple est de ne pas faire.....seulement si c'est possible !..."
"The easiest way is not to do ..... only if it is possible ! ..."
Reply | Threaded
Open this post in threaded view
|

Re: First contact with the OpenSCAD community

Lou_Papet
In reply to this post by Lou_Papet
Hi Ronaldo,

------------------------------------------------------------------------------------
You wrote :
...
Second, functions may be much more complex than a simple algebraic
expression as you suggest. Thanks to list comprehension and conditional
expressions, you can code iterations, recursions, tests and
pre-calculations inside a function. Here is a simple example that uses your
formule_Bezier() function
...
// computes the list of Fibonacci numbers up to a limiting value greater than 0
function Fibonacci(limit, _result) =
    is_undef(_result) 
    ? Fibonacci(limit,[0,1])
    : let( n = len(_result) )
       _result[n-1]+_result[n-2] > limit 
       ? _result
       : Fibonacci(limit, concat(_result, _result[n-1]+_result[n-2] ) );
------------------------------------------------------------------------------------

Of course, I fully understand the method which I find too concentrated for a good understanding of the code in cases of more elaborate writing than the one you propose. From this point of view, the maintenance of such functions is not very easy.

This writing is enabled thanks to the ternary operator "?" :

value = logical_expression_1  ?  expression_2  :  expression_3 ;

taken up in many languages in different forms which I personally don't like very much and which I intentionally use infrequently. Moreover, this type of writing is accepted by the C language in particular as shown by the following code which uses the one you proposed to me in OpenSCAD :

//============================================================
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

//************************************************************
//*** Fonction de concatenation pour simuler
//    la fonction "concat" de la librairie d'OpenSCAD ;
int *joindre(int *result, int val)
{
  result[++result[0]] = val ;
  return(result) ;
}
//************************************************************

//*** Illustration de l'équivalence d'écriture :
int *Fibonacci(int limit, int *result)
{
  return  (result[result[0]] + result[result[0]-1]) > limit
          ? result
          : Fibonacci( limit
                     , joindre( result
                              , result[result[0]] + result[result[0]-1]
                              )
                     ) ;
}

//*** Fonction d'appel
void test_code()
{
  int result[1024] ;

  result[0] = 2 ; result[1] = 2 ; result[2] = 4 ;
  printf("\n\nSuite de Fibonacci départ : %d,%d\n", result[1],result[2]) ;

  Fibonacci(200, result) ;

  for(int i=0; i<result[0] ; i++)
  { printf( "result[0] = %3d    result[%3d]= %5d\n"
          ,  result[0], i, result[i+1]
          ) ;
  }
  return ;
}
image.png
//============================================================

As the C language is very typical, it took a bit to compose to program the equivalent.

I will however point out that this type of ternary statment is very old since this writing was very used in the language "Algol" (Algo 60), first language that I had learned in the university at the beginning of the years 1960. I enclose an example below taken fron the programmer's guide that I kept (statment 3 and othesr) :

image.png
This this type of programming was widely possible at the time and I didn't quite agree with a lot of colleagues who found this instruction great.

regards,
Lou Papet

--
"Pourquoi faire simple quand on peut faire encore plus simple..."
"Le plus simple est de ne pas faire.....seulement si c'est possible !..."

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
"Pourquoi faire simple quand on peut faire encore plus simple !..."
"Why keep it simple when you can make it even simpler ! ..."
"Le plus simple est de ne pas faire.....seulement si c'est possible !..."
"The easiest way is not to do ..... only if it is possible ! ..."