Re: Discuss Digest, Vol 65, Issue 2

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

Re: Discuss Digest, Vol 65, Issue 2

rssalerno
1) Easy & efficient way to create fillets and chamfers.

2) On OSX version, enable "End" key to move cursor to EOL in editor.

On 4/3/20, [hidden email]
<[hidden email]> wrote:

> Send Discuss mailing list submissions to
> [hidden email]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
> or, via email, send a message with subject or body 'help' to
> [hidden email]
>
> You can reach the person managing the list at
> [hidden email]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Discuss digest..."
>
>
> Today's Topics:
>
>    1. Re: User Poll: What do you want to see from OpenSCAD
>       development? (AKADAP)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 2 Apr 2020 11:29:14 -0700 (MST)
> From: AKADAP <[hidden email]>
> To: [hidden email]
> Subject: Re: [OpenSCAD] User Poll: What do you want to see from
> OpenSCAD development?
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=us-ascii
>
> I would like to see either an extension to rotate_extrude() or a new
> extrude
> function to implement a proper spiral (no linear_extrude() is not good
> enough as the object being extruded is not orthogonal to the path).
> I feel so strongly about this that I attempted to implement this myself
> within the language: https://www.thingiverse.com/thing:1958354
> It works after a fashion, but because I could not directly access the
> points
> of the children, it could not be implemented in the most efficient manner,
> and is at best an approximation.
>
> I'd also like to be able to put children into a list. I recently ran into a
> limitation of the current version of OpenSCAD that prevented me from
> algorithmicly generating children to be passed to a library function. The
> output of a for() loop is a union, so it only generates one child, but a
> for() loop can generate a list of any other type of object. Being able to
> generate a list of children seems to me a useful generalization to solve
> the
> problem I ran into.
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Discuss mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
>
> ------------------------------
>
> End of Discuss Digest, Vol 65, Issue 2
> **************************************
>

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

Re: Discuss Digest, Vol 65, Issue 2

khackbarth
1) provide a Lint like feature () to help me identify modules that are never called and variables that are never used
2) allow a variable to be assigned a new value after it has already been assigned a value
3) allow for a variable to be assigned a value in an if statement and then have that value preserved when the if completes
4) allow for directives/pragma that can specify that certain blocks of code aren't executed if a property is set

-- and fillets/chamfers like Russell says below!


-----Original Message-----
From: Russell Salerno <[hidden email]>
Sent: Friday, April 3, 2020 11:06 AM
To: [hidden email]
Subject: Re: [OpenSCAD] Discuss Digest, Vol 65, Issue 2

1) Easy & efficient way to create fillets and chamfers.

2) On OSX version, enable "End" key to move cursor to EOL in editor.

On 4/3/20, [hidden email]
<[hidden email]> wrote:

> Send Discuss mailing list submissions to
> [hidden email]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
> or, via email, send a message with subject or body 'help' to
> [hidden email]
>
> You can reach the person managing the list at
> [hidden email]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Discuss digest..."
>
>
> Today's Topics:
>
>    1. Re: User Poll: What do you want to see from OpenSCAD
>       development? (AKADAP)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 2 Apr 2020 11:29:14 -0700 (MST)
> From: AKADAP <[hidden email]>
> To: [hidden email]
> Subject: Re: [OpenSCAD] User Poll: What do you want to see from
> OpenSCAD development?
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=us-ascii
>
> I would like to see either an extension to rotate_extrude() or a new
> extrude function to implement a proper spiral (no linear_extrude() is
> not good enough as the object being extruded is not orthogonal to the
> path).
> I feel so strongly about this that I attempted to implement this
> myself within the language: https://www.thingiverse.com/thing:1958354
> It works after a fashion, but because I could not directly access the
> points of the children, it could not be implemented in the most
> efficient manner, and is at best an approximation.
>
> I'd also like to be able to put children into a list. I recently ran
> into a limitation of the current version of OpenSCAD that prevented me
> from algorithmicly generating children to be passed to a library
> function. The output of a for() loop is a union, so it only generates
> one child, but a
> for() loop can generate a list of any other type of object. Being able
> to generate a list of children seems to me a useful generalization to
> solve the problem I ran into.
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Discuss mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
>
> ------------------------------
>
> End of Discuss Digest, Vol 65, Issue 2
> **************************************
>




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

Re: Discuss Digest, Vol 65, Issue 2

doug.moen
Ken said: 4) allow for directives/pragma that can specify that certain blocks of code aren't executed if a property is set

What limitations prevent you from using the 'if' statement for this?

Doug Moen

On Sat, Apr 4, 2020, at 6:49 PM, [hidden email] wrote:

