discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Geometric information as data

JB
Jordan Brown
Sun, Dec 14, 2025 10:36 PM

If you could get the points and vertexes of an OpenSCAD subassembly,
what would you do with the information?

That is, suppose there was a feature that would let you build up an
arbitrarily complex model, and would then return the points and faces in
the result - suitable for passing to polyhedron() - what would that let
you do?

A couple of quick starters:

  • You could get the bounding box, and position the subassembly (or
    another subassembly) based on those dimensions.
  • You could (not easily!) bend the object.
  • You could calculate the center of mass.

People ask for this feature not-infrequently... what are you itching to
do, that's hard to do without it?

If you could get the points and vertexes of an OpenSCAD subassembly, what would you do with the information? That is, suppose there was a feature that would let you build up an arbitrarily complex model, and would then return the points and faces in the result - suitable for passing to polyhedron() - what would that let you do? A couple of quick starters: * You could get the bounding box, and position the subassembly (or another subassembly) based on those dimensions. * You could (not easily!) bend the object. * You could calculate the center of mass. People ask for this feature not-infrequently... what are you itching to do, that's hard to do without it?
JB
Jordan Brown
Sun, Dec 14, 2025 10:37 PM

Oh, and to be clear, the points and paths resulting from 2D operations
would be similarly available.

Oh, and to be clear, the points and paths resulting from 2D operations would be similarly available.
AM
Adrian Mariano
Sun, Dec 14, 2025 10:50 PM

BOSL2 already has vnf_bend().  Other kinds of point remapping would be
possible.  You could position other objects onto the surface of the
object.  You could find the edges and apply rounding masks to them.
Knowing the bounding box lets you robustly do things like take the top half
of an object without needing a user parameter for the object's
size.  Things like catmull smoothing or more sophisticated algorithms of
that sort would be possible.

The difficulty of doing interesting things to 3d objects in userspace is
that typically it's intractable in OpenSCAD language.

On Sun, Dec 14, 2025 at 5:38 PM Jordan Brown via Discuss <
discuss@lists.openscad.org> wrote:

Oh, and to be clear, the points and paths resulting from 2D operations
would be similarly available.


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

BOSL2 already has vnf_bend(). Other kinds of point remapping would be possible. You could position other objects onto the surface of the object. You could find the edges and apply rounding masks to them. Knowing the bounding box lets you robustly do things like take the top half of an object without needing a user parameter for the object's size. Things like catmull smoothing or more sophisticated algorithms of that sort would be possible. The difficulty of doing interesting things to 3d objects in userspace is that typically it's intractable in OpenSCAD language. On Sun, Dec 14, 2025 at 5:38 PM Jordan Brown via Discuss < discuss@lists.openscad.org> wrote: > Oh, and to be clear, the points and paths resulting from 2D operations > would be similarly available. > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
LM
Leonard Martin Struttmann
Mon, Dec 15, 2025 1:28 AM

I kinda do that by exporting from OpenSCAD to an OBJ file.

I then run the OBJ through a Python program that:

  1. Determines the bounding box,
  2. Optionally applies scaling,
  3. Translates the points so that the minimum X, Y, & Z points are at the
    original,
  4. Then writes an OpenSCAD file that contains the point and faces, with a
    polyhedron() at the end.

I use this to convert STEP files from parts and PCB manufacturers into
OpenSCAD models.

On Sun, Dec 14, 2025 at 4:51 PM Adrian Mariano via Discuss <
discuss@lists.openscad.org> wrote:

BOSL2 already has vnf_bend().  Other kinds of point remapping would be
possible.  You could position other objects onto the surface of the
object.  You could find the edges and apply rounding masks to them.
Knowing the bounding box lets you robustly do things like take the top half
of an object without needing a user parameter for the object's
size.  Things like catmull smoothing or more sophisticated algorithms of
that sort would be possible.

The difficulty of doing interesting things to 3d objects in userspace is
that typically it's intractable in OpenSCAD language.

On Sun, Dec 14, 2025 at 5:38 PM Jordan Brown via Discuss <
discuss@lists.openscad.org> wrote:

