discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

operating on BOSL2 2D lists of points

JB
Jon Bondy
Sat, Dec 6, 2025 11:30 PM

I want to sweep a 2D object that consists of a square subtracted from a
circle.  I see how BOSL2 can return either a square or a circle as a "2D
path/list of points", but I cannot see how one can manipulate (subtract,
difference)  those two lists to create a third list that is the difference.

Jon

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

I want to sweep a 2D object that consists of a square subtracted from a circle.  I see how BOSL2 can return either a square or a circle as a "2D path/list of points", but I cannot see how one can manipulate (subtract, difference)  those two lists to create a third list that is the difference. Jon -- This email has been checked for viruses by AVG antivirus software. www.avg.com
TA
Todd Allen
Sun, Dec 7, 2025 12:48 AM

In BOSL2 a "region" is a path with zero or more holes in it.  I think a
region is a list of paths with the first path being the outer path and
additional paths defining the holes.

On Sat, Dec 6, 2025, 5:31 PM Jon Bondy via Discuss <
discuss@lists.openscad.org> wrote:

I want to sweep a 2D object that consists of a square subtracted from a
circle.  I see how BOSL2 can return either a square or a circle as a "2D
path/list of points", but I cannot see how one can manipulate (subtract,
difference)  those two lists to create a third list that is the difference.

Jon

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


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

In BOSL2 a "region" is a path with zero or more holes in it. I think a region is a list of paths with the first path being the outer path and additional paths defining the holes. On Sat, Dec 6, 2025, 5:31 PM Jon Bondy via Discuss < discuss@lists.openscad.org> wrote: > I want to sweep a 2D object that consists of a square subtracted from a > circle. I see how BOSL2 can return either a square or a circle as a "2D > path/list of points", but I cannot see how one can manipulate (subtract, > difference) those two lists to create a third list that is the difference. > > Jon > > > -- > This email has been checked for viruses by AVG antivirus software. > www.avg.com > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
JJ
jon jonbondy.com
Sun, Dec 7, 2025 1:01 AM

I think you gave me a definition.  I was looking for how to perform operations, like difference(), if that is possible

On 12/6/2025 7:48 PM, Todd Allen wrote:
In BOSL2 a "region" is a path with zero or more holes in it.  I think a region is a list of paths with the first path being the outer path and additional paths defining the holes.

On Sat, Dec 6, 2025, 5:31 PM Jon Bondy via Discuss <discuss@lists.openscad.orgmailto:discuss@lists.openscad.org> wrote:
I want to sweep a 2D object that consists of a square subtracted from a
circle.  I see how BOSL2 can return either a square or a circle as a "2D
path/list of points", but I cannot see how one can manipulate (subtract,
difference)  those two lists to create a third list that is the difference.

Jon

--
This email has been checked for viruses by AVG antivirus software.
www.avg.comhttps://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=RjDcEeyB_RayZwbO2XTnMISeptHQUcKeEcafHQUFc33VqhS2l-4zsHZxJ9lh8A_D&s=QmF1jcpwxWNJb1lT0tpOngOFDGaNt5eOMWzxTAijY7k&e=


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

I think you gave me a definition. I was looking for how to perform operations, like difference(), if that is possible On 12/6/2025 7:48 PM, Todd Allen wrote: In BOSL2 a "region" is a path with zero or more holes in it. I think a region is a list of paths with the first path being the outer path and additional paths defining the holes. On Sat, Dec 6, 2025, 5:31 PM Jon Bondy via Discuss <discuss@lists.openscad.org<mailto:discuss@lists.openscad.org>> wrote: I want to sweep a 2D object that consists of a square subtracted from a circle. I see how BOSL2 can return either a square or a circle as a "2D path/list of points", but I cannot see how one can manipulate (subtract, difference) those two lists to create a third list that is the difference. Jon -- This email has been checked for viruses by AVG antivirus software. www.avg.com<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=RjDcEeyB_RayZwbO2XTnMISeptHQUcKeEcafHQUFc33VqhS2l-4zsHZxJ9lh8A_D&s=QmF1jcpwxWNJb1lT0tpOngOFDGaNt5eOMWzxTAijY7k&e=> _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org<mailto:discuss-leave@lists.openscad.org>
DP
Dan Perry
Sun, Dec 7, 2025 2:19 AM

