CC
Cory Cross
Sat, Jun 20, 2026 4:59 PM
My approach for this sort of thing has been to code in parallel:
- a module which makes a specific piece of geometry
- a matching function which when passed a descriptor of some aspect of the dimensions of the geometry, calculates and then returns that dimension
I'm assuming you use the function in the module?
On June 20, 2026 9:30:34 AM PDT, "William F. Adams via Discuss" <discuss@lists.openscad.org> wrote:
>My approach for this sort of thing has been to code in parallel:
>
> - a module which makes a specific piece of geometry
> - a matching function which when passed a descriptor of some aspect of the dimensions of the geometry, calculates and then returns that dimension
I'm assuming you use the function in the module?
LM
Leonard Martin Struttmann
Sat, Jun 20, 2026 5:09 PM
I do the same thing for keeping track of bounding-box info for each of my
parts/assemblies. I use<> all of my part files. Each file has a module()
to provide the geometry and a function() of the same name to "publish" any
internal data that is needed by the upper level assembly,
On Sat, Jun 20, 2026 at 12:00 PM Cory Cross via Discuss <
discuss@lists.openscad.org> wrote:
My approach for this sort of thing has been to code in parallel:
- a module which makes a specific piece of geometry
- a matching function which when passed a descriptor of some aspect of
the dimensions of the geometry, calculates and then returns that dimension
I'm assuming you use the function in the module?
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I do the same thing for keeping track of bounding-box info for each of my
parts/assemblies. I use<> all of my part files. Each file has a module()
to provide the geometry and a function() of the same name to "publish" any
internal data that is needed by the upper level assembly,
On Sat, Jun 20, 2026 at 12:00 PM Cory Cross via Discuss <
discuss@lists.openscad.org> wrote:
>
>
> On June 20, 2026 9:30:34 AM PDT, "William F. Adams via Discuss" <
> discuss@lists.openscad.org> wrote:
> >My approach for this sort of thing has been to code in parallel:
> >
> > - a module which makes a specific piece of geometry
> > - a matching function which when passed a descriptor of some aspect of
> the dimensions of the geometry, calculates and then returns that dimension
>
>
> I'm assuming you use the function in the module?
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
WF
William F. Adams
Sat, Jun 20, 2026 5:09 PM
My approach for this sort of thing has been to code in parallel:
- a module which makes a specific piece of geometry
- a matching function which when passed a descriptor of some aspect of the dimensions of the geometry, calculates and then returns that dimension
I'm assuming you use the function in the module?
Sometimes, or I use it in a different module, depends on what I'm doing and how I approach it.
That would probably be the best approach though, but since switching to PythonSCAD I haven't had occasion to do this sort of thing.
William
--
Sphinx of black quartz, judge my vow.
https://designinto3d.com/
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
On June 20, 2026 9:30:34 AM PDT, "William F. Adams via Discuss" <discuss@lists.openscad.org> wrote:
>My approach for this sort of thing has been to code in parallel:
>
> - a module which makes a specific piece of geometry
> - a matching function which when passed a descriptor of some aspect of the dimensions of the geometry, calculates and then returns that dimension
On Saturday, June 20, 2026 at 01:00:28 PM EDT, Cory Cross via Discuss <discuss@lists.openscad.org> wrote:
>I'm assuming you use the function in the module?
Sometimes, or I use it in a different module, depends on what I'm doing and how I approach it.
That would probably be the best approach though, but since switching to PythonSCAD I haven't had occasion to do this sort of thing.
William
--
Sphinx of black quartz, judge my vow.
https://designinto3d.com/
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
RW
Raymond West
Sun, Jun 21, 2026 11:01 AM
Hi Jordan,
what information about the shape would be useful? If manifold/watertight
3d, then surface area, volume, CoG, maybe location of CoG in world
coordinates, that sort of thing?
Best wishes,
Ray
On 20/06/2026 17:14, Jordan Brown via Discuss wrote:
Alas, the answer is simple: No.
Some work has been done to provide a feature that would let you
retrieve information about the shape resulting from OpenSCAD
operations, but it has been stalled for years. See PR #4478
https://github.com/openscad/openscad/pull/4478 and OEP 8
https://github.com/openscad/openscad/wiki/OEP8%3A-Objects-%28dictionaries%3F%29%2C-Geometry-as-data%2C-and-Module-References.
A bit of internals, to explain why this isn't easy: OpenSCAD runs a
program in approximately three phases:
- It parses the program into an internal Abstract Syntax Tree form.
- It evaluates the AST, executing the program, to yield a
Constructive Solid Geometry tree.
- It processes the CSG tree to yield triangles and OpenGL operations
(preview) or to yield a triangle mesh (render).
While the program is being executed, in the second phase, it hasn't
done any geometry work yet. It doesn't know what the results are of
the union - and in fact, for preview and some specialty cases, it may
never do the required geometry work to determine those results.
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
Hi Jordan,
what information about the shape would be useful? If manifold/watertight
3d, then surface area, volume, CoG, maybe location of CoG in world
coordinates, that sort of thing?
Best wishes,
Ray
On 20/06/2026 17:14, Jordan Brown via Discuss wrote:
>
> Alas, the answer is simple: No.
>
> Some work has been done to provide a feature that would let you
> retrieve information about the shape resulting from OpenSCAD
> operations, but it has been stalled for years. See PR #4478
> <https://github.com/openscad/openscad/pull/4478> and OEP 8
> <https://github.com/openscad/openscad/wiki/OEP8%3A-Objects-%28dictionaries%3F%29%2C-Geometry-as-data%2C-and-Module-References>.
>
> A bit of internals, to explain why this isn't easy: OpenSCAD runs a
> program in approximately three phases:
>
> * It parses the program into an internal Abstract Syntax Tree form.
> * It evaluates the AST, executing the program, to yield a
> Constructive Solid Geometry tree.
> * It processes the CSG tree to yield triangles and OpenGL operations
> (preview) or to yield a triangle mesh (render).
>
> While the program is being executed, in the second phase, it hasn't
> done any geometry work yet. It doesn't *know* what the results are of
> the union - and in fact, for preview and some specialty cases, it may
> never do the required geometry work to determine those results.
>
>
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email todiscuss-leave@lists.openscad.org
JD
John David
Sun, Jun 21, 2026 1:56 PM
I cannot speak for Jordan, but in the past I have needed information like
computing the "osculating sphere" at a given location, the "radius of
curvature", as well as easily computing multiple derivatives at 1D, 2D, and
3D positions. I think the length of a NURB has been included into BOSL2's
functionality in its NURB line/surface release. I will have to think what
else I have used in the past that was a pain. I remember needing to look
at derivative lines/surfaces for fairing, and also to calculate/smooth NURB
representations of motion -- which required calculating the "snap,"
"crackle," and "pop" derivatives of position. See <
https://en.wikipedia.org/wiki/Fourth,_fifth,_and_sixth_derivatives_of_position>
for details.
EBo --
On Sun, Jun 21, 2026 at 7:01 AM Raymond West via Discuss <
discuss@lists.openscad.org> wrote:
Hi Jordan,
what information about the shape would be useful? If manifold/watertight
3d, then surface area, volume, CoG, maybe location of CoG in world
coordinates, that sort of thing?
Best wishes,
Ray
On 20/06/2026 17:14, Jordan Brown via Discuss wrote:
Alas, the answer is simple: No.
Some work has been done to provide a feature that would let you retrieve
information about the shape resulting from OpenSCAD operations, but it has
been stalled for years. See PR #4478
https://github.com/openscad/openscad/pull/4478 and OEP 8
https://github.com/openscad/openscad/wiki/OEP8%3A-Objects-%28dictionaries%3F%29%2C-Geometry-as-data%2C-and-Module-References
.
A bit of internals, to explain why this isn't easy: OpenSCAD runs a
program in approximately three phases:
- It parses the program into an internal Abstract Syntax Tree form.
- It evaluates the AST, executing the program, to yield a Constructive
Solid Geometry tree.
- It processes the CSG tree to yield triangles and OpenGL operations
(preview) or to yield a triangle mesh (render).
While the program is being executed, in the second phase, it hasn't done
any geometry work yet. It doesn't know what the results are of the union
- and in fact, for preview and some specialty cases, it may never do the
required geometry work to determine those results.
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 cannot speak for Jordan, but in the past I have needed information like
computing the "osculating sphere" at a given location, the "radius of
curvature", as well as easily computing multiple derivatives at 1D, 2D, and
3D positions. I think the length of a NURB has been included into BOSL2's
functionality in its NURB line/surface release. I will have to think what
else I have used in the past that was a pain. I remember needing to look
at derivative lines/surfaces for fairing, and also to calculate/smooth NURB
representations of motion -- which required calculating the "snap,"
"crackle," and "pop" derivatives of position. See <
https://en.wikipedia.org/wiki/Fourth,_fifth,_and_sixth_derivatives_of_position>
for details.
EBo --
On Sun, Jun 21, 2026 at 7:01 AM Raymond West via Discuss <
discuss@lists.openscad.org> wrote:
> Hi Jordan,
>
> what information about the shape would be useful? If manifold/watertight
> 3d, then surface area, volume, CoG, maybe location of CoG in world
> coordinates, that sort of thing?
>
> Best wishes,
>
> Ray
> On 20/06/2026 17:14, Jordan Brown via Discuss wrote:
>
> Alas, the answer is simple: No.
>
> Some work has been done to provide a feature that would let you retrieve
> information about the shape resulting from OpenSCAD operations, but it has
> been stalled for years. See PR #4478
> <https://github.com/openscad/openscad/pull/4478> and OEP 8
> <https://github.com/openscad/openscad/wiki/OEP8%3A-Objects-%28dictionaries%3F%29%2C-Geometry-as-data%2C-and-Module-References>
> .
>
> A bit of internals, to explain why this isn't easy: OpenSCAD runs a
> program in approximately three phases:
>
> - It parses the program into an internal Abstract Syntax Tree form.
> - It evaluates the AST, executing the program, to yield a Constructive
> Solid Geometry tree.
> - It processes the CSG tree to yield triangles and OpenGL operations
> (preview) or to yield a triangle mesh (render).
>
> While the program is being executed, in the second phase, it hasn't done
> any geometry work yet. It doesn't *know* what the results are of the union
> - and in fact, for preview and some specialty cases, it may never do the
> required geometry work to determine those results.
>
>
>
> _______________________________________________
> 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
JB
Jordan Brown
Sun, Jun 21, 2026 4:10 PM
what information about the shape would be useful?
Start with the list of vertices and faces.
If manifold/watertight 3d, then surface area, volume, CoG, maybe location of CoG in world coordinates, that sort of thing?
You need the vertices and faces to calculate any of those things, and if you have the Vs and Fs you can calculate the rest.
,
> what information about the shape would be useful?
>
Start with the list of vertices and faces.
> If manifold/watertight 3d, then surface area, volume, CoG, maybe location of CoG in world coordinates, that sort of thing?
>
You need the vertices and faces to calculate any of those things, and if you have the Vs and Fs you can calculate the rest.