discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

is there a function to return the 2D equivalent of a number of intersections or an object constructed from unions and differences?

JD
John David
Tue, Mar 4, 2025 4:45 AM

Some time back, I had been working on a library that heavily uses params.
I end up caching the perimeter outline of various shapes to use elsewhere.
I'm looking for an easier way to calculate the perimeter than doing all the
math by hand.  Is there a function that can take multiple primitives with
union, difference, and/or intersection, and return the perimeter?

EBo --

Some time back, I had been working on a library that heavily uses params. I end up caching the perimeter outline of various shapes to use elsewhere. I'm looking for an easier way to calculate the perimeter than doing all the math by hand. Is there a function that can take multiple primitives with union, difference, and/or intersection, and return the perimeter? EBo --
RW
Raymond West
Tue, Mar 4, 2025 9:46 AM

I've often exported as svg, which gives a list of vertices, manipulated
that list and included the manipulated list into openscad again as a
list of points for a polygon. You can use search and replace within a 
plain text editor to manipulate the svg file,  if you wish, it is quite
straightforward. Afaik, there is no automatic conversion within
openscad, no idea if bosl2 has anything.

On 04/03/2025 04:45, John David via Discuss wrote:

Some time back, I had been working on a library that heavily uses
params.  I end up caching the perimeter outline of various shapes to
use elsewhere.  I'm looking for an easier way to calculate the
perimeter than doing all the math by hand.  Is there a function that
can take multiple primitives with union, difference, and/or
intersection, and return the perimeter?

  EBo --


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

I've often exported as svg, which gives a list of vertices, manipulated that list and included the manipulated list into openscad again as a list of points for a polygon. You can use search and replace within a  plain text editor to manipulate the svg file,  if you wish, it is quite straightforward. Afaik, there is no automatic conversion within openscad, no idea if bosl2 has anything. On 04/03/2025 04:45, John David via Discuss wrote: > Some time back, I had been working on a library that heavily uses > params.  I end up caching the perimeter outline of various shapes to > use elsewhere.  I'm looking for an easier way to calculate the > perimeter than doing all the math by hand.  Is there a function that > can take multiple primitives with union, difference, and/or > intersection, and return the perimeter? > >   EBo -- > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
AM
Adrian Mariano
Tue, Mar 4, 2025 11:16 AM

In BOSL2 you can use function forms of union(), difference() and
intersection() to operate on point lists and produce a point list as output
which I think is the result you want.  Be warned that these are kind of
slow.

On Tue, Mar 4, 2025 at 4:47 AM Raymond West via Discuss <
discuss@lists.openscad.org> wrote:

I've often exported as svg, which gives a list of vertices, manipulated
that list and included the manipulated list into openscad again as a
list of points for a polygon. You can use search and replace within a
plain text editor to manipulate the svg file,  if you wish, it is quite
straightforward. Afaik, there is no automatic conversion within
openscad, no idea if bosl2 has anything.

On 04/03/2025 04:45, John David via Discuss wrote:

Some time back, I had been working on a library that heavily uses
params.  I end up caching the perimeter outline of various shapes to
use elsewhere.  I'm looking for an easier way to calculate the
perimeter than doing all the math by hand.  Is there a function that
can take multiple primitives with union, difference, and/or
intersection, and return the perimeter?

EBo --


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

In BOSL2 you can use function forms of union(), difference() and intersection() to operate on point lists and produce a point list as output which I think is the result you want. Be warned that these are kind of slow. On Tue, Mar 4, 2025 at 4:47 AM Raymond West via Discuss < discuss@lists.openscad.org> wrote: > I've often exported as svg, which gives a list of vertices, manipulated > that list and included the manipulated list into openscad again as a > list of points for a polygon. You can use search and replace within a > plain text editor to manipulate the svg file, if you wish, it is quite > straightforward. Afaik, there is no automatic conversion within > openscad, no idea if bosl2 has anything. > > On 04/03/2025 04:45, John David via Discuss wrote: > > Some time back, I had been working on a library that heavily uses > > params. I end up caching the perimeter outline of various shapes to > > use elsewhere. I'm looking for an easier way to calculate the > > perimeter than doing all the math by hand. Is there a function that > > can take multiple primitives with union, difference, and/or > > intersection, and return the perimeter? > > > > EBo -- > > > > _______________________________________________ > > 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 >
JD
John David
Tue, Mar 4, 2025 12:05 PM

