discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

2D shapes vs outlines

MF
mike.fraser.1945+osc@gmail.com
Thu, Dec 12, 2024 3:53 PM

Does OpenSCAD have the capability to produce simple shape outlines vs a filled-in shape?

I need to create a model that contains multiple concentric circles that I can export as an SVG or DXF file?

If  I do:

for (i=[1:1:10]) {

circle(d=I\*10) ;

}

All I see is a 100mm circle.  The other 9 are lost under the larger one.

Is such doable in OpenSCAD or must I look for another program?

Mike

Does OpenSCAD have the capability to produce simple shape outlines vs a filled-in shape? I need to create a model that contains multiple concentric circles that I can export as an SVG or DXF file? If I do: for (i=\[1:1:10\]) { circle(d=I\*10) ; } All I see is a 100mm circle. The other 9 are lost under the larger one. Is such doable in OpenSCAD or must I look for another program? Mike
WF
William F. Adams
Thu, Dec 12, 2024 4:04 PM

If you're willing to consider OpenPythonSCAD:

https://pythonscad.org/

I've worked up a technique for making arbitrary DXF files:

https://forum.makerforums.info/t/rewriting-gcodepreview-with-python/88617/28

using the library I've been writing:

https://github.com/WillAdams/gcodepreview

haven't done an upload recently, but the current version is in the issue/discussion:

https://github.com/gsohler/openscad/issues/50

William

--
Sphinx of black quartz, judge my vow
https://designinto3d.com/

If you're willing to consider OpenPythonSCAD: https://pythonscad.org/ I've worked up a technique for making arbitrary DXF files: https://forum.makerforums.info/t/rewriting-gcodepreview-with-python/88617/28 using the library I've been writing: https://github.com/WillAdams/gcodepreview haven't done an upload recently, but the current version is in the issue/discussion: https://github.com/gsohler/openscad/issues/50 William -- Sphinx of black quartz, judge my vow https://designinto3d.com/
ME
Mark Erbaugh
Thu, Dec 12, 2024 4:08 PM

Primitive shapes are filled in. If you just want the outline, create a difference with a slightly smaller shape.

for (i=[1:1:10])
{
difference()
{
circle(d=i10) ;
offset(-0.1)
circle(d=i
10) ;
}
}

Primitive shapes are filled in. If you just want the outline, create a difference with a slightly smaller shape. > for (i=[1:1:10]) > { > difference() > { > circle(d=i*10) ; > offset(-0.1) > circle(d=i*10) ; > } > }
JO
jjvb-openscad@bassklampfe.de
Thu, Dec 12, 2024 4:20 PM

Use difference() !

for (i=[1:2:10])
{
    difference()
    {
        circle(d=(i+1)*10) ;
        circle(d=(i)*10) ;
    }
}

Am 12.12.24 um 16:53 schrieb mike.fraser.1945+osc--- via Discuss:

Does OpenSCAD have the capability to produce simple shape outlines vs
a filled-in shape?

I need to create a model that contains multiple concentric circles
that I can export as an SVG or DXF file?

If //I do:

for (i=[1:1:10]) {

circle(d=I*10) ;

}

All I see is a 100mm circle. The other 9 are lost under the larger one.

Is such doable in OpenSCAD or must I look for another program?

Mike


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

Use difference() ! for (i=[1:2:10]) {     difference()     {         circle(d=(i+1)*10) ;         circle(d=(i)*10) ;     } } Am 12.12.24 um 16:53 schrieb mike.fraser.1945+osc--- via Discuss: > > Does OpenSCAD have the capability to produce simple shape outlines vs > a filled-in shape? > > I need to create a model that contains multiple concentric circles > that I can export as an SVG or DXF file? > > If //I do: > > for (i=[1:1:10]) { > > circle(d=I*10) ; > > } > > All I see is a 100mm circle. The other 9 are lost under the larger one. > > Is such doable in OpenSCAD or must I look for another program? > > Mike > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org
JB
Jordan Brown
Thu, Dec 12, 2024 7:25 PM

On 12/12/2024 7:53 AM, mike.fraser.1945+osc--- via Discuss wrote:

Does OpenSCAD have the capability to produce simple shape outlines vs
a filled-in shape?

No.  As others have said, you can make a 2D donut - formally, an annulus
(yes, I had to look it up) - by differencing circles, but that's not an
outline per se.

OpenSCAD has only solid shapes - filled-in polygons in 2D, and filled-in
polyhedra in 3D.  (Incomplete polyhedra excepted; they don't really work
with the operators.)

There's a proposal to do various non-solid objects in
OEP7: Mixed Dimension Geometry Support
https://github.com/openscad/openscad/wiki/OEP7%3A-Mixed-Dimension-Geometry-Support
but I don't think it's gotten a lot of attention recently.

What you want is a scripting interface for Inkscape, but I'm not aware
of one.

On 12/12/2024 7:53 AM, mike.fraser.1945+osc--- via Discuss wrote: > > Does OpenSCAD have the capability to produce simple shape outlines vs > a filled-in shape? > No.  As others have said, you can make a 2D donut - formally, an annulus (yes, I had to look it up) - by differencing circles, but that's not an outline per se. OpenSCAD has only solid shapes - filled-in polygons in 2D, and filled-in polyhedra in 3D.  (Incomplete polyhedra excepted; they don't really work with the operators.) There's a proposal to do various non-solid objects in OEP7: Mixed Dimension Geometry Support <https://github.com/openscad/openscad/wiki/OEP7%3A-Mixed-Dimension-Geometry-Support> but I don't think it's gotten a lot of attention recently. What you want is a scripting interface for Inkscape, but I'm not aware of one.
WF
William F. Adams
Thu, Dec 12, 2024 7:42 PM

On 12/12/2024 7:53 AM, mike.fraser.1945+osc--- via Discuss wrote:

What you want is a scripting interface for Inkscape, but I'm not aware of one.

On 12/12/2024 7:53 AM, mike.fraser.1945+osc--- via Discuss wrote: >What you want is a scripting interface for Inkscape, but I'm not aware of one. https://inkscape.org/~pakin/%E2%98%85simple-inkscape-scripting William
JB
Jordan Brown
Thu, Dec 12, 2024 7:46 PM

On 12/12/2024 11:42 AM, William F. Adams via Discuss wrote:

On 12/12/2024 7:53 AM, mike.fraser.1945+osc--- via Discuss wrote:

What you want is a scripting interface for Inkscape, but I'm not aware of one.

Cool, thanks!

On 12/12/2024 11:42 AM, William F. Adams via Discuss wrote: > On 12/12/2024 7:53 AM, mike.fraser.1945+osc--- via Discuss wrote: >> What you want is a scripting interface for Inkscape, but I'm not aware of one. > https://inkscape.org/~pakin/%E2%98%85simple-inkscape-scripting Cool, thanks!