include <BOSL2/std.scad>

s = square(20, center=true);
c = circle(r=8, $fn=40);

sh = difference(s, c);

region(sh);

[image: image.png]

On Sat, Dec 6, 2025 at 5:02 PM jon jonbondy.com via Discuss <
discuss@lists.openscad.org> wrote:

I think you gave me a definition.  I was looking for how to perform
operations, like difference(), if that is possible

On 12/6/2025 7:48 PM, Todd Allen wrote:

In BOSL2 a "region" is a path with zero or more holes in it.  I think a
region is a list of paths with the first path being the outer path and
additional paths defining the holes.

On Sat, Dec 6, 2025, 5:31 PM Jon Bondy via Discuss <
discuss@lists.openscad.org> wrote:

I want to sweep a 2D object that consists of a square subtracted from a
circle.  I see how BOSL2 can return either a square or a circle as a "2D
path/list of points", but I cannot see how one can manipulate (subtract,
difference)  those two lists to create a third list that is the
difference.

Jon

--
This email has been checked for viruses by AVG antivirus software.
www.avg.com
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=RjDcEeyB_RayZwbO2XTnMISeptHQUcKeEcafHQUFc33VqhS2l-4zsHZxJ9lh8A_D&s=QmF1jcpwxWNJb1lT0tpOngOFDGaNt5eOMWzxTAijY7k&e=


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

include <BOSL2/std.scad> s = square(20, center=true); c = circle(r=8, $fn=40); sh = difference(s, c); region(sh); [image: image.png] On Sat, Dec 6, 2025 at 5:02 PM jon jonbondy.com via Discuss < discuss@lists.openscad.org> wrote: > I think you gave me a definition. I was looking for how to perform > operations, like difference(), if that is possible > > > On 12/6/2025 7:48 PM, Todd Allen wrote: > > In BOSL2 a "region" is a path with zero or more holes in it. I think a > region is a list of paths with the first path being the outer path and > additional paths defining the holes. > > On Sat, Dec 6, 2025, 5:31 PM Jon Bondy via Discuss < > discuss@lists.openscad.org> wrote: > >> I want to sweep a 2D object that consists of a square subtracted from a >> circle. I see how BOSL2 can return either a square or a circle as a "2D >> path/list of points", but I cannot see how one can manipulate (subtract, >> difference) those two lists to create a third list that is the >> difference. >> >> Jon >> >> >> -- >> This email has been checked for viruses by AVG antivirus software. >> www.avg.com >> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=RjDcEeyB_RayZwbO2XTnMISeptHQUcKeEcafHQUFc33VqhS2l-4zsHZxJ9lh8A_D&s=QmF1jcpwxWNJb1lT0tpOngOFDGaNt5eOMWzxTAijY7k&e=> >> _______________________________________________ >> 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
Sun, Dec 7, 2025 3:07 AM

Thanks, but...

this

include <BOSL2/std.scad> c = right(5) circle(r = 5); s = translate([6,
-1]) square([4, 2]); sh = difference(c, s);

produces this

Parsing design (AST generation)...

Saved backup file:
C:/Users/jon/OneDrive/Documents/OpenSCAD/backups/Brian Griggs
Screw-backup-ALqlHngx.scad

ERROR: Parser error: syntax error in file ., line 3

Execution aborted

with the error cursor on the left paren of the circle()

On 12/6/2025 9:19 PM, Dan Perry via Discuss wrote:

include <BOSL2/std.scad>

s = square(20, center=true);
c = circle(r=8, $fn=40);

sh = difference(s, c);

region(sh);

image.png

