Fwd: OpenSCAD language - replace it with Python3

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

Fwd: OpenSCAD language - replace it with Python3

mondo


On 03/12/2020 07:07, Troberg wrote:
>> I once had a teacher who said that it would have been much easier for new
>> users if the \ (or /, depending on OS)
It's interesting, or maybe not, what we use the / for and how in normal
sort of tryping when you can't find the right code, how to write for
example five and five sixteenths. Never mind the new fangled \ . When I
was a lad, many of these symbols were unknown. It's odd, how in most
every human endeavour, we make things more complicated, instead of more
simple.

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

Re: Fwd: OpenSCAD language - replace it with Python3

OpenSCAD mailing list-2
Ray West <[hidden email]> wrote:

>It's interesting, or maybe not, what we use the / for and how in normal
>sort of typing when you can't find the right code, how to write for
>example five and five sixteenths. Never mind the new fangled \ . When I
>was a lad, many of these symbols were unknown. It's odd, how in most
>every human endeavour, we make things more complicated, instead of more
>simple.

They were known/used, just not easily accessible, since printing math books (termed as "penalty copy") required special sets of mathematical symbols and/or matrices for a Monotype hot metal casting machine.

It's been a very, very long while (centuries) since mathematic problems were written out as essentially textual descriptions --- the symbols since developed are far more expressive (I did the typesetting of the English translation of Thomas Harriot's https://www.goodreads.com/book/show/16808003-thomas-harriot-s-artis-analyticae-praxis under contract) --- folks who want to make use of them when programming can consider systems such as Literate Programming:

http://literateprogramming.com/

which allow mixing formulae (written using (La)TeX which is a quite close mapping to how a mathematician might write out a formulae) and program code.

Eventually I'll re-work:

http://tug.org/TUGboat/tb40-2/tb125adams-3d.pdf

as a literate program.

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: !![SPAM]!! Re: Fwd: OpenSCAD language - replace it with Python3

mondo

But Mathematicians are a subset of humanity, mathematically speaking! The \ was undefined in EBCDIC encoding. Sir Clive Marles Sinclair, who invented the first scientific (and pocket) calculator went for reverse polish notation, which although being easier to implement, therefore mathematically purer? was pretty much useless for many folk.

Over on the freecad forum, someone had posted about being able to write openscad code. I had a look. I responded as below, the essence of which was copied from the original at https://github.com/supermerill/FreePySCAD.

Not sure why it's openscad, with a different syntax.


Braces are replaced with parenthesis

The ; (semicolons) are replaced with , (commas) and is required to place it after ) if no other ) are directly after that to respect the python syntax.

Modifiers like translate, rotate must not be unattached. Use the parenthesis or a dot:

OpenSCAD: difference(){ translate([1,1,0]) cube(2); rotate([0,0,45]) cube(2); }
FreePySCAD: difference()( translate([1,1,0]).cube(2), rotate([0,0,45])(cube(2)),)

After fighting with myself having to shove a ; at the end of lines, I now have to use ,'s?

or should that be - After fighting with myself having to shove a  ';' at the end of lines, I now have to use a ' ,'?

Poet's day today, (but having left paid employment many years ago, every day is poet's day

Best wishes,

Ray

On 04/12/2020 15:15, William F. Adams via Discuss wrote:
Ray West [hidden email] wrote:

>It's interesting, or maybe not, what we use the / for and how in normal
>sort of typing when you can't find the right code, how to write for
>example five and five sixteenths. Never mind the new fangled \ . When I
>was a lad, many of these symbols were unknown. It's odd, how in most
>every human endeavour, we make things more complicated, instead of more
>simple.

They were known/used, just not easily accessible, since printing math books (termed as "penalty copy") required special sets of mathematical symbols and/or matrices for a Monotype hot metal casting machine.

It's been a very, very long while (centuries) since mathematic problems were written out as essentially textual descriptions --- the symbols since developed are far more expressive (I did the typesetting of the English translation of Thomas Harriot's https://www.goodreads.com/book/show/16808003-thomas-harriot-s-artis-analyticae-praxis under contract) --- folks who want to make use of them when programming can consider systems such as Literate Programming:


which allow mixing formulae (written using (La)TeX which is a quite close mapping to how a mathematician might write out a formulae) and program code.

Eventually I'll re-work:


as a literate program.

William

_______________________________________________
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