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 3:29 AM

I got some time to go back to playing with using Open-/Python-SCAD to pass
colored SVG (where the color contains conveys information about
cutting/engraving/scoring/etc.)...

The thing I am stuck on is that I have a 2D model, or use
3D_object.project(cut=true), but I have not figured out how to convert the
edge of the 2D polygon to lines?  How is this done?

Thanks in advance.

EBo --

I got some time to go back to playing with using Open-/Python-SCAD to pass colored SVG (where the color contains conveys information about cutting/engraving/scoring/etc.)... The thing I am stuck on is that I have a 2D model, or use 3D_object.project(cut=true), but I have not figured out how to convert the edge of the 2D polygon to lines? How is this done? Thanks in advance. EBo --
JD
John David
Fri, Feb 6, 2026 3:46 AM

I have found a number of places that define line() as a 2D or 3D objects <
https://openhome.cc/eGossip/OpenSCAD/Polyline.html>, which build a line
(with its width) as polygons.  Is there no actual line primitive in
OpenSCAD?

On Thu, Feb 5, 2026 at 10:29 PM John David ebo.2112@gmail.com wrote:

I got some time to go back to playing with using Open-/Python-SCAD to pass
colored SVG (where the color contains conveys information about
cutting/engraving/scoring/etc.)...

The thing I am stuck on is that I have a 2D model, or use
3D_object.project(cut=true), but I have not figured out how to convert the
edge of the 2D polygon to lines?  How is this done?

Thanks in advance.

EBo --

I have found a number of places that define line() as a 2D or 3D objects < https://openhome.cc/eGossip/OpenSCAD/Polyline.html>, which build a line (with its width) as polygons. Is there no actual line primitive in OpenSCAD? On Thu, Feb 5, 2026 at 10:29 PM John David <ebo.2112@gmail.com> wrote: > I got some time to go back to playing with using Open-/Python-SCAD to pass > colored SVG (where the color contains conveys information about > cutting/engraving/scoring/etc.)... > > The thing I am stuck on is that I have a 2D model, or use > 3D_object.project(cut=true), but I have not figured out how to convert the > edge of the 2D polygon to lines? How is this done? > > Thanks in advance. > > EBo -- >
JB
Jordan Brown
Fri, Feb 6, 2026 4:59 AM

On 2/5/2026 7:46 PM, John David via Discuss wrote:

I have found a number of places that define line() as a 2D or 3D
objects https://openhome.cc/eGossip/OpenSCAD/Polyline.html, which
build a line (with its width) as polygons.  Is there no actual line
primitive in OpenSCAD?

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).

OEP7: Mixed Dimension Geometry Support
https://github.com/openscad/openscad/wiki/OEP7:-Mixed-Dimension-Geometry-Support
discusses some ideas for supporting additional variations, but I am not
aware of any current effort in that area.

On 2/5/2026 7:46 PM, John David via Discuss wrote: > I have found a number of places that define line() as a 2D or 3D > objects <https://openhome.cc/eGossip/OpenSCAD/Polyline.html>, which > build a line (with its width) as polygons.  Is there no actual line > primitive in OpenSCAD? 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). OEP7: Mixed Dimension Geometry Support <https://github.com/openscad/openscad/wiki/OEP7:-Mixed-Dimension-Geometry-Support> discusses some ideas for supporting additional variations, but I am not aware of any current effort in that area.
JB
Jordan Brown
Fri, Feb 6, 2026 5:06 AM

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.

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.
JD
John David
Fri, Feb 6, 2026 6:06 AM

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.

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. > > >
RW
Raymond West
Fri, Feb 6, 2026 10:24 AM

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 todiscuss-leave@lists.openscad.org

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 todiscuss-leave@lists.openscad.org
GS
Guenther Sohler
Fri, Feb 6, 2026 10:50 AM

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

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
NH
nop head
Fri, Feb 6, 2026 10:52 AM

Or perhaps use a python script to remove the fill parameter from the SVG
polygons

On Fri, 6 Feb 2026, 10:25 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

Or perhaps use a python script to remove the fill parameter from the SVG polygons On Fri, 6 Feb 2026, 10:25 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
M
mikeonenine@web.de
Fri, Feb 6, 2026 12:19 PM

John David wrote:

I got some time to go back to playing with using Open-/Python-SCAD to pass
colored SVG (where the color contains conveys information about
cutting/engraving/scoring/etc.)...

The thing I am stuck on is that I have a 2D model, or use
3D_object.project(cut=true), but I have not figured out how to convert the
edge of the 2D polygon to lines?  How is this done?

Thanks in advance.

EBo --

It can be done like this:

module xy() then colour1 offset(+off) xy(); followed by colour2 offset(-off) xyz();

where xy is a 2D shape and off stands for offset, if you can live with a crude workaround.

See also:

https://lists.openscad.org/empathy/thread/6SDAM4WFVBADFAOTZ2I3EFSEDN7UREZ4

https://lists.openscad.org/empathy/thread/TU7WPMWZLVJMXDK2RCFHJ2A7GKJGZUUG

https://lists.openscad.org/empathy/thread/VJFEXUE5NFU4J7GHIX3LGCYLOHLZRJ4E

John David wrote: > I got some time to go back to playing with using Open-/Python-SCAD to pass > colored SVG (where the color contains conveys information about > cutting/engraving/scoring/etc.)... > > The thing I am stuck on is that I have a 2D model, or use > 3D_object.project(cut=true), but I have not figured out how to convert the > edge of the 2D polygon to lines? How is this done? > > Thanks in advance. > > EBo -- It can be done like this: module xy() then colour1 offset(+off) xy(); followed by colour2 offset(-off) xyz(); where xy is a 2D shape and off stands for offset, if you can live with a crude workaround. See also: <https://lists.openscad.org/empathy/thread/6SDAM4WFVBADFAOTZ2I3EFSEDN7UREZ4> <https://lists.openscad.org/empathy/thread/TU7WPMWZLVJMXDK2RCFHJ2A7GKJGZUUG> <https://lists.openscad.org/empathy/thread/VJFEXUE5NFU4J7GHIX3LGCYLOHLZRJ4E>
RW
Raymond West
Fri, Feb 6, 2026 12:38 PM

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 todiscuss-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 todiscuss-leave@lists.openscad.org

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 todiscuss-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 todiscuss-leave@lists.openscad.org