discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

points list from stl

TP
Torsten Paul
Sun, Oct 23, 2022 6:28 PM

On 23.10.22 20:21, nop head wrote:

If we had module references we could have a render(module_ref) function > that returns points and faces to pass to polyhedron, or polygon or
iterate through with for loops.

That does not need module references as shown in (incomplete)
https://github.com/openscad/openscad/pull/3956 - just normal
modules will do.

It "only" needs render() as function so it can return data
instead of geometry.

The challenge is more defining the data structure and exact
behavior to be as future proof as possible.

ciao,
Torsten.

On 23.10.22 20:21, nop head wrote: > If we had module references we could have a render(module_ref) function > that returns points and faces to pass to polyhedron, or polygon or > iterate through with for loops. That does not need module references as shown in (incomplete) https://github.com/openscad/openscad/pull/3956 - just normal modules will do. It "only" needs render() as function so it can return data instead of geometry. The challenge is more defining the data structure and exact behavior to be as future proof as possible. ciao, Torsten.
NH
nop head
Sun, Oct 23, 2022 6:33 PM

That seems more disruptive because it mixes module syntax into expressions.
A module reference is just a value, so can naturally be passed to a
function.

On Sun, 23 Oct 2022 at 19:29, Torsten Paul Torsten.Paul@gmx.de wrote:

On 23.10.22 20:21, nop head wrote:

If we had module references we could have a render(module_ref) function
that returns points and faces to pass to polyhedron, or polygon or
iterate through with for loops.

That does not need module references as shown in (incomplete)
https://github.com/openscad/openscad/pull/3956 - just normal
modules will do.

It "only" needs render() as function so it can return data
instead of geometry.

The challenge is more defining the data structure and exact
behavior to be as future proof as possible.

ciao,
Torsten.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

That seems more disruptive because it mixes module syntax into expressions. A module reference is just a value, so can naturally be passed to a function. On Sun, 23 Oct 2022 at 19:29, Torsten Paul <Torsten.Paul@gmx.de> wrote: > On 23.10.22 20:21, nop head wrote: > > If we had module references we could have a render(module_ref) function > > that returns points and faces to pass to polyhedron, or polygon or > > iterate through with for loops. > > That does not need module references as shown in (incomplete) > https://github.com/openscad/openscad/pull/3956 - just normal > modules will do. > > It "only" needs render() as function so it can return data > instead of geometry. > > The challenge is more defining the data structure and exact > behavior to be as future proof as possible. > > ciao, > Torsten. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
TP
Torsten Paul
Sun, Oct 23, 2022 7:13 PM

On 23.10.22 20:33, nop head wrote:

That seems more disruptive because it mixes module syntax into
expressions. A module reference is just a value, so can naturally
 be passed to a function.

Having the more general form is probably nicer, I'm just saying
it's not required to have references. Also I don't think it's
that disruptive as it basically follows the normal chained style
of modules, just bridging the existing gap between functions and
modules which is exactly the point.

With the other discussion around objects / module literals or
whatever those will be called taking up speed maybe it's not
needed to have the in-between solution.

ciao,
Torsten.

On 23.10.22 20:33, nop head wrote: > That seems more disruptive because it mixes module syntax into > expressions. A module reference is just a value, so can naturally > be passed to a function. Having the more general form is probably nicer, I'm just saying it's not *required* to have references. Also I don't think it's that disruptive as it basically follows the normal chained style of modules, just bridging the existing gap between functions and modules which is exactly the point. With the other discussion around objects / module literals or whatever those will be called taking up speed maybe it's not needed to have the in-between solution. ciao, Torsten.
NH
nop head
Sun, Oct 23, 2022 8:14 PM

Module references are needed for polymorphism, etc, just as function
references. I would currently draw a configurable hot end with enums and a
switch statement but neither exist, so random constants and if then else,
ugly.

On Sun, 23 Oct 2022 at 20:14, Torsten Paul Torsten.Paul@gmx.de wrote:

On 23.10.22 20:33, nop head wrote:

That seems more disruptive because it mixes module syntax into
expressions. A module reference is just a value, so can naturally
be passed to a function.

Having the more general form is probably nicer, I'm just saying
it's not required to have references. Also I don't think it's
that disruptive as it basically follows the normal chained style
of modules, just bridging the existing gap between functions and
modules which is exactly the point.

With the other discussion around objects / module literals or
whatever those will be called taking up speed maybe it's not
needed to have the in-between solution.

ciao,
Torsten.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Module references are needed for polymorphism, etc, just as function references. I would currently draw a configurable hot end with enums and a switch statement but neither exist, so random constants and if then else, ugly. On Sun, 23 Oct 2022 at 20:14, Torsten Paul <Torsten.Paul@gmx.de> wrote: > On 23.10.22 20:33, nop head wrote: > > That seems more disruptive because it mixes module syntax into > > expressions. A module reference is just a value, so can naturally > > be passed to a function. > > Having the more general form is probably nicer, I'm just saying > it's not *required* to have references. Also I don't think it's > that disruptive as it basically follows the normal chained style > of modules, just bridging the existing gap between functions and > modules which is exactly the point. > > With the other discussion around objects / module literals or > whatever those will be called taking up speed maybe it's not > needed to have the in-between solution. > > ciao, > Torsten. > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
JB
Jordan Brown
Sun, Oct 23, 2022 11:41 PM

On 10/23/2022 1:14 PM, nop head wrote:

Module references are needed for polymorphism, etc, just as function
references.

Yes, but module references, like function references, are not very
interesting without parameters.

What is needed is a way to get geometry into expression context. 
Whether that is via a "geometry literal" mechanism or via a way to call
a module like you would call a function, it is geometry values that are
interesting.

On 10/23/2022 1:14 PM, nop head wrote: > Module references are needed for polymorphism, etc, just as function > references. Yes, but module references, like function references, are not very interesting without parameters. What is needed is a way to get *geometry* into expression context.  Whether that is via a "geometry literal" mechanism or via a way to call a module like you would call a function, it is geometry values that are interesting.