discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Fwd: Problem with SVG import

RW
Raymond West
Fri, May 13, 2022 11:54 AM

what I have just tested, if you construct a shape, such as

$fn=100;
difference(){
circle(100);
circle(99.99);
}
translate([0,-100])
square([100,.001]);

and export it as dxf, then it seems to save it as // lines, BUT not
exactly as it should (the circle is 'split', and there are extra lines).
However, it can be imported into my cnc software, and it seems to be
displayed as a single line, and can be profiled. dxf import and export
in openscad is lacking in many areas, but there are probably ways around
that. There may be an 'optimum line thickness' that exports to my cnc
software, but my cad package cannot see this dxf file.(i.e. it imports
it, but shows nothing, probably because the exported dxf is poorly formed.)

svg has a line thickness, that could possibly be minimised, but my cnc
software does not handle svg directly. svg stroke width defaults to 0.5,
but is visible at  0.05

The main annoyance, is that if you have, say stepped pockets, such as

#square(80,true);
color ("red")square(50,true);
square(30,true);

when exported as dxf, then you simply get the outline of the largest
square. For similar machined items, I have to export as three separate
dxfs. Afaik, dxf format was designed for lines, not shapes, and there is
no indication of the version that openscad generates, or imports..
Anyway, dxf is de-emphasised now, so probably best to use something else
for  2/2.5D.

On 12/05/2022 21:35, Jordan Brown wrote:

It would be nice to have what one might call a "1D" subsystem, that
would allow for lines that did not form closed polygons, much as you
can have incomplete polyhedra.

The CNC crew would thank us.


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

what I have just tested, if you construct a shape, such as $fn=100; difference(){ circle(100); circle(99.99); } translate([0,-100]) square([100,.001]); and export it as dxf, then it seems to save it as // lines, BUT not exactly as it should (the circle is 'split', and there are extra lines). However, it can be imported into my cnc software, and it seems to be displayed as a single line, and can be profiled. dxf import and export in openscad is lacking in many areas, but there are probably ways around that. There may be an 'optimum line thickness' that exports to my cnc software, but my cad package cannot see this dxf file.(i.e. it imports it, but shows nothing, probably because the exported dxf is poorly formed.) svg has a line thickness, that could possibly be minimised, but my cnc software does not handle svg directly. svg stroke width defaults to 0.5, but is visible at  0.05 The main annoyance, is that if you have, say stepped pockets, such as #square(80,true); color ("red")square(50,true); square(30,true); when exported as dxf, then you simply get the outline of the largest square. For similar machined items, I have to export as three separate dxfs. Afaik, dxf format was designed for lines, not shapes, and there is no indication of the version that openscad generates, or imports.. Anyway, dxf is de-emphasised now, so probably best to use something else for  2/2.5D. On 12/05/2022 21:35, Jordan Brown wrote: > It would be nice to have what one might call a "1D" subsystem, that > would allow for lines that did not form closed polygons, much as you > can have incomplete polyhedra. > > The CNC crew would thank us. > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
SP
Sanjeev Prabhakar
Fri, May 13, 2022 12:53 PM

I have not used svg and therefore not much idea about the same.

But if you need to draw a shape with lines, it maybe possible within
openscad in many cases.

Probably some functions/ modules need to be written

Regards
Sanjeev

On Fri, 13 May 2022, 17:24 Raymond West, raywest@raywest.com wrote:

what I have just tested, if you construct a shape, such as

$fn=100;
difference(){
circle(100);
circle(99.99);
}
translate([0,-100])
square([100,.001]);

and export it as dxf, then it seems to save it as // lines, BUT not
exactly as it should (the circle is 'split', and there are extra lines).
However, it can be imported into my cnc software, and it seems to be
displayed as a single line, and can be profiled. dxf import and export
in openscad is lacking in many areas, but there are probably ways around
that. There may be an 'optimum line thickness' that exports to my cnc
software, but my cad package cannot see this dxf file.(i.e. it imports
it, but shows nothing, probably because the exported dxf is poorly formed.)

svg has a line thickness, that could possibly be minimised, but my cnc
software does not handle svg directly. svg stroke width defaults to 0.5,
but is visible at  0.05

The main annoyance, is that if you have, say stepped pockets, such as

#square(80,true);
color ("red")square(50,true);
square(30,true);

when exported as dxf, then you simply get the outline of the largest
square. For similar machined items, I have to export as three separate
dxfs. Afaik, dxf format was designed for lines, not shapes, and there is
no indication of the version that openscad generates, or imports..
Anyway, dxf is de-emphasised now, so probably best to use something else
for  2/2.5D.

On 12/05/2022 21:35, Jordan Brown wrote:

It would be nice to have what one might call a "1D" subsystem, that
would allow for lines that did not form closed polygons, much as you
can have incomplete polyhedra.

The CNC crew would thank us.


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 have not used svg and therefore not much idea about the same. But if you need to draw a shape with lines, it maybe possible within openscad in many cases. Probably some functions/ modules need to be written Regards Sanjeev On Fri, 13 May 2022, 17:24 Raymond West, <raywest@raywest.com> wrote: > what I have just tested, if you construct a shape, such as > > $fn=100; > difference(){ > circle(100); > circle(99.99); > } > translate([0,-100]) > square([100,.001]); > > and export it as dxf, then it seems to save it as // lines, BUT not > exactly as it should (the circle is 'split', and there are extra lines). > However, it can be imported into my cnc software, and it seems to be > displayed as a single line, and can be profiled. dxf import and export > in openscad is lacking in many areas, but there are probably ways around > that. There may be an 'optimum line thickness' that exports to my cnc > software, but my cad package cannot see this dxf file.(i.e. it imports > it, but shows nothing, probably because the exported dxf is poorly formed.) > > svg has a line thickness, that could possibly be minimised, but my cnc > software does not handle svg directly. svg stroke width defaults to 0.5, > but is visible at 0.05 > > The main annoyance, is that if you have, say stepped pockets, such as > > #square(80,true); > color ("red")square(50,true); > square(30,true); > > when exported as dxf, then you simply get the outline of the largest > square. For similar machined items, I have to export as three separate > dxfs. Afaik, dxf format was designed for lines, not shapes, and there is > no indication of the version that openscad generates, or imports.. > Anyway, dxf is de-emphasised now, so probably best to use something else > for 2/2.5D. > > On 12/05/2022 21:35, Jordan Brown wrote: > > It would be nice to have what one might call a "1D" subsystem, that > > would allow for lines that did not form closed polygons, much as you > > can have incomplete polyhedra. > > > > The CNC crew would thank us. > > > > > > _______________________________________________ > > 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 >
WF
William F. Adams
Fri, May 13, 2022 2:57 PM

For nested shapes, you have to alternately subtract/add the pockets/islands.
If there are overlaps, then you have to shift things and recomposite them --- see:
https://github.com/WillAdams/Design_Into_3D/blob/master/blindmiter_boxjoint/Design%20into%203D_%20Box%20with%20Lid.scad

for one approach.
William

For nested shapes, you have to alternately subtract/add the pockets/islands. If there are overlaps, then you have to shift things and recomposite them --- see: https://github.com/WillAdams/Design_Into_3D/blob/master/blindmiter_boxjoint/Design%20into%203D_%20Box%20with%20Lid.scad for one approach. William