discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Import Path from dxf / svg into BOSL2

TR
Thomas Richter
Fri, Jun 5, 2026 4:34 PM

I have a quite complex closed path with several thousand vertices created in a CAD Software. I can export it as dxf or svg and easily import it into OpenSCAD and linear_extrude it. Nonetheless, I'd like to create a BOSL2 path (an array of vertices) out of it to be able to extrude the path with chamfers or fillets. Unfortunately the path is not convex such that I cannot simply do

hull() {
linear_extrude(height = 0.01) import(file = "path1.dxf"); // the original path
translate([0, 0, 1.99]) linear_extrude(height = 0.01) import(file = "path2.dxf"); // the path offset by 2mm
}

to get the 45 degree chamfer.

Is there any option to convert / import the dxf / svg such that I get a path object that can be put into BOSL2 operations? Creating the array manually from the svg <path... is not an option due to the large number of vertices. I'd prefer to avoid to use external programs or Python etc. scripts.

I thought about projecting the shape and getting a path out of the projection but that doesn't seem to work.

I have a quite complex closed path with several thousand vertices created in a CAD Software. I can export it as dxf or svg and easily import it into OpenSCAD and linear_extrude it. Nonetheless, I'd like to create a BOSL2 path (an array of vertices) out of it to be able to extrude the path with chamfers or fillets. Unfortunately the path is not convex such that I cannot simply do hull() { linear_extrude(height = 0.01) import(file = "path1.dxf"); // the original path translate([0, 0, 1.99]) linear_extrude(height = 0.01) import(file = "path2.dxf"); // the path offset by 2mm } to get the 45 degree chamfer. Is there any option to convert / import the dxf / svg such that I get a path object that can be put into BOSL2 operations? Creating the array manually from the svg <path... is not an option due to the large number of vertices. I'd prefer to avoid to use external programs or Python etc. scripts. I thought about projecting the shape and getting a path out of the projection but that doesn't seem to work.
JB
Jordan Brown
Fri, Jun 5, 2026 6:22 PM

Is there any option to convert / import the dxf / svg such that I get a path object that can be put into BOSL2 operations?

No.  Maybe in the future, but not now.

> Is there any option to convert / import the dxf / svg such that I get a path object that can be put into BOSL2 operations? No. Maybe in the future, but not now.
AM
Adrian Mariano
Fri, Jun 5, 2026 6:43 PM

You can use the pathbuilder library to do this

https://github.com/dinther/pathbuilder

include <pathbuilder.scad>

svg_d = "M 10,10 L 100,10 C 100,50 50,90 10,90 Z";

// Get the point list — returns a list of lists (one per subpath)
pts = svgPoints(svg_d);

Of course, this requires you to paste the svg content into a string in your
scad file.

On Fri, Jun 5, 2026 at 12:35 PM Thomas Richter via Discuss <
discuss@lists.openscad.org> wrote:

I have a quite complex closed path with several thousand vertices created
in a CAD Software. I can export it as dxf or svg and easily import it into
OpenSCAD and linear_extrude it. Nonetheless, I'd like to create a BOSL2
path (an array of vertices) out of it to be able to extrude the path with
chamfers or fillets. Unfortunately the path is not convex such that I
cannot simply do

hull() {
linear_extrude(height = 0.01) import(file = "path1.dxf"); // the
original path
translate([0, 0, 1.99]) linear_extrude(height = 0.01) import(file =
"path2.dxf"); // the path offset by 2mm
}

to get the 45 degree chamfer.

Is there any option to convert / import the dxf / svg such that I get a
path object that can be put into BOSL2 operations? Creating the array
manually from the svg <path... is not an option due to the large number of
vertices. I'd prefer to avoid to use external programs or Python etc.
scripts.

I thought about projecting the shape and getting a path out of the
projection but that doesn't seem to work.


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

