discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

is here some way to extract the edge of a 2D object as lines?

JD
John David
Fri, Feb 6, 2026 1:12 PM

this creates a polygon that has width=t, and not an actual line.  The
problem is that there is no line primitive in OpenSCAD.  I have to figure
out how to resolve that.

On Fri, Feb 6, 2026 at 7:39 AM Raymond West via Discuss <
discuss@lists.openscad.org> wrote:

The reply was wrt coloured simulated laser cutter lines. What other lines
are there? Ones defining edges? point to point? Here is some code, for
lines you can not visualise.

On 06/02/2026 10:50, Guenther Sohler via Discuss wrote:

Raymond, your lines are actually 2D because they have a width and
therefore suitable for visualization.
(and its needs a moderate amount of processingm circle, hull)
I wished, OpenSCAD would also start to support real 1D elements.
Effectively its just one additional data type
More datatypes don make sense.

On Fri, Feb 6, 2026 at 11:25 AM Raymond West via Discuss <
discuss@lists.openscad.org> wrote:

A few lines of code will do what you want wrt coloured lines in openscad.

module line(p1,p2,t,col){
color(col)hull(){
translate(p1)circle(d=t);
translate(p2)circle(d=t);
}
};

line([0,20],[5,9],0.5,"red");

On 06/02/2026 06:06, John David via Discuss wrote:

Thank you, Jordan, I was afraid of that. There are a couple of us who
have been trying to generate colored SVG images to export into laser
cutters and the like.  I have colored SVG now working, but by using diffs
of objects with offsets, I end up getting 2x lines (which would force the
laser to go over the path twice...  I'm now looking at the experimental
gcode support and see where that takes me.

Thanks again, and not having point or line primitives explains a lot of
confusion I have been having.

On Fri, Feb 6, 2026 at 12:06 AM Jordan Brown <
openscad@jordan.maileater.net> wrote:

On 2/5/2026 8:59 PM, Jordan Brown via Discuss wrote:

There is no actual line primitive in OpenSCAD.  OpenSCAD deals with
solid 3D polyhedra and filled 2D polygons, and does not deal with any other
variations (e.g. points, lines, unfilled objects).

I should add a small disclaimer to that.  There are a few cases that are
not exactly 3D polyhedra and not exactly 2D polygons, that sort of work,
some of the time:

- 2D polygons transformed out of the Z=0 plane will be previewed
sensibly, but will render and extrude projected at Z=0.
- You can give hull() a "polyhedron" that consists of a point cloud,
and it'll give you a hull of those points.  (I don't recall whether you
have to pretend to group them into faces, but you don't have to group them
into *sensible* faces.)
- You can create "incomplete" polyhedra, where the faces aren't
fully and correctly connected.  Previewing will more or less work.
Rendering will fail as soon as it tries to do any boolean operation.  (This
is actually quite useful while you are constructing and debugging a
polyhedron.)

But there's definitely no lines or points.


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