I'll look into building point lists.  That said, I wrote this prototype
code over a year ago, and I think I got too into playing with the
parameters.  I think I need to just stick to the standard methods (union,
difference, intersection), but still use hashmap'ed parameters to help
manage the project level configuration.  I really like passing a single
hashmapped parameter list, instead of passing a dozen or two parameters
into each and every function and method.

Thanks again Adrian,

EBo --

On Tue, Mar 4, 2025 at 6:16 AM Adrian Mariano via Discuss <
discuss@lists.openscad.org> wrote:

In BOSL2 you can use function forms of union(), difference() and
intersection() to operate on point lists and produce a point list as output
which I think is the result you want.  Be warned that these are kind of
slow.

On Tue, Mar 4, 2025 at 4:47 AM Raymond West via Discuss <
discuss@lists.openscad.org> wrote:

I've often exported as svg, which gives a list of vertices, manipulated
that list and included the manipulated list into openscad again as a
list of points for a polygon. You can use search and replace within a
plain text editor to manipulate the svg file,  if you wish, it is quite
straightforward. Afaik, there is no automatic conversion within
openscad, no idea if bosl2 has anything.

On 04/03/2025 04:45, John David via Discuss wrote:

Some time back, I had been working on a library that heavily uses
params.  I end up caching the perimeter outline of various shapes to
use elsewhere.  I'm looking for an easier way to calculate the
perimeter than doing all the math by hand.  Is there a function that
can take multiple primitives with union, difference, and/or
intersection, and return the perimeter?

EBo --


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

I'll look into building point lists. That said, I wrote this prototype code over a year ago, and I think I got too into playing with the parameters. I think I need to just stick to the standard methods (union, difference, intersection), but still use hashmap'ed parameters to help manage the project level configuration. I really like passing a single hashmapped parameter list, instead of passing a dozen or two parameters into each and every function and method. Thanks again Adrian, EBo -- On Tue, Mar 4, 2025 at 6:16 AM Adrian Mariano via Discuss < discuss@lists.openscad.org> wrote: > In BOSL2 you can use function forms of union(), difference() and > intersection() to operate on point lists and produce a point list as output > which I think is the result you want. Be warned that these are kind of > slow. > > On Tue, Mar 4, 2025 at 4:47 AM Raymond West via Discuss < > discuss@lists.openscad.org> wrote: > >> I've often exported as svg, which gives a list of vertices, manipulated >> that list and included the manipulated list into openscad again as a >> list of points for a polygon. You can use search and replace within a >> plain text editor to manipulate the svg file, if you wish, it is quite >> straightforward. Afaik, there is no automatic conversion within >> openscad, no idea if bosl2 has anything. >> >> On 04/03/2025 04:45, John David via Discuss wrote: >> > Some time back, I had been working on a library that heavily uses >> > params. I end up caching the perimeter outline of various shapes to >> > use elsewhere. I'm looking for an easier way to calculate the >> > perimeter than doing all the math by hand. Is there a function that >> > can take multiple primitives with union, difference, and/or >> > intersection, and return the perimeter? >> > >> > EBo -- >> > >> > _______________________________________________ >> > 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 >
JB
Jon Bondy
Tue, Mar 4, 2025 12:29 PM

Given a 2D object, could you do an offset() by 0.01 and then remove the
interior using difference()?

Jon

On 3/4/2025 7:05 AM, John David via Discuss wrote:

I'll look into building point lists.  That said, I wrote this
prototype code over a year ago, and I think I got too into playing
with the parameters.  I think I need to just stick to the standard
methods (union, difference, intersection), but still use hashmap'ed
parameters to help manage the project level configuration.  I really
like passing a single hashmapped parameter list, instead of passing a
dozen or two parameters into each and every function and method.