> 1) provide a Lint like feature () to help me identify modules that are
> never called and variables that are never used
> 2) allow a variable to be assigned a new value after it has already
> been assigned a value
> 3) allow for a variable to be assigned a value in an if statement and
> then have that value preserved when the if completes
> 4) allow for directives/pragma that can specify that certain blocks of
> code aren't executed if a property is set
>
> -- and fillets/chamfers like Russell says below!
>
>
> -----Original Message-----
> From: Russell Salerno <[hidden email]>
> Sent: Friday, April 3, 2020 11:06 AM
> To: [hidden email]
> Subject: Re: [OpenSCAD] Discuss Digest, Vol 65, Issue 2
>
> 1) Easy & efficient way to create fillets and chamfers.
>
> 2) On OSX version, enable "End" key to move cursor to EOL in editor.
>
> On 4/3/20, [hidden email]
> <[hidden email]> wrote:
> > Send Discuss mailing list submissions to
> > [hidden email]
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
> > or, via email, send a message with subject or body 'help' to
> > [hidden email]
> >
> > You can reach the person managing the list at
> > [hidden email]
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of Discuss digest..."
> >
> >
> > Today's Topics:
> >
> >    1. Re: User Poll: What do you want to see from OpenSCAD
> >       development? (AKADAP)
> >
> >
> > ----------------------------------------------------------------------
> >
> > Message: 1
> > Date: Thu, 2 Apr 2020 11:29:14 -0700 (MST)
> > From: AKADAP <[hidden email]>
> > To: [hidden email]
> > Subject: Re: [OpenSCAD] User Poll: What do you want to see from
> > OpenSCAD development?
> > Message-ID: <[hidden email]>
> > Content-Type: text/plain; charset=us-ascii
> >
> > I would like to see either an extension to rotate_extrude() or a new
> > extrude function to implement a proper spiral (no linear_extrude() is
> > not good enough as the object being extruded is not orthogonal to the
> > path).
> > I feel so strongly about this that I attempted to implement this
> > myself within the language: https://www.thingiverse.com/thing:1958354
> > It works after a fashion, but because I could not directly access the
> > points of the children, it could not be implemented in the most
> > efficient manner, and is at best an approximation.
> >
> > I'd also like to be able to put children into a list. I recently ran
> > into a limitation of the current version of OpenSCAD that prevented me
> > from algorithmicly generating children to be passed to a library
> > function. The output of a for() loop is a union, so it only generates
> > one child, but a
> > for() loop can generate a list of any other type of object. Being able
> > to generate a list of children seems to me a useful generalization to
> > solve the problem I ran into.
> >
> >
> >
> > --
> > Sent from: http://forum.openscad.org/
> >
> >
> >
> > ------------------------------
> >
> > Subject: Digest Footer
> >
> > _______________________________________________
> > Discuss mailing list
> > [hidden email]
> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
> >
> >
> > ------------------------------
> >
> > End of Discuss Digest, Vol 65, Issue 2
> > **************************************
> >
>
>
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>

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

Re: Discuss Digest, Vol 65, Issue 2

khackbarth
I need to control the execution of code that appears in the Customizer
region of the code.  That means that I have to define the controlling
parameter before that code... which exposes the controlling parameter in the
Customizer.  In fact, you can't wrap Customizer parameters in an If block
anyway so what I just said is moot - I don't think I could use an inline If
either...

Thanks,
Ken

-----Original Message-----
From: Doug Moen <[hidden email]>
Sent: Saturday, April 4, 2020 5:14 PM
To: [hidden email]; OpenSCAD Discuss <[hidden email]>
Subject: Re: [OpenSCAD] Discuss Digest, Vol 65, Issue 2

Ken said: 4) allow for directives/pragma that can specify that certain
blocks of code aren't executed if a property is set

What limitations prevent you from using the 'if' statement for this?

Doug Moen

On Sat, Apr 4, 2020, at 6:49 PM, [hidden email] wrote:

> 1) provide a Lint like feature () to help me identify modules that are
> never called and variables that are never used
> 2) allow a variable to be assigned a new value after it has already
> been assigned a value
> 3) allow for a variable to be assigned a value in an if statement and
> then have that value preserved when the if completes
> 4) allow for directives/pragma that can specify that certain blocks of
> code aren't executed if a property is set
>
> -- and fillets/chamfers like Russell says below!
>
>
> -----Original Message-----
> From: Russell Salerno <[hidden email]>
> Sent: Friday, April 3, 2020 11:06 AM
> To: [hidden email]
> Subject: Re: [OpenSCAD] Discuss Digest, Vol 65, Issue 2
>
> 1) Easy & efficient way to create fillets and chamfers.
>
> 2) On OSX version, enable "End" key to move cursor to EOL in editor.
>
> On 4/3/20, [hidden email]
> <[hidden email]> wrote:
> > Send Discuss mailing list submissions to
> > [hidden email]
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> >
> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.or
> > g or, via email, send a message with subject or body 'help' to
> > [hidden email]
> >
> > You can reach the person managing the list at
> > [hidden email]
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of Discuss digest..."
> >
> >
> > Today's Topics:
> >
> >    1. Re: User Poll: What do you want to see from OpenSCAD
> >       development? (AKADAP)
> >
> >
> > --------------------------------------------------------------------
> > --
> >
> > Message: 1
> > Date: Thu, 2 Apr 2020 11:29:14 -0700 (MST)
> > From: AKADAP <[hidden email]>
> > To: [hidden email]
> > Subject: Re: [OpenSCAD] User Poll: What do you want to see from
> > OpenSCAD development?
> > Message-ID: <[hidden email]>
> > Content-Type: text/plain; charset=us-ascii
> >
> > I would like to see either an extension to rotate_extrude() or a new
> > extrude function to implement a proper spiral (no linear_extrude()
> > is not good enough as the object being extruded is not orthogonal to
> > the path).
> > I feel so strongly about this that I attempted to implement this
> > myself within the language:
> > https://www.thingiverse.com/thing:1958354
> > It works after a fashion, but because I could not directly access
> > the points of the children, it could not be implemented in the most
> > efficient manner, and is at best an approximation.
> >
> > I'd also like to be able to put children into a list. I recently ran
> > into a limitation of the current version of OpenSCAD that prevented
> > me from algorithmicly generating children to be passed to a library
> > function. The output of a for() loop is a union, so it only
> > generates one child, but a
> > for() loop can generate a list of any other type of object. Being
> > able to generate a list of children seems to me a useful
> > generalization to solve the problem I ran into.
> >
> >
> >
> > --
> > Sent from: http://forum.openscad.org/
> >
> >
> >
> > ------------------------------
> >
> > Subject: Digest Footer
> >
> > _______________________________________________
> > Discuss mailing list
> > [hidden email]
> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.or
> > g
> >
> >
> > ------------------------------
> >
> > End of Discuss Digest, Vol 65, Issue 2
> > **************************************
> >
>
>
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>


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