this creates a polygon that has width=t, and not an actual line. The problem is that there is no line primitive in OpenSCAD. I have to figure out how to resolve that. On Fri, Feb 6, 2026 at 7:39 AM Raymond West via Discuss < discuss@lists.openscad.org> wrote: > The reply was wrt coloured simulated laser cutter lines. What other lines > are there? Ones defining edges? point to point? Here is some code, for > lines you can not visualise. > > > On 06/02/2026 10:50, Guenther Sohler via Discuss wrote: > > Raymond, your lines are actually 2D because they have a width and > therefore suitable for visualization. > (and its needs a moderate amount of processingm circle, hull) > I wished, OpenSCAD would also start to support *real* 1D elements. > Effectively its just one additional data type > More datatypes don make sense. > > > On Fri, Feb 6, 2026 at 11:25 AM Raymond West via Discuss < > discuss@lists.openscad.org> wrote: > >> A few lines of code will do what you want wrt coloured lines in openscad. >> >> module line(p1,p2,t,col){ >> color(col)hull(){ >> translate(p1)circle(d=t); >> translate(p2)circle(d=t); >> } >> }; >> >> >> line([0,20],[5,9],0.5,"red"); >> >> >> On 06/02/2026 06:06, John David via Discuss wrote: >> >> Thank you, Jordan, I was afraid of that. There are a couple of us who >> have been trying to generate colored SVG images to export into laser >> cutters and the like. I have colored SVG now working, but by using diffs >> of objects with offsets, I end up getting 2x lines (which would force the >> laser to go over the path twice... I'm now looking at the experimental >> gcode support and see where that takes me. >> >> Thanks again, and not having point or line primitives explains a lot of >> confusion I have been having. >> >> On Fri, Feb 6, 2026 at 12:06 AM Jordan Brown < >> openscad@jordan.maileater.net> wrote: >> >>> On 2/5/2026 8:59 PM, Jordan Brown via Discuss wrote: >>> >>> There is no actual line primitive in OpenSCAD. OpenSCAD deals with >>> solid 3D polyhedra and filled 2D polygons, and does not deal with any other >>> variations (e.g. points, lines, unfilled objects). >>> >>> >>> I should add a small disclaimer to that. There are a few cases that are >>> not exactly 3D polyhedra and not exactly 2D polygons, that sort of work, >>> some of the time: >>> >>> - 2D polygons transformed out of the Z=0 plane will be previewed >>> sensibly, but will render and extrude projected at Z=0. >>> - You can give hull() a "polyhedron" that consists of a point cloud, >>> and it'll give you a hull of those points. (I don't recall whether you >>> have to pretend to group them into faces, but you don't have to group them >>> into *sensible* faces.) >>> - You can create "incomplete" polyhedra, where the faces aren't >>> fully and correctly connected. Previewing will more or less work. >>> Rendering will fail as soon as it tries to do any boolean operation. (This >>> is actually quite useful while you are constructing and debugging a >>> polyhedron.) >>> >>> But there's definitely no lines or points. >>> >>> >>> >> _______________________________________________ >> 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
NH
nop head
Fri, Feb 6, 2026 6:34 PM

I think an SVG polygon with no fill attribute will be interpreted as an
outline. You could hand edit one to try it.

On Fri, 6 Feb 2026, 13:13 John David via Discuss, <
discuss@lists.openscad.org> wrote:

this creates a polygon that has width=t, and not an actual line.  The
problem is that there is no line primitive in OpenSCAD.  I have to figure
out how to resolve that.

On Fri, Feb 6, 2026 at 7:39 AM Raymond West via Discuss <
discuss@lists.openscad.org> wrote:

The reply was wrt coloured simulated laser cutter lines. What other lines
are there? Ones defining edges? point to point? Here is some code, for
lines you can not visualise.

On 06/02/2026 10:50, Guenther Sohler via Discuss wrote:

Raymond, your lines are actually 2D because they have a width and
therefore suitable for visualization.
(and its needs a moderate amount of processingm circle, hull)
I wished, OpenSCAD would also start to support real 1D elements.
Effectively its just one additional data type
More datatypes don make sense.

On Fri, Feb 6, 2026 at 11:25 AM Raymond West via Discuss <
discuss@lists.openscad.org> wrote:

A few lines of code will do what you want wrt coloured lines in openscad.

module line(p1,p2,t,col){
color(col)hull(){
translate(p1)circle(d=t);
translate(p2)circle(d=t);
}
};

line([0,20],[5,9],0.5,"red");

On 06/02/2026 06:06, John David via Discuss wrote:

Thank you, Jordan, I was afraid of that. There are a couple of us who
have been trying to generate colored SVG images to export into laser
cutters and the like.  I have colored SVG now working, but by using diffs
of objects with offsets, I end up getting 2x lines (which would force the
laser to go over the path twice...  I'm now looking at the experimental
gcode support and see where that takes me.

Thanks again, and not having point or line primitives explains a lot of
confusion I have been having.

On Fri, Feb 6, 2026 at 12:06 AM Jordan Brown <
openscad@jordan.maileater.net> wrote:

On 2/5/2026 8:59 PM, Jordan Brown via Discuss wrote:

There is no actual line primitive in OpenSCAD.  OpenSCAD deals with
solid 3D polyhedra and filled 2D polygons, and does not deal with any other
variations (e.g. points, lines, unfilled objects).

I should add a small disclaimer to that.  There are a few cases that
are not exactly 3D polyhedra and not exactly 2D polygons, that sort of
work, some of the time:

- 2D polygons transformed out of the Z=0 plane will be previewed
sensibly, but will render and extrude projected at Z=0.
- You can give hull() a "polyhedron" that consists of a point
cloud, and it'll give you a hull of those points.  (I don't recall whether
you have to pretend to group them into faces, but you don't have to group
them into *sensible* faces.)
- You can create "incomplete" polyhedra, where the faces aren't
fully and correctly connected.  Previewing will more or less work.
Rendering will fail as soon as it tries to do any boolean operation.  (This
is actually quite useful while you are constructing and debugging a
polyhedron.)

But there's definitely no lines or points.


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

I think an SVG polygon with no fill attribute will be interpreted as an outline. You could hand edit one to try it. On Fri, 6 Feb 2026, 13:13 John David via Discuss, < discuss@lists.openscad.org> wrote: > this creates a polygon that has width=t, and not an actual line. The > problem is that there is no line primitive in OpenSCAD. I have to figure > out how to resolve that. > > On Fri, Feb 6, 2026 at 7:39 AM Raymond West via Discuss < > discuss@lists.openscad.org> wrote: > >> The reply was wrt coloured simulated laser cutter lines. What other lines >> are there? Ones defining edges? point to point? Here is some code, for >> lines you can not visualise. >> >> >> On 06/02/2026 10:50, Guenther Sohler via Discuss wrote: >> >> Raymond, your lines are actually 2D because they have a width and >> therefore suitable for visualization. >> (and its needs a moderate amount of processingm circle, hull) >> I wished, OpenSCAD would also start to support *real* 1D elements. >> Effectively its just one additional data type >> More datatypes don make sense. >> >> >> On Fri, Feb 6, 2026 at 11:25 AM Raymond West via Discuss < >> discuss@lists.openscad.org> wrote: >> >>> A few lines of code will do what you want wrt coloured lines in openscad. >>> >>> module line(p1,p2,t,col){ >>> color(col)hull(){ >>> translate(p1)circle(d=t); >>> translate(p2)circle(d=t); >>> } >>> }; >>> >>> >>> line([0,20],[5,9],0.5,"red"); >>> >>> >>> On 06/02/2026 06:06, John David via Discuss wrote: >>> >>> Thank you, Jordan, I was afraid of that. There are a couple of us who >>> have been trying to generate colored SVG images to export into laser >>> cutters and the like. I have colored SVG now working, but by using diffs >>> of objects with offsets, I end up getting 2x lines (which would force the >>> laser to go over the path twice... I'm now looking at the experimental >>> gcode support and see where that takes me. >>> >>> Thanks again, and not having point or line primitives explains a lot of >>> confusion I have been having. >>> >>> On Fri, Feb 6, 2026 at 12:06 AM Jordan Brown < >>> openscad@jordan.maileater.net> wrote: >>> >>>> On 2/5/2026 8:59 PM, Jordan Brown via Discuss wrote: >>>> >>>> There is no actual line primitive in OpenSCAD. OpenSCAD deals with >>>> solid 3D polyhedra and filled 2D polygons, and does not deal with any other >>>> variations (e.g. points, lines, unfilled objects). >>>> >>>> >>>> I should add a small disclaimer to that. There are a few cases that >>>> are not exactly 3D polyhedra and not exactly 2D polygons, that sort of >>>> work, some of the time: >>>> >>>> - 2D polygons transformed out of the Z=0 plane will be previewed >>>> sensibly, but will render and extrude projected at Z=0. >>>> - You can give hull() a "polyhedron" that consists of a point >>>> cloud, and it'll give you a hull of those points. (I don't recall whether >>>> you have to pretend to group them into faces, but you don't have to group >>>> them into *sensible* faces.) >>>> - You can create "incomplete" polyhedra, where the faces aren't >>>> fully and correctly connected. Previewing will more or less work. >>>> Rendering will fail as soon as it tries to do any boolean operation. (This >>>> is actually quite useful while you are constructing and debugging a >>>> polyhedron.) >>>> >>>> But there's definitely no lines or points. >>>> >>>> >>>> >>> _______________________________________________ >>> 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
JB
Jordan Brown
Fri, Feb 6, 2026 7:58 PM

I wished, OpenSCAD would also start to support real 1D elements. Effectively its just one additional data type

It’s not just a data type - it’s operations on that data type. You should, for instance, be able to intersect a line with a sphere and get only that portion of the line that lies inside the sphere.

All of that is clearly possible.  All it takes is work, by people who have the right knowledge and, critically, who are interested enough to spend their spare time doing it.

> I wished, OpenSCAD would also start to support *real* 1D elements. Effectively its just one additional data type It’s not just a data type - it’s operations on that data type. You should, for instance, be able to intersect a line with a sphere and get only that portion of the line that lies inside the sphere. All of that is clearly possible. All it takes is work, by people who have the right knowledge and, critically, who are interested enough to spend their spare time doing it.
AM
Adrian Mariano
Fri, Feb 6, 2026 11:53 PM

BOSL2 provides some line intersection methods, including line intersection
with polygon (which can generate a list of line segments), and I wrote line
intersection with polyhedron.  I didn't actually put the latter in the
library since I wasn't sure it was useful and it's kinda slow.  I was
actually trying to do polygon-polyhedron intersection and the run time was
outrageously long.  Would line-polyhedron intersection be useful to
somebody in OpenSCAD?

On Fri, Feb 6, 2026 at 2:58 PM Jordan Brown via Discuss <
discuss@lists.openscad.org> wrote:

I wished, OpenSCAD would also start to support real 1D elements.

Effectively its just one additional data type

It’s not just a data type - it’s operations on that data type. You should,
for instance, be able to intersect a line with a sphere and get only that
portion of the line that lies inside the sphere.

All of that is clearly possible.  All it takes is work, by people who have
the right knowledge and, critically, who are interested enough to spend
their spare time doing it.


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

BOSL2 provides some line intersection methods, including line intersection with polygon (which can generate a list of line segments), and I wrote line intersection with polyhedron. I didn't actually put the latter in the library since I wasn't sure it was useful and it's kinda slow. I was actually trying to do polygon-polyhedron intersection and the run time was outrageously long. Would line-polyhedron intersection be useful to somebody in OpenSCAD? On Fri, Feb 6, 2026 at 2:58 PM Jordan Brown via Discuss < discuss@lists.openscad.org> wrote: > > > I wished, OpenSCAD would also start to support *real* 1D elements. > Effectively its just one additional data type > > It’s not just a data type - it’s operations on that data type. You should, > for instance, be able to intersect a line with a sphere and get only that > portion of the line that lies inside the sphere. > > All of that is clearly possible. All it takes is work, by people who have > the right knowledge and, critically, who are interested enough to spend > their spare time doing it. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
JB
Jordan Brown
Sat, Feb 7, 2026 12:28 AM

On 2/6/2026 3:53 PM, Adrian Mariano via Discuss wrote:

BOSL2 provides some line intersection methods, including line
intersection with polygon (which can generate a list of line
segments), and I wrote line intersection with polyhedron.  I didn't
actually put the latter in the library since I wasn't sure it was
useful and it's kinda slow.  I was actually trying to do
polygon-polyhedron intersection and the run time was outrageously
long.  Would line-polyhedron intersection be useful to somebody in
OpenSCAD?  

I have no real feeling on whether line-polyhedron intersection is
useful.  Line-polygon intersection and difference do seem useful.

Generally, if we're going to have these components I would prefer that
all of the combinations that can do something sensible, do.  The
alternative is a patchwork where one can never tell what combination
will and won't work.

That said, polygon-polyhedron intersection and difference are sensible
and we don't support them today.  Similarly, we don't support any
boolean operations on "incomplete" polyhedra, which are sort of related
to 2D objects but are different.

On 2/6/2026 3:53 PM, Adrian Mariano via Discuss wrote: > BOSL2 provides some line intersection methods, including line > intersection with polygon (which can generate a list of line > segments), and I wrote line intersection with polyhedron.  I didn't > actually put the latter in the library since I wasn't sure it was > useful and it's kinda slow.  I was actually trying to do > polygon-polyhedron intersection and the run time was outrageously > long.  Would line-polyhedron intersection be useful to somebody in > OpenSCAD?   I have no real feeling on whether line-polyhedron intersection is useful.  Line-polygon intersection and difference do seem useful. Generally, if we're going to have these components I would prefer that all of the combinations that can do something sensible, do.  The alternative is a patchwork where one can never tell what combination will and won't work. That said, polygon-polyhedron intersection and difference are sensible and we don't support them today.  Similarly, we don't support any boolean operations on "incomplete" polyhedra, which are sort of related to 2D objects but are different.