Thanks again Adrian,

  EBo --

On Tue, Mar 4, 2025 at 6:16 AM Adrian Mariano via Discuss
discuss@lists.openscad.org wrote:

 In BOSL2 you can use function forms of union(), difference() and
 intersection() to operate on point lists and produce a point list
 as output which I think is the result you want.  Be warned that
 these are kind of slow.

 On Tue, Mar 4, 2025 at 4:47 AM Raymond West via Discuss
 <discuss@lists.openscad.org> wrote:

     I've often exported as svg, which gives a list of vertices,
     manipulated
     that list and included the manipulated list into openscad
     again as a
     list of points for a polygon. You can use search and replace
     within a
     plain text editor to manipulate the svg file,  if you wish, it
     is quite
     straightforward. Afaik, there is no automatic conversion within
     openscad, no idea if bosl2 has anything.

     On 04/03/2025 04:45, John David via Discuss wrote:

Some time back, I had been working on a library that heavily

     uses

params.  I end up caching the perimeter outline of various

     shapes to

use elsewhere.  I'm looking for an easier way to calculate the
perimeter than doing all the math by hand.  Is there a

     function that

can take multiple primitives with union, difference, and/or
intersection, and return the perimeter?

  EBo --


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

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

--
This email has been checked for viruses by AVG antivirus software.
www.avg.com

Given a 2D object, could you do an offset() by 0.01 and then remove the interior using difference()? Jon On 3/4/2025 7:05 AM, John David via Discuss wrote: > I'll look into building point lists.  That said, I wrote this > prototype code over a year ago, and I think I got too into playing > with the parameters.  I think I need to just stick to the standard > methods (union, difference, intersection), but still use hashmap'ed > parameters to help manage the project level configuration.  I really > like passing a single hashmapped parameter list, instead of passing a > dozen or two parameters into each and every function and method. > > Thanks again Adrian, > >   EBo -- > > On Tue, Mar 4, 2025 at 6:16 AM Adrian Mariano via Discuss > <discuss@lists.openscad.org> wrote: > > In BOSL2 you can use function forms of union(), difference() and > intersection() to operate on point lists and produce a point list > as output which I think is the result you want.  Be warned that > these are kind of slow. > > On Tue, Mar 4, 2025 at 4:47 AM Raymond West via Discuss > <discuss@lists.openscad.org> wrote: > > I've often exported as svg, which gives a list of vertices, > manipulated > that list and included the manipulated list into openscad > again as a > list of points for a polygon. You can use search and replace > within a > plain text editor to manipulate the svg file,  if you wish, it > is quite > straightforward. Afaik, there is no automatic conversion within > openscad, no idea if bosl2 has anything. > > On 04/03/2025 04:45, John David via Discuss wrote: > > Some time back, I had been working on a library that heavily > uses > > params.  I end up caching the perimeter outline of various > shapes to > > use elsewhere.  I'm looking for an easier way to calculate the > > perimeter than doing all the math by hand.  Is there a > function that > > can take multiple primitives with union, difference, and/or > > intersection, and return the perimeter? > > > >   EBo -- > > > > _______________________________________________ > > 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 > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org -- This email has been checked for viruses by AVG antivirus software. www.avg.com
MH
Matthieu Hendriks
Tue, Mar 4, 2025 2:55 PM

I've used this several times. Best way is to have the 2D object
centralized. on the x/y axis.

Jon Bondy via Discuss schreef op 2025-03-04 13:29:

Given a 2D object, could you do an offset() by 0.01 and then remove the
interior using difference()?

Jon

On 3/4/2025 7:05 AM, John David via Discuss wrote:

I'll look into building point lists.  That said, I wrote this prototype
code over a year ago, and I think I got too into playing with the
parameters.  I think I need to just stick to the standard methods
(union, difference, intersection), but still use hashmap'ed parameters
to help manage the project level configuration.  I really like passing
a single hashmapped parameter list, instead of passing a dozen or two
parameters into each and every function and method.

Thanks again Adrian,

EBo --