On Sat, Dec 6, 2025 at 5:02 PM jon jonbondy.com
https://urldefense.proofpoint.com/v2/url?u=http-3A__jonbondy.com&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=5F1_ORH2iq5gReDZX3C3DgF0ZLMpShDqzOievQ7FFhC3UBCyj0mQ4fXulK2Qaixe&s=udrpaIIKJ2JEokf7IzyCORri-4ZF3e8RdCdLNQX9ruU&e=
via Discuss discuss@lists.openscad.org wrote:

 I think you gave me a definition.  I was looking for how to
 perform operations, like difference(), if that is possible

 On 12/6/2025 7:48 PM, Todd Allen wrote:
 In BOSL2 a "region" is a path with zero or more holes in it.   I
 think a region is a list of paths with the first path being the
 outer path and additional paths defining the holes.

 On Sat, Dec 6, 2025, 5:31 PM Jon Bondy via Discuss
 <discuss@lists.openscad.org> wrote:

     I want to sweep a 2D object that consists of a square
     subtracted from a
     circle.  I see how BOSL2 can return either a square or a
     circle as a "2D
     path/list of points", but I cannot see how one can manipulate
     (subtract,
     difference)  those two lists to create a third list that is
     the difference.

     Jon


     -- 
     This email has been checked for viruses by AVG antivirus
     software.
     www.avg.com
     <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=RjDcEeyB_RayZwbO2XTnMISeptHQUcKeEcafHQUFc33VqhS2l-4zsHZxJ9lh8A_D&s=QmF1jcpwxWNJb1lT0tpOngOFDGaNt5eOMWzxTAijY7k&e=>
     _______________________________________________
     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

Thanks, but... this include <BOSL2/std.scad> c = right(5) circle(r = 5); s = translate([6, -1]) square([4, 2]); sh = difference(c, s); produces this Parsing design (AST generation)... Saved backup file: C:/Users/jon/OneDrive/Documents/OpenSCAD/backups/Brian Griggs Screw-backup-ALqlHngx.scad ERROR: Parser error: syntax error in file ., line 3 Execution aborted with the error cursor on the left paren of the circle() On 12/6/2025 9:19 PM, Dan Perry via Discuss wrote: > include <BOSL2/std.scad> > > s = square(20, center=true); > c = circle(r=8, $fn=40); > > sh = difference(s, c); > > region(sh); > > > image.png > > > > > On Sat, Dec 6, 2025 at 5:02 PM jon jonbondy.com > <https://urldefense.proofpoint.com/v2/url?u=http-3A__jonbondy.com&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=5F1_ORH2iq5gReDZX3C3DgF0ZLMpShDqzOievQ7FFhC3UBCyj0mQ4fXulK2Qaixe&s=udrpaIIKJ2JEokf7IzyCORri-4ZF3e8RdCdLNQX9ruU&e=> > via Discuss <discuss@lists.openscad.org> wrote: > > I think you gave me a definition.  I was looking for how to > perform operations, like difference(), if that is possible > > On 12/6/2025 7:48 PM, Todd Allen wrote: >> In BOSL2 a "region" is a path with zero or more holes in it.   I >> think a region is a list of paths with the first path being the >> outer path and additional paths defining the holes. >> >> On Sat, Dec 6, 2025, 5:31 PM Jon Bondy via Discuss >> <discuss@lists.openscad.org> wrote: >> >> I want to sweep a 2D object that consists of a square >> subtracted from a >> circle.  I see how BOSL2 can return either a square or a >> circle as a "2D >> path/list of points", but I cannot see how one can manipulate >> (subtract, >> difference)  those two lists to create a third list that is >> the difference. >> >> Jon >> >> >> -- >> This email has been checked for viruses by AVG antivirus >> software. >> www.avg.com >> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=RjDcEeyB_RayZwbO2XTnMISeptHQUcKeEcafHQUFc33VqhS2l-4zsHZxJ9lh8A_D&s=QmF1jcpwxWNJb1lT0tpOngOFDGaNt5eOMWzxTAijY7k&e=> >> _______________________________________________ >> 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
TA
Todd Allen
Sun, Dec 7, 2025 3:21 AM

c = right(5) circle(r = 5);

Module invocations can be chained, functions must be nested to pass the
return value as a parameter to another.  Try:
c = right(5, circle(r=5));

On Sat, Dec 6, 2025 at 9:07 PM Jon Bondy via Discuss <
discuss@lists.openscad.org> wrote:

Thanks, but...

this

include <BOSL2/std.scad> c = right(5) circle(r = 5); s = translate([6,
-1]) square([4, 2]); sh = difference(c, s);

produces this

Parsing design (AST generation)...

Saved backup file: C:/Users/jon/OneDrive/Documents/OpenSCAD/backups/Brian
Griggs Screw-backup-ALqlHngx.scad