Re: Discuss Digest, Vol 65, Issue 2

JordanBrown
In reply to this post by khackbarth
On 4/4/2020 3:49 PM, [hidden email] wrote:
1) provide a Lint like feature () to help me identify modules that are never called and variables that are never used

Note that as in lint itself there would need to be a way to mark a file as containing a library, since it's normal not to use all of the features exported by the library.

2) allow a variable to be assigned a new value after it has already been assigned a value
3) allow for a variable to be assigned a value in an if statement and then have that value preserved when the if completes

I'm not one of the developers, but this is easy to answer:  not going to happen.  OpenSCAD doesn't execute anything like a conventional language.  It does *not* execute lines in the order that you expect. (And some features, like the children() feature, depend on that fact.)

For fun, try this program.  Try to predict this output, then run it, then try to understand the results.
module foo() {
    a = echo("foo assignment 1") 0;
    children(1);
    children(0);
    b = echo("foo assignment 2") 0;
}

foo() {
    x = echo("assignment 1") 0;
    echo("child 1");
    echo("child 2");
    echo("child 3");
    y = echo("assignment 2") 0;
}

For extra fun, try throwing $ variables into the mix.


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

Re: Discuss Digest, Vol 65, Issue 2

OpenSCAD mailing list-2
In reply to this post by khackbarth
I also want #2 and #3.
I would like to count included components as they are added and need true global variables/functions that last for the entire execution to do this.
If you are adding dozens of different OTS components to a product design, it is a PITA not to be able to come up with a BOM for the product as part of the design.

#4 seems to make a lot of sense if you are really trying to do parametric design.
One should not have to copy, paste and edit a module for each library used to build the product

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#Special_variables seems to suggest that user defined variables actually might do this but it appears that the documentation is wrong or misleading. Needs a look from someone who knows.



Mine:
Error messages should be less about the way a programmer sees an internal function failing and more about what the designer/user might have done. This might require a bit of work to suggest issues that started in earlier lines but some might be easy - too many or too few "}" could be explained "Missing closing bracket" "More closing brackets than opening brackets" This would seem to be easy to detect and report.

Missing closing ";" might be suggested when it is easy to guess that the syntax would be correct if the earlier line had been closed properly. That is, the parser sees a token that is legal but not in the right context. This would only be a suggestion to the designer as a place to look. 'Did you forget a ";"?'

I am a new user and like the project so far. I am a software guy but have supported engineers using parametric CAD for more than 15 years and have been using Blender for a long time and recently for 3D printing. Would like to move to openSCAD and so far I am pretty happy. Not printed anything yet but we are under self-isolating lockdown for now.

Ron

On 2020-04-04 6:49 p.m., [hidden email] wrote:
1) provide a Lint like feature () to help me identify modules that are never called and variables that are never used
2) allow a variable to be assigned a new value after it has already been assigned a value
3) allow for a variable to be assigned a value in an if statement and then have that value preserved when the if completes
4) allow for directives/pragma that can specify that certain blocks of code aren't executed if a property is set

-- and fillets/chamfers like Russell says below!


-----Original Message-----
From: Russell Salerno [hidden email] 
Sent: Friday, April 3, 2020 11:06 AM
To: [hidden email]
Subject: Re: [OpenSCAD] Discuss Digest, Vol 65, Issue 2

1) Easy & efficient way to create fillets and chamfers.

2) On OSX version, enable "End" key to move cursor to EOL in editor.