On Tue, Mar 4, 2025 at 6:16 AM Adrian Mariano via Discuss
discuss@lists.openscad.org wrote:
In BOSL2 you can use function forms of union(), difference() and
intersection() to operate on point lists and produce a point list as
output which I think is the result you want.  Be warned that these are
kind of slow.

On Tue, Mar 4, 2025 at 4:47 AM Raymond West via Discuss
discuss@lists.openscad.org wrote: I've often exported as svg, which
gives a list of vertices, manipulated
that list and included the manipulated list into openscad again as a
list of points for a polygon. You can use search and replace within a
plain text editor to manipulate the svg file,  if you wish, it is quite
straightforward. Afaik, there is no automatic conversion within
openscad, no idea if bosl2 has anything.

On 04/03/2025 04:45, John David via Discuss wrote:

Some time back, I had been working on a library that heavily uses
params.  I end up caching the perimeter outline of various shapes to
use elsewhere.  I'm looking for an easier way to calculate the
perimeter than doing all the math by hand.  Is there a function that
can take multiple primitives with union, difference, and/or
intersection, and return the perimeter?

EBo --


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


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

	 [1]
	Virus-free.www.avg.com [1]

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

Links:

[1]
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient

I've used this several times. Best way is to have the 2D object centralized. on the x/y axis. Jon Bondy via Discuss schreef op 2025-03-04 13:29: > Given a 2D object, could you do an offset() by 0.01 and then remove the > interior using difference()? > > Jon > > On 3/4/2025 7:05 AM, John David via Discuss wrote: > > I'll look into building point lists. That said, I wrote this prototype > code over a year ago, and I think I got too into playing with the > parameters. I think I need to just stick to the standard methods > (union, difference, intersection), but still use hashmap'ed parameters > to help manage the project level configuration. I really like passing > a single hashmapped parameter list, instead of passing a dozen or two > parameters into each and every function and method. > > Thanks again Adrian, > > EBo -- > > On Tue, Mar 4, 2025 at 6:16 AM Adrian Mariano via Discuss > <discuss@lists.openscad.org> wrote: > In BOSL2 you can use function forms of union(), difference() and > intersection() to operate on point lists and produce a point list as > output which I think is the result you want. Be warned that these are > kind of slow. > > On Tue, Mar 4, 2025 at 4:47 AM Raymond West via Discuss > <discuss@lists.openscad.org> wrote: I've often exported as svg, which > gives a list of vertices, manipulated > that list and included the manipulated list into openscad again as a > list of points for a polygon. You can use search and replace within a > plain text editor to manipulate the svg file, if you wish, it is quite > straightforward. Afaik, there is no automatic conversion within > openscad, no idea if bosl2 has anything. > > On 04/03/2025 04:45, John David via Discuss wrote: >> Some time back, I had been working on a library that heavily uses >> params. I end up caching the perimeter outline of various shapes to >> use elsewhere. I'm looking for an easier way to calculate the >> perimeter than doing all the math by hand. Is there a function that >> can take multiple primitives with union, difference, and/or >> intersection, and return the perimeter? >> >> EBo -- >> >> _______________________________________________ >> 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 _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org [1] Virus-free.www.avg.com [1] _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org Links: ------ [1] http://www.avg.com/email-signature?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=emailclient
AM
Adrian Mariano
Tue, Mar 4, 2025 9:20 PM

The original post is very vague about what the 2d shape is and how "the
perimeter" is being used, so it's tough to know what he needs.  If you're
using offset it doesn't matter where the object is located.

On Tue, Mar 4, 2025 at 9:55 AM Matthieu Hendriks via Discuss <
discuss@lists.openscad.org> wrote:

I've used this several times. Best way is to have the 2D object
centralized. on the x/y axis.

Jon Bondy via Discuss schreef op 2025-03-04 13:29:

Given a 2D object, could you do an offset() by 0.01 and then remove the
interior using difference()?

Jon
On 3/4/2025 7:05 AM, John David via Discuss wrote:

I'll look into building point lists.  That said, I wrote this prototype
code over a year ago, and I think I got too into playing with the
parameters.  I think I need to just stick to the standard methods (union,
difference, intersection), but still use hashmap'ed parameters to help
manage the project level configuration.  I really like passing a single
hashmapped parameter list, instead of passing a dozen or two parameters
into each and every function and method.

Thanks again Adrian,

EBo --

On Tue, Mar 4, 2025 at 6:16 AM Adrian Mariano via Discuss <
discuss@lists.openscad.org> wrote:

In BOSL2 you can use function forms of union(), difference() and
intersection() to operate on point lists and produce a point list as output
which I think is the result you want.  Be warned that these are kind of
slow.

On Tue, Mar 4, 2025 at 4:47 AM Raymond West via Discuss <
discuss@lists.openscad.org> wrote:

I've often exported as svg, which gives a list of vertices, manipulated
that list and included the manipulated list into openscad again as a
list of points for a polygon. You can use search and replace within a
plain text editor to manipulate the svg file,  if you wish, it is quite
straightforward. Afaik, there is no automatic conversion within
openscad, no idea if bosl2 has anything.

On 04/03/2025 04:45, John David via Discuss wrote:

Some time back, I had been working on a library that heavily uses
params.  I end up caching the perimeter outline of various shapes to
use elsewhere.  I'm looking for an easier way to calculate the
perimeter than doing all the math by hand.  Is there a function that
can take multiple primitives with union, difference, and/or
intersection, and return the perimeter?

EBo --


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


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

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient
Virus-free.www.avg.com
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient


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

The original post is very vague about what the 2d shape is and how "the perimeter" is being used, so it's tough to know what he needs. If you're using offset it doesn't matter where the object is located. On Tue, Mar 4, 2025 at 9:55 AM Matthieu Hendriks via Discuss < discuss@lists.openscad.org> wrote: > I've used this several times. Best way is to have the 2D object > centralized. on the x/y axis. > > > > Jon Bondy via Discuss schreef op 2025-03-04 13:29: > > Given a 2D object, could you do an offset() by 0.01 and then remove the > interior using difference()? > > Jon > On 3/4/2025 7:05 AM, John David via Discuss wrote: > > I'll look into building point lists. That said, I wrote this prototype > code over a year ago, and I think I got too into playing with the > parameters. I think I need to just stick to the standard methods (union, > difference, intersection), but still use hashmap'ed parameters to help > manage the project level configuration. I really like passing a single > hashmapped parameter list, instead of passing a dozen or two parameters > into each and every function and method. > > Thanks again Adrian, > > EBo -- > > On Tue, Mar 4, 2025 at 6:16 AM Adrian Mariano via Discuss < > discuss@lists.openscad.org> wrote: > > In BOSL2 you can use function forms of union(), difference() and > intersection() to operate on point lists and produce a point list as output > which I think is the result you want. Be warned that these are kind of > slow. > > On Tue, Mar 4, 2025 at 4:47 AM Raymond West via Discuss < > discuss@lists.openscad.org> wrote: > > I've often exported as svg, which gives a list of vertices, manipulated > that list and included the manipulated list into openscad again as a > list of points for a polygon. You can use search and replace within a > plain text editor to manipulate the svg file, if you wish, it is quite > straightforward. Afaik, there is no automatic conversion within > openscad, no idea if bosl2 has anything. > > On 04/03/2025 04:45, John David via Discuss wrote: > > Some time back, I had been working on a library that heavily uses > > params. I end up caching the perimeter outline of various shapes to > > use elsewhere. I'm looking for an easier way to calculate the > > perimeter than doing all the math by hand. Is there a function that > > can take multiple primitives with union, difference, and/or > > intersection, and return the perimeter? > > > > EBo -- > > > > _______________________________________________ > > 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 > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > > > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > Virus-free.www.avg.com > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > > _______________________________________________ > 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 >
JB
Jordan Brown
Wed, Mar 5, 2025 12:19 AM

On 3/4/2025 1:20 PM, Adrian Mariano via Discuss wrote:

The original post is very vague about what the 2d shape is and how
"the perimeter" is being used, so it's tough to know what he needs. 
If you're using offset it doesn't matter where the object is located. 