You can use the pathbuilder library to do this https://github.com/dinther/pathbuilder include <pathbuilder.scad> svg_d = "M 10,10 L 100,10 C 100,50 50,90 10,90 Z"; // Get the point list — returns a list of lists (one per subpath) pts = svgPoints(svg_d); Of course, this requires you to paste the svg content into a string in your scad file. On Fri, Jun 5, 2026 at 12:35 PM Thomas Richter via Discuss < discuss@lists.openscad.org> wrote: > I have a quite complex closed path with several thousand vertices created > in a CAD Software. I can export it as dxf or svg and easily import it into > OpenSCAD and linear_extrude it. Nonetheless, I'd like to create a BOSL2 > path (an array of vertices) out of it to be able to extrude the path with > chamfers or fillets. Unfortunately the path is not convex such that I > cannot simply do > > hull() { > linear_extrude(height = 0.01) import(file = "path1.dxf"); // the > original path > translate([0, 0, 1.99]) linear_extrude(height = 0.01) import(file = > "path2.dxf"); // the path offset by 2mm > } > > to get the 45 degree chamfer. > > Is there any option to convert / import the dxf / svg such that I get a > path object that can be put into BOSL2 operations? Creating the array > manually from the svg <path... is not an option due to the large number of > vertices. I'd prefer to avoid to use external programs or Python etc. > scripts. > > I thought about projecting the shape and getting a path out of the > projection but that doesn't seem to work. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
TR
Thomas Richter
Fri, Jun 5, 2026 8:09 PM

This works like a charm, thank you.

Am 05.06.2026 um 20:43 schrieb Adrian Mariano via Discuss discuss@lists.openscad.org:

You can use the pathbuilder library to do this

https://github.com/dinther/pathbuilder

include <pathbuilder.scad>

svg_d = "M 10,10 L 100,10 C 100,50 50,90 10,90 Z";

// Get the point list — returns a list of lists (one per subpath)
pts = svgPoints(svg_d);

Of course, this requires you to paste the svg content into a string in your scad file.

On Fri, Jun 5, 2026 at 12:35 PM Thomas Richter via Discuss discuss@lists.openscad.org wrote:
I have a quite complex closed path with several thousand vertices created in a CAD Software. I can export it as dxf or svg and easily import it into OpenSCAD and linear_extrude it. Nonetheless, I'd like to create a BOSL2 path (an array of vertices) out of it to be able to extrude the path with chamfers or fillets. Unfortunately the path is not convex such that I cannot simply do

hull() {
linear_extrude(height = 0.01) import(file = "path1.dxf"); // the original path
translate([0, 0, 1.99]) linear_extrude(height = 0.01) import(file = "path2.dxf"); // the path offset by 2mm
}

to get the 45 degree chamfer.

Is there any option to convert / import the dxf / svg such that I get a path object that can be put into BOSL2 operations? Creating the array manually from the svg <path... is not an option due to the large number of vertices. I'd prefer to avoid to use external programs or Python etc. scripts.

I thought about projecting the shape and getting a path out of the projection but that doesn't seem to work.


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 works like a charm, thank you. > Am 05.06.2026 um 20:43 schrieb Adrian Mariano via Discuss <discuss@lists.openscad.org>: > > You can use the pathbuilder library to do this > > https://github.com/dinther/pathbuilder > > include <pathbuilder.scad> > > svg_d = "M 10,10 L 100,10 C 100,50 50,90 10,90 Z"; > > // Get the point list — returns a list of lists (one per subpath) > pts = svgPoints(svg_d); > > Of course, this requires you to paste the svg content into a string in your scad file. > >> On Fri, Jun 5, 2026 at 12:35 PM Thomas Richter via Discuss <discuss@lists.openscad.org> wrote: >> I have a quite complex closed path with several thousand vertices created in a CAD Software. I can export it as dxf or svg and easily import it into OpenSCAD and linear_extrude it. Nonetheless, I'd like to create a BOSL2 path (an array of vertices) out of it to be able to extrude the path with chamfers or fillets. Unfortunately the path is not convex such that I cannot simply do >> >> hull() { >> linear_extrude(height = 0.01) import(file = "path1.dxf"); // the original path >> translate([0, 0, 1.99]) linear_extrude(height = 0.01) import(file = "path2.dxf"); // the path offset by 2mm >> } >> >> to get the 45 degree chamfer. >> >> Is there any option to convert / import the dxf / svg such that I get a path object that can be put into BOSL2 operations? Creating the array manually from the svg <path... is not an option due to the large number of vertices. I'd prefer to avoid to use external programs or Python etc. scripts. >> >> I thought about projecting the shape and getting a path out of the projection but that doesn't seem to work. >> _______________________________________________ >> 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
TA
Todd Allen
Sat, Jun 6, 2026 3:10 AM