Oh, and to be clear, the points and paths resulting from 2D operations
would be similarly available.


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 kinda do that by exporting from OpenSCAD to an OBJ file. I then run the OBJ through a Python program that: 1) Determines the bounding box, 2) Optionally applies scaling, 3) Translates the points so that the minimum X, Y, & Z points are at the original, 4) Then writes an OpenSCAD file that contains the point and faces, with a polyhedron() at the end. I use this to convert STEP files from parts and PCB manufacturers into OpenSCAD models. On Sun, Dec 14, 2025 at 4:51 PM Adrian Mariano via Discuss < discuss@lists.openscad.org> wrote: > BOSL2 already has vnf_bend(). Other kinds of point remapping would be > possible. You could position other objects onto the surface of the > object. You could find the edges and apply rounding masks to them. > Knowing the bounding box lets you robustly do things like take the top half > of an object without needing a user parameter for the object's > size. Things like catmull smoothing or more sophisticated algorithms of > that sort would be possible. > > The difficulty of doing interesting things to 3d objects in userspace is > that typically it's intractable in OpenSCAD language. > > On Sun, Dec 14, 2025 at 5:38 PM Jordan Brown via Discuss < > discuss@lists.openscad.org> wrote: > >> Oh, and to be clear, the points and paths resulting from 2D operations >> would be similarly available. >> >> _______________________________________________ >> 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
Jon Bondy
Mon, Dec 15, 2025 1:40 AM

Leonard's comment is just one in a series of recent comments that make
me wonder what all of us are doing with/in OpenSCAD.

Rather than everyone chiming in, resulting in a chaotic thread, I wonder
if we could set up a small database/table somewhere that people could
fill in.  I imagine that the breadth would be stunning, and it could be
a good way to promote the language.

On 12/14/2025 8:28 PM, Leonard Martin Struttmann via Discuss wrote:

I kinda do that by exporting from OpenSCAD to an OBJ file.

I then run the OBJ through a Python program that:

  1. Determines the bounding box,
  2. Optionally applies scaling,
  3. Translates the points so that the minimum X, Y, & Z points are at
    the original,
  4. Then writes an OpenSCAD file that contains the point and faces,
    with a polyhedron() at the end.

I use this to convert STEP files from parts and PCB manufacturers into
OpenSCAD models.

--
This email has been checked for viruses by AVG antivirus software.
www.avg.com

Leonard's comment is just one in a series of recent comments that make me wonder what all of us are doing with/in OpenSCAD. Rather than everyone chiming in, resulting in a chaotic thread, I wonder if we could set up a small database/table somewhere that people could fill in.  I imagine that the breadth would be stunning, and it could be a good way to promote the language. On 12/14/2025 8:28 PM, Leonard Martin Struttmann via Discuss wrote: > I kinda do that by exporting from OpenSCAD to an OBJ file. > > I then run the OBJ through a Python program that: > 1) Determines the bounding box, > 2) Optionally applies scaling, > 3) Translates the points so that the minimum X, Y, & Z points are at > the original, > 4) Then writes an OpenSCAD file that contains the point and faces, > with a polyhedron() at the end. > > I use this to convert STEP files from parts and PCB manufacturers into > OpenSCAD models. > -- This email has been checked for viruses by AVG antivirus software. www.avg.com
LD
lee.deraud@roadrunner.com
Mon, Dec 15, 2025 2:33 AM

I’ve often thought that, if I had any children, I’d happily trade the oldest for a bounding box function.

The ‘manifold’ render display of it means a complete “can’t do that” is now “ well that’s annoying”. But still…

(I’m old enough that my hypothetical eldest would be long-since grown: I’m  not a complete monster. 😊)

From: Jordan Brown via Discuss discuss@lists.openscad.org
Sent: Sunday, December 14, 2025 2:36 PM
To: OpenSCAD discuss@lists.openscad.org
Cc: Jordan Brown openscad@jordan.maileater.net
Subject: [OpenSCAD] Geometric information as data

If you could get the points and vertexes of an OpenSCAD subassembly, what would you do with the information?

That is, suppose there was a feature that would let you build up an arbitrarily complex model, and would then return the points and faces in the result - suitable for passing to polyhedron() - what would that let you do?

A couple of quick starters:

  • You could get the bounding box, and position the subassembly (or another subassembly) based on those dimensions.
  • You could (not easily!) bend the object.
  • You could calculate the center of mass.

People ask for this feature not-infrequently... what are you itching to do, that's hard to do without it?

I’ve often thought that, if I had any children, I’d happily trade the oldest for a bounding box function. The ‘manifold’ render display of it means a complete “can’t do that” is now “ well that’s annoying”. But still… (I’m old enough that my hypothetical eldest would be long-since grown: I’m not a complete monster. 😊) From: Jordan Brown via Discuss <discuss@lists.openscad.org> Sent: Sunday, December 14, 2025 2:36 PM To: OpenSCAD <discuss@lists.openscad.org> Cc: Jordan Brown <openscad@jordan.maileater.net> Subject: [OpenSCAD] Geometric information as data If you could get the points and vertexes of an OpenSCAD subassembly, what would you do with the information? That is, suppose there was a feature that would let you build up an arbitrarily complex model, and would then return the points and faces in the result - suitable for passing to polyhedron() - what would that let you do? A couple of quick starters: * You could get the bounding box, and position the subassembly (or another subassembly) based on those dimensions. * You could (not easily!) bend the object. * You could calculate the center of mass. People ask for this feature not-infrequently... what are you itching to do, that's hard to do without it?
LM
Leonard Martin Struttmann
Mon, Dec 15, 2025 3:44 AM