ERROR: Parser error: syntax error in file ., line 3

Execution aborted

with the error cursor on the left paren of the circle()

On 12/6/2025 9:19 PM, Dan Perry via Discuss wrote:

include <BOSL2/std.scad>

s = square(20, center=true);
c = circle(r=8, $fn=40);

sh = difference(s, c);

region(sh);

[image: image.png]

On Sat, Dec 6, 2025 at 5:02 PM jon jonbondy.com
https://urldefense.proofpoint.com/v2/url?u=http-3A__jonbondy.com&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=5F1_ORH2iq5gReDZX3C3DgF0ZLMpShDqzOievQ7FFhC3UBCyj0mQ4fXulK2Qaixe&s=udrpaIIKJ2JEokf7IzyCORri-4ZF3e8RdCdLNQX9ruU&e=
via Discuss discuss@lists.openscad.org wrote:

I think you gave me a definition.  I was looking for how to perform
operations, like difference(), if that is possible

On 12/6/2025 7:48 PM, Todd Allen wrote:

In BOSL2 a "region" is a path with zero or more holes in it.  I think a
region is a list of paths with the first path being the outer path and
additional paths defining the holes.

On Sat, Dec 6, 2025, 5:31 PM Jon Bondy via Discuss <
discuss@lists.openscad.org> wrote:

I want to sweep a 2D object that consists of a square subtracted from a
circle.  I see how BOSL2 can return either a square or a circle as a "2D
path/list of points", but I cannot see how one can manipulate (subtract,
difference)  those two lists to create a third list that is the
difference.

Jon

--
This email has been checked for viruses by AVG antivirus software.
www.avg.com
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=RjDcEeyB_RayZwbO2XTnMISeptHQUcKeEcafHQUFc33VqhS2l-4zsHZxJ9lh8A_D&s=QmF1jcpwxWNJb1lT0tpOngOFDGaNt5eOMWzxTAijY7k&e=


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
<#m_-6356855161383209497_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


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

> c = right(5) circle(r = 5); Module invocations can be chained, functions must be nested to pass the return value as a parameter to another. Try: c = right(5, circle(r=5)); On Sat, Dec 6, 2025 at 9:07 PM Jon Bondy via Discuss < discuss@lists.openscad.org> wrote: > Thanks, but... > > this > > include <BOSL2/std.scad> c = right(5) circle(r = 5); s = translate([6, > -1]) square([4, 2]); sh = difference(c, s); > > produces this > > Parsing design (AST generation)... > > Saved backup file: C:/Users/jon/OneDrive/Documents/OpenSCAD/backups/Brian > Griggs Screw-backup-ALqlHngx.scad > > ERROR: Parser error: syntax error in file ., line 3 > > Execution aborted > > with the error cursor on the left paren of the circle() > > On 12/6/2025 9:19 PM, Dan Perry via Discuss wrote: > > include <BOSL2/std.scad> > > s = square(20, center=true); > c = circle(r=8, $fn=40); > > sh = difference(s, c); > > region(sh); > > > [image: image.png] > > > > > On Sat, Dec 6, 2025 at 5:02 PM jon jonbondy.com > <https://urldefense.proofpoint.com/v2/url?u=http-3A__jonbondy.com&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=5F1_ORH2iq5gReDZX3C3DgF0ZLMpShDqzOievQ7FFhC3UBCyj0mQ4fXulK2Qaixe&s=udrpaIIKJ2JEokf7IzyCORri-4ZF3e8RdCdLNQX9ruU&e=> > via Discuss <discuss@lists.openscad.org> wrote: > >> I think you gave me a definition. I was looking for how to perform >> operations, like difference(), if that is possible >> >> On 12/6/2025 7:48 PM, Todd Allen wrote: >> >> In BOSL2 a "region" is a path with zero or more holes in it. I think a >> region is a list of paths with the first path being the outer path and >> additional paths defining the holes. >> >> On Sat, Dec 6, 2025, 5:31 PM Jon Bondy via Discuss < >> discuss@lists.openscad.org> wrote: >> >>> I want to sweep a 2D object that consists of a square subtracted from a >>> circle. I see how BOSL2 can return either a square or a circle as a "2D >>> path/list of points", but I cannot see how one can manipulate (subtract, >>> difference) those two lists to create a third list that is the >>> difference. >>> >>> Jon >>> >>> >>> -- >>> This email has been checked for viruses by AVG antivirus software. >>> www.avg.com >>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=RjDcEeyB_RayZwbO2XTnMISeptHQUcKeEcafHQUFc33VqhS2l-4zsHZxJ9lh8A_D&s=QmF1jcpwxWNJb1lT0tpOngOFDGaNt5eOMWzxTAijY7k&e=> >>> _______________________________________________ >>> 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> > <#m_-6356855161383209497_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
JB
Jon Bondy
Sun, Dec 7, 2025 3:33 AM

