PC
Patrick Callahan
Tue, Nov 23, 2021 10:16 PM
The big thing that's missing is the ability to construct an object from an
OpenSCAD program. I believe that the expectation is that that will look
something like
o = {
a = 5;
b = 6;
};
Then there should probably be some other stuff like union, difference and
intersection. Maybe some kind of "object comprehension" that would let you
construct an object in the same sort of way that a list comprehension lets
you construct lists.
Just having the ability to create the object, pass it to a module or
function, and reference the contents by o.a or o.b would be a big win. It
would reduce the need to create constructor and access functions for every
aspect of a feature.
How can I help?
-Pat
Note that this reply is bottom-posted.
If using Gmail's web app, click the three dots immediately after hitting
reply, place cursor at bottom. Easy!
>
>
> The big thing that's missing is the ability to construct an object from an
> OpenSCAD program. I believe that the expectation is that that will look
> something like
>
> o = {
> a = 5;
> b = 6;
> };
>
> Then there should probably be some other stuff like union, difference and
> intersection. Maybe some kind of "object comprehension" that would let you
> construct an object in the same sort of way that a list comprehension lets
> you construct lists.
>
> Just having the ability to create the object, pass it to a module or
function, and reference the contents by o.a or o.b would be a big win. It
would reduce the need to create constructor and access functions for every
aspect of a feature.
How can I help?
-Pat
Note that this reply is bottom-posted.
If using Gmail's web app, click the three dots immediately after hitting
reply, place cursor at bottom. Easy!
TP
Torsten Paul
Wed, Nov 24, 2021 5:30 PM
On 23.11.21 23:16, Patrick Callahan wrote:
Discussion about objects is here:
https://github.com/openscad/openscad/pull/3087
https://github.com/openscad/openscad/issues/3088
This is based on the OpenSCAD2 proposal Doug made some
time ago. The topic is a bit dormant, but as Jordan
wrote, the some internal parts of the objects are now
already present in the dev snapshots and used by the
text/fontmetrics calls.
Also note that other parts of the OpenSCAD2 proposal
are already released, like the function literals.
In my view, it's not meant as big bang change, like
the python2 -> python3 process. Instead it's a guide
for improvement.
ciao,
Torsten.
On 23.11.21 23:16, Patrick Callahan wrote:
> How can I help?
Discussion about objects is here:
https://github.com/openscad/openscad/pull/3087
https://github.com/openscad/openscad/issues/3088
This is based on the OpenSCAD2 proposal Doug made some
time ago. The topic is a bit dormant, but as Jordan
wrote, the some internal parts of the objects are now
already present in the dev snapshots and used by the
text/fontmetrics calls.
Also note that other parts of the OpenSCAD2 proposal
are already released, like the function literals.
In my view, it's not meant as big bang change, like
the python2 -> python3 process. Instead it's a guide
for improvement.
ciao,
Torsten.
PC
Patrick Callahan
Wed, Nov 24, 2021 6:30 PM
On 23.11.21 23:16, Patrick Callahan wrote:
Discussion about objects is here:
https://github.com/openscad/openscad/pull/3087
https://github.com/openscad/openscad/issues/3088
This is based on the OpenSCAD2 proposal Doug made some
time ago. The topic is a bit dormant, but as Jordan
wrote, the some internal parts of the objects are now
already present in the dev snapshots and used by the
text/fontmetrics calls.
Also note that other parts of the OpenSCAD2 proposal
are already released, like the function literals.
In my view, it's not meant as big bang change, like
the python2 -> python3 process. Instead it's a guide
for improvement.
ciao,
Torsten.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
On Wed, Nov 24, 2021 at 12:30 PM Torsten Paul <Torsten.Paul@gmx.de> wrote:
> On 23.11.21 23:16, Patrick Callahan wrote:
> > How can I help?
>
> Discussion about objects is here:
> https://github.com/openscad/openscad/pull/3087
> https://github.com/openscad/openscad/issues/3088
>
> This is based on the OpenSCAD2 proposal Doug made some
> time ago. The topic is a bit dormant, but as Jordan
> wrote, the some internal parts of the objects are now
> already present in the dev snapshots and used by the
> text/fontmetrics calls.
>
> Also note that other parts of the OpenSCAD2 proposal
> are already released, like the function literals.
>
> In my view, it's not meant as big bang change, like
> the python2 -> python3 process. Instead it's a guide
> for improvement.
>
> ciao,
> Torsten.
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
PC
Patrick Callahan
Wed, Nov 24, 2021 7:08 PM
On 23.11.21 23:16, Patrick Callahan wrote:
Ok Read all that.
I understand some of the software language engineering issues raised and
that parts of the OpenScad2 proposal are moving forward even if OpenSCAD2
as a whole is not.
Also note that other parts of the OpenSCAD2 proposal
are already released, like the function literals.
What do function literals allow me to do that I could not do without them?
I can see what they are but can't see beyond that.
For what hat are they suitable? I'm not clear on how to think about coding
with them.
In my view, it's not meant as big bang change, like
the python2 -> python3 process. Instead it's a guide
for improvement.
Yup. There's a lot of discussion of various points on the proposal
itself, issue threads, and pull requests, and I'm reading more before
commenting further. Expect questions though.
On Wed, Nov 24, 2021 at 12:30 PM Torsten Paul <Torsten.Paul@gmx.de> wrote:
> On 23.11.21 23:16, Patrick Callahan wrote:
> > How can I help?
>
> Discussion about objects is here:
> https://github.com/openscad/openscad/pull/3087
> https://github.com/openscad/openscad/issues/3088
> <snip>
Ok Read all that.
I understand some of the software language engineering issues raised and
that parts of the OpenScad2 proposal are moving forward even if OpenSCAD2
as a whole is not.
> Also note that other parts of the OpenSCAD2 proposal
> are already released, like the function literals.
>
>
What do function literals allow me to do that I could not do without them?
I can see what they are but can't see beyond that.
For what hat are they suitable? I'm not clear on how to think about coding
with them.
In my view, it's not meant as big bang change, like
> the python2 -> python3 process. Instead it's a guide
> for improvement.
>
> Yup. There's a lot of discussion of various points on the proposal
itself, issue threads, and pull requests, and I'm reading more before
commenting further. Expect questions though.
NH
nop head
Wed, Nov 24, 2021 7:13 PM
Function literals allow you to store function references in valuables and
pass them as parameters. So for example you could have a quicksort routine
and pass a function to do the comparison.
On Wed, 24 Nov 2021 at 19:09, Patrick Callahan pat.callahan1@gmail.com
wrote:
On 23.11.21 23:16, Patrick Callahan wrote:
Ok Read all that.
I understand some of the software language engineering issues raised and
that parts of the OpenScad2 proposal are moving forward even if OpenSCAD2
as a whole is not.
Also note that other parts of the OpenSCAD2 proposal
are already released, like the function literals.
What do function literals allow me to do that I could not do without them?
I can see what they are but can't see beyond that.
For what hat are they suitable? I'm not clear on how to think about
coding with them.
In my view, it's not meant as big bang change, like
the python2 -> python3 process. Instead it's a guide
for improvement.
Yup. There's a lot of discussion of various points on the proposal
itself, issue threads, and pull requests, and I'm reading more before
commenting further. Expect questions though.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Function literals allow you to store function references in valuables and
pass them as parameters. So for example you could have a quicksort routine
and pass a function to do the comparison.
On Wed, 24 Nov 2021 at 19:09, Patrick Callahan <pat.callahan1@gmail.com>
wrote:
>
>
> On Wed, Nov 24, 2021 at 12:30 PM Torsten Paul <Torsten.Paul@gmx.de> wrote:
>
>> On 23.11.21 23:16, Patrick Callahan wrote:
>> > How can I help?
>>
>> Discussion about objects is here:
>> https://github.com/openscad/openscad/pull/3087
>> https://github.com/openscad/openscad/issues/3088
>> <snip>
>
> Ok Read all that.
>
> I understand some of the software language engineering issues raised and
> that parts of the OpenScad2 proposal are moving forward even if OpenSCAD2
> as a whole is not.
>
>
>> Also note that other parts of the OpenSCAD2 proposal
>> are already released, like the function literals.
>>
>>
> What do function literals allow me to do that I could not do without them?
> I can see what they are but can't see beyond that.
> For what hat are they suitable? I'm not clear on how to think about
> coding with them.
>
> In my view, it's not meant as big bang change, like
>> the python2 -> python3 process. Instead it's a guide
>> for improvement.
>>
>> Yup. There's a lot of discussion of various points on the proposal
> itself, issue threads, and pull requests, and I'm reading more before
> commenting further. Expect questions though.
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
TP
Torsten Paul
Wed, Nov 24, 2021 7:59 PM
On 24.11.21 20:08, Patrick Callahan wrote:
For what hat are they suitable? I'm not clear on how to
think about coding with them.
Passing functions to other functions or modules allows
for quite powerful library style functions, e.g. fold()
that give the caller influence of calculation details.
fold = function(i, v, f, off = 0) len(v) > off ? fold(f(i, v[off]), v, f, off + 1) : i;
v = [1, 2, 7, 4, -5];
f_add = function(x, y) x + y;
f_mul = function(x, y) x * y;
f_min = function(x, y) is_undef(x) ? y : min(x, y);
f_max = function(x, y) is_undef(x) ? y : max(x, y);
echo(add = fold(0, v, f_add)); // ECHO: add = 9
echo(mul = fold(1, v, f_mul)); // ECHO: mul = -280
echo(min = fold(undef, v, f_min)) // ECHO: -5
echo(max = fold(undef, v, f_max)) // ECHO: 7
More examples: https://github.com/thehans/funcutils
ciao,
Torsten.
On 24.11.21 20:08, Patrick Callahan wrote:
> For what hat are they suitable? I'm not clear on how to
> think about coding with them.
Passing functions to other functions or modules allows
for quite powerful library style functions, e.g. fold()
that give the caller influence of calculation details.
fold = function(i, v, f, off = 0) len(v) > off ? fold(f(i, v[off]), v, f, off + 1) : i;
v = [1, 2, 7, 4, -5];
f_add = function(x, y) x + y;
f_mul = function(x, y) x * y;
f_min = function(x, y) is_undef(x) ? y : min(x, y);
f_max = function(x, y) is_undef(x) ? y : max(x, y);
echo(add = fold(0, v, f_add)); // ECHO: add = 9
echo(mul = fold(1, v, f_mul)); // ECHO: mul = -280
echo(min = fold(undef, v, f_min)) // ECHO: -5
echo(max = fold(undef, v, f_max)) // ECHO: 7
More examples: https://github.com/thehans/funcutils
ciao,
Torsten.
PC
Patrick Callahan
Thu, Nov 25, 2021 1:52 AM
I've looked through https://github.com/thehans/funcutils.
Now, after looking through the documentation and function definitions in a
few of the modules, I wonder how the utility functions defined in the
funcutils library help when one uses them in an OpenSCAD program.
I know this question exhibits my lack of background in functional
programming.
-Pat
I wonder when functional programming will start to click for me.
On Wed, Nov 24, 2021 at 2:59 PM Torsten Paul Torsten.Paul@gmx.de wrote:
On 24.11.21 20:08, Patrick Callahan wrote:
For what hat are they suitable? I'm not clear on how to
think about coding with them.
Passing functions to other functions or modules allows
for quite powerful library style functions, e.g. fold()
that give the caller influence of calculation details.
fold = function(i, v, f, off = 0) len(v) > off ? fold(f(i, v[off]), v, f,
off + 1) : i;
v = [1, 2, 7, 4, -5];
f_add = function(x, y) x + y;
f_mul = function(x, y) x * y;
f_min = function(x, y) is_undef(x) ? y : min(x, y);
f_max = function(x, y) is_undef(x) ? y : max(x, y);
echo(add = fold(0, v, f_add)); // ECHO: add = 9
echo(mul = fold(1, v, f_mul)); // ECHO: mul = -280
echo(min = fold(undef, v, f_min)) // ECHO: -5
echo(max = fold(undef, v, f_max)) // ECHO: 7
More examples: https://github.com/thehans/funcutils
ciao,
Torsten.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I've looked through https://github.com/thehans/funcutils.
Now, after looking through the documentation and function definitions in a
few of the modules, I wonder how the utility functions defined in the
funcutils library help when one uses them in an OpenSCAD program.
I know this question exhibits my lack of background in functional
programming.
-Pat
I wonder when functional programming will start to click for me.
On Wed, Nov 24, 2021 at 2:59 PM Torsten Paul <Torsten.Paul@gmx.de> wrote:
> On 24.11.21 20:08, Patrick Callahan wrote:
> > For what hat are they suitable? I'm not clear on how to
> > think about coding with them.
>
> Passing functions to other functions or modules allows
> for quite powerful library style functions, e.g. fold()
> that give the caller influence of calculation details.
>
> fold = function(i, v, f, off = 0) len(v) > off ? fold(f(i, v[off]), v, f,
> off + 1) : i;
>
> v = [1, 2, 7, 4, -5];
>
> f_add = function(x, y) x + y;
> f_mul = function(x, y) x * y;
> f_min = function(x, y) is_undef(x) ? y : min(x, y);
> f_max = function(x, y) is_undef(x) ? y : max(x, y);
>
> echo(add = fold(0, v, f_add)); // ECHO: add = 9
> echo(mul = fold(1, v, f_mul)); // ECHO: mul = -280
> echo(min = fold(undef, v, f_min)) // ECHO: -5
> echo(max = fold(undef, v, f_max)) // ECHO: 7
>
> More examples: https://github.com/thehans/funcutils
>
> ciao,
> Torsten.
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
FH
Father Horton
Thu, Nov 25, 2021 4:01 AM
It took several tries for it to click. XSLT is the first functional
language I encountered and it took me forever to get it. It didn’t help
that one of the free books I looked at on Amazon did its level best to use
it as an imperative language.
On Wed, Nov 24, 2021 at 7:52 PM Patrick Callahan pat.callahan1@gmail.com
wrote:
I've looked through https://github.com/thehans/funcutils.
Now, after looking through the documentation and function definitions in a
few of the modules, I wonder how the utility functions defined in the
funcutils library help when one uses them in an OpenSCAD program.
I know this question exhibits my lack of background in functional
programming.
-Pat
I wonder when functional programming will start to click for me.
On Wed, Nov 24, 2021 at 2:59 PM Torsten Paul Torsten.Paul@gmx.de wrote:
On 24.11.21 20:08, Patrick Callahan wrote:
For what hat are they suitable? I'm not clear on how to
think about coding with them.
Passing functions to other functions or modules allows
for quite powerful library style functions, e.g. fold()
that give the caller influence of calculation details.
fold = function(i, v, f, off = 0) len(v) > off ? fold(f(i, v[off]), v, f,
off + 1) : i;
v = [1, 2, 7, 4, -5];
f_add = function(x, y) x + y;
f_mul = function(x, y) x * y;
f_min = function(x, y) is_undef(x) ? y : min(x, y);
f_max = function(x, y) is_undef(x) ? y : max(x, y);
echo(add = fold(0, v, f_add)); // ECHO: add = 9
echo(mul = fold(1, v, f_mul)); // ECHO: mul = -280
echo(min = fold(undef, v, f_min)) // ECHO: -5
echo(max = fold(undef, v, f_max)) // ECHO: 7
More examples: https://github.com/thehans/funcutils
ciao,
Torsten.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
It took several tries for it to click. XSLT is the first functional
language I encountered and it took me forever to get it. It didn’t help
that one of the free books I looked at on Amazon did its level best to use
it as an imperative language.
On Wed, Nov 24, 2021 at 7:52 PM Patrick Callahan <pat.callahan1@gmail.com>
wrote:
> I've looked through https://github.com/thehans/funcutils.
>
> Now, after looking through the documentation and function definitions in a
> few of the modules, I wonder how the utility functions defined in the
> funcutils library help when one uses them in an OpenSCAD program.
> I know this question exhibits my lack of background in functional
> programming.
>
> -Pat
> I wonder when functional programming will start to click for me.
>
>
> On Wed, Nov 24, 2021 at 2:59 PM Torsten Paul <Torsten.Paul@gmx.de> wrote:
>
>> On 24.11.21 20:08, Patrick Callahan wrote:
>> > For what hat are they suitable? I'm not clear on how to
>> > think about coding with them.
>>
>> Passing functions to other functions or modules allows
>> for quite powerful library style functions, e.g. fold()
>> that give the caller influence of calculation details.
>>
>> fold = function(i, v, f, off = 0) len(v) > off ? fold(f(i, v[off]), v, f,
>> off + 1) : i;
>>
>> v = [1, 2, 7, 4, -5];
>>
>> f_add = function(x, y) x + y;
>> f_mul = function(x, y) x * y;
>> f_min = function(x, y) is_undef(x) ? y : min(x, y);
>> f_max = function(x, y) is_undef(x) ? y : max(x, y);
>>
>> echo(add = fold(0, v, f_add)); // ECHO: add = 9
>> echo(mul = fold(1, v, f_mul)); // ECHO: mul = -280
>> echo(min = fold(undef, v, f_min)) // ECHO: -5
>> echo(max = fold(undef, v, f_max)) // ECHO: 7
>>
>> More examples: https://github.com/thehans/funcutils
>>
>> ciao,
>> Torsten.
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
PC
Patrick Callahan
Fri, Nov 26, 2021 12:38 PM
My code looks as imperative as possible. That For statement is my
downfall, even if it is used in a functional way.
It's been said that OpenScad is a functional language. Is it?
Can you do this?
Array(10).fill("functional programming is not a religion")
.map((msg) => {
console.log(msg);
return msg;
});
Sorry about the impure thoughts Father Horton, see you next Saturday...
On Thu, Nov 25, 2021 at 2:17 AM Father Horton fatherhorton@gmail.com
wrote:
It took several tries for it to click. XSLT is the first functional
language I encountered and it took me forever to get it. It didn’t help
that one of the free books I looked at on Amazon did its level best to use
it as an imperative language.
On Wed, Nov 24, 2021 at 7:52 PM Patrick Callahan pat.callahan1@gmail.com
wrote:
I've looked through https://github.com/thehans/funcutils.
Now, after looking through the documentation and function definitions in
a few of the modules, I wonder how the utility functions defined in the
funcutils library help when one uses them in an OpenSCAD program.
I know this question exhibits my lack of background in functional
programming.
-Pat
I wonder when functional programming will start to click for me.
On Wed, Nov 24, 2021 at 2:59 PM Torsten Paul Torsten.Paul@gmx.de wrote:
On 24.11.21 20:08, Patrick Callahan wrote:
For what hat are they suitable? I'm not clear on how to
think about coding with them.
Passing functions to other functions or modules allows
for quite powerful library style functions, e.g. fold()
that give the caller influence of calculation details.
fold = function(i, v, f, off = 0) len(v) > off ? fold(f(i, v[off]), v,
f, off + 1) : i;
v = [1, 2, 7, 4, -5];
f_add = function(x, y) x + y;
f_mul = function(x, y) x * y;
f_min = function(x, y) is_undef(x) ? y : min(x, y);
f_max = function(x, y) is_undef(x) ? y : max(x, y);
echo(add = fold(0, v, f_add)); // ECHO: add = 9
echo(mul = fold(1, v, f_mul)); // ECHO: mul = -280
echo(min = fold(undef, v, f_min)) // ECHO: -5
echo(max = fold(undef, v, f_max)) // ECHO: 7
More examples: https://github.com/thehans/funcutils
ciao,
Torsten.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
My code looks as imperative as possible. That For statement is my
downfall, even if it is used in a functional way.
It's been said that OpenScad is a functional language. Is it?
Can you do this?
Array(10).fill("functional programming is not a religion")
.map((msg) => {
console.log(msg);
return msg;
});
Sorry about the impure thoughts Father Horton, see you next Saturday...
On Thu, Nov 25, 2021 at 2:17 AM Father Horton <fatherhorton@gmail.com>
wrote:
> It took several tries for it to click. XSLT is the first functional
> language I encountered and it took me forever to get it. It didn’t help
> that one of the free books I looked at on Amazon did its level best to use
> it as an imperative language.
>
> On Wed, Nov 24, 2021 at 7:52 PM Patrick Callahan <pat.callahan1@gmail.com>
> wrote:
>
>> I've looked through https://github.com/thehans/funcutils.
>>
>> Now, after looking through the documentation and function definitions in
>> a few of the modules, I wonder how the utility functions defined in the
>> funcutils library help when one uses them in an OpenSCAD program.
>> I know this question exhibits my lack of background in functional
>> programming.
>>
>> -Pat
>> I wonder when functional programming will start to click for me.
>>
>>
>> On Wed, Nov 24, 2021 at 2:59 PM Torsten Paul <Torsten.Paul@gmx.de> wrote:
>>
>>> On 24.11.21 20:08, Patrick Callahan wrote:
>>> > For what hat are they suitable? I'm not clear on how to
>>> > think about coding with them.
>>>
>>> Passing functions to other functions or modules allows
>>> for quite powerful library style functions, e.g. fold()
>>> that give the caller influence of calculation details.
>>>
>>> fold = function(i, v, f, off = 0) len(v) > off ? fold(f(i, v[off]), v,
>>> f, off + 1) : i;
>>>
>>> v = [1, 2, 7, 4, -5];
>>>
>>> f_add = function(x, y) x + y;
>>> f_mul = function(x, y) x * y;
>>> f_min = function(x, y) is_undef(x) ? y : min(x, y);
>>> f_max = function(x, y) is_undef(x) ? y : max(x, y);
>>>
>>> echo(add = fold(0, v, f_add)); // ECHO: add = 9
>>> echo(mul = fold(1, v, f_mul)); // ECHO: mul = -280
>>> echo(min = fold(undef, v, f_min)) // ECHO: -5
>>> echo(max = fold(undef, v, f_max)) // ECHO: 7
>>>
>>> More examples: https://github.com/thehans/funcutils
>>>
>>> ciao,
>>> Torsten.
>>> _______________________________________________
>>> OpenSCAD mailing list
>>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>>
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
TP
Torsten Paul
Fri, Nov 26, 2021 1:32 PM
On 26.11.21 13:38, Patrick Callahan wrote:
Sure, but why?
array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
ciao,
Torsten.
On 26.11.21 13:38, Patrick Callahan wrote:
> Can you do this?
Sure, but why?
array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
ciao,
Torsten.
PC
Patrick Callahan
Fri, Nov 26, 2021 2:18 PM
Sorry, It was an attempt at humor in a programming language. Never a good
idea.
-Pat
On Fri, Nov 26, 2021 at 8:33 AM Torsten Paul Torsten.Paul@gmx.de wrote:
On 26.11.21 13:38, Patrick Callahan wrote:
Sure, but why?
array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
ciao,
Torsten.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Sorry, It was an attempt at humor in a programming language. Never a good
idea.
-Pat
On Fri, Nov 26, 2021 at 8:33 AM Torsten Paul <Torsten.Paul@gmx.de> wrote:
> On 26.11.21 13:38, Patrick Callahan wrote:
> > Can you do this?
>
> Sure, but why?
>
> array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
>
> ciao,
> Torsten.
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
AM
Adrian Mariano
Fri, Nov 26, 2021 3:05 PM
I think if you want OpenSCAD programming to "click" the answer is to
write a bunch of programs where you try to do something difficult. If
you're trying to do something and you care about efficiency then you
should try to do that thing with OpenSCAD native matrix operations
first. For example, using the fold() function above to sum up a
simple vector of numbers is 40 times slower than using a vector
product, something like:
sum_of_test = test*[for(i=test) 1]];
The second choice for efficiency (and probably the first for
readability) is to use a list comprehension. Neither of these two
methods is "functional programming". List comprehensions can do a lot
of things---anything where the value at one output point is
independent of the value at other output points. There's the business
of not being able to redefine variables, which can be an occasional
nuisance, but it's not a big issue. The main consequence is that you
have to handle all cases all at once with the ternary operator, or you
have to introduce more variables. But if you can't use a list
comprehension because the answer depends on previous answers, then you
need to use recursion. That's when things look "functional". If
you're lucky you can do this with tail recursion, and get more
efficiency. If not you'll be in a less efficient situation. The last
option is the C-style for loop, which in my testing I have found to be
the slowest option, slower than recursion. It's hard to use (usually
harder than recursion).
So is OpenSCAD a "functional language"? I'm not sure. A lot of
OpenSCAD programming doesn't really seem functional. If you want to
code in OpenSCAD then you need to learn OpenSCAD and its quirks and
not get hung up on terminology. At the end of the day, if your
program works does it matter if it was "functional" or "procedural"?
On Fri, Nov 26, 2021 at 9:19 AM Patrick Callahan
pat.callahan1@gmail.com wrote:
Sorry, It was an attempt at humor in a programming language. Never a good idea.
-Pat
On Fri, Nov 26, 2021 at 8:33 AM Torsten Paul Torsten.Paul@gmx.de wrote:
On 26.11.21 13:38, Patrick Callahan wrote:
Can you do this?
Sure, but why?
array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
ciao,
Torsten.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I think if you want OpenSCAD programming to "click" the answer is to
write a bunch of programs where you try to do something difficult. If
you're trying to do something and you care about efficiency then you
should try to do that thing with OpenSCAD native matrix operations
first. For example, using the fold() function above to sum up a
simple vector of numbers is 40 times slower than using a vector
product, something like:
sum_of_test = test*[for(i=test) 1]];
The second choice for efficiency (and probably the first for
readability) is to use a list comprehension. Neither of these two
methods is "functional programming". List comprehensions can do a lot
of things---anything where the value at one output point is
independent of the value at other output points. There's the business
of not being able to redefine variables, which can be an occasional
nuisance, but it's not a big issue. The main consequence is that you
have to handle all cases all at once with the ternary operator, or you
have to introduce more variables. But if you can't use a list
comprehension because the answer depends on previous answers, then you
need to use recursion. That's when things look "functional". If
you're lucky you can do this with tail recursion, and get more
efficiency. If not you'll be in a less efficient situation. The last
option is the C-style for loop, which in my testing I have found to be
the slowest option, slower than recursion. It's hard to use (usually
harder than recursion).
So is OpenSCAD a "functional language"? I'm not sure. A lot of
OpenSCAD programming doesn't really seem functional. If you want to
code in OpenSCAD then you need to learn OpenSCAD and its quirks and
not get hung up on terminology. At the end of the day, if your
program works does it matter if it was "functional" or "procedural"?
On Fri, Nov 26, 2021 at 9:19 AM Patrick Callahan
<pat.callahan1@gmail.com> wrote:
>
> Sorry, It was an attempt at humor in a programming language. Never a good idea.
>
> -Pat
>
> On Fri, Nov 26, 2021 at 8:33 AM Torsten Paul <Torsten.Paul@gmx.de> wrote:
>>
>> On 26.11.21 13:38, Patrick Callahan wrote:
>> > Can you do this?
>>
>> Sure, but why?
>>
>> array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
>>
>> ciao,
>> Torsten.
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
ER
edmund ronald
Fri, Nov 26, 2021 6:52 PM
I do have something difficult I need to do: somehow find a way to place a
marker on the rendered object interactively and locate that point. Or even
compute a distance between two markers. If I can figure out a way to do
that in openscad I don't care whether it is functional or imperative or
declarative, I like it just fine - and if I can't do that then I'll have to
move to some other system which I would find unfortunate because so far
after a few months openSCAD has always got the job done for me.
Edmund
On Fri, Nov 26, 2021 at 4:05 PM Adrian Mariano avm4@cornell.edu wrote:
I think if you want OpenSCAD programming to "click" the answer is to
write a bunch of programs where you try to do something difficult. If
you're trying to do something and you care about efficiency then you
should try to do that thing with OpenSCAD native matrix operations
first. For example, using the fold() function above to sum up a
simple vector of numbers is 40 times slower than using a vector
product, something like:
sum_of_test = test*[for(i=test) 1]];
The second choice for efficiency (and probably the first for
readability) is to use a list comprehension. Neither of these two
methods is "functional programming". List comprehensions can do a lot
of things---anything where the value at one output point is
independent of the value at other output points. There's the business
of not being able to redefine variables, which can be an occasional
nuisance, but it's not a big issue. The main consequence is that you
have to handle all cases all at once with the ternary operator, or you
have to introduce more variables. But if you can't use a list
comprehension because the answer depends on previous answers, then you
need to use recursion. That's when things look "functional". If
you're lucky you can do this with tail recursion, and get more
efficiency. If not you'll be in a less efficient situation. The last
option is the C-style for loop, which in my testing I have found to be
the slowest option, slower than recursion. It's hard to use (usually
harder than recursion).
So is OpenSCAD a "functional language"? I'm not sure. A lot of
OpenSCAD programming doesn't really seem functional. If you want to
code in OpenSCAD then you need to learn OpenSCAD and its quirks and
not get hung up on terminology. At the end of the day, if your
program works does it matter if it was "functional" or "procedural"?
On Fri, Nov 26, 2021 at 9:19 AM Patrick Callahan
pat.callahan1@gmail.com wrote:
Sorry, It was an attempt at humor in a programming language. Never a
On 26.11.21 13:38, Patrick Callahan wrote:
Sure, but why?
array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
ciao,
Torsten.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I do have something difficult I need to do: somehow find a way to place a
marker on the rendered object interactively and locate that point. Or even
compute a distance between two markers. If I can figure out a way to do
that in openscad I don't care whether it is functional or imperative or
declarative, I like it just fine - and if I can't do that then I'll have to
move to some other system which I would find unfortunate because so far
after a few months openSCAD has always got the job done for me.
Edmund
On Fri, Nov 26, 2021 at 4:05 PM Adrian Mariano <avm4@cornell.edu> wrote:
> I think if you want OpenSCAD programming to "click" the answer is to
> write a bunch of programs where you try to do something difficult. If
> you're trying to do something and you care about efficiency then you
> should try to do that thing with OpenSCAD native matrix operations
> first. For example, using the fold() function above to sum up a
> simple vector of numbers is 40 times slower than using a vector
> product, something like:
>
> sum_of_test = test*[for(i=test) 1]];
>
> The second choice for efficiency (and probably the first for
> readability) is to use a list comprehension. Neither of these two
> methods is "functional programming". List comprehensions can do a lot
> of things---anything where the value at one output point is
> independent of the value at other output points. There's the business
> of not being able to redefine variables, which can be an occasional
> nuisance, but it's not a big issue. The main consequence is that you
> have to handle all cases all at once with the ternary operator, or you
> have to introduce more variables. But if you can't use a list
> comprehension because the answer depends on previous answers, then you
> need to use recursion. That's when things look "functional". If
> you're lucky you can do this with tail recursion, and get more
> efficiency. If not you'll be in a less efficient situation. The last
> option is the C-style for loop, which in my testing I have found to be
> the slowest option, slower than recursion. It's hard to use (usually
> harder than recursion).
>
> So is OpenSCAD a "functional language"? I'm not sure. A lot of
> OpenSCAD programming doesn't really seem functional. If you want to
> code in OpenSCAD then you need to learn OpenSCAD and its quirks and
> not get hung up on terminology. At the end of the day, if your
> program works does it matter if it was "functional" or "procedural"?
>
> On Fri, Nov 26, 2021 at 9:19 AM Patrick Callahan
> <pat.callahan1@gmail.com> wrote:
> >
> > Sorry, It was an attempt at humor in a programming language. Never a
> good idea.
> >
> > -Pat
> >
> > On Fri, Nov 26, 2021 at 8:33 AM Torsten Paul <Torsten.Paul@gmx.de>
> wrote:
> >>
> >> On 26.11.21 13:38, Patrick Callahan wrote:
> >> > Can you do this?
> >>
> >> Sure, but why?
> >>
> >> array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
> >>
> >> ciao,
> >> Torsten.
> >> _______________________________________________
> >> OpenSCAD mailing list
> >> To unsubscribe send an email to discuss-leave@lists.openscad.org
> >
> > _______________________________________________
> > OpenSCAD mailing list
> > To unsubscribe send an email to discuss-leave@lists.openscad.org
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
NH
nop head
Fri, Nov 26, 2021 7:05 PM
I never need to do that because if a dimension is important I specify it in
my source code and make it so in the code. Do you want to measure other
people's designs?
On Fri, 26 Nov 2021 at 18:52, edmund ronald edmundronald@gmail.com wrote:
I do have something difficult I need to do: somehow find a way to place a
marker on the rendered object interactively and locate that point. Or even
compute a distance between two markers. If I can figure out a way to do
that in openscad I don't care whether it is functional or imperative or
declarative, I like it just fine - and if I can't do that then I'll have to
move to some other system which I would find unfortunate because so far
after a few months openSCAD has always got the job done for me.
Edmund
On Fri, Nov 26, 2021 at 4:05 PM Adrian Mariano avm4@cornell.edu wrote:
I think if you want OpenSCAD programming to "click" the answer is to
write a bunch of programs where you try to do something difficult. If
you're trying to do something and you care about efficiency then you
should try to do that thing with OpenSCAD native matrix operations
first. For example, using the fold() function above to sum up a
simple vector of numbers is 40 times slower than using a vector
product, something like:
sum_of_test = test*[for(i=test) 1]];
The second choice for efficiency (and probably the first for
readability) is to use a list comprehension. Neither of these two
methods is "functional programming". List comprehensions can do a lot
of things---anything where the value at one output point is
independent of the value at other output points. There's the business
of not being able to redefine variables, which can be an occasional
nuisance, but it's not a big issue. The main consequence is that you
have to handle all cases all at once with the ternary operator, or you
have to introduce more variables. But if you can't use a list
comprehension because the answer depends on previous answers, then you
need to use recursion. That's when things look "functional". If
you're lucky you can do this with tail recursion, and get more
efficiency. If not you'll be in a less efficient situation. The last
option is the C-style for loop, which in my testing I have found to be
the slowest option, slower than recursion. It's hard to use (usually
harder than recursion).
So is OpenSCAD a "functional language"? I'm not sure. A lot of
OpenSCAD programming doesn't really seem functional. If you want to
code in OpenSCAD then you need to learn OpenSCAD and its quirks and
not get hung up on terminology. At the end of the day, if your
program works does it matter if it was "functional" or "procedural"?
On Fri, Nov 26, 2021 at 9:19 AM Patrick Callahan
pat.callahan1@gmail.com wrote:
Sorry, It was an attempt at humor in a programming language. Never a
On 26.11.21 13:38, Patrick Callahan wrote:
Sure, but why?
array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
ciao,
Torsten.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I never need to do that because if a dimension is important I specify it in
my source code and make it so in the code. Do you want to measure other
people's designs?
On Fri, 26 Nov 2021 at 18:52, edmund ronald <edmundronald@gmail.com> wrote:
> I do have something difficult I need to do: somehow find a way to place a
> marker on the rendered object interactively and locate that point. Or even
> compute a distance between two markers. If I can figure out a way to do
> that in openscad I don't care whether it is functional or imperative or
> declarative, I like it just fine - and if I can't do that then I'll have to
> move to some other system which I would find unfortunate because so far
> after a few months openSCAD has always got the job done for me.
>
> Edmund
>
> On Fri, Nov 26, 2021 at 4:05 PM Adrian Mariano <avm4@cornell.edu> wrote:
>
>> I think if you want OpenSCAD programming to "click" the answer is to
>> write a bunch of programs where you try to do something difficult. If
>> you're trying to do something and you care about efficiency then you
>> should try to do that thing with OpenSCAD native matrix operations
>> first. For example, using the fold() function above to sum up a
>> simple vector of numbers is 40 times slower than using a vector
>> product, something like:
>>
>> sum_of_test = test*[for(i=test) 1]];
>>
>> The second choice for efficiency (and probably the first for
>> readability) is to use a list comprehension. Neither of these two
>> methods is "functional programming". List comprehensions can do a lot
>> of things---anything where the value at one output point is
>> independent of the value at other output points. There's the business
>> of not being able to redefine variables, which can be an occasional
>> nuisance, but it's not a big issue. The main consequence is that you
>> have to handle all cases all at once with the ternary operator, or you
>> have to introduce more variables. But if you can't use a list
>> comprehension because the answer depends on previous answers, then you
>> need to use recursion. That's when things look "functional". If
>> you're lucky you can do this with tail recursion, and get more
>> efficiency. If not you'll be in a less efficient situation. The last
>> option is the C-style for loop, which in my testing I have found to be
>> the slowest option, slower than recursion. It's hard to use (usually
>> harder than recursion).
>>
>> So is OpenSCAD a "functional language"? I'm not sure. A lot of
>> OpenSCAD programming doesn't really seem functional. If you want to
>> code in OpenSCAD then you need to learn OpenSCAD and its quirks and
>> not get hung up on terminology. At the end of the day, if your
>> program works does it matter if it was "functional" or "procedural"?
>>
>> On Fri, Nov 26, 2021 at 9:19 AM Patrick Callahan
>> <pat.callahan1@gmail.com> wrote:
>> >
>> > Sorry, It was an attempt at humor in a programming language. Never a
>> good idea.
>> >
>> > -Pat
>> >
>> > On Fri, Nov 26, 2021 at 8:33 AM Torsten Paul <Torsten.Paul@gmx.de>
>> wrote:
>> >>
>> >> On 26.11.21 13:38, Patrick Callahan wrote:
>> >> > Can you do this?
>> >>
>> >> Sure, but why?
>> >>
>> >> array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
>> >>
>> >> ciao,
>> >> Torsten.
>> >> _______________________________________________
>> >> OpenSCAD mailing list
>> >> To unsubscribe send an email to discuss-leave@lists.openscad.org
>> >
>> > _______________________________________________
>> > OpenSCAD mailing list
>> > To unsubscribe send an email to discuss-leave@lists.openscad.org
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
WF
William F. Adams
Fri, Nov 26, 2021 8:26 PM
I do have something difficult I need to do: somehow find a way to place a marker
on the rendered object interactively and locate that point. Or even compute a
distance between two markers. If I can figure out a way to do that in openscad
I don't care whether it is functional or imperative or declarative, I like it just fine -
and if I can't do that then I'll have to move to some other system which I would
find unfortunate because so far after a few months openSCAD has always got the job done for me.
When I need to check a distance/position, I add in geometry as necessary to measure, usually prefacing it w/ a # so that it renders transparent, sometimes assigning it to a different colour.
William
edmund ronald wrote:
>I do have something difficult I need to do: somehow find a way to place a marker
>on the rendered object interactively and locate that point. Or even compute a
>distance between two markers. If I can figure out a way to do that in openscad
>I don't care whether it is functional or imperative or declarative, I like it just fine -
>and if I can't do that then I'll have to move to some other system which I would
>find unfortunate because so far after a few months openSCAD has always got the job done for me.
When I need to check a distance/position, I add in geometry as necessary to measure, usually prefacing it w/ a # so that it renders transparent, sometimes assigning it to a different colour.
William
ER
edmund ronald
Fri, Nov 26, 2021 8:30 PM
"I never do X" is not really an answer to a question.
My designs contain a bunch of curves, and then to be sure whether they fit
something I need to check.
I once interviewed a senior manager at IBM who told me, for quote to a
business magazine "We don't need mice and windows, we're not children".
A similar story was true of the Mac, where Steve Jobs vetoed arrow keys on
the Mac again because he didn't see a need for them.
More technically, openSCAD has a text based programming model, and a window
and mouse presentation layer. I fully agree that the programming model is
useful and powerful; I just need some added facilities in the presentation
layer. I have looked in the archives and people keep asking for this and
the answer given to them seems to be repeatedly that "real men know their
dimensions" :) I think someone has even tried to put a bounty on such a
measuring feature, which shows how desperate people are.
Edmund
Edmund
On Fri, Nov 26, 2021 at 8:07 PM nop head nop.head@gmail.com wrote:
I never need to do that because if a dimension is important I specify it
in my source code and make it so in the code. Do you want to measure other
people's designs?
On Fri, 26 Nov 2021 at 18:52, edmund ronald edmundronald@gmail.com
wrote:
I do have something difficult I need to do: somehow find a way to place a
marker on the rendered object interactively and locate that point. Or even
compute a distance between two markers. If I can figure out a way to do
that in openscad I don't care whether it is functional or imperative or
declarative, I like it just fine - and if I can't do that then I'll have to
move to some other system which I would find unfortunate because so far
after a few months openSCAD has always got the job done for me.
Edmund
On Fri, Nov 26, 2021 at 4:05 PM Adrian Mariano avm4@cornell.edu wrote:
I think if you want OpenSCAD programming to "click" the answer is to
write a bunch of programs where you try to do something difficult. If
you're trying to do something and you care about efficiency then you
should try to do that thing with OpenSCAD native matrix operations
first. For example, using the fold() function above to sum up a
simple vector of numbers is 40 times slower than using a vector
product, something like:
sum_of_test = test*[for(i=test) 1]];
The second choice for efficiency (and probably the first for
readability) is to use a list comprehension. Neither of these two
methods is "functional programming". List comprehensions can do a lot
of things---anything where the value at one output point is
independent of the value at other output points. There's the business
of not being able to redefine variables, which can be an occasional
nuisance, but it's not a big issue. The main consequence is that you
have to handle all cases all at once with the ternary operator, or you
have to introduce more variables. But if you can't use a list
comprehension because the answer depends on previous answers, then you
need to use recursion. That's when things look "functional". If
you're lucky you can do this with tail recursion, and get more
efficiency. If not you'll be in a less efficient situation. The last
option is the C-style for loop, which in my testing I have found to be
the slowest option, slower than recursion. It's hard to use (usually
harder than recursion).
So is OpenSCAD a "functional language"? I'm not sure. A lot of
OpenSCAD programming doesn't really seem functional. If you want to
code in OpenSCAD then you need to learn OpenSCAD and its quirks and
not get hung up on terminology. At the end of the day, if your
program works does it matter if it was "functional" or "procedural"?
On Fri, Nov 26, 2021 at 9:19 AM Patrick Callahan
pat.callahan1@gmail.com wrote:
Sorry, It was an attempt at humor in a programming language. Never a
On 26.11.21 13:38, Patrick Callahan wrote:
Sure, but why?
array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
ciao,
Torsten.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
"I never do X" is not really an answer to a question.
My designs contain a bunch of curves, and then to be sure whether they fit
something I need to check.
I once interviewed a senior manager at IBM who told me, for quote to a
business magazine "We don't need mice and windows, we're not children".
A similar story was true of the Mac, where Steve Jobs vetoed arrow keys on
the Mac again because _he_ didn't see a need for them.
More technically, openSCAD has a text based programming model, and a window
and mouse presentation layer. I fully agree that the programming model is
useful and powerful; I just need some added facilities in the presentation
layer. I have looked in the archives and people keep asking for this and
the answer given to them seems to be repeatedly that "real men know their
dimensions" :) I think someone has even tried to put a bounty on such a
measuring feature, which shows how desperate people are.
Edmund
Edmund
On Fri, Nov 26, 2021 at 8:07 PM nop head <nop.head@gmail.com> wrote:
> I never need to do that because if a dimension is important I specify it
> in my source code and make it so in the code. Do you want to measure other
> people's designs?
>
> On Fri, 26 Nov 2021 at 18:52, edmund ronald <edmundronald@gmail.com>
> wrote:
>
>> I do have something difficult I need to do: somehow find a way to place a
>> marker on the rendered object interactively and locate that point. Or even
>> compute a distance between two markers. If I can figure out a way to do
>> that in openscad I don't care whether it is functional or imperative or
>> declarative, I like it just fine - and if I can't do that then I'll have to
>> move to some other system which I would find unfortunate because so far
>> after a few months openSCAD has always got the job done for me.
>>
>> Edmund
>>
>> On Fri, Nov 26, 2021 at 4:05 PM Adrian Mariano <avm4@cornell.edu> wrote:
>>
>>> I think if you want OpenSCAD programming to "click" the answer is to
>>> write a bunch of programs where you try to do something difficult. If
>>> you're trying to do something and you care about efficiency then you
>>> should try to do that thing with OpenSCAD native matrix operations
>>> first. For example, using the fold() function above to sum up a
>>> simple vector of numbers is 40 times slower than using a vector
>>> product, something like:
>>>
>>> sum_of_test = test*[for(i=test) 1]];
>>>
>>> The second choice for efficiency (and probably the first for
>>> readability) is to use a list comprehension. Neither of these two
>>> methods is "functional programming". List comprehensions can do a lot
>>> of things---anything where the value at one output point is
>>> independent of the value at other output points. There's the business
>>> of not being able to redefine variables, which can be an occasional
>>> nuisance, but it's not a big issue. The main consequence is that you
>>> have to handle all cases all at once with the ternary operator, or you
>>> have to introduce more variables. But if you can't use a list
>>> comprehension because the answer depends on previous answers, then you
>>> need to use recursion. That's when things look "functional". If
>>> you're lucky you can do this with tail recursion, and get more
>>> efficiency. If not you'll be in a less efficient situation. The last
>>> option is the C-style for loop, which in my testing I have found to be
>>> the slowest option, slower than recursion. It's hard to use (usually
>>> harder than recursion).
>>>
>>> So is OpenSCAD a "functional language"? I'm not sure. A lot of
>>> OpenSCAD programming doesn't really seem functional. If you want to
>>> code in OpenSCAD then you need to learn OpenSCAD and its quirks and
>>> not get hung up on terminology. At the end of the day, if your
>>> program works does it matter if it was "functional" or "procedural"?
>>>
>>> On Fri, Nov 26, 2021 at 9:19 AM Patrick Callahan
>>> <pat.callahan1@gmail.com> wrote:
>>> >
>>> > Sorry, It was an attempt at humor in a programming language. Never a
>>> good idea.
>>> >
>>> > -Pat
>>> >
>>> > On Fri, Nov 26, 2021 at 8:33 AM Torsten Paul <Torsten.Paul@gmx.de>
>>> wrote:
>>> >>
>>> >> On 26.11.21 13:38, Patrick Callahan wrote:
>>> >> > Can you do this?
>>> >>
>>> >> Sure, but why?
>>> >>
>>> >> array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
>>> >>
>>> >> ciao,
>>> >> Torsten.
>>> >> _______________________________________________
>>> >> OpenSCAD mailing list
>>> >> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>> >
>>> > _______________________________________________
>>> > OpenSCAD mailing list
>>> > To unsubscribe send an email to discuss-leave@lists.openscad.org
>>> _______________________________________________
>>> OpenSCAD mailing list
>>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>>
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
NH
nop head
Fri, Nov 26, 2021 9:27 PM
Well OpenSCAD is a language for defining geometry in code. So if a curve
has to miss something or meet something I express that in the code. I don't
do trial and error. When you preview the geometry is just drawn as pixels,
so there isn't really a way to get dimensions from them, hence why the
requests are not implemented. Once rendered with F6 measurements could be
made like NetFabb is able to measure STLs, but it is a lot of work to
implement that, so it won't happen until a developer with the skill to do
it thinks it is worth spending time on.
[image: image.png]
This is what I would use if I had to measure something. but in this case,
and all others, I can write an expression for the distance and
OpenSCAD echos 17.9.
On Fri, 26 Nov 2021 at 20:31, edmund ronald edmundronald@gmail.com wrote:
"I never do X" is not really an answer to a question.
My designs contain a bunch of curves, and then to be sure whether they fit
something I need to check.
I once interviewed a senior manager at IBM who told me, for quote to a
business magazine "We don't need mice and windows, we're not children".
A similar story was true of the Mac, where Steve Jobs vetoed arrow keys on
the Mac again because he didn't see a need for them.
More technically, openSCAD has a text based programming model, and a
window and mouse presentation layer. I fully agree that the programming
model is useful and powerful; I just need some added facilities in the
presentation layer. I have looked in the archives and people keep asking
for this and the answer given to them seems to be repeatedly that "real men
know their dimensions" :) I think someone has even tried to put a bounty on
such a measuring feature, which shows how desperate people are.
Edmund
Edmund
On Fri, Nov 26, 2021 at 8:07 PM nop head nop.head@gmail.com wrote:
I never need to do that because if a dimension is important I specify it
in my source code and make it so in the code. Do you want to measure other
people's designs?
On Fri, 26 Nov 2021 at 18:52, edmund ronald edmundronald@gmail.com
wrote:
I do have something difficult I need to do: somehow find a way to place
a marker on the rendered object interactively and locate that point. Or
even compute a distance between two markers. If I can figure out a way to
do that in openscad I don't care whether it is functional or imperative or
declarative, I like it just fine - and if I can't do that then I'll have to
move to some other system which I would find unfortunate because so far
after a few months openSCAD has always got the job done for me.
Edmund
On Fri, Nov 26, 2021 at 4:05 PM Adrian Mariano avm4@cornell.edu wrote:
I think if you want OpenSCAD programming to "click" the answer is to
write a bunch of programs where you try to do something difficult. If
you're trying to do something and you care about efficiency then you
should try to do that thing with OpenSCAD native matrix operations
first. For example, using the fold() function above to sum up a
simple vector of numbers is 40 times slower than using a vector
product, something like:
sum_of_test = test*[for(i=test) 1]];
The second choice for efficiency (and probably the first for
readability) is to use a list comprehension. Neither of these two
methods is "functional programming". List comprehensions can do a lot
of things---anything where the value at one output point is
independent of the value at other output points. There's the business
of not being able to redefine variables, which can be an occasional
nuisance, but it's not a big issue. The main consequence is that you
have to handle all cases all at once with the ternary operator, or you
have to introduce more variables. But if you can't use a list
comprehension because the answer depends on previous answers, then you
need to use recursion. That's when things look "functional". If
you're lucky you can do this with tail recursion, and get more
efficiency. If not you'll be in a less efficient situation. The last
option is the C-style for loop, which in my testing I have found to be
the slowest option, slower than recursion. It's hard to use (usually
harder than recursion).
So is OpenSCAD a "functional language"? I'm not sure. A lot of
OpenSCAD programming doesn't really seem functional. If you want to
code in OpenSCAD then you need to learn OpenSCAD and its quirks and
not get hung up on terminology. At the end of the day, if your
program works does it matter if it was "functional" or "procedural"?
On Fri, Nov 26, 2021 at 9:19 AM Patrick Callahan
pat.callahan1@gmail.com wrote:
Sorry, It was an attempt at humor in a programming language. Never a
On 26.11.21 13:38, Patrick Callahan wrote:
Sure, but why?
array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
ciao,
Torsten.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Well OpenSCAD is a language for defining geometry in code. So if a curve
has to miss something or meet something I express that in the code. I don't
do trial and error. When you preview the geometry is just drawn as pixels,
so there isn't really a way to get dimensions from them, hence why the
requests are not implemented. Once rendered with F6 measurements could be
made like NetFabb is able to measure STLs, but it is a lot of work to
implement that, so it won't happen until a developer with the skill to do
it thinks it is worth spending time on.
[image: image.png]
This is what I would use if I had to measure something. but in this case,
and all others, I can write an expression for the distance and
OpenSCAD echos 17.9.
On Fri, 26 Nov 2021 at 20:31, edmund ronald <edmundronald@gmail.com> wrote:
> "I never do X" is not really an answer to a question.
> My designs contain a bunch of curves, and then to be sure whether they fit
> something I need to check.
> I once interviewed a senior manager at IBM who told me, for quote to a
> business magazine "We don't need mice and windows, we're not children".
> A similar story was true of the Mac, where Steve Jobs vetoed arrow keys on
> the Mac again because _he_ didn't see a need for them.
>
> More technically, openSCAD has a text based programming model, and a
> window and mouse presentation layer. I fully agree that the programming
> model is useful and powerful; I just need some added facilities in the
> presentation layer. I have looked in the archives and people keep asking
> for this and the answer given to them seems to be repeatedly that "real men
> know their dimensions" :) I think someone has even tried to put a bounty on
> such a measuring feature, which shows how desperate people are.
>
> Edmund
>
> Edmund
>
>
> On Fri, Nov 26, 2021 at 8:07 PM nop head <nop.head@gmail.com> wrote:
>
>> I never need to do that because if a dimension is important I specify it
>> in my source code and make it so in the code. Do you want to measure other
>> people's designs?
>>
>> On Fri, 26 Nov 2021 at 18:52, edmund ronald <edmundronald@gmail.com>
>> wrote:
>>
>>> I do have something difficult I need to do: somehow find a way to place
>>> a marker on the rendered object interactively and locate that point. Or
>>> even compute a distance between two markers. If I can figure out a way to
>>> do that in openscad I don't care whether it is functional or imperative or
>>> declarative, I like it just fine - and if I can't do that then I'll have to
>>> move to some other system which I would find unfortunate because so far
>>> after a few months openSCAD has always got the job done for me.
>>>
>>> Edmund
>>>
>>> On Fri, Nov 26, 2021 at 4:05 PM Adrian Mariano <avm4@cornell.edu> wrote:
>>>
>>>> I think if you want OpenSCAD programming to "click" the answer is to
>>>> write a bunch of programs where you try to do something difficult. If
>>>> you're trying to do something and you care about efficiency then you
>>>> should try to do that thing with OpenSCAD native matrix operations
>>>> first. For example, using the fold() function above to sum up a
>>>> simple vector of numbers is 40 times slower than using a vector
>>>> product, something like:
>>>>
>>>> sum_of_test = test*[for(i=test) 1]];
>>>>
>>>> The second choice for efficiency (and probably the first for
>>>> readability) is to use a list comprehension. Neither of these two
>>>> methods is "functional programming". List comprehensions can do a lot
>>>> of things---anything where the value at one output point is
>>>> independent of the value at other output points. There's the business
>>>> of not being able to redefine variables, which can be an occasional
>>>> nuisance, but it's not a big issue. The main consequence is that you
>>>> have to handle all cases all at once with the ternary operator, or you
>>>> have to introduce more variables. But if you can't use a list
>>>> comprehension because the answer depends on previous answers, then you
>>>> need to use recursion. That's when things look "functional". If
>>>> you're lucky you can do this with tail recursion, and get more
>>>> efficiency. If not you'll be in a less efficient situation. The last
>>>> option is the C-style for loop, which in my testing I have found to be
>>>> the slowest option, slower than recursion. It's hard to use (usually
>>>> harder than recursion).
>>>>
>>>> So is OpenSCAD a "functional language"? I'm not sure. A lot of
>>>> OpenSCAD programming doesn't really seem functional. If you want to
>>>> code in OpenSCAD then you need to learn OpenSCAD and its quirks and
>>>> not get hung up on terminology. At the end of the day, if your
>>>> program works does it matter if it was "functional" or "procedural"?
>>>>
>>>> On Fri, Nov 26, 2021 at 9:19 AM Patrick Callahan
>>>> <pat.callahan1@gmail.com> wrote:
>>>> >
>>>> > Sorry, It was an attempt at humor in a programming language. Never a
>>>> good idea.
>>>> >
>>>> > -Pat
>>>> >
>>>> > On Fri, Nov 26, 2021 at 8:33 AM Torsten Paul <Torsten.Paul@gmx.de>
>>>> wrote:
>>>> >>
>>>> >> On 26.11.21 13:38, Patrick Callahan wrote:
>>>> >> > Can you do this?
>>>> >>
>>>> >> Sure, but why?
>>>> >>
>>>> >> array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
>>>> >>
>>>> >> ciao,
>>>> >> Torsten.
>>>> >> _______________________________________________
>>>> >> OpenSCAD mailing list
>>>> >> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>>> >
>>>> > _______________________________________________
>>>> > OpenSCAD mailing list
>>>> > To unsubscribe send an email to discuss-leave@lists.openscad.org
>>>> _______________________________________________
>>>> OpenSCAD mailing list
>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>>>
>>> _______________________________________________
>>> OpenSCAD mailing list
>>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>>
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
AM
Adrian Mariano
Fri, Nov 26, 2021 9:53 PM
This was a discussion about coding and it seems you're trying to divert it
to a totally different subject, since making measurements has nothing to do
with coding. It seems to me that if this feature were implemented it would
be of very limited utility, because there's no way to unambiguously define
a point by clicking the mouse. If you want to know that some curved
surface meets some criterion, how can you define via the mouse a point on
that curved surface that is actually well-defined? This seems impossible,
unless you have some way to define the point such as intersection with some
other pair of surfaces. I think I have to agree with nophead that if you
have some constraints you need to meet then you should use the programmatic
interface to build a model that meets them, not construct an ad-hoc model
and try to verify that you've met the constraints. If this doesn't seem
adequate for your problem then I guess OpenSCAD isn't suited to your needs.
On Fri, Nov 26, 2021 at 4:29 PM nop head nop.head@gmail.com wrote:
Well OpenSCAD is a language for defining geometry in code. So if a curve
has to miss something or meet something I express that in the code. I don't
do trial and error. When you preview the geometry is just drawn as pixels,
so there isn't really a way to get dimensions from them, hence why the
requests are not implemented. Once rendered with F6 measurements could be
made like NetFabb is able to measure STLs, but it is a lot of work to
implement that, so it won't happen until a developer with the skill to do
it thinks it is worth spending time on.
[image: image.png]
This is what I would use if I had to measure something. but in this case,
and all others, I can write an expression for the distance and
OpenSCAD echos 17.9.
On Fri, 26 Nov 2021 at 20:31, edmund ronald edmundronald@gmail.com
wrote:
"I never do X" is not really an answer to a question.
My designs contain a bunch of curves, and then to be sure whether they
fit something I need to check.
I once interviewed a senior manager at IBM who told me, for quote to a
business magazine "We don't need mice and windows, we're not children".
A similar story was true of the Mac, where Steve Jobs vetoed arrow keys
on the Mac again because he didn't see a need for them.
More technically, openSCAD has a text based programming model, and a
window and mouse presentation layer. I fully agree that the programming
model is useful and powerful; I just need some added facilities in the
presentation layer. I have looked in the archives and people keep asking
for this and the answer given to them seems to be repeatedly that "real men
know their dimensions" :) I think someone has even tried to put a bounty on
such a measuring feature, which shows how desperate people are.
Edmund
Edmund
On Fri, Nov 26, 2021 at 8:07 PM nop head nop.head@gmail.com wrote:
I never need to do that because if a dimension is important I specify it
in my source code and make it so in the code. Do you want to measure other
people's designs?
On Fri, 26 Nov 2021 at 18:52, edmund ronald edmundronald@gmail.com
wrote:
I do have something difficult I need to do: somehow find a way to place
a marker on the rendered object interactively and locate that point. Or
even compute a distance between two markers. If I can figure out a way to
do that in openscad I don't care whether it is functional or imperative or
declarative, I like it just fine - and if I can't do that then I'll have to
move to some other system which I would find unfortunate because so far
after a few months openSCAD has always got the job done for me.
Edmund
On Fri, Nov 26, 2021 at 4:05 PM Adrian Mariano avm4@cornell.edu
wrote:
I think if you want OpenSCAD programming to "click" the answer is to
write a bunch of programs where you try to do something difficult. If
you're trying to do something and you care about efficiency then you
should try to do that thing with OpenSCAD native matrix operations
first. For example, using the fold() function above to sum up a
simple vector of numbers is 40 times slower than using a vector
product, something like:
sum_of_test = test*[for(i=test) 1]];
The second choice for efficiency (and probably the first for
readability) is to use a list comprehension. Neither of these two
methods is "functional programming". List comprehensions can do a lot
of things---anything where the value at one output point is
independent of the value at other output points. There's the business
of not being able to redefine variables, which can be an occasional
nuisance, but it's not a big issue. The main consequence is that you
have to handle all cases all at once with the ternary operator, or you
have to introduce more variables. But if you can't use a list
comprehension because the answer depends on previous answers, then you
need to use recursion. That's when things look "functional". If
you're lucky you can do this with tail recursion, and get more
efficiency. If not you'll be in a less efficient situation. The last
option is the C-style for loop, which in my testing I have found to be
the slowest option, slower than recursion. It's hard to use (usually
harder than recursion).
So is OpenSCAD a "functional language"? I'm not sure. A lot of
OpenSCAD programming doesn't really seem functional. If you want to
code in OpenSCAD then you need to learn OpenSCAD and its quirks and
not get hung up on terminology. At the end of the day, if your
program works does it matter if it was "functional" or "procedural"?
On Fri, Nov 26, 2021 at 9:19 AM Patrick Callahan
pat.callahan1@gmail.com wrote:
Sorry, It was an attempt at humor in a programming language. Never
On 26.11.21 13:38, Patrick Callahan wrote:
Sure, but why?
array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
ciao,
Torsten.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
This was a discussion about coding and it seems you're trying to divert it
to a totally different subject, since making measurements has nothing to do
with coding. It seems to me that if this feature were implemented it would
be of very limited utility, because there's no way to unambiguously define
a point by clicking the mouse. If you want to know that some curved
surface meets some criterion, how can you define via the mouse a point on
that curved surface that is actually well-defined? This seems impossible,
unless you have some way to define the point such as intersection with some
other pair of surfaces. I think I have to agree with nophead that if you
have some constraints you need to meet then you should use the programmatic
interface to build a model that meets them, not construct an ad-hoc model
and try to verify that you've met the constraints. If this doesn't seem
adequate for your problem then I guess OpenSCAD isn't suited to your needs.
On Fri, Nov 26, 2021 at 4:29 PM nop head <nop.head@gmail.com> wrote:
> Well OpenSCAD is a language for defining geometry in code. So if a curve
> has to miss something or meet something I express that in the code. I don't
> do trial and error. When you preview the geometry is just drawn as pixels,
> so there isn't really a way to get dimensions from them, hence why the
> requests are not implemented. Once rendered with F6 measurements could be
> made like NetFabb is able to measure STLs, but it is a lot of work to
> implement that, so it won't happen until a developer with the skill to do
> it thinks it is worth spending time on.
>
> [image: image.png]
>
> This is what I would use if I had to measure something. but in this case,
> and all others, I can write an expression for the distance and
> OpenSCAD echos 17.9.
>
> On Fri, 26 Nov 2021 at 20:31, edmund ronald <edmundronald@gmail.com>
> wrote:
>
>> "I never do X" is not really an answer to a question.
>> My designs contain a bunch of curves, and then to be sure whether they
>> fit something I need to check.
>> I once interviewed a senior manager at IBM who told me, for quote to a
>> business magazine "We don't need mice and windows, we're not children".
>> A similar story was true of the Mac, where Steve Jobs vetoed arrow keys
>> on the Mac again because _he_ didn't see a need for them.
>>
>> More technically, openSCAD has a text based programming model, and a
>> window and mouse presentation layer. I fully agree that the programming
>> model is useful and powerful; I just need some added facilities in the
>> presentation layer. I have looked in the archives and people keep asking
>> for this and the answer given to them seems to be repeatedly that "real men
>> know their dimensions" :) I think someone has even tried to put a bounty on
>> such a measuring feature, which shows how desperate people are.
>>
>> Edmund
>>
>> Edmund
>>
>>
>> On Fri, Nov 26, 2021 at 8:07 PM nop head <nop.head@gmail.com> wrote:
>>
>>> I never need to do that because if a dimension is important I specify it
>>> in my source code and make it so in the code. Do you want to measure other
>>> people's designs?
>>>
>>> On Fri, 26 Nov 2021 at 18:52, edmund ronald <edmundronald@gmail.com>
>>> wrote:
>>>
>>>> I do have something difficult I need to do: somehow find a way to place
>>>> a marker on the rendered object interactively and locate that point. Or
>>>> even compute a distance between two markers. If I can figure out a way to
>>>> do that in openscad I don't care whether it is functional or imperative or
>>>> declarative, I like it just fine - and if I can't do that then I'll have to
>>>> move to some other system which I would find unfortunate because so far
>>>> after a few months openSCAD has always got the job done for me.
>>>>
>>>> Edmund
>>>>
>>>> On Fri, Nov 26, 2021 at 4:05 PM Adrian Mariano <avm4@cornell.edu>
>>>> wrote:
>>>>
>>>>> I think if you want OpenSCAD programming to "click" the answer is to
>>>>> write a bunch of programs where you try to do something difficult. If
>>>>> you're trying to do something and you care about efficiency then you
>>>>> should try to do that thing with OpenSCAD native matrix operations
>>>>> first. For example, using the fold() function above to sum up a
>>>>> simple vector of numbers is 40 times slower than using a vector
>>>>> product, something like:
>>>>>
>>>>> sum_of_test = test*[for(i=test) 1]];
>>>>>
>>>>> The second choice for efficiency (and probably the first for
>>>>> readability) is to use a list comprehension. Neither of these two
>>>>> methods is "functional programming". List comprehensions can do a lot
>>>>> of things---anything where the value at one output point is
>>>>> independent of the value at other output points. There's the business
>>>>> of not being able to redefine variables, which can be an occasional
>>>>> nuisance, but it's not a big issue. The main consequence is that you
>>>>> have to handle all cases all at once with the ternary operator, or you
>>>>> have to introduce more variables. But if you can't use a list
>>>>> comprehension because the answer depends on previous answers, then you
>>>>> need to use recursion. That's when things look "functional". If
>>>>> you're lucky you can do this with tail recursion, and get more
>>>>> efficiency. If not you'll be in a less efficient situation. The last
>>>>> option is the C-style for loop, which in my testing I have found to be
>>>>> the slowest option, slower than recursion. It's hard to use (usually
>>>>> harder than recursion).
>>>>>
>>>>> So is OpenSCAD a "functional language"? I'm not sure. A lot of
>>>>> OpenSCAD programming doesn't really seem functional. If you want to
>>>>> code in OpenSCAD then you need to learn OpenSCAD and its quirks and
>>>>> not get hung up on terminology. At the end of the day, if your
>>>>> program works does it matter if it was "functional" or "procedural"?
>>>>>
>>>>> On Fri, Nov 26, 2021 at 9:19 AM Patrick Callahan
>>>>> <pat.callahan1@gmail.com> wrote:
>>>>> >
>>>>> > Sorry, It was an attempt at humor in a programming language. Never
>>>>> a good idea.
>>>>> >
>>>>> > -Pat
>>>>> >
>>>>> > On Fri, Nov 26, 2021 at 8:33 AM Torsten Paul <Torsten.Paul@gmx.de>
>>>>> wrote:
>>>>> >>
>>>>> >> On 26.11.21 13:38, Patrick Callahan wrote:
>>>>> >> > Can you do this?
>>>>> >>
>>>>> >> Sure, but why?
>>>>> >>
>>>>> >> array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
>>>>> >>
>>>>> >> ciao,
>>>>> >> Torsten.
>>>>> >> _______________________________________________
>>>>> >> OpenSCAD mailing list
>>>>> >> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>>>> >
>>>>> > _______________________________________________
>>>>> > OpenSCAD mailing list
>>>>> > To unsubscribe send an email to discuss-leave@lists.openscad.org
>>>>> _______________________________________________
>>>>> OpenSCAD mailing list
>>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>>>>
>>>> _______________________________________________
>>>> OpenSCAD mailing list
>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>>>
>>> _______________________________________________
>>> OpenSCAD mailing list
>>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>>
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
ER
edmund ronald
Sat, Nov 27, 2021 12:31 AM
We fully agree about the fact that making a measurement has nothing to do
with coding. It is a coding environment operation which is akin to
interactively zooming or rotating a render. To that extent it can of course
be omitted from the environment, to the same degree as it is completely
redundant to have a code editor or a visual preview or render inside
OpenScad as many other programs are available to edit code or render a
mesh.
As someone who -of course purely accidentally- acquired a maths PhD, I
would of course fully agree that previews are redundant and users should be
able to type in code and visualise an object in their mind as they design
it; in fact my ability to do this is what causes me to use OpenSCAD in the
first place. However I do understand that some other people would prefer
the assistance of a built-in interactive visualiser, and so I would beg you
to consider that the requests for an interactive measurement aid in the
context not of the language but of the visualiser.
And I would like to leave you with a thought: It is easy to define an
object by a syntax tree - just as it is easy to define a program as a piece
of code. But to visualise the actual physical structure corresponding to an
OpenScad syntax tree, bugs and all is as hard as predicting the behaviour
of a piece of conventional computer code, bugs and all. There is no
dishonor in providing debugging tools in a programming environment.
Edmund
On Fri, Nov 26, 2021 at 10:53 PM Adrian Mariano avm4@cornell.edu wrote:
This was a discussion about coding and it seems you're trying to divert it
to a totally different subject, since making measurements has nothing to do
with coding. It seems to me that if this feature were implemented it would
be of very limited utility, because there's no way to unambiguously define
a point by clicking the mouse. If you want to know that some curved
surface meets some criterion, how can you define via the mouse a point on
that curved surface that is actually well-defined? This seems impossible,
unless you have some way to define the point such as intersection with some
other pair of surfaces. I think I have to agree with nophead that if you
have some constraints you need to meet then you should use the programmatic
interface to build a model that meets them, not construct an ad-hoc model
and try to verify that you've met the constraints. If this doesn't seem
adequate for your problem then I guess OpenSCAD isn't suited to your needs.
On Fri, Nov 26, 2021 at 4:29 PM nop head nop.head@gmail.com wrote:
Well OpenSCAD is a language for defining geometry in code. So if a curve
has to miss something or meet something I express that in the code. I don't
do trial and error. When you preview the geometry is just drawn as pixels,
so there isn't really a way to get dimensions from them, hence why the
requests are not implemented. Once rendered with F6 measurements could be
made like NetFabb is able to measure STLs, but it is a lot of work to
implement that, so it won't happen until a developer with the skill to do
it thinks it is worth spending time on.
[image: image.png]
This is what I would use if I had to measure something. but in this case,
and all others, I can write an expression for the distance and
OpenSCAD echos 17.9.
On Fri, 26 Nov 2021 at 20:31, edmund ronald edmundronald@gmail.com
wrote:
"I never do X" is not really an answer to a question.
My designs contain a bunch of curves, and then to be sure whether they
fit something I need to check.
I once interviewed a senior manager at IBM who told me, for quote to a
business magazine "We don't need mice and windows, we're not children".
A similar story was true of the Mac, where Steve Jobs vetoed arrow keys
on the Mac again because he didn't see a need for them.
More technically, openSCAD has a text based programming model, and a
window and mouse presentation layer. I fully agree that the programming
model is useful and powerful; I just need some added facilities in the
presentation layer. I have looked in the archives and people keep asking
for this and the answer given to them seems to be repeatedly that "real men
know their dimensions" :) I think someone has even tried to put a bounty on
such a measuring feature, which shows how desperate people are.
Edmund
Edmund
On Fri, Nov 26, 2021 at 8:07 PM nop head nop.head@gmail.com wrote:
I never need to do that because if a dimension is important I
specify it in my source code and make it so in the code. Do you want to
measure other people's designs?
On Fri, 26 Nov 2021 at 18:52, edmund ronald edmundronald@gmail.com
wrote:
I do have something difficult I need to do: somehow find a way to
place a marker on the rendered object interactively and locate that point.
Or even compute a distance between two markers. If I can figure out a way
to do that in openscad I don't care whether it is functional or imperative
or declarative, I like it just fine - and if I can't do that then I'll have
to move to some other system which I would find unfortunate because so far
after a few months openSCAD has always got the job done for me.
Edmund
On Fri, Nov 26, 2021 at 4:05 PM Adrian Mariano avm4@cornell.edu
wrote:
I think if you want OpenSCAD programming to "click" the answer is to
write a bunch of programs where you try to do something difficult. If
you're trying to do something and you care about efficiency then you
should try to do that thing with OpenSCAD native matrix operations
first. For example, using the fold() function above to sum up a
simple vector of numbers is 40 times slower than using a vector
product, something like:
sum_of_test = test*[for(i=test) 1]];
The second choice for efficiency (and probably the first for
readability) is to use a list comprehension. Neither of these two
methods is "functional programming". List comprehensions can do a lot
of things---anything where the value at one output point is
independent of the value at other output points. There's the business
of not being able to redefine variables, which can be an occasional
nuisance, but it's not a big issue. The main consequence is that you
have to handle all cases all at once with the ternary operator, or you
have to introduce more variables. But if you can't use a list
comprehension because the answer depends on previous answers, then you
need to use recursion. That's when things look "functional". If
you're lucky you can do this with tail recursion, and get more
efficiency. If not you'll be in a less efficient situation. The last
option is the C-style for loop, which in my testing I have found to be
the slowest option, slower than recursion. It's hard to use (usually
harder than recursion).
So is OpenSCAD a "functional language"? I'm not sure. A lot of
OpenSCAD programming doesn't really seem functional. If you want to
code in OpenSCAD then you need to learn OpenSCAD and its quirks and
not get hung up on terminology. At the end of the day, if your
program works does it matter if it was "functional" or "procedural"?
On Fri, Nov 26, 2021 at 9:19 AM Patrick Callahan
pat.callahan1@gmail.com wrote:
Sorry, It was an attempt at humor in a programming language. Never
On 26.11.21 13:38, Patrick Callahan wrote:
Sure, but why?
array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
ciao,
Torsten.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
We fully agree about the fact that making a measurement has nothing to do
with coding. It is a coding environment operation which is akin to
interactively zooming or rotating a render. To that extent it can of course
be omitted from the environment, to the same degree as it is completely
redundant to have a code editor or a visual preview or render inside
OpenScad as many other programs are available to edit code or render a
mesh.
As someone who -of course purely accidentally- acquired a maths PhD, I
would of course fully agree that previews are redundant and users should be
able to type in code and visualise an object in their mind as they design
it; in fact my ability to do this is what causes me to use OpenSCAD in the
first place. However I do understand that some other people would prefer
the assistance of a built-in interactive visualiser, and so I would beg you
to consider that the requests for an interactive measurement aid _in the
context not of the language but of the visualiser_.
And I would like to leave you with a thought: It is easy to define an
object by a syntax tree - just as it is easy to define a program as a piece
of code. But to visualise the actual physical structure corresponding to an
OpenScad syntax tree, bugs and all is as hard as predicting the behaviour
of a piece of conventional computer code, bugs and all. There is no
dishonor in providing debugging tools in a programming environment.
Edmund
On Fri, Nov 26, 2021 at 10:53 PM Adrian Mariano <avm4@cornell.edu> wrote:
> This was a discussion about coding and it seems you're trying to divert it
> to a totally different subject, since making measurements has nothing to do
> with coding. It seems to me that if this feature were implemented it would
> be of very limited utility, because there's no way to unambiguously define
> a point by clicking the mouse. If you want to know that some curved
> surface meets some criterion, how can you define via the mouse a point on
> that curved surface that is actually well-defined? This seems impossible,
> unless you have some way to define the point such as intersection with some
> other pair of surfaces. I think I have to agree with nophead that if you
> have some constraints you need to meet then you should use the programmatic
> interface to build a model that meets them, not construct an ad-hoc model
> and try to verify that you've met the constraints. If this doesn't seem
> adequate for your problem then I guess OpenSCAD isn't suited to your needs.
>
>
> On Fri, Nov 26, 2021 at 4:29 PM nop head <nop.head@gmail.com> wrote:
>
>> Well OpenSCAD is a language for defining geometry in code. So if a curve
>> has to miss something or meet something I express that in the code. I don't
>> do trial and error. When you preview the geometry is just drawn as pixels,
>> so there isn't really a way to get dimensions from them, hence why the
>> requests are not implemented. Once rendered with F6 measurements could be
>> made like NetFabb is able to measure STLs, but it is a lot of work to
>> implement that, so it won't happen until a developer with the skill to do
>> it thinks it is worth spending time on.
>>
>> [image: image.png]
>>
>> This is what I would use if I had to measure something. but in this case,
>> and all others, I can write an expression for the distance and
>> OpenSCAD echos 17.9.
>>
>> On Fri, 26 Nov 2021 at 20:31, edmund ronald <edmundronald@gmail.com>
>> wrote:
>>
>>> "I never do X" is not really an answer to a question.
>>> My designs contain a bunch of curves, and then to be sure whether they
>>> fit something I need to check.
>>> I once interviewed a senior manager at IBM who told me, for quote to a
>>> business magazine "We don't need mice and windows, we're not children".
>>> A similar story was true of the Mac, where Steve Jobs vetoed arrow keys
>>> on the Mac again because _he_ didn't see a need for them.
>>>
>>> More technically, openSCAD has a text based programming model, and a
>>> window and mouse presentation layer. I fully agree that the programming
>>> model is useful and powerful; I just need some added facilities in the
>>> presentation layer. I have looked in the archives and people keep asking
>>> for this and the answer given to them seems to be repeatedly that "real men
>>> know their dimensions" :) I think someone has even tried to put a bounty on
>>> such a measuring feature, which shows how desperate people are.
>>>
>>> Edmund
>>>
>>> Edmund
>>>
>>>
>>> On Fri, Nov 26, 2021 at 8:07 PM nop head <nop.head@gmail.com> wrote:
>>>
>>>> I never need to do that because if a dimension is important I
>>>> specify it in my source code and make it so in the code. Do you want to
>>>> measure other people's designs?
>>>>
>>>> On Fri, 26 Nov 2021 at 18:52, edmund ronald <edmundronald@gmail.com>
>>>> wrote:
>>>>
>>>>> I do have something difficult I need to do: somehow find a way to
>>>>> place a marker on the rendered object interactively and locate that point.
>>>>> Or even compute a distance between two markers. If I can figure out a way
>>>>> to do that in openscad I don't care whether it is functional or imperative
>>>>> or declarative, I like it just fine - and if I can't do that then I'll have
>>>>> to move to some other system which I would find unfortunate because so far
>>>>> after a few months openSCAD has always got the job done for me.
>>>>>
>>>>> Edmund
>>>>>
>>>>> On Fri, Nov 26, 2021 at 4:05 PM Adrian Mariano <avm4@cornell.edu>
>>>>> wrote:
>>>>>
>>>>>> I think if you want OpenSCAD programming to "click" the answer is to
>>>>>> write a bunch of programs where you try to do something difficult. If
>>>>>> you're trying to do something and you care about efficiency then you
>>>>>> should try to do that thing with OpenSCAD native matrix operations
>>>>>> first. For example, using the fold() function above to sum up a
>>>>>> simple vector of numbers is 40 times slower than using a vector
>>>>>> product, something like:
>>>>>>
>>>>>> sum_of_test = test*[for(i=test) 1]];
>>>>>>
>>>>>> The second choice for efficiency (and probably the first for
>>>>>> readability) is to use a list comprehension. Neither of these two
>>>>>> methods is "functional programming". List comprehensions can do a lot
>>>>>> of things---anything where the value at one output point is
>>>>>> independent of the value at other output points. There's the business
>>>>>> of not being able to redefine variables, which can be an occasional
>>>>>> nuisance, but it's not a big issue. The main consequence is that you
>>>>>> have to handle all cases all at once with the ternary operator, or you
>>>>>> have to introduce more variables. But if you can't use a list
>>>>>> comprehension because the answer depends on previous answers, then you
>>>>>> need to use recursion. That's when things look "functional". If
>>>>>> you're lucky you can do this with tail recursion, and get more
>>>>>> efficiency. If not you'll be in a less efficient situation. The last
>>>>>> option is the C-style for loop, which in my testing I have found to be
>>>>>> the slowest option, slower than recursion. It's hard to use (usually
>>>>>> harder than recursion).
>>>>>>
>>>>>> So is OpenSCAD a "functional language"? I'm not sure. A lot of
>>>>>> OpenSCAD programming doesn't really seem functional. If you want to
>>>>>> code in OpenSCAD then you need to learn OpenSCAD and its quirks and
>>>>>> not get hung up on terminology. At the end of the day, if your
>>>>>> program works does it matter if it was "functional" or "procedural"?
>>>>>>
>>>>>> On Fri, Nov 26, 2021 at 9:19 AM Patrick Callahan
>>>>>> <pat.callahan1@gmail.com> wrote:
>>>>>> >
>>>>>> > Sorry, It was an attempt at humor in a programming language. Never
>>>>>> a good idea.
>>>>>> >
>>>>>> > -Pat
>>>>>> >
>>>>>> > On Fri, Nov 26, 2021 at 8:33 AM Torsten Paul <Torsten.Paul@gmx.de>
>>>>>> wrote:
>>>>>> >>
>>>>>> >> On 26.11.21 13:38, Patrick Callahan wrote:
>>>>>> >> > Can you do this?
>>>>>> >>
>>>>>> >> Sure, but why?
>>>>>> >>
>>>>>> >> array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
>>>>>> >>
>>>>>> >> ciao,
>>>>>> >> Torsten.
>>>>>> >> _______________________________________________
>>>>>> >> OpenSCAD mailing list
>>>>>> >> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>>>>> >
>>>>>> > _______________________________________________
>>>>>> > OpenSCAD mailing list
>>>>>> > To unsubscribe send an email to discuss-leave@lists.openscad.org
>>>>>> _______________________________________________
>>>>>> OpenSCAD mailing list
>>>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>>>>>
>>>>> _______________________________________________
>>>>> OpenSCAD mailing list
>>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>>>>
>>>> _______________________________________________
>>>> OpenSCAD mailing list
>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>>>
>>> _______________________________________________
>>> OpenSCAD mailing list
>>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>>
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
RW
Rogier Wolff
Sat, Nov 27, 2021 9:36 AM
On Fri, Nov 26, 2021 at 07:05:35PM +0000, nop head wrote:
I never need to do that because if a dimension is important I specify it in
my source code and make it so in the code. Do you want to measure other
people's designs?
Recent project: I had a central "box", some margin, and then a frame
around that. And then a box to fit that frame. So my total size is:
inner_box_x + 2margin + 2framesize.
Sure I can write down the formula for that.
But what if say right side frame-size is determined by a square tilted
at an angle. Sure, I can do the trig to calculate the right side of
that tilted square, but wouldn't it be nice to ask openscad to
calculate that for me?
Roger.
I do have something difficult I need to do: somehow find a way to place a
marker on the rendered object interactively and locate that point. Or even
compute a distance between two markers. If I can figure out a way to do
that in openscad I don't care whether it is functional or imperative or
declarative, I like it just fine - and if I can't do that then I'll have to
move to some other system which I would find unfortunate because so far
after a few months openSCAD has always got the job done for me.
Edmund
On Fri, Nov 26, 2021 at 4:05 PM Adrian Mariano avm4@cornell.edu wrote:
I think if you want OpenSCAD programming to "click" the answer is to
write a bunch of programs where you try to do something difficult. If
you're trying to do something and you care about efficiency then you
should try to do that thing with OpenSCAD native matrix operations
first. For example, using the fold() function above to sum up a
simple vector of numbers is 40 times slower than using a vector
product, something like:
sum_of_test = test*[for(i=test) 1]];
The second choice for efficiency (and probably the first for
readability) is to use a list comprehension. Neither of these two
methods is "functional programming". List comprehensions can do a lot
of things---anything where the value at one output point is
independent of the value at other output points. There's the business
of not being able to redefine variables, which can be an occasional
nuisance, but it's not a big issue. The main consequence is that you
have to handle all cases all at once with the ternary operator, or you
have to introduce more variables. But if you can't use a list
comprehension because the answer depends on previous answers, then you
need to use recursion. That's when things look "functional". If
you're lucky you can do this with tail recursion, and get more
efficiency. If not you'll be in a less efficient situation. The last
option is the C-style for loop, which in my testing I have found to be
the slowest option, slower than recursion. It's hard to use (usually
harder than recursion).
So is OpenSCAD a "functional language"? I'm not sure. A lot of
OpenSCAD programming doesn't really seem functional. If you want to
code in OpenSCAD then you need to learn OpenSCAD and its quirks and
not get hung up on terminology. At the end of the day, if your
program works does it matter if it was "functional" or "procedural"?
On Fri, Nov 26, 2021 at 9:19 AM Patrick Callahan
pat.callahan1@gmail.com wrote:
Sorry, It was an attempt at humor in a programming language. Never a
On 26.11.21 13:38, Patrick Callahan wrote:
Sure, but why?
array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
ciao,
Torsten.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 **
f equals m times a. When your f is steady, and your m is going down
your a is going up. -- Chris Hadfield about flying up the space shuttle.
On Fri, Nov 26, 2021 at 07:05:35PM +0000, nop head wrote:
> I never need to do that because if a dimension is important I specify it in
> my source code and make it so in the code. Do you want to measure other
> people's designs?
Recent project: I had a central "box", some margin, and then a frame
around that. And then a box to fit that frame. So my total size is:
inner_box_x + 2*margin + 2*framesize.
Sure I can write down the formula for that.
But what if say right side frame-size is determined by a square tilted
at an angle. Sure, I can do the trig to calculate the right side of
that tilted square, but wouldn't it be nice to ask openscad to
calculate that for me?
Roger.
>
> On Fri, 26 Nov 2021 at 18:52, edmund ronald <edmundronald@gmail.com> wrote:
>
> > I do have something difficult I need to do: somehow find a way to place a
> > marker on the rendered object interactively and locate that point. Or even
> > compute a distance between two markers. If I can figure out a way to do
> > that in openscad I don't care whether it is functional or imperative or
> > declarative, I like it just fine - and if I can't do that then I'll have to
> > move to some other system which I would find unfortunate because so far
> > after a few months openSCAD has always got the job done for me.
> >
> > Edmund
> >
> > On Fri, Nov 26, 2021 at 4:05 PM Adrian Mariano <avm4@cornell.edu> wrote:
> >
> >> I think if you want OpenSCAD programming to "click" the answer is to
> >> write a bunch of programs where you try to do something difficult. If
> >> you're trying to do something and you care about efficiency then you
> >> should try to do that thing with OpenSCAD native matrix operations
> >> first. For example, using the fold() function above to sum up a
> >> simple vector of numbers is 40 times slower than using a vector
> >> product, something like:
> >>
> >> sum_of_test = test*[for(i=test) 1]];
> >>
> >> The second choice for efficiency (and probably the first for
> >> readability) is to use a list comprehension. Neither of these two
> >> methods is "functional programming". List comprehensions can do a lot
> >> of things---anything where the value at one output point is
> >> independent of the value at other output points. There's the business
> >> of not being able to redefine variables, which can be an occasional
> >> nuisance, but it's not a big issue. The main consequence is that you
> >> have to handle all cases all at once with the ternary operator, or you
> >> have to introduce more variables. But if you can't use a list
> >> comprehension because the answer depends on previous answers, then you
> >> need to use recursion. That's when things look "functional". If
> >> you're lucky you can do this with tail recursion, and get more
> >> efficiency. If not you'll be in a less efficient situation. The last
> >> option is the C-style for loop, which in my testing I have found to be
> >> the slowest option, slower than recursion. It's hard to use (usually
> >> harder than recursion).
> >>
> >> So is OpenSCAD a "functional language"? I'm not sure. A lot of
> >> OpenSCAD programming doesn't really seem functional. If you want to
> >> code in OpenSCAD then you need to learn OpenSCAD and its quirks and
> >> not get hung up on terminology. At the end of the day, if your
> >> program works does it matter if it was "functional" or "procedural"?
> >>
> >> On Fri, Nov 26, 2021 at 9:19 AM Patrick Callahan
> >> <pat.callahan1@gmail.com> wrote:
> >> >
> >> > Sorry, It was an attempt at humor in a programming language. Never a
> >> good idea.
> >> >
> >> > -Pat
> >> >
> >> > On Fri, Nov 26, 2021 at 8:33 AM Torsten Paul <Torsten.Paul@gmx.de>
> >> wrote:
> >> >>
> >> >> On 26.11.21 13:38, Patrick Callahan wrote:
> >> >> > Can you do this?
> >> >>
> >> >> Sure, but why?
> >> >>
> >> >> array = [ for (msg = [ for ([0:9]) "blah" ]) echo(msg) msg ];
> >> >>
> >> >> ciao,
> >> >> Torsten.
> >> >> _______________________________________________
> >> >> OpenSCAD mailing list
> >> >> To unsubscribe send an email to discuss-leave@lists.openscad.org
> >> >
> >> > _______________________________________________
> >> > OpenSCAD mailing list
> >> > To unsubscribe send an email to discuss-leave@lists.openscad.org
> >> _______________________________________________
> >> OpenSCAD mailing list
> >> To unsubscribe send an email to discuss-leave@lists.openscad.org
> >>
> > _______________________________________________
> > OpenSCAD mailing list
> > To unsubscribe send an email to discuss-leave@lists.openscad.org
> >
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 **
f equals m times a. When your f is steady, and your m is going down
your a is going up. -- Chris Hadfield about flying up the space shuttle.