I’ve often thought that, if I had any children, I’d happily trade the
oldest for a bounding box function.

Yes, that IS one of my biggest wish-list items.

To get around that lack, I developed a very complicated scheme where each
part that I model (in its own file) also includes a function that provides
the (manually calculated) bounding box for that part.  Then, when I create
an Assembly from those parts, I query all of the part's functions to
finally calculate an overall bounding box for the entire assembly.

It works... most of the time.

On Sun, Dec 14, 2025 at 8:34 PM Lee DeRaud via Discuss <
discuss@lists.openscad.org> wrote:

I’ve often thought that, if I had any children, I’d happily trade the
oldest for a bounding box function.

The ‘manifold’ render display of it means a complete “can’t do that” is
now “ well that’s annoying”. But still…

(I’m old enough that my hypothetical eldest would be long-since grown: I’m
not a complete monster. 😊)

From: Jordan Brown via Discuss discuss@lists.openscad.org
Sent: Sunday, December 14, 2025 2:36 PM
To: OpenSCAD discuss@lists.openscad.org
Cc: Jordan Brown openscad@jordan.maileater.net
Subject: [OpenSCAD] Geometric information as data

If you could get the points and vertexes of an OpenSCAD subassembly, what
would you do with the information?

That is, suppose there was a feature that would let you build up an
arbitrarily complex model, and would then return the points and faces in
the result - suitable for passing to polyhedron() - what would that let you
do?

A couple of quick starters:

- You could get the bounding box, and position the subassembly (or
another subassembly) based on those dimensions.
- You could (not easily!) bend the object.
- You could calculate the center of mass.

People ask for this feature not-infrequently... what are you itching to
do, that's hard to do without it?


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

*I’ve often thought that, if I had any children, I’d happily trade the oldest for a bounding box function.* Yes, that IS one of my biggest wish-list items. To get around that lack, I developed a very complicated scheme where each part that I model (in its own file) also includes a function that provides the (manually calculated) bounding box for that part. Then, when I create an Assembly from those parts, I query all of the part's functions to finally calculate an overall bounding box for the entire assembly. It works... most of the time. On Sun, Dec 14, 2025 at 8:34 PM Lee DeRaud via Discuss < discuss@lists.openscad.org> wrote: > I’ve often thought that, if I had any children, I’d happily trade the > oldest for a bounding box function. > > The ‘manifold’ render display of it means a complete “can’t do that” is > now “ well that’s annoying”. But still… > > > > (I’m old enough that my hypothetical eldest would be long-since grown: I’m > not a *complete* monster. 😊) > > > > *From:* Jordan Brown via Discuss <discuss@lists.openscad.org> > *Sent:* Sunday, December 14, 2025 2:36 PM > *To:* OpenSCAD <discuss@lists.openscad.org> > *Cc:* Jordan Brown <openscad@jordan.maileater.net> > *Subject:* [OpenSCAD] Geometric information as data > > > > If you could get the points and vertexes of an OpenSCAD subassembly, what > would you do with the information? > > That is, suppose there was a feature that would let you build up an > arbitrarily complex model, and would then return the points and faces in > the result - suitable for passing to polyhedron() - what would that let you > do? > > A couple of quick starters: > > - You could get the bounding box, and position the subassembly (or > another subassembly) based on those dimensions. > - You could (not easily!) bend the object. > - You could calculate the center of mass. > > People ask for this feature not-infrequently... what are you itching to > do, that's hard to do without it? > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
CC
Cory Cross
Mon, Dec 15, 2025 5:33 AM

On December 14, 2025 2:50:52 PM PST, Adrian Mariano via Discuss discuss@lists.openscad.org wrote:

The difficulty of doing interesting things to 3d objects in userspace is
that typically it's intractable in OpenSCAD language.

What do you mean by this?

On December 14, 2025 2:50:52 PM PST, Adrian Mariano via Discuss <discuss@lists.openscad.org> wrote: >The difficulty of doing interesting things to 3d objects in userspace is >that typically it's intractable in OpenSCAD language. What do you mean by this?
AM
Adrian Mariano
Mon, Dec 15, 2025 11:29 AM

The OpenSCAD language provides no powerful data structures.  If you look up
geometrical algorithms they almost always rely on things like a priority
queue that is supposed to have O(log n) insertion and O(1) retrieval.
That's not possible to implement in OpenSCAD.  The result is that
implementation of such algorithms ends up being quadratic or worse.  My
implementation of offset() in 2d in userspace is O(N^2) and relies on
heuristics that sometimes fail because when I tried a robust implementation
it was taking minutes to run on even small inputs.  That's what I mean by
intractable, and that was in 2d.  Our implementation of duplicate point
removal for 3d geometry can take a long time to run.  The validator for
polygon data usually takes tens of minutes on inputs of moderate size.