On 4/3/20, [hidden email]
[hidden email] wrote:
Send Discuss mailing list submissions to
	[hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
	http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
or, via email, send a message with subject or body 'help' to
	[hidden email]

You can reach the person managing the list at
	[hidden email]

When replying, please edit your Subject line so it is more specific 
than "Re: Contents of Discuss digest..."


Today's Topics:

   1. Re: User Poll: What do you want to see from OpenSCAD
      development? (AKADAP)


----------------------------------------------------------------------

Message: 1
Date: Thu, 2 Apr 2020 11:29:14 -0700 (MST)
From: AKADAP [hidden email]
To: [hidden email]
Subject: Re: [OpenSCAD] User Poll: What do you want to see from
	OpenSCAD development?
Message-ID: [hidden email]
Content-Type: text/plain; charset=us-ascii

I would like to see either an extension to rotate_extrude() or a new 
extrude function to implement a proper spiral (no linear_extrude() is 
not good enough as the object being extruded is not orthogonal to the 
path).
I feel so strongly about this that I attempted to implement this 
myself within the language: https://www.thingiverse.com/thing:1958354
It works after a fashion, but because I could not directly access the 
points of the children, it could not be implemented in the most 
efficient manner, and is at best an approximation.

I'd also like to be able to put children into a list. I recently ran 
into a limitation of the current version of OpenSCAD that prevented me 
from algorithmicly generating children to be passed to a library 
function. The output of a for() loop is a union, so it only generates 
one child, but a
for() loop can generate a list of any other type of object. Being able 
to generate a list of children seems to me a useful generalization to 
solve the problem I ran into.



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



------------------------------

Subject: Digest Footer

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


------------------------------

End of Discuss Digest, Vol 65, Issue 2
**************************************




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

-- 
Ron Wheeler
Artifact Software
438-345-3369
[hidden email]

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

Re: Discuss Digest, Vol 65, Issue 2

OpenSCAD mailing list-2
In reply to this post by JordanBrown
Not sure that your example is a "normal use case" where variables might be helpful.
I can not even visualize what you are trying to make.

In my case, I only need the variables to persist from start to end and be acted on at some time during that period whenever an operation is requested that adds a component.
If I add bunch of purchased or printed parts or a number of pipes of a certain length, I would like to generate a BOM
24 part A
47 part B
3   Part C (custom part to print from a separate OpenSCAD used in the assembly)
2     10 foot pipes
20   2 foot pipes
16   3 foot pipes
and so on.

When your project gets into the dozens of each part and there are 100+ parts, the effort of redoing the count from a picture and the chance of missing a part both get high.

Is there another/better way to tag objects created to enable a BOM to be generated at the end?
If so, I could get a list of all tags created during the execution and then loop through the list and write ECHO "A count of all getTagName(i) is  getTagCount(i)"; at the end.
During the creation of objects I would have to code something to say  "Tag this group of commands as a "Part A", "Tag this group as "Pipe_1.25_Inch-36" where 36 is some local value (length, width, diameter, etc.) used in the creation of the object.


It does not solve all of the parametric design issues but would solve the BOM problem.


Ron

On 2020-04-04 7:26 p.m., Jordan Brown wrote:
On 4/4/2020 3:49 PM, [hidden email] wrote:
1) provide a Lint like feature () to help me identify modules that are never called and variables that are never used

Note that as in lint itself there would need to be a way to mark a file as containing a library, since it's normal not to use all of the features exported by the library.

2) allow a variable to be assigned a new value after it has already been assigned a value
3) allow for a variable to be assigned a value in an if statement and then have that value preserved when the if completes

I'm not one of the developers, but this is easy to answer:  not going to happen.  OpenSCAD doesn't execute anything like a conventional language.  It does *not* execute lines in the order that you expect. (And some features, like the children() feature, depend on that fact.)

For fun, try this program.  Try to predict this output, then run it, then try to understand the results.
module foo() {
    a = echo("foo assignment 1") 0;
    children(1);
    children(0);
    b = echo("foo assignment 2") 0;
}

foo() {
    x = echo("assignment 1") 0;
    echo("child 1");
    echo("child 2");
    echo("child 3");
    y = echo("assignment 2") 0;
}

For extra fun, try throwing $ variables into the mix.


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

-- 
Ron Wheeler
Artifact Software
438-345-3369
[hidden email]

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

Re: Discuss Digest, Vol 65, Issue 2

nophead
I generate BOMs using modules that echo and then process the output stream with Python scripts that generate BOMs and assembly diagrams and instructions.

On Sun, 5 Apr 2020 at 01:42, Ron Wheeler via Discuss <[hidden email]> wrote:
Not sure that your example is a "normal use case" where variables might be helpful.
I can not even visualize what you are trying to make.

In my case, I only need the variables to persist from start to end and be acted on at some time during that period whenever an operation is requested that adds a component.
If I add bunch of purchased or printed parts or a number of pipes of a certain length, I would like to generate a BOM
24 part A
47 part B
3   Part C (custom part to print from a separate OpenSCAD used in the assembly)
2     10 foot pipes
20   2 foot pipes
16   3 foot pipes
and so on.

When your project gets into the dozens of each part and there are 100+ parts, the effort of redoing the count from a picture and the chance of missing a part both get high.

Is there another/better way to tag objects created to enable a BOM to be generated at the end?
If so, I could get a list of all tags created during the execution and then loop through the list and write ECHO "A count of all getTagName(i) is  getTagCount(i)"; at the end.
During the creation of objects I would have to code something to say  "Tag this group of commands as a "Part A", "Tag this group as "Pipe_1.25_Inch-36" where 36 is some local value (length, width, diameter, etc.) used in the creation of the object.


It does not solve all of the parametric design issues but would solve the BOM problem.


Ron

On 2020-04-04 7:26 p.m., Jordan Brown wrote:
On 4/4/2020 3:49 PM, [hidden email] wrote:
1) provide a Lint like feature () to help me identify modules that are never called and variables that are never used

Note that as in lint itself there would need to be a way to mark a file as containing a library, since it's normal not to use all of the features exported by the library.

2) allow a variable to be assigned a new value after it has already been assigned a value
3) allow for a variable to be assigned a value in an if statement and then have that value preserved when the if completes

I'm not one of the developers, but this is easy to answer:  not going to happen.  OpenSCAD doesn't execute anything like a conventional language.  It does *not* execute lines in the order that you expect. (And some features, like the children() feature, depend on that fact.)

For fun, try this program.  Try to predict this output, then run it, then try to understand the results.
module foo() {
    a = echo("foo assignment 1") 0;
    children(1);
    children(0);
    b = echo("foo assignment 2") 0;
}