Right.  The big question is what he wants to do that can't be done
readily with the builtin operations.

It does take a mindset change to work with OpenSCAD-style geometry
results and children rather than conventional-language return values and
parameters.

On 3/4/2025 1:20 PM, Adrian Mariano via Discuss wrote: > The original post is very vague about what the 2d shape is and how > "the perimeter" is being used, so it's tough to know what he needs.  > If you're using offset it doesn't matter where the object is located.  Right.  The big question is what he wants to do that can't be done readily with the builtin operations. It does take a mindset change to work with OpenSCAD-style geometry results and children rather than conventional-language return values and parameters.
RW
Raymond West
Wed, Mar 5, 2025 10:13 AM

I thought the perimeter was the distance around the outside edge of a 2d
shape, so basically the sum of the distances between the vertices. I
thought the op was generating the shape by combining primitives -
squares, circles, and so on. I do not know of a method, within openscad,
of exposing the vertices of such generated shapes, but exporting as svg
gives the list of vertices (albeit in a different format). Maybe, if you
set an xy problem, you get a to z answers.

On 05/03/2025 00:19, Jordan Brown via Discuss wrote:

On 3/4/2025 1:20 PM, Adrian Mariano via Discuss wrote:

The original post is very vague about what the 2d shape is and how
"the perimeter" is being used, so it's tough to know what he needs. 
If you're using offset it doesn't matter where the object is located.

Right.  The big question is what he wants to do that can't be done
readily with the builtin operations.

It does take a mindset change to work with OpenSCAD-style geometry
results and children rather than conventional-language return values
and parameters.


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

I thought the perimeter was the distance around the outside edge of a 2d shape, so basically the sum of the distances between the vertices. I thought the op was generating the shape by combining primitives - squares, circles, and so on. I do not know of a method, within openscad, of exposing the vertices of such generated shapes, but exporting as svg gives the list of vertices (albeit in a different format). Maybe, if you set an xy problem, you get a to z answers. On 05/03/2025 00:19, Jordan Brown via Discuss wrote: > On 3/4/2025 1:20 PM, Adrian Mariano via Discuss wrote: >> The original post is very vague about what the 2d shape is and how >> "the perimeter" is being used, so it's tough to know what he needs.  >> If you're using offset it doesn't matter where the object is located. > > Right.  The big question is what he wants to do that can't be done > readily with the builtin operations. > > It does take a mindset change to work with OpenSCAD-style geometry > results and children rather than conventional-language return values > and parameters. > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
JB
Jordan Brown
Wed, Mar 5, 2025 4:53 PM

On Mar 5, 2025, at 2:13 AM, Raymond West via Discuss discuss@lists.openscad.org wrote:

I thought the perimeter was the distance around the outside edge of a 2d shape, so basically the sum of the distances between the vertices.

Yes, more or less.  The dictionary definition is that “perimeter” is the outside edge of the shape, or the length of that outside edge.

I thought the op was generating the shape by combining primitives - squares, circles, and so on. I do not know of a method, within openscad, of exposing the vertices of such generated shapes, but exporting as svg gives the list of vertices (albeit in a different format). Maybe, if you set an xy problem, you get a to z answers.

There is no way in current OpenSCAD to extract the vertexes of a generated shape.

The question is what the OP wanted to do, that required the actual list of points.

> On Mar 5, 2025, at 2:13 AM, Raymond West via Discuss <discuss@lists.openscad.org> wrote: > > I thought the perimeter was the distance around the outside edge of a 2d shape, so basically the sum of the distances between the vertices. Yes, more or less. The dictionary definition is that “perimeter” is the outside edge of the shape, or the length of that outside edge. > I thought the op was generating the shape by combining primitives - squares, circles, and so on. I do not know of a method, within openscad, of exposing the vertices of such generated shapes, but exporting as svg gives the list of vertices (albeit in a different format). Maybe, if you set an xy problem, you get a to z answers. There is no way in current OpenSCAD to extract the vertexes of a generated shape. The question is what the OP wanted to do, that required the actual list of points.