On Mon, Dec 15, 2025 at 12:33 AM Cory Cross via Discuss <
discuss@lists.openscad.org> wrote:

On December 14, 2025 2:50:52 PM PST, Adrian Mariano via Discuss <
discuss@lists.openscad.org> wrote:

The difficulty of doing interesting things to 3d objects in userspace is
that typically it's intractable in OpenSCAD language.

What do you mean by this?


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

The OpenSCAD language provides no powerful data structures. If you look up geometrical algorithms they almost always rely on things like a priority queue that is supposed to have O(log n) insertion and O(1) retrieval. That's not possible to implement in OpenSCAD. The result is that implementation of such algorithms ends up being quadratic or worse. My implementation of offset() in 2d in userspace is O(N^2) and relies on heuristics that sometimes fail because when I tried a robust implementation it was taking minutes to run on even small inputs. That's what I mean by intractable, and that was in 2d. Our implementation of duplicate point removal for 3d geometry can take a long time to run. The validator for polygon data usually takes tens of minutes on inputs of moderate size. On Mon, Dec 15, 2025 at 12:33 AM Cory Cross via Discuss < discuss@lists.openscad.org> wrote: > > > On December 14, 2025 2:50:52 PM PST, Adrian Mariano via Discuss < > discuss@lists.openscad.org> wrote: > >The difficulty of doing interesting things to 3d objects in userspace is > >that typically it's intractable in OpenSCAD language. > > What do you mean by this? > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
GB
Glenn Butcher
Mon, Dec 15, 2025 3:52 PM
  1. Make multiple copies.  Right now, every time I need a corbel on my
    current project, a railroad depot model, I need to import() it from the
    .3mf file.  23 times.  It would be nice to be able to 'corbel =
    import("corbel.3mf");', then 'render corbel;' or somesuch 23 times
    prepended with the requisite translate() calls to place them around the
    building.

  2. Mung meshes made from heightmaps.  On the same project, I'm modeling
    stone walls, and the stones have a taper down to the mortar.  I'm doing
    this right now in a C++ program that uses OpenCV to make incremental
    contours by scaling copies of the original contour and using them as
    multipliers against the texture heightmap, but I think there's a mesh
    deformation method that would be more straightforward.  Also, being able
    to define heightmap tables in the language would be handy, too. Oh, and
    exposing Manifold's Simplify() method would be handy to reduce the
    complexity of heightmap-sourced meshes.

Glenn

On 12/14/2025 3:36 PM, Jordan Brown via Discuss wrote:

If you could get the points and vertexes of an OpenSCAD subassembly,
what would you do with the information?

That is, suppose there was a feature that would let you build up an
arbitrarily complex model, and would then return the points and faces
in the result - suitable for passing to polyhedron() - what would that
let you do?

A couple of quick starters:

  • You could get the bounding box, and position the subassembly (or
    another subassembly) based on those dimensions.
  • You could (not easily!) bend the object.
  • You could calculate the center of mass.

People ask for this feature not-infrequently... what are you itching
to do, that's hard to do without it?


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

1. Make multiple copies.  Right now, every time I need a corbel on my current project, a railroad depot model, I need to import() it from the .3mf file.  23 times.  It would be nice to be able to 'corbel = import("corbel.3mf");', then 'render corbel;' or somesuch 23 times prepended with the requisite translate() calls to place them around the building. 2. Mung meshes made from heightmaps.  On the same project, I'm modeling stone walls, and the stones have a taper down to the mortar.  I'm doing this right now in a C++ program that uses OpenCV to make incremental contours by scaling copies of the original contour and using them as multipliers against the texture heightmap, but I think there's a mesh deformation method that would be more straightforward.  Also, being able to define heightmap tables in the language would be handy, too. Oh, and exposing Manifold's Simplify() method would be handy to reduce the complexity of heightmap-sourced meshes. Glenn On 12/14/2025 3:36 PM, Jordan Brown via Discuss wrote: > If you could get the points and vertexes of an OpenSCAD subassembly, > what would you do with the information? > > That is, suppose there was a feature that would let you build up an > arbitrarily complex model, and would then return the points and faces > in the result - suitable for passing to polyhedron() - what would that > let you do? > > A couple of quick starters: > > * You could get the bounding box, and position the subassembly (or > another subassembly) based on those dimensions. > * You could (not easily!) bend the object. > * You could calculate the center of mass. > > People ask for this feature not-infrequently... what are you itching > to do, that's hard to do without it? > > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org