You can also use the experimental roof() module to chamfer non convex 2d
geometry such as text that can't easily be converted to BOSL2 paths.

On Fri, Jun 5, 2026, 3:10 PM Thomas Richter via Discuss <
discuss@lists.openscad.org> wrote:

This works like a charm, thank you.

Am 05.06.2026 um 20:43 schrieb Adrian Mariano via Discuss <

You can use the pathbuilder library to do this

https://github.com/dinther/pathbuilder

include <pathbuilder.scad>

svg_d = "M 10,10 L 100,10 C 100,50 50,90 10,90 Z";

// Get the point list — returns a list of lists (one per subpath)
pts = svgPoints(svg_d);

Of course, this requires you to paste the svg content into a string in

your scad file.

On Fri, Jun 5, 2026 at 12:35 PM Thomas Richter via Discuss <

I have a quite complex closed path with several thousand vertices

created in a CAD Software. I can export it as dxf or svg and easily import
it into OpenSCAD and linear_extrude it. Nonetheless, I'd like to create a
BOSL2 path (an array of vertices) out of it to be able to extrude the path
with chamfers or fillets. Unfortunately the path is not convex such that I
cannot simply do

hull() {
linear_extrude(height = 0.01) import(file = "path1.dxf"); // the

original path

translate([0, 0, 1.99]) linear_extrude(height = 0.01) import(file =

"path2.dxf"); // the path offset by 2mm

}

to get the 45 degree chamfer.

Is there any option to convert / import the dxf / svg such that I get a

path object that can be put into BOSL2 operations? Creating the array
manually from the svg <path... is not an option due to the large number of
vertices. I'd prefer to avoid to use external programs or Python etc.
scripts.

I thought about projecting the shape and getting a path out of the

projection but that doesn't seem to work.


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

You can also use the experimental roof() module to chamfer non convex 2d geometry such as text that can't easily be converted to BOSL2 paths. On Fri, Jun 5, 2026, 3:10 PM Thomas Richter via Discuss < discuss@lists.openscad.org> wrote: > This works like a charm, thank you. > > > Am 05.06.2026 um 20:43 schrieb Adrian Mariano via Discuss < > discuss@lists.openscad.org>: > > > > You can use the pathbuilder library to do this > > > > https://github.com/dinther/pathbuilder > > > > include <pathbuilder.scad> > > > > svg_d = "M 10,10 L 100,10 C 100,50 50,90 10,90 Z"; > > > > // Get the point list — returns a list of lists (one per subpath) > > pts = svgPoints(svg_d); > > > > Of course, this requires you to paste the svg content into a string in > your scad file. > > > >> On Fri, Jun 5, 2026 at 12:35 PM Thomas Richter via Discuss < > discuss@lists.openscad.org> wrote: > >> I have a quite complex closed path with several thousand vertices > created in a CAD Software. I can export it as dxf or svg and easily import > it into OpenSCAD and linear_extrude it. Nonetheless, I'd like to create a > BOSL2 path (an array of vertices) out of it to be able to extrude the path > with chamfers or fillets. Unfortunately the path is not convex such that I > cannot simply do > >> > >> hull() { > >> linear_extrude(height = 0.01) import(file = "path1.dxf"); // the > original path > >> translate([0, 0, 1.99]) linear_extrude(height = 0.01) import(file = > "path2.dxf"); // the path offset by 2mm > >> } > >> > >> to get the 45 degree chamfer. > >> > >> Is there any option to convert / import the dxf / svg such that I get a > path object that can be put into BOSL2 operations? Creating the array > manually from the svg <path... is not an option due to the large number of > vertices. I'd prefer to avoid to use external programs or Python etc. > scripts. > >> > >> I thought about projecting the shape and getting a path out of the > projection but that doesn't seem to work. > >> _______________________________________________ > >> 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
YV
yur_vol@yahoo.com
Sun, Jun 7, 2026 8:04 AM

I convert 2D dxf path to bosl2 turtle commands with python script. But currently only MOVE and ARC entities  supported

I convert 2D dxf path to bosl2 turtle commands with python script. But currently only MOVE and ARC entities supported