foo() {
    x = echo("assignment 1") 0;
    echo("child 1");
    echo("child 2");
    echo("child 3");
    y = echo("assignment 2") 0;
}

For extra fun, try throwing $ variables into the mix.


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

-- 
Ron Wheeler
Artifact Software
438-345-3369
[hidden email]
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

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

Re: Discuss Digest, Vol 65, Issue 2

cacb
In reply to this post by OpenSCAD mailing list-2
On 2020-04-05 01:54, Ron Wheeler via Discuss wrote:
> I also want #2 and #3.

It is not going to happen in OpenSCAD as other have explained, the
language does not execute in the traditional sense. In AngelCAD it works
as you suggest https://arnholm.github.io/angelcad-docs/

Carsten Arnholm

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

Re: Discuss Digest, Vol 65, Issue 2

OpenSCAD mailing list-2
In reply to this post by nophead
Very interesting idea. I will give that a shot.

Thanks

Ron

On 2020-04-05 3:53 a.m., nop head wrote:
I generate BOMs using modules that echo and then process the output stream with Python scripts that generate BOMs and assembly diagrams and instructions.

On Sun, 5 Apr 2020 at 01:42, Ron Wheeler via Discuss <[hidden email]> wrote:
Not sure that your example is a "normal use case" where variables might be helpful.
I can not even visualize what you are trying to make.

In my case, I only need the variables to persist from start to end and be acted on at some time during that period whenever an operation is requested that adds a component.
If I add bunch of purchased or printed parts or a number of pipes of a certain length, I would like to generate a BOM
24 part A
47 part B
3   Part C (custom part to print from a separate OpenSCAD used in the assembly)
2     10 foot pipes
20   2 foot pipes
16   3 foot pipes
and so on.

When your project gets into the dozens of each part and there are 100+ parts, the effort of redoing the count from a picture and the chance of missing a part both get high.

Is there another/better way to tag objects created to enable a BOM to be generated at the end?
If so, I could get a list of all tags created during the execution and then loop through the list and write ECHO "A count of all getTagName(i) is  getTagCount(i)"; at the end.
During the creation of objects I would have to code something to say  "Tag this group of commands as a "Part A", "Tag this group as "Pipe_1.25_Inch-36" where 36 is some local value (length, width, diameter, etc.) used in the creation of the object.


It does not solve all of the parametric design issues but would solve the BOM problem.


Ron

On 2020-04-04 7:26 p.m., Jordan Brown wrote:
On 4/4/2020 3:49 PM, [hidden email] wrote:
1) provide a Lint like feature () to help me identify modules that are never called and variables that are never used

Note that as in lint itself there would need to be a way to mark a file as containing a library, since it's normal not to use all of the features exported by the library.

2) allow a variable to be assigned a new value after it has already been assigned a value
3) allow for a variable to be assigned a value in an if statement and then have that value preserved when the if completes

I'm not one of the developers, but this is easy to answer:  not going to happen.  OpenSCAD doesn't execute anything like a conventional language.  It does *not* execute lines in the order that you expect. (And some features, like the children() feature, depend on that fact.)

For fun, try this program.  Try to predict this output, then run it, then try to understand the results.
module foo() {
    a = echo("foo assignment 1") 0;
    children(1);
    children(0);
    b = echo("foo assignment 2") 0;
}

foo() {
    x = echo("assignment 1") 0;
    echo("child 1");
    echo("child 2");
    echo("child 3");
    y = echo("assignment 2") 0;
}

For extra fun, try throwing $ variables into the mix.


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

-- 
Ron Wheeler
Artifact Software
438-345-3369
[hidden email]
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

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

-- 
Ron Wheeler
Artifact Software
438-345-3369
[hidden email]

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

Re: Discuss Digest, Vol 65, Issue 2

nophead
You can find all the code for it my library here:  https://github.com/nophead/NopSCADlib

On Sun, 5 Apr 2020 at 14:32, Ron Wheeler via Discuss <[hidden email]> wrote:
Very interesting idea. I will give that a shot.

Thanks

Ron

On 2020-04-05 3:53 a.m., nop head wrote:
I generate BOMs using modules that echo and then process the output stream with Python scripts that generate BOMs and assembly diagrams and instructions.

On Sun, 5 Apr 2020 at 01:42, Ron Wheeler via Discuss <[hidden email]> wrote:
Not sure that your example is a "normal use case" where variables might be helpful.
I can not even visualize what you are trying to make.

In my case, I only need the variables to persist from start to end and be acted on at some time during that period whenever an operation is requested that adds a component.
If I add bunch of purchased or printed parts or a number of pipes of a certain length, I would like to generate a BOM
24 part A
47 part B
3   Part C (custom part to print from a separate OpenSCAD used in the assembly)
2     10 foot pipes
20   2 foot pipes
16   3 foot pipes
and so on.

When your project gets into the dozens of each part and there are 100+ parts, the effort of redoing the count from a picture and the chance of missing a part both get high.

Is there another/better way to tag objects created to enable a BOM to be generated at the end?
If so, I could get a list of all tags created during the execution and then loop through the list and write ECHO "A count of all getTagName(i) is  getTagCount(i)"; at the end.
During the creation of objects I would have to code something to say  "Tag this group of commands as a "Part A", "Tag this group as "Pipe_1.25_Inch-36" where 36 is some local value (length, width, diameter, etc.) used in the creation of the object.


It does not solve all of the parametric design issues but would solve the BOM problem.


Ron