That was it!  Thank you!

On 12/6/2025 10:21 PM, Todd Allen via Discuss wrote:

c = right(5) circle(r = 5);

Module invocations can be chained, functions must be nested to pass
the return value as a parameter to another.  Try:
c = right(5, circle(r=5));

On Sat, Dec 6, 2025 at 9:07 PM Jon Bondy via Discuss
discuss@lists.openscad.org wrote:

 Thanks, but...

 this

 include <BOSL2/std.scad> c = right(5) circle(r = 5); s =
 translate([6, -1]) square([4, 2]); sh = difference(c, s);

 produces this

 Parsing design (AST generation)...

 Saved backup file:
 C:/Users/jon/OneDrive/Documents/OpenSCAD/backups/Brian Griggs
 Screw-backup-ALqlHngx.scad

 ERROR: Parser error: syntax error in file ., line 3

 Execution aborted

 with the error cursor on the left paren of the circle()

 On 12/6/2025 9:19 PM, Dan Perry via Discuss wrote:
 include <BOSL2/std.scad>

 s = square(20, center=true);
 c = circle(r=8, $fn=40);

 sh = difference(s, c);

 region(sh);


 image.png




 On Sat, Dec 6, 2025 at 5:02 PM jon jonbondy.com
 <https://urldefense.proofpoint.com/v2/url?u=http-3A__jonbondy.com&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=5F1_ORH2iq5gReDZX3C3DgF0ZLMpShDqzOievQ7FFhC3UBCyj0mQ4fXulK2Qaixe&s=udrpaIIKJ2JEokf7IzyCORri-4ZF3e8RdCdLNQX9ruU&e=>
 via Discuss <discuss@lists.openscad.org> wrote:

     I think you gave me a definition.  I was looking for how to
     perform operations, like difference(), if that is possible

     On 12/6/2025 7:48 PM, Todd Allen wrote:
     In BOSL2 a "region" is a path with zero or more holes in
     it.   I think a region is a list of paths with the first
     path being the outer path and additional paths defining the
     holes.

     On Sat, Dec 6, 2025, 5:31 PM Jon Bondy via Discuss
     <discuss@lists.openscad.org> wrote:

         I want to sweep a 2D object that consists of a square
         subtracted from a
         circle.  I see how BOSL2 can return either a square or a
         circle as a "2D
         path/list of points", but I cannot see how one can
         manipulate (subtract,
         difference)  those two lists to create a third list that
         is the difference.

         Jon


         -- 
         This email has been checked for viruses by AVG antivirus
         software.
         www.avg.com
         <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=RjDcEeyB_RayZwbO2XTnMISeptHQUcKeEcafHQUFc33VqhS2l-4zsHZxJ9lh8A_D&s=QmF1jcpwxWNJb1lT0tpOngOFDGaNt5eOMWzxTAijY7k&e=>
         _______________________________________________
         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
 <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsignature-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dlink-26utm-5Fcampaign-3Dsig-2Demail-26utm-5Fcontent-3Demailclient&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=xiXcSqu6j9Nk8ni8sjXMPQnZ4ir0-p1mOyVcHJqLEUhcM9RrX96NGZ1N-byEiCtK&s=Nw6ahPjeHQQEoLBZahg6d_N8eGhoX4-KmaIrIDcoZ7k&e=>
 	Virus-free.www.avg.com
 <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsignature-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dlink-26utm-5Fcampaign-3Dsig-2Demail-26utm-5Fcontent-3Demailclient&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=xiXcSqu6j9Nk8ni8sjXMPQnZ4ir0-p1mOyVcHJqLEUhcM9RrX96NGZ1N-byEiCtK&s=Nw6ahPjeHQQEoLBZahg6d_N8eGhoX4-KmaIrIDcoZ7k&e=>


 <#m_-6356855161383209497_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
 _______________________________________________
 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

