discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

is there a way to get just the perimeter of an object?

JD
John David
Mon, May 12, 2025 8:08 PM

I know that I can use "projection(cut = true)" to slice through an object,
but is there a way to then just get the perimeter line of that object?

I have designed a quick-release jig and plate for my laser cutter, but I
would also like to add an engraved ruler. The original OpenSCAD is
embedding the engraving into the object, and I am trying to get them both
to output to a colored SVG file.

As a note, "projection(cut = true)"  does not work in pythonscad.

EBo --

I know that I can use "projection(cut = true)" to slice through an object, but is there a way to then just get the perimeter line of that object? I have designed a quick-release jig and plate for my laser cutter, but I would also like to add an engraved ruler. The original OpenSCAD is embedding the engraving into the object, and I am trying to get them both to output to a colored SVG file. As a note, "projection(cut = true)" does not work in pythonscad. EBo --
GS
Guenther Sohler
Mon, May 12, 2025 8:17 PM

Hi John,

thats not completly true.

Look at this code:

from openscad import *
a=cube(10).projection(cut="cut")
print(a.mesh())
a.show()

Yes, the parameter cut="cut" is weird, and its wrong, but I will fix that
In any case, its possible to retrieve the points of the cut, then its easy
to calculate the perimeter

On Mon, May 12, 2025 at 10:09 PM John David via Discuss <
discuss@lists.openscad.org> wrote:

I know that I can use "projection(cut = true)" to slice through an object,
but is there a way to then just get the perimeter line of that object?

I have designed a quick-release jig and plate for my laser cutter, but I
would also like to add an engraved ruler. The original OpenSCAD is
embedding the engraving into the object, and I am trying to get them both
to output to a colored SVG file.

As a note, "projection(cut = true)"  does not work in pythonscad.

EBo --


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

Hi John, thats not *completly* true. Look at this code: from openscad import * a=cube(10).projection(cut="cut") print(a.mesh()) a.show() Yes, the parameter cut="cut" is weird, and its wrong, but I will fix that In any case, its possible to retrieve the points of the cut, then its easy to calculate the perimeter On Mon, May 12, 2025 at 10:09 PM John David via Discuss < discuss@lists.openscad.org> wrote: > I know that I can use "projection(cut = true)" to slice through an object, > but is there a way to then just get the perimeter line of that object? > > I have designed a quick-release jig and plate for my laser cutter, but I > would also like to add an engraved ruler. The original OpenSCAD is > embedding the engraving into the object, and I am trying to get them both > to output to a colored SVG file. > > As a note, "projection(cut = true)" does not work in pythonscad. > > EBo -- > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
AM
Adrian Mariano
Mon, May 12, 2025 8:18 PM

What 's "the perimeter line"?  You can difference away an offset of your
original shape to produce a shape which is the perimeter.  If you want to
extract the actual points on the perimeter then no, that's impossible.  If
that's what you want you can do it in BOSL2 with projection() if you have
your object as a VNF.

On Mon, May 12, 2025 at 4:09 PM John David via Discuss <
discuss@lists.openscad.org> wrote:

I know that I can use "projection(cut = true)" to slice through an object,
but is there a way to then just get the perimeter line of that object?

I have designed a quick-release jig and plate for my laser cutter, but I
would also like to add an engraved ruler. The original OpenSCAD is
embedding the engraving into the object, and I am trying to get them both
to output to a colored SVG file.

As a note, "projection(cut = true)"  does not work in pythonscad.

EBo --


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

What 's "the perimeter line"? You can difference away an offset of your original shape to produce a shape which is the perimeter. If you want to extract the actual points on the perimeter then no, that's impossible. If that's what you want you can do it in BOSL2 with projection() if you have your object as a VNF. On Mon, May 12, 2025 at 4:09 PM John David via Discuss < discuss@lists.openscad.org> wrote: > I know that I can use "projection(cut = true)" to slice through an object, > but is there a way to then just get the perimeter line of that object? > > I have designed a quick-release jig and plate for my laser cutter, but I > would also like to add an engraved ruler. The original OpenSCAD is > embedding the engraving into the object, and I am trying to get them both > to output to a colored SVG file. > > As a note, "projection(cut = true)" does not work in pythonscad. > > EBo -- > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
TP
Torsten Paul
Mon, May 12, 2025 8:23 PM