On 2020-04-04 7:26 p.m., Jordan Brown wrote:
On 4/4/2020 3:49 PM, [hidden email] wrote:
1) provide a Lint like feature () to help me identify modules that are never called and variables that are never used

Note that as in lint itself there would need to be a way to mark a file as containing a library, since it's normal not to use all of the features exported by the library.

2) allow a variable to be assigned a new value after it has already been assigned a value
3) allow for a variable to be assigned a value in an if statement and then have that value preserved when the if completes

I'm not one of the developers, but this is easy to answer:  not going to happen.  OpenSCAD doesn't execute anything like a conventional language.  It does *not* execute lines in the order that you expect. (And some features, like the children() feature, depend on that fact.)

For fun, try this program.  Try to predict this output, then run it, then try to understand the results.
module foo() {
    a = echo("foo assignment 1") 0;
    children(1);
    children(0);
    b = echo("foo assignment 2") 0;
}

foo() {
    x = echo("assignment 1") 0;
    echo("child 1");
    echo("child 2");
    echo("child 3");
    y = echo("assignment 2") 0;
}

For extra fun, try throwing $ variables into the mix.


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

-- 
Ron Wheeler
Artifact Software
438-345-3369
[hidden email]
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

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

-- 
Ron Wheeler
Artifact Software
438-345-3369
[hidden email]
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

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

Re: Discuss Digest, Vol 65, Issue 2

JordanBrown
In reply to this post by OpenSCAD mailing list-2
On 4/4/2020 5:41 PM, Ron Wheeler via Discuss wrote:
Not sure that your example is a "normal use case" where variables might be helpful.
I can not even visualize what you are trying to make.


It isn't intended as a use case.  It's intended to demonstrate parts of the order of execution, and that OpenSCAD doesn't execute in an order that you would expect.

Here's another.
a = echo("assign a") 123;
if (echo("compare") a == b) {
	echo("a and b are equal");
}
b = echo("assign b") 123;

When you run this, you'll see that the two assignments occur before the condition and body of the "if" run.


One could debate whether this language structure is a *good* thing, but it is what it is and I assume that it would be a major redesign to change it.



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

Re: Discuss Digest, Vol 65, Issue 2

JordanBrown
In reply to this post by OpenSCAD mailing list-2
On 4/4/2020 4:54 PM, Ron Wheeler via Discuss wrote:
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#Special_variables seems to suggest that user defined variables actually might do this but it appears that the documentation is wrong or misleading.

Special variables - the ones beginning with $ - are constant too, just with different scope.

Regular variables have scopes that follow the block structure of the program:
a = 1;
module foo() {
    b = 2;
    if (a==b) {
        a = 4;
        c = 3;
    }
}

The scope of the first "a" is the whole file, except the body of the "if".  The scope of "b" is the module.  The scope of "c" is the body of the "if" block.  The scope of the "a" in the "if" block is the body of the if block, overriding/hiding/shadowing the file-scope "a".

This scoping is pretty typical for any block-structured language.

Special variables are scoped according to the execution tree.

$a = 1;

module foo() {
    echo($a);
}

module bar() {
    $a = 2;
    foo();
}

foo();
bar();
foo($a=3);

For the first invocation of "foo", the top-level definition of $a is in scope, so the value is 1.

For the invocation of "bar", "bar" overrides the definition of $a, and so when it executes "foo" the value is 2.

For the final invocation of "foo", the value of $a is overridden for that one call, and so the value is 3.


Error messages should be less about the way a programmer sees an internal function failing and more about what the designer/user might have done. This might require a bit of work to suggest issues that started in earlier lines but some might be easy - too many or too few "}" could be explained "Missing closing bracket" "More closing brackets than opening brackets" This would seem to be easy to detect and report.

I agree that improving the messages would be helpful.  Whether or not it's easy depends on what kind of compilation infrastructure they're using.  The compilation infrastructure might not report anything other than "I wasn't able to match the defined syntax".

Missing closing ";" might be suggested when it is easy to guess that the syntax would be correct if the earlier line had been closed properly. That is, the parser sees a token that is legal but not in the right context. This would only be a suggestion to the designer as a place to look. 'Did you forget a ";"?'

Note that some of the most obvious missing-semicolon cases are not actually syntax errors.
module foo()
{
    echo("foo");
}

module bar()
{
    echo("bar");
}

foo()
bar()
if (true) {
    echo("hello");
}
is syntactically completely legal.  Doesn't do what you probably expect, but it's legal.

(The built-in modules detect this error at run time.  It would be cool if user-defined modules could get similar detection.  It wouldn't be as simple as "was children() called"; it would have to involve remembering whether there are *any* calls to children() or $children in the module.)



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

Re: Discuss Digest, Vol 65, Issue 2

adrianv
JordanBrown wrote
>
> (The built-in modules detect this error at run time.  It would be cool
> if user-defined modules could get similar detection.  It wouldn't be as
> simple as "was children() called"; it would have to involve remembering
> whether there are *any* calls to children() or $children in the module.)

I assume that built-in modules just know that they don't take children, so
the presence of children is suspicious.  They don't do some kind of internal
code analysis to decide whether children are OK.  This effect is easily
achieved with user-defined modules.  Just tag modules that don't use
children with "no_children($children)" as shown below:  

module foo() {
   no_children($children);
   echo("hello world");
   // no children used here
}

module no_children(count)
{
  assert(count==0, str("Module ",parent_module(1),"() does not support child
modules"));
}    




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

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

Re: Discuss Digest, Vol 65, Issue 2

JordanBrown
On 4/5/2020 12:33 PM, adrianv wrote:
JordanBrown wrote
(The built-in modules detect this error at run time.  It would be cool
if user-defined modules could get similar detection.  It wouldn't be as
simple as "was children() called"; it would have to involve remembering
whether there are *any* calls to children() or $children in the module.)
I assume that built-in modules just know that they don't take children, so
the presence of children is suspicious.

Yes.

They don't do some kind of internal code analysis to decide whether children are OK. This effect is easily achieved with user-defined modules.  

Sure.  As you show, you can trivially do this check yourself.  But it would be cool if the infrastructure did it for you, so that a newcomer who doesn't even know what children() does will get the protection.


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

Re: Discuss Digest, Vol 65, Issue 2

OpenSCAD mailing list-2
In reply to this post by JordanBrown
Someone suggested a way to solve my BOM problem with echo and a script. I am working on that.
I am still not convinced that it is impossible to reliably describe a "real" global variable.

The missing ";" error message problem is not that OpenSCAD can not recognize that it is missing but does not give any indication about how it knew that it was missing.
It seems that it knows that it found a keyword in a context where it was not allowed.

It would be a bit of work to test that if a ";" had been inserted before the keyword, the previous block and the current block would be legal and suggest to the script-writer to look to see if adding the ";" would be the right thing to do.

This is a common problem in writing scripts but this is clearly an additional usability feature rather than a functional demand.

Ron


On 2020-04-05 3:22 p.m., Jordan Brown wrote:
On 4/4/2020 4:54 PM, Ron Wheeler via Discuss wrote:
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#Special_variables seems to suggest that user defined variables actually might do this but it appears that the documentation is wrong or misleading.

Special variables - the ones beginning with $ - are constant too, just with different scope.

Regular variables have scopes that follow the block structure of the program:
a = 1;
module foo() {
    b = 2;
    if (a==b) {
        a = 4;
        c = 3;
    }
}

The scope of the first "a" is the whole file, except the body of the "if".  The scope of "b" is the module.  The scope of "c" is the body of the "if" block.  The scope of the "a" in the "if" block is the body of the if block, overriding/hiding/shadowing the file-scope "a".

This scoping is pretty typical for any block-structured language.

Special variables are scoped according to the execution tree.

$a = 1;

module foo() {
    echo($a);
}

module bar() {
    $a = 2;
    foo();
}

foo();
bar();
foo($a=3);

For the first invocation of "foo", the top-level definition of $a is in scope, so the value is 1.

For the invocation of "bar", "bar" overrides the definition of $a, and so when it executes "foo" the value is 2.

For the final invocation of "foo", the value of $a is overridden for that one call, and so the value is 3.


Error messages should be less about the way a programmer sees an internal function failing and more about what the designer/user might have done. This might require a bit of work to suggest issues that started in earlier lines but some might be easy - too many or too few "}" could be explained "Missing closing bracket" "More closing brackets than opening brackets" This would seem to be easy to detect and report.

I agree that improving the messages would be helpful.  Whether or not it's easy depends on what kind of compilation infrastructure they're using.  The compilation infrastructure might not report anything other than "I wasn't able to match the defined syntax".

Missing closing ";" might be suggested when it is easy to guess that the syntax would be correct if the earlier line had been closed properly. That is, the parser sees a token that is legal but not in the right context. This would only be a suggestion to the designer as a place to look. 'Did you forget a ";"?'

Note that some of the most obvious missing-semicolon cases are not actually syntax errors.
module foo()
{
    echo("foo");
}

module bar()
{
    echo("bar");
}

foo()
bar()
if (true) {
    echo("hello");
}
is syntactically completely legal.  Doesn't do what you probably expect, but it's legal.

(The built-in modules detect this error at run time.  It would be cool if user-defined modules could get similar detection.  It wouldn't be as simple as "was children() called"; it would have to involve remembering whether there are *any* calls to children() or $children in the module.)



-- 
Ron Wheeler
Artifact Software
438-345-3369
[hidden email]

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

Re: Discuss Digest, Vol 65, Issue 2

nophead
The parser is automatically generated by yacc, so I don't know if it is possible to get better syntax error messages. If you load the file into the editor and hit F5 it will position the cursor where the parser thinks the error is.

The are no variables in OpenSCAD, global or otherwise, only named constants, apart from in for loops.

On Mon, 6 Apr 2020 at 05:38, Ron Wheeler via Discuss <[hidden email]> wrote:
Someone suggested a way to solve my BOM problem with echo and a script. I am working on that.
I am still not convinced that it is impossible to reliably describe a "real" global variable.

The missing ";" error message problem is not that OpenSCAD can not recognize that it is missing but does not give any indication about how it knew that it was missing.
It seems that it knows that it found a keyword in a context where it was not allowed.

It would be a bit of work to test that if a ";" had been inserted before the keyword, the previous block and the current block would be legal and suggest to the script-writer to look to see if adding the ";" would be the right thing to do.

This is a common problem in writing scripts but this is clearly an additional usability feature rather than a functional demand.

Ron


On 2020-04-05 3:22 p.m., Jordan Brown wrote:
On 4/4/2020 4:54 PM, Ron Wheeler via Discuss wrote:
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#Special_variables seems to suggest that user defined variables actually might do this but it appears that the documentation is wrong or misleading.

Special variables - the ones beginning with $ - are constant too, just with different scope.

Regular variables have scopes that follow the block structure of the program:
a = 1;
module foo() {
    b = 2;
    if (a==b) {
        a = 4;
        c = 3;
    }
}

The scope of the first "a" is the whole file, except the body of the "if".  The scope of "b" is the module.  The scope of "c" is the body of the "if" block.  The scope of the "a" in the "if" block is the body of the if block, overriding/hiding/shadowing the file-scope "a".

This scoping is pretty typical for any block-structured language.

Special variables are scoped according to the execution tree.

$a = 1;

module foo() {
    echo($a);
}

module bar() {
    $a = 2;
    foo();
}

foo();
bar();
foo($a=3);

For the first invocation of "foo", the top-level definition of $a is in scope, so the value is 1.

For the invocation of "bar", "bar" overrides the definition of $a, and so when it executes "foo" the value is 2.

For the final invocation of "foo", the value of $a is overridden for that one call, and so the value is 3.


Error messages should be less about the way a programmer sees an internal function failing and more about what the designer/user might have done. This might require a bit of work to suggest issues that started in earlier lines but some might be easy - too many or too few "}" could be explained "Missing closing bracket" "More closing brackets than opening brackets" This would seem to be easy to detect and report.

I agree that improving the messages would be helpful.  Whether or not it's easy depends on what kind of compilation infrastructure they're using.  The compilation infrastructure might not report anything other than "I wasn't able to match the defined syntax".

Missing closing ";" might be suggested when it is easy to guess that the syntax would be correct if the earlier line had been closed properly. That is, the parser sees a token that is legal but not in the right context. This would only be a suggestion to the designer as a place to look. 'Did you forget a ";"?'

Note that some of the most obvious missing-semicolon cases are not actually syntax errors.
module foo()
{
    echo("foo");
}

module bar()
{
    echo("bar");
}

foo()
bar()
if (true) {
    echo("hello");
}
is syntactically completely legal.  Doesn't do what you probably expect, but it's legal.

(The built-in modules detect this error at run time.  It would be cool if user-defined modules could get similar detection.  It wouldn't be as simple as "was children() called"; it would have to involve remembering whether there are *any* calls to children() or $children in the module.)



-- 
Ron Wheeler
Artifact Software
438-345-3369
[hidden email]
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

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

Re: Discuss Digest, Vol 65, Issue 2

JordanBrown
In reply to this post by OpenSCAD mailing list-2
On 4/5/2020 9:37 PM, Ron Wheeler wrote:
Someone suggested a way to solve my BOM problem with echo and a script. I am working on that.

Another possibility that I think some have used is to write a program in another language, that emits OpenSCAD as an intermediate form.

I am still not convinced that it is impossible to reliably describe a "real" global variable.

They don't exist.  There is no way to change the value of a "variable".  Of course the language could have been designed with conventional variables and a conventional control flow, but it wasn't.

Moreover, there is no way to get information out of a block or a module, back to the main body of the program.  (Of course the geometry comes out, and echo() output comes out, but neither of those is available to the rest of the program.)

nop head says:
The are no variables in OpenSCAD, global or otherwise, only named constants, apart from in for loops.

I'd actually argue with even that last exception.  Just as when you enter a block a second time the "variables" can have different values, I'd say that each iteration through a for loop has a new instance of the variable with a new value.  That is,
for (i=[1:3]) {
    foo(i);
}

is equivalent to

group() {
    i = 1;
    foo(i);
}
group() {
    i = 2;
    foo(i);
}
group() {
    i = 3;
    foo(i);
}
Now, that's my mental model, not knowledge of the implementation, but I think it's consistent.  (I can't think of any way that you can distinguish the behaviors under the two models, but I prefer the model that consistently says that you can't change the value of a  variable.)

Sometimes I think of it as a macro language, not a conventional programming language at all.  Everything that looks like a control structure is expanded into zero or more instances of its argument.

Most of the time I think of it as a programming language that emits geometry, but the macro processor model is probably more accurate.


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

Re: Discuss Digest, Vol 65, Issue 2

tp3
On 06.04.20 19:02, Jordan Brown wrote:
> On 4/5/2020 9:37 PM, Ron Wheeler wrote:
>> Someone suggested a way to solve my BOM problem with
>> echo and a script. I am working on that.
>
> Another possibility that I think some have used is to
> write a program in another language, that emits OpenSCAD
> as an intermediate form.

True, and there are some use cases where it makes a lot
of sense.

I think it would be still nice to have things like BOM
covered without that. I believe the way to go is what
was already mentioned in a previous post: tagging parts
of the design with meta data.

I've collected some ideas in:
https://github.com/openscad/openscad/wiki/Meta-Data-Use-Cases

This kind of annotations is widely adopted in other
languages and is used to also control external/separate
applications or generators.

ciao,
  Torsten.

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

Use cases, B.O.M. generation, cut lists, &c.

OpenSCAD mailing list-2
Put me down as another person hoeing this row.

I'd like to see a better option for this sort of thing, but thus far my best first approximation of this is:

 - model in OpenSCAD using Customizer
 - preserve preset parameters in a JSON file
 - parse JSON file and act on those numbers in a separate programming tool

Wrote up a bit on this in an article in TUGboat:

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

and beginning to work through it in more detail at:

https://willadams.gitbook.io/design-into-3d/3d-project

I'd be glad of any feedback and commentary (or corrections/suggestions)

William

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