That was it!  Thank you! On 12/6/2025 10:21 PM, Todd Allen via Discuss wrote: > > c = right(5) circle(r = 5); > > Module invocations can be chained, functions must be nested to pass > the return value as a parameter to another.  Try: > c = right(5, circle(r=5)); > > On Sat, Dec 6, 2025 at 9:07 PM Jon Bondy via Discuss > <discuss@lists.openscad.org> wrote: > > Thanks, but... > > this > > include <BOSL2/std.scad> c = right(5) circle(r = 5); s = > translate([6, -1]) square([4, 2]); sh = difference(c, s); > > produces this > > Parsing design (AST generation)... > > Saved backup file: > C:/Users/jon/OneDrive/Documents/OpenSCAD/backups/Brian Griggs > Screw-backup-ALqlHngx.scad > > ERROR: Parser error: syntax error in file ., line 3 > > Execution aborted > > with the error cursor on the left paren of the circle() > > On 12/6/2025 9:19 PM, Dan Perry via Discuss wrote: >> include <BOSL2/std.scad> >> >> s = square(20, center=true); >> c = circle(r=8, $fn=40); >> >> sh = difference(s, c); >> >> region(sh); >> >> >> image.png >> >> >> >> >> On Sat, Dec 6, 2025 at 5:02 PM jon jonbondy.com >> <https://urldefense.proofpoint.com/v2/url?u=http-3A__jonbondy.com&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=5F1_ORH2iq5gReDZX3C3DgF0ZLMpShDqzOievQ7FFhC3UBCyj0mQ4fXulK2Qaixe&s=udrpaIIKJ2JEokf7IzyCORri-4ZF3e8RdCdLNQX9ruU&e=> >> via Discuss <discuss@lists.openscad.org> wrote: >> >> I think you gave me a definition.  I was looking for how to >> perform operations, like difference(), if that is possible >> >> On 12/6/2025 7:48 PM, Todd Allen wrote: >>> In BOSL2 a "region" is a path with zero or more holes in >>> it.   I think a region is a list of paths with the first >>> path being the outer path and additional paths defining the >>> holes. >>> >>> On Sat, Dec 6, 2025, 5:31 PM Jon Bondy via Discuss >>> <discuss@lists.openscad.org> wrote: >>> >>> I want to sweep a 2D object that consists of a square >>> subtracted from a >>> circle.  I see how BOSL2 can return either a square or a >>> circle as a "2D >>> path/list of points", but I cannot see how one can >>> manipulate (subtract, >>> difference)  those two lists to create a third list that >>> is the difference. >>> >>> Jon >>> >>> >>> -- >>> This email has been checked for viruses by AVG antivirus >>> software. >>> www.avg.com >>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=RjDcEeyB_RayZwbO2XTnMISeptHQUcKeEcafHQUFc33VqhS2l-4zsHZxJ9lh8A_D&s=QmF1jcpwxWNJb1lT0tpOngOFDGaNt5eOMWzxTAijY7k&e=> >>> _______________________________________________ >>> 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 > > <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsignature-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dlink-26utm-5Fcampaign-3Dsig-2Demail-26utm-5Fcontent-3Demailclient&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=xiXcSqu6j9Nk8ni8sjXMPQnZ4ir0-p1mOyVcHJqLEUhcM9RrX96NGZ1N-byEiCtK&s=Nw6ahPjeHQQEoLBZahg6d_N8eGhoX4-KmaIrIDcoZ7k&e=> > Virus-free.www.avg.com > <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsignature-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dlink-26utm-5Fcampaign-3Dsig-2Demail-26utm-5Fcontent-3Demailclient&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=xiXcSqu6j9Nk8ni8sjXMPQnZ4ir0-p1mOyVcHJqLEUhcM9RrX96NGZ1N-byEiCtK&s=Nw6ahPjeHQQEoLBZahg6d_N8eGhoX4-KmaIrIDcoZ7k&e=> > > > <#m_-6356855161383209497_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > _______________________________________________ > 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