On 12.05.25 22:08, John David via Discuss wrote:

I know that I can use "projection(cut = true)" to slice through an
object, but is there a way to then just get the perimeter line of that
object?

Do you mean that?
fill() projection(cut = true) ...

ciao,
Torsten.

On 12.05.25 22:08, John David via Discuss wrote: > I know that I can use "projection(cut = true)" to slice through an > object, but is there a way to then just get the perimeter line of that > object? Do you mean that? fill() projection(cut = true) ... ciao, Torsten.
JD
John David
Mon, May 12, 2025 9:02 PM

both projection(cut="cut") and <obj>.mesh() is working.

On Mon, May 12, 2025 at 4:23 PM Torsten Paul via Discuss <
discuss@lists.openscad.org> wrote:

On 12.05.25 22:08, John David via Discuss wrote:

I know that I can use "projection(cut = true)" to slice through an
object, but is there a way to then just get the perimeter line of that
object?

Do you mean that?
fill() projection(cut = true) ...

ciao,
Torsten.


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

both projection(cut="cut") and <obj>.mesh() is working. On Mon, May 12, 2025 at 4:23 PM Torsten Paul via Discuss < discuss@lists.openscad.org> wrote: > On 12.05.25 22:08, John David via Discuss wrote: > > I know that I can use "projection(cut = true)" to slice through an > > object, but is there a way to then just get the perimeter line of that > > object? > > Do you mean that? > fill() projection(cut = true) ... > > ciao, > Torsten. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
M
mikeonenine@web.de
Tue, May 20, 2025 7:31 PM

Adrian Mariano wrote:

You can difference away an offset of your original shape to produce a shape which is the perimeter.

Like this?

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

To get the true outline, you need to cover a positive offset with a negative offset rather than the original.

This gives an opaque 2D shape, which is required in some cases. For a pure outline, where you can see through the middle, difference a negative offset from a positive offset:

difference()

{

offset(1)

square(20);

offset(-1)

square(20);

}

Slight cosmetic problem: sharp corners are rounded.

Adrian Mariano wrote: > You can difference away an offset of your original shape to produce a shape which is the perimeter. Like this? https://lists.openscad.org/empathy/thread/6VOTPBG26BHWADP7GNR4I3GRIP3HG7CR To get the true outline, you need to cover a positive offset with a negative offset rather than the original. This gives an opaque 2D shape, which is required in some cases. For a pure outline, where you can see through the middle, difference a negative offset from a positive offset: `difference()` `{` `offset(1)` `square(20);` `offset(-1)` `square(20);` `}` Slight cosmetic problem: sharp corners are rounded.
TP
Torsten Paul
Tue, May 20, 2025 7:33 PM

On 20.05.25 21:31, Caddiy via Discuss wrote:

Slight cosmetic problem: sharp corners are rounded.

offset(delta = 10) square(10);

No rounding.

ciao,
Torsten.

On 20.05.25 21:31, Caddiy via Discuss wrote: > Slight cosmetic problem: sharp corners are rounded. offset(delta = 10) square(10); No rounding. ciao, Torsten.
M
mikeonenine@web.de
Tue, May 20, 2025 7:37 PM

Torsten Paul wrote:

On 20.05.25 21:31, Caddiy via Discuss wrote:

Slight cosmetic problem: sharp corners are rounded.

offset(delta = 10) square(10);

No rounding.

ciao,
Torsten.

Hey! That’s great!

Torsten Paul wrote: > On 20.05.25 21:31, Caddiy via Discuss wrote: > > > Slight cosmetic problem: sharp corners are rounded. > > offset(delta = 10) square(10); > > No rounding. > > ciao, > Torsten. Hey! That’s great!