No good reason other than inexperience. It's not a complete list, is it?
On Fri, Oct 22, 2021 at 6:03 PM William F. Adams via Discuss <
discuss@lists.openscad.org> wrote:
---------- Forwarded message ----------
From: "William F. Adams" willadams@aol.com
To: "discuss@lists.openscad.org" discuss@lists.openscad.org
Cc:
Bcc:
Date: Fri, 22 Oct 2021 19:36:06 +0000 (UTC)
Subject: [OpenSCAD] Re: Fwd: Re: start a module from a variabel
Is there a reason you left out using parameters from the JSON file for
them using the Customizer?
William
-----Original Message-----
From: Patrick Callahan pat.callahan1@gmail.com
To: OpenSCAD general discussion discuss@lists.openscad.org
Sent: Fri, Oct 22, 2021 3:25 pm
Subject: [OpenSCAD] Re: Fwd: Re: start a module from a variabel
I am thinking about where to put various kinds of data in an OpenSCAD
project.
1. Encoded in File Names
2. Scalar and Vector Variable values included* from a .scad file
3. Python or Bash script variables
4. Spreadsheets
5. Flat Files read by a bash or python script
6. Visual Studio Code configuration?
I'm closely examining https://github.com/nophead/NopSCADlib to see how
Chris Palmer approaches this.
*To get variable values, I found that I had to use "include" rather than
"use."
Did I mention the case where a 3d print features need scaling to print
accurately? How do we handle that as data?
On Fri, Oct 22, 2021 at 8:13 AM Patrick Callahan pat.callahan1@gmail.com
wrote:
Ray,
I think I'm trying to get to some rules for code and interface
organization specific to OpenSCAD.
Your comments on the separation of components as modules and the treatment
of variables exemplify the kind of structural thinking I want to clarify.
I think everyone who uses openSCAD will eventually find that they are
solving this kind of problem whether they think about it directly or not.
I'm hoping to avoid duplicating work others have already done as I organize
my work.
Certain "kinds" of OpenSCAD code would be in each of those "types" of
files. The question is, what specific kind of code
I've got my first project written as individual modules, one module per
part usually and sometimes one per feature. But some interfaces have many
parameters. That's not a good sign.
I'm thinking of files with names like:
*.measurements.scad
*.feature.scad
*.part.scad
*.layout.scad
*.animation.scad
*.component.scad
etc.
On Thu, Oct 21, 2021 at 2:08 PM Ray West raywest@raywest.com wrote:
Speaking generally, in an example where you have a number of component
items, and a layout/collection file.
if you write each component/part/group of parts as separate modules, and
if you extract all the values that you want to change as variables, you can
test each part individually. then you can comment out the variables that
you want to change in the 'layout file' and save it as a component file.
Then in the layout file, you can include each component file inside a
module, and set the variables inside the module, or outside, if you want.
That allows you to use simple variable names like length, width, whatever
for each component, and to have the values individually adjustable in the
layout file, without having to alter values in the component files.
On 21/10/2021 16:55, Patrick Callahan wrote:
I'll want to arrange the data for parts and assemblies in an organized way.
Today, my measurements for a project are in a single .scad file. I import
this file in each part file. But it's becoming unwieldy.
So, I'm looking for advice and examples of ways folks have dealt with the
structure of data in OpenScad projects.'
-Pat
As for scripting, language does not matter to me.
Ideally, I'd like to see the features addressed by scripting handled by
extending the OpenSCAD language, but that's a bit beyond my skills for now.
Data Usage
- absolute measurements for single or multiple sizes
- relative measurements between parts
- clearances
- calculated measures
- re-use of a measurement in multiple parts
- location and orientation data
- movement
- part selection
Goals:
- exploded views
- animated movement showing the assembly process and movement within
the final assembly
- 2d Drawings with labels and measures
- 3d print compatible files with one or more parts
- parts lists (with pictures)
- assembly instructions (with pictures)
On Mon, Oct 11, 2021 at 3:07 PM Ray West raywest@raywest.com wrote:
If it is for my own use and i can't bother with typing a list of if's, I
just rem out what's not needed - e.g. like
// body();
// translate([0,0,-2.5])flor();
translate([0,-0.5,-12-thickness]) underframe();
On 11/10/2021 18:44, Matthieu Hendriks wrote:
Yes I do the same, it's still a workaround for the extra coding effort :)
Groet Matthieu
Jan Wieck schreef op 2021-10-11 19:34:
On 10/11/21 11:59 AM, Matthieu Hendriks wrote:
Is it possible to execute a module depending on a variable name. Example:
When I have "assemblies" I usually create a drop-down list and then create
modules depending on the value. Like:
part = "body"; // [body, arm, leg, head, all]
if (part == "body") { body(); }
if (part == "arm") { arm(); }
...
if (part == "all") {
body();
arm();
leg();
head();
}
That way I can select individual parts to work on, render and export for
printing, but I can also see the entire assembly together. The "all"
selection often has some rotate() and translate() for the actual parts to
put them at the right position within the assembly.
Regards, Jan
module_to_start = "create_plate"
sys(module_to_start) or &module_to_start
module create_plate () { ...}
module create_head () { ...}
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
---------- Forwarded message ----------
From: "William F. Adams via Discuss" discuss@lists.openscad.org
To: "discuss@lists.openscad.org" discuss@lists.openscad.org
Cc: "William F. Adams" willadams@aol.com
Bcc:
Date: Fri, 22 Oct 2021 19:36:06 +0000 (UTC)
Subject: [OpenSCAD] Re: Fwd: Re: start a module from a variabel
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
It's a quintessentially OpenSCAD-style of working, so not including it seemed a bit odd.
I wrote up a bit about making use of it at:
http://tug.org/TUGboat/tb40-2/tb125adams-3d.pdf
William
-----Original Message-----
From: Patrick Callahan pat.callahan1@gmail.com
To: William F. Adams via Discuss discuss@lists.openscad.org
Sent: Sat, Oct 23, 2021 9:45 am
Subject: [OpenSCAD] Re: Fwd: Re: start a module from a variabel
No good reason other than inexperience. It's not a complete list, is it?
On Fri, Oct 22, 2021 at 6:03 PM William F. Adams via Discuss discuss@lists.openscad.org wrote:
---------- Forwarded message ----------
From: "William F. Adams" willadams@aol.com
To: "discuss@lists.openscad.org" discuss@lists.openscad.org
Cc:
Bcc:
Date: Fri, 22 Oct 2021 19:36:06 +0000 (UTC)
Subject: [OpenSCAD] Re: Fwd: Re: start a module from a variabel
Is there a reason you left out using parameters from the JSON file for them using the Customizer?
William
-----Original Message-----
From: Patrick Callahan pat.callahan1@gmail.com
To: OpenSCAD general discussion discuss@lists.openscad.org
Sent: Fri, Oct 22, 2021 3:25 pm
Subject: [OpenSCAD] Re: Fwd: Re: start a module from a variabel
I am thinking about where to put various kinds of data in an OpenSCAD project.
Ray,
I think I'm trying to get to some rules for code and interface organization specific to OpenSCAD.
Your comments on the separation of components as modules and the treatment of variables exemplify the kind of structural thinking I want to clarify.
I think everyone who uses openSCAD will eventually find that they are solving this kind of problem whether they think about it directly or not. I'm hoping to avoid duplicating work others have already done as I organize my work.
Certain "kinds" of OpenSCAD code would be in each of those "types" of files. The question is, what specific kind of code
I've got my first project written as individual modules, one module per part usually and sometimes one per feature. But some interfaces have many parameters. That's not a good sign.
I'm thinking of files with names like:
.measurements.scad.feature.scad*.part.scad*.layout.scad*.animation.scad*.component.scadetc.
On Thu, Oct 21, 2021 at 2:08 PM Ray West raywest@raywest.com wrote:
Speaking generally, in an example where you have a number of component items, and a layout/collection file. if you write each component/part/group of parts as separate modules, and if you extract all the values that you want to change as variables, you can test each part individually. then you can comment out the variables that you want to change in the 'layout file' and save it as a component file. Then in the layout file, you can include each component file inside a module, and set the variables inside the module, or outside, if you want. That allows you to use simple variable names like length, width, whatever for each component, and to have the values individually adjustable in the layout file, without having to alter values in the component files.
On 21/10/2021 16:55, Patrick Callahan wrote:
I'll want to arrange the data for parts and assemblies in an organized way.
Today, my measurements for a project are in a single .scad file. I import this file in each part file. But it's becoming unwieldy. So, I'm looking for advice and examples of ways folks have dealt with the structure of data in OpenScad projects.'
-Pat
As for scripting, language does not matter to me. Ideally, I'd like to see the features addressed by scripting handled by extending the OpenSCAD language, but that's a bit beyond my skills for now. Data Usage
On Mon, Oct 11, 2021 at 3:07 PM Ray West raywest@raywest.com wrote:
If it is for my own use and i can't bother with typing a list of if's, I just rem out what's not needed - e.g. like // body();
// translate([0,0,-2.5])flor();
translate([0,-0.5,-12-thickness]) underframe();
On 11/10/2021 18:44, Matthieu Hendriks wrote:
Yes I do the same, it's still a workaround for the extra coding effort :) Groet Matthieu
Jan Wieck schreef op 2021-10-11 19:34:
On 10/11/21 11:59 AM, Matthieu Hendriks wrote:
Is it possible to execute a module depending on a variable name. Example:
When I have "assemblies" I usually create a drop-down list and then create modules depending on the value. Like:
part = "body"; // [body, arm, leg, head, all]
if (part == "body") { body(); }
if (part == "arm") { arm(); }
...
if (part == "all") {
body();
arm();
leg();
head();
}
That way I can select individual parts to work on, render and export for printing, but I can also see the entire assembly together. The "all" selection often has some rotate() and translate() for the actual parts to put them at the right position within the assembly.
Regards, Jan
module_to_start = "create_plate"
sys(module_to_start) or &module_to_start
module create_plate () { ...}
module create_head () { ...}
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
---------- Forwarded message ----------
From: "William F. Adams via Discuss" discuss@lists.openscad.org
To: "discuss@lists.openscad.org" discuss@lists.openscad.org
Cc: "William F. Adams" willadams@aol.com
Bcc:
Date: Fri, 22 Oct 2021 19:36:06 +0000 (UTC)
Subject: [OpenSCAD] Re: Fwd: Re: start a module from a variabel
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