discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Struggling with BOSL2 and fillet at curved top edge of prism

TR
Thomas Richter
Mon, May 25, 2026 9:43 AM

I use the rounding features BOSL2 a lot to create fillets and teardrop-shaped edges for 3d printed parts. Many things work very nicely.

Recently I came over a problem that seemed to be solveable quite easy but appeared to be too hard for me to solve with the rounding features of BOSL2.

Consider the following simplified example code:

include <BOSL2/std.scad>

path = [
[  0, -10],
[ 20, -20],
[ 20,  20],
[-20,  20],
[-20, -20],
];

intersection() {

linear_sweep(
region = path,
height = 40,
);

sphere(r = 40, $fn = 120);
}

I try to create a fillet with r = 1 at the curved top edges of the resulting part. I have no idea how to do this. I tried all of linear_sweep, rounded_prism, offset_sweep, join_prism but never came to a solution.

My first idea was that this could possibly be done without the intersection but only with the rounding options of offset_sweep etc. But I couldn't get it done. It is important that the top surface of the prism is - except for the small fillet I try to create - part of a sphere with fixed radius since it moves and turns inside a tube with that inner radius and the contact surface must be maximal.

Please note that the path is a simplification of the real part's base polygon. I just wanted to make clear that the base polygon is concave and that it is constructed by extruding a path.

Thanks,
Thomas

I use the rounding features BOSL2 a lot to create fillets and teardrop-shaped edges for 3d printed parts. Many things work very nicely. Recently I came over a problem that seemed to be solveable quite easy but appeared to be too hard for me to solve with the rounding features of BOSL2. Consider the following simplified example code: include <BOSL2/std.scad> path = [ [ 0, -10], [ 20, -20], [ 20, 20], [-20, 20], [-20, -20], ]; intersection() { linear_sweep( region = path, height = 40, ); sphere(r = 40, $fn = 120); } I try to create a fillet with r = 1 at the curved top edges of the resulting part. I have no idea how to do this. I tried all of linear_sweep, rounded_prism, offset_sweep, join_prism but never came to a solution. My first idea was that this could possibly be done without the intersection but only with the rounding options of offset_sweep etc. But I couldn't get it done. It is important that the top surface of the prism is - except for the small fillet I try to create - part of a sphere with fixed radius since it moves and turns inside a tube with that inner radius and the contact surface must be maximal. Please note that the path is a simplification of the real part's base polygon. I just wanted to make clear that the base polygon is concave and that it is constructed by extruding a path. Thanks, Thomas
DP
Dan Perry
Mon, May 25, 2026 11:47 AM

You can use path_sweep() following the arc() on the left/right/back sides.
You'll have to play around with the mask_angle argument of
mask2d_roundover() to fit the shape.  The front edge of your shape is going
to be really difficult.  If you also intend to add a roundover to the
vertical edges, it will be even more complicated.
Dan

On Mon, May 25, 2026 at 10:44 AM Thomas Richter via Discuss <
discuss@lists.openscad.org> wrote:

I use the rounding features BOSL2 a lot to create fillets and
teardrop-shaped edges for 3d printed parts. Many things work very nicely.

Recently I came over a problem that seemed to be solveable quite easy but
appeared to be too hard for me to solve with the rounding features of BOSL2.

Consider the following simplified example code:

include <BOSL2/std.scad>

path = [
[  0, -10],
[ 20, -20],
[ 20,  20],
[-20,  20],
[-20, -20],
];

intersection() {

linear_sweep(
region = path,
height = 40,
);

sphere(r = 40, $fn = 120);
}

I try to create a fillet with r = 1 at the curved top edges of the
resulting part. I have no idea how to do this. I tried all of linear_sweep,
rounded_prism, offset_sweep, join_prism but never came to a solution.

My first idea was that this could possibly be done without the
intersection but only with the rounding options of offset_sweep etc. But I
couldn't get it done. It is important that the top surface of the prism is

  • except for the small fillet I try to create - part of a sphere with fixed
    radius since it moves and turns inside a tube with that inner radius and
    the contact surface must be maximal.

Please note that the path is a simplification of the real part's base
polygon. I just wanted to make clear that the base polygon is concave and
that it is constructed by extruding a path.

Thanks,
Thomas


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

You can use path_sweep() following the arc() on the left/right/back sides. You'll have to play around with the mask_angle argument of mask2d_roundover() to fit the shape. The front edge of your shape is going to be really difficult. If you also intend to add a roundover to the vertical edges, it will be even more complicated. Dan On Mon, May 25, 2026 at 10:44 AM Thomas Richter via Discuss < discuss@lists.openscad.org> wrote: > I use the rounding features BOSL2 a lot to create fillets and > teardrop-shaped edges for 3d printed parts. Many things work very nicely. > > Recently I came over a problem that seemed to be solveable quite easy but > appeared to be too hard for me to solve with the rounding features of BOSL2. > > Consider the following simplified example code: > > include <BOSL2/std.scad> > > path = [ > [ 0, -10], > [ 20, -20], > [ 20, 20], > [-20, 20], > [-20, -20], > ]; > > intersection() { > > linear_sweep( > region = path, > height = 40, > ); > > sphere(r = 40, $fn = 120); > } > > I try to create a fillet with r = 1 at the curved top edges of the > resulting part. I have no idea how to do this. I tried all of linear_sweep, > rounded_prism, offset_sweep, join_prism but never came to a solution. > > My first idea was that this could possibly be done without the > intersection but only with the rounding options of offset_sweep etc. But I > couldn't get it done. It is important that the top surface of the prism is > - except for the small fillet I try to create - part of a sphere with fixed > radius since it moves and turns inside a tube with that inner radius and > the contact surface must be maximal. > > Please note that the path is a simplification of the real part's base > polygon. I just wanted to make clear that the base polygon is concave and > that it is constructed by extruding a path. > > Thanks, > Thomas > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
TR
Thomas Richter
Mon, May 25, 2026 12:10 PM

Dear Dan,

thank you for the response. The base polygon's path of the actual part is way more complicated with several dozens of edges pointing inward.

I will take another look at the mask functions but I'm not very confident.

Best, Thomas

Am 25.05.2026 um 13:47 schrieb Dan Perry via Discuss discuss@lists.openscad.org:

You can use path_sweep() following the arc() on the left/right/back sides.  You'll have to play around with the mask_angle argument of mask2d_roundover() to fit the shape.  The front edge of your shape is going to be really difficult.  If you also intend to add a roundover to the vertical edges, it will be even more complicated.
Dan

On Mon, May 25, 2026 at 10:44 AM Thomas Richter via Discuss discuss@lists.openscad.org wrote:
I use the rounding features BOSL2 a lot to create fillets and teardrop-shaped edges for 3d printed parts. Many things work very nicely.

Recently I came over a problem that seemed to be solveable quite easy but appeared to be too hard for me to solve with the rounding features of BOSL2.

Consider the following simplified example code:

include <BOSL2/std.scad>

path = [
[  0, -10],
[ 20, -20],
[ 20,  20],
[-20,  20],
[-20, -20],
];

intersection() {

linear_sweep(
region = path,
height = 40,
);

sphere(r = 40, $fn = 120);
}

I try to create a fillet with r = 1 at the curved top edges of the resulting part. I have no idea how to do this. I tried all of linear_sweep, rounded_prism, offset_sweep, join_prism but never came to a solution.

My first idea was that this could possibly be done without the intersection but only with the rounding options of offset_sweep etc. But I couldn't get it done. It is important that the top surface of the prism is - except for the small fillet I try to create - part of a sphere with fixed radius since it moves and turns inside a tube with that inner radius and the contact surface must be maximal.

Please note that the path is a simplification of the real part's base polygon. I just wanted to make clear that the base polygon is concave and that it is constructed by extruding a path.

Thanks,
Thomas


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

Dear Dan, thank you for the response. The base polygon's path of the actual part is way more complicated with several dozens of edges pointing inward. I will take another look at the mask functions but I'm not very confident. Best, Thomas > Am 25.05.2026 um 13:47 schrieb Dan Perry via Discuss <discuss@lists.openscad.org>: > > You can use path_sweep() following the arc() on the left/right/back sides. You'll have to play around with the mask_angle argument of mask2d_roundover() to fit the shape. The front edge of your shape is going to be really difficult. If you also intend to add a roundover to the vertical edges, it will be even more complicated. > Dan > >> On Mon, May 25, 2026 at 10:44 AM Thomas Richter via Discuss <discuss@lists.openscad.org> wrote: >> I use the rounding features BOSL2 a lot to create fillets and teardrop-shaped edges for 3d printed parts. Many things work very nicely. >> >> Recently I came over a problem that seemed to be solveable quite easy but appeared to be too hard for me to solve with the rounding features of BOSL2. >> >> Consider the following simplified example code: >> >> include <BOSL2/std.scad> >> >> path = [ >> [ 0, -10], >> [ 20, -20], >> [ 20, 20], >> [-20, 20], >> [-20, -20], >> ]; >> >> intersection() { >> >> linear_sweep( >> region = path, >> height = 40, >> ); >> >> sphere(r = 40, $fn = 120); >> } >> >> I try to create a fillet with r = 1 at the curved top edges of the resulting part. I have no idea how to do this. I tried all of linear_sweep, rounded_prism, offset_sweep, join_prism but never came to a solution. >> >> My first idea was that this could possibly be done without the intersection but only with the rounding options of offset_sweep etc. But I couldn't get it done. It is important that the top surface of the prism is - except for the small fillet I try to create - part of a sphere with fixed radius since it moves and turns inside a tube with that inner radius and the contact surface must be maximal. >> >> Please note that the path is a simplification of the real part's base polygon. I just wanted to make clear that the base polygon is concave and that it is constructed by extruding a path. >> >> Thanks, >> Thomas >> _______________________________________________ >> 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
AM
Adrian Mariano
Mon, May 25, 2026 11:28 PM

This is a very difficult fillet problem.  The angle between the sphere and
the side is not constant, so if you want a fillet that is tangent at both
sides, the curve needs to change along its length. The easiest way to apply
a roundover to this is probably to use minkowski().  The strategy of using
path_sweep to sweep some mask (perhaps a chamfer?) around the arcs could
work, but it would be a lot of trouble to figure out what all those arcs
are, especially if the extruded polygon is more complex.

On Mon, May 25, 2026 at 8:11 AM Thomas Richter via Discuss <
discuss@lists.openscad.org> wrote:

Dear Dan,

thank you for the response. The base polygon's path of the actual part is
way more complicated with several dozens of edges pointing inward.

I will take another look at the mask functions but I'm not very confident.

Best, Thomas

Am 25.05.2026 um 13:47 schrieb Dan Perry via Discuss <

You can use path_sweep() following the arc() on the left/right/back

sides.  You'll have to play around with the mask_angle argument of
mask2d_roundover() to fit the shape.  The front edge of your shape is going
to be really difficult.  If you also intend to add a roundover to the
vertical edges, it will be even more complicated.

Dan

On Mon, May 25, 2026 at 10:44 AM Thomas Richter via Discuss <

I use the rounding features BOSL2 a lot to create fillets and

teardrop-shaped edges for 3d printed parts. Many things work very nicely.

Recently I came over a problem that seemed to be solveable quite easy

but appeared to be too hard for me to solve with the rounding features of
BOSL2.

Consider the following simplified example code:

include <BOSL2/std.scad>

path = [
[  0, -10],
[ 20, -20],
[ 20,  20],
[-20,  20],
[-20, -20],
];

intersection() {

linear_sweep(
region = path,
height = 40,
);

sphere(r = 40, $fn = 120);
}

I try to create a fillet with r = 1 at the curved top edges of the

resulting part. I have no idea how to do this. I tried all of linear_sweep,
rounded_prism, offset_sweep, join_prism but never came to a solution.

My first idea was that this could possibly be done without the

intersection but only with the rounding options of offset_sweep etc. But I
couldn't get it done. It is important that the top surface of the prism is

  • except for the small fillet I try to create - part of a sphere with fixed
    radius since it moves and turns inside a tube with that inner radius and
    the contact surface must be maximal.

Please note that the path is a simplification of the real part's base

polygon. I just wanted to make clear that the base polygon is concave and
that it is constructed by extruding a path.

Thanks,
Thomas


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

This is a very difficult fillet problem. The angle between the sphere and the side is not constant, so if you want a fillet that is tangent at both sides, the curve needs to change along its length. The easiest way to apply a roundover to this is probably to use minkowski(). The strategy of using path_sweep to sweep some mask (perhaps a chamfer?) around the arcs could work, but it would be a lot of trouble to figure out what all those arcs are, especially if the extruded polygon is more complex. On Mon, May 25, 2026 at 8:11 AM Thomas Richter via Discuss < discuss@lists.openscad.org> wrote: > Dear Dan, > > thank you for the response. The base polygon's path of the actual part is > way more complicated with several dozens of edges pointing inward. > > I will take another look at the mask functions but I'm not very confident. > > Best, Thomas > > > > Am 25.05.2026 um 13:47 schrieb Dan Perry via Discuss < > discuss@lists.openscad.org>: > > > > You can use path_sweep() following the arc() on the left/right/back > sides. You'll have to play around with the mask_angle argument of > mask2d_roundover() to fit the shape. The front edge of your shape is going > to be really difficult. If you also intend to add a roundover to the > vertical edges, it will be even more complicated. > > Dan > > > >> On Mon, May 25, 2026 at 10:44 AM Thomas Richter via Discuss < > discuss@lists.openscad.org> wrote: > >> I use the rounding features BOSL2 a lot to create fillets and > teardrop-shaped edges for 3d printed parts. Many things work very nicely. > >> > >> Recently I came over a problem that seemed to be solveable quite easy > but appeared to be too hard for me to solve with the rounding features of > BOSL2. > >> > >> Consider the following simplified example code: > >> > >> include <BOSL2/std.scad> > >> > >> path = [ > >> [ 0, -10], > >> [ 20, -20], > >> [ 20, 20], > >> [-20, 20], > >> [-20, -20], > >> ]; > >> > >> intersection() { > >> > >> linear_sweep( > >> region = path, > >> height = 40, > >> ); > >> > >> sphere(r = 40, $fn = 120); > >> } > >> > >> I try to create a fillet with r = 1 at the curved top edges of the > resulting part. I have no idea how to do this. I tried all of linear_sweep, > rounded_prism, offset_sweep, join_prism but never came to a solution. > >> > >> My first idea was that this could possibly be done without the > intersection but only with the rounding options of offset_sweep etc. But I > couldn't get it done. It is important that the top surface of the prism is > - except for the small fillet I try to create - part of a sphere with fixed > radius since it moves and turns inside a tube with that inner radius and > the contact surface must be maximal. > >> > >> Please note that the path is a simplification of the real part's base > polygon. I just wanted to make clear that the base polygon is concave and > that it is constructed by extruding a path. > >> > >> Thanks, > >> Thomas > >> _______________________________________________ > >> 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
TR
Thomas Richter
Tue, May 26, 2026 7:36 AM

I had already solved the fillet problem analytically a while ago by building the prism layer by layer and using trigonometry to calculate the vertices of the polyhedron with the fillets. But that solution has - including extensive comments as well as Customizer options - about 850 lines of code. Back then I didn't know much about BOSL2.

Now I wanted to extend it to be able to use teardrops and chamfers too and thought it would be easy to rewrite the whole thing with BOSL2 and reduce the code to about 50 lines. Unfortunately it isn't as simple as I thought. In the meantime I thought about BOSL2 attachables but that doesn't provide a simple "create-this-fillet-at-that-edge-of-the-child" solution either.

Minkowski was the very first solution. Rendering a prism extruded from a base polygon with 200 to 400 edges took about five minutes. That's why I solved it analytically in the first place, reducing the rendering time to less than a second.

I think I will leave it as it is and build the teardrop myself with the current analytical approach.

Am 26.05.2026 um 01:28 schrieb Adrian Mariano via Discuss discuss@lists.openscad.org:

This is a very difficult fillet problem.  The angle between the sphere and the side is not constant, so if you want a fillet that is tangent at both sides, the curve needs to change along its length. The easiest way to apply a roundover to this is probably to use minkowski().  The strategy of using path_sweep to sweep some mask (perhaps a chamfer?) around the arcs could work, but it would be a lot of trouble to figure out what all those arcs are, especially if the extruded polygon is more complex.

On Mon, May 25, 2026 at 8:11 AM Thomas Richter via Discuss discuss@lists.openscad.org wrote:
Dear Dan,

thank you for the response. The base polygon's path of the actual part is way more complicated with several dozens of edges pointing inward.

I will take another look at the mask functions but I'm not very confident.

Best, Thomas

Am 25.05.2026 um 13:47 schrieb Dan Perry via Discuss discuss@lists.openscad.org:

You can use path_sweep() following the arc() on the left/right/back sides.  You'll have to play around with the mask_angle argument of mask2d_roundover() to fit the shape.  The front edge of your shape is going to be really difficult.  If you also intend to add a roundover to the vertical edges, it will be even more complicated.
Dan

On Mon, May 25, 2026 at 10:44 AM Thomas Richter via Discuss discuss@lists.openscad.org wrote:
I use the rounding features BOSL2 a lot to create fillets and teardrop-shaped edges for 3d printed parts. Many things work very nicely.

Recently I came over a problem that seemed to be solveable quite easy but appeared to be too hard for me to solve with the rounding features of BOSL2.

Consider the following simplified example code:

include <BOSL2/std.scad>

path = [
[  0, -10],
[ 20, -20],
[ 20,  20],
[-20,  20],
[-20, -20],
];

intersection() {

linear_sweep(
region = path,
height = 40,
);

sphere(r = 40, $fn = 120);
}

I try to create a fillet with r = 1 at the curved top edges of the resulting part. I have no idea how to do this. I tried all of linear_sweep, rounded_prism, offset_sweep, join_prism but never came to a solution.

My first idea was that this could possibly be done without the intersection but only with the rounding options of offset_sweep etc. But I couldn't get it done. It is important that the top surface of the prism is - except for the small fillet I try to create - part of a sphere with fixed radius since it moves and turns inside a tube with that inner radius and the contact surface must be maximal.

Please note that the path is a simplification of the real part's base polygon. I just wanted to make clear that the base polygon is concave and that it is constructed by extruding a path.

Thanks,
Thomas


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

I had already solved the fillet problem analytically a while ago by building the prism layer by layer and using trigonometry to calculate the vertices of the polyhedron with the fillets. But that solution has - including extensive comments as well as Customizer options - about 850 lines of code. Back then I didn't know much about BOSL2. Now I wanted to extend it to be able to use teardrops and chamfers too and thought it would be easy to rewrite the whole thing with BOSL2 and reduce the code to about 50 lines. Unfortunately it isn't as simple as I thought. In the meantime I thought about BOSL2 attachables but that doesn't provide a simple "create-this-fillet-at-that-edge-of-the-child" solution either. Minkowski was the very first solution. Rendering a prism extruded from a base polygon with 200 to 400 edges took about five minutes. That's why I solved it analytically in the first place, reducing the rendering time to less than a second. I think I will leave it as it is and build the teardrop myself with the current analytical approach. > Am 26.05.2026 um 01:28 schrieb Adrian Mariano via Discuss <discuss@lists.openscad.org>: > > This is a very difficult fillet problem. The angle between the sphere and the side is not constant, so if you want a fillet that is tangent at both sides, the curve needs to change along its length. The easiest way to apply a roundover to this is probably to use minkowski(). The strategy of using path_sweep to sweep some mask (perhaps a chamfer?) around the arcs could work, but it would be a lot of trouble to figure out what all those arcs are, especially if the extruded polygon is more complex. > >> On Mon, May 25, 2026 at 8:11 AM Thomas Richter via Discuss <discuss@lists.openscad.org> wrote: >> Dear Dan, >> >> thank you for the response. The base polygon's path of the actual part is way more complicated with several dozens of edges pointing inward. >> >> I will take another look at the mask functions but I'm not very confident. >> >> Best, Thomas >> >> >> > Am 25.05.2026 um 13:47 schrieb Dan Perry via Discuss <discuss@lists.openscad.org>: >> > >> > You can use path_sweep() following the arc() on the left/right/back sides. You'll have to play around with the mask_angle argument of mask2d_roundover() to fit the shape. The front edge of your shape is going to be really difficult. If you also intend to add a roundover to the vertical edges, it will be even more complicated. >> > Dan >> > >> >> On Mon, May 25, 2026 at 10:44 AM Thomas Richter via Discuss <discuss@lists.openscad.org> wrote: >> >> I use the rounding features BOSL2 a lot to create fillets and teardrop-shaped edges for 3d printed parts. Many things work very nicely. >> >> >> >> Recently I came over a problem that seemed to be solveable quite easy but appeared to be too hard for me to solve with the rounding features of BOSL2. >> >> >> >> Consider the following simplified example code: >> >> >> >> include <BOSL2/std.scad> >> >> >> >> path = [ >> >> [ 0, -10], >> >> [ 20, -20], >> >> [ 20, 20], >> >> [-20, 20], >> >> [-20, -20], >> >> ]; >> >> >> >> intersection() { >> >> >> >> linear_sweep( >> >> region = path, >> >> height = 40, >> >> ); >> >> >> >> sphere(r = 40, $fn = 120); >> >> } >> >> >> >> I try to create a fillet with r = 1 at the curved top edges of the resulting part. I have no idea how to do this. I tried all of linear_sweep, rounded_prism, offset_sweep, join_prism but never came to a solution. >> >> >> >> My first idea was that this could possibly be done without the intersection but only with the rounding options of offset_sweep etc. But I couldn't get it done. It is important that the top surface of the prism is - except for the small fillet I try to create - part of a sphere with fixed radius since it moves and turns inside a tube with that inner radius and the contact surface must be maximal. >> >> >> >> Please note that the path is a simplification of the real part's base polygon. I just wanted to make clear that the base polygon is concave and that it is constructed by extruding a path. >> >> >> >> Thanks, >> >> Thomas >> >> _______________________________________________ >> >> 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
AM
Adrian Mariano
Tue, May 26, 2026 10:29 AM

Are you using a dev snapshot with the manifold backend?  If not, you will
find minkowski() is faster (and so is everything else) if you switch.
But that won't provide teardrop.

It seems like 850 lines of code is more than should be needed for the
analytical approach you describe.  If you're building a polyhedron
vnf_vertex_array() or skin() can be helpful.  I could see an approach where
you convert a point in your polygon to polar, then working at fixed theta,
intersect it with the circle from the sphere using
circle_line_intersection().  Then use path_join() to join the circle arc to
the straight arc with a rounding.  And if desired add a rounding or
teardrop at the bottom by concatenating the points.  Collect all the paths
for your polygon and use vnf_vertex_array().  This strategy seems like it
should more like 50 lines of code.  You were a bit vague about what
roundings you want---the strategy I describe rounds the top and bottom
edges.  If you need to also round the vertical ones you do that by passing
your polygon to round_corners() before starting the algorithm.  This can
make a chamfer at the top or a (non-circular) rounding at the top, chamfer
or rounding on the vertical edges, and chamfer, rounding or teardrop at the
bottom.

On Tue, May 26, 2026 at 3:37 AM Thomas Richter via Discuss <
discuss@lists.openscad.org> wrote:

I had already solved the fillet problem analytically a while ago by
building the prism layer by layer and using trigonometry to calculate the
vertices of the polyhedron with the fillets. But that solution has -
including extensive comments as well as Customizer options - about 850
lines of code. Back then I didn't know much about BOSL2.

Now I wanted to extend it to be able to use teardrops and chamfers too and
thought it would be easy to rewrite the whole thing with BOSL2 and reduce
the code to about 50 lines. Unfortunately it isn't as simple as I thought.
In the meantime I thought about BOSL2 attachables but that doesn't provide
a simple "create-this-fillet-at-that-edge-of-the-child" solution either.

Minkowski was the very first solution. Rendering a prism extruded from a
base polygon with 200 to 400 edges took about five minutes. That's why I
solved it analytically in the first place, reducing the rendering time to
less than a second.

I think I will leave it as it is and build the teardrop myself with the
current analytical approach.

Am 26.05.2026 um 01:28 schrieb Adrian Mariano via Discuss <

This is a very difficult fillet problem.  The angle between the sphere

and the side is not constant, so if you want a fillet that is tangent at
both sides, the curve needs to change along its length. The easiest way to
apply a roundover to this is probably to use minkowski().  The strategy of
using path_sweep to sweep some mask (perhaps a chamfer?) around the arcs
could work, but it would be a lot of trouble to figure out what all those
arcs are, especially if the extruded polygon is more complex.

On Mon, May 25, 2026 at 8:11 AM Thomas Richter via Discuss <

Dear Dan,

thank you for the response. The base polygon's path of the actual part

is way more complicated with several dozens of edges pointing inward.

I will take another look at the mask functions but I'm not very

confident.

Best, Thomas

Am 25.05.2026 um 13:47 schrieb Dan Perry via Discuss <

You can use path_sweep() following the arc() on the left/right/back

sides.  You'll have to play around with the mask_angle argument of
mask2d_roundover() to fit the shape.  The front edge of your shape is going
to be really difficult.  If you also intend to add a roundover to the
vertical edges, it will be even more complicated.

Dan

On Mon, May 25, 2026 at 10:44 AM Thomas Richter via Discuss <

I use the rounding features BOSL2 a lot to create fillets and

teardrop-shaped edges for 3d printed parts. Many things work very nicely.

Recently I came over a problem that seemed to be solveable quite

easy but appeared to be too hard for me to solve with the rounding features
of BOSL2.

Consider the following simplified example code:

include <BOSL2/std.scad>

path = [
[  0, -10],
[ 20, -20],
[ 20,  20],
[-20,  20],
[-20, -20],
];

intersection() {

linear_sweep(
region = path,
height = 40,
);

sphere(r = 40, $fn = 120);
}

I try to create a fillet with r = 1 at the curved top edges of the

resulting part. I have no idea how to do this. I tried all of linear_sweep,
rounded_prism, offset_sweep, join_prism but never came to a solution.

My first idea was that this could possibly be done without the

intersection but only with the rounding options of offset_sweep etc. But I
couldn't get it done. It is important that the top surface of the prism is

  • except for the small fillet I try to create - part of a sphere with fixed
    radius since it moves and turns inside a tube with that inner radius and
    the contact surface must be maximal.

Please note that the path is a simplification of the real part's

base polygon. I just wanted to make clear that the base polygon is concave
and that it is constructed by extruding a path.

Thanks,
Thomas


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


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

Are you using a dev snapshot with the manifold backend? If not, you will find minkowski() is faster (and so is everything else) if you switch. But that won't provide teardrop. It seems like 850 lines of code is more than should be needed for the analytical approach you describe. If you're building a polyhedron vnf_vertex_array() or skin() can be helpful. I could see an approach where you convert a point in your polygon to polar, then working at fixed theta, intersect it with the circle from the sphere using circle_line_intersection(). Then use path_join() to join the circle arc to the straight arc with a rounding. And if desired add a rounding or teardrop at the bottom by concatenating the points. Collect all the paths for your polygon and use vnf_vertex_array(). This strategy seems like it should more like 50 lines of code. You were a bit vague about what roundings you want---the strategy I describe rounds the top and bottom edges. If you need to also round the vertical ones you do that by passing your polygon to round_corners() before starting the algorithm. This can make a chamfer at the top or a (non-circular) rounding at the top, chamfer or rounding on the vertical edges, and chamfer, rounding or teardrop at the bottom. On Tue, May 26, 2026 at 3:37 AM Thomas Richter via Discuss < discuss@lists.openscad.org> wrote: > I had already solved the fillet problem analytically a while ago by > building the prism layer by layer and using trigonometry to calculate the > vertices of the polyhedron with the fillets. But that solution has - > including extensive comments as well as Customizer options - about 850 > lines of code. Back then I didn't know much about BOSL2. > > Now I wanted to extend it to be able to use teardrops and chamfers too and > thought it would be easy to rewrite the whole thing with BOSL2 and reduce > the code to about 50 lines. Unfortunately it isn't as simple as I thought. > In the meantime I thought about BOSL2 attachables but that doesn't provide > a simple "create-this-fillet-at-that-edge-of-the-child" solution either. > > Minkowski was the very first solution. Rendering a prism extruded from a > base polygon with 200 to 400 edges took about five minutes. That's why I > solved it analytically in the first place, reducing the rendering time to > less than a second. > > I think I will leave it as it is and build the teardrop myself with the > current analytical approach. > > > Am 26.05.2026 um 01:28 schrieb Adrian Mariano via Discuss < > discuss@lists.openscad.org>: > > > > This is a very difficult fillet problem. The angle between the sphere > and the side is not constant, so if you want a fillet that is tangent at > both sides, the curve needs to change along its length. The easiest way to > apply a roundover to this is probably to use minkowski(). The strategy of > using path_sweep to sweep some mask (perhaps a chamfer?) around the arcs > could work, but it would be a lot of trouble to figure out what all those > arcs are, especially if the extruded polygon is more complex. > > > >> On Mon, May 25, 2026 at 8:11 AM Thomas Richter via Discuss < > discuss@lists.openscad.org> wrote: > >> Dear Dan, > >> > >> thank you for the response. The base polygon's path of the actual part > is way more complicated with several dozens of edges pointing inward. > >> > >> I will take another look at the mask functions but I'm not very > confident. > >> > >> Best, Thomas > >> > >> > >> > Am 25.05.2026 um 13:47 schrieb Dan Perry via Discuss < > discuss@lists.openscad.org>: > >> > > >> > You can use path_sweep() following the arc() on the left/right/back > sides. You'll have to play around with the mask_angle argument of > mask2d_roundover() to fit the shape. The front edge of your shape is going > to be really difficult. If you also intend to add a roundover to the > vertical edges, it will be even more complicated. > >> > Dan > >> > > >> >> On Mon, May 25, 2026 at 10:44 AM Thomas Richter via Discuss < > discuss@lists.openscad.org> wrote: > >> >> I use the rounding features BOSL2 a lot to create fillets and > teardrop-shaped edges for 3d printed parts. Many things work very nicely. > >> >> > >> >> Recently I came over a problem that seemed to be solveable quite > easy but appeared to be too hard for me to solve with the rounding features > of BOSL2. > >> >> > >> >> Consider the following simplified example code: > >> >> > >> >> include <BOSL2/std.scad> > >> >> > >> >> path = [ > >> >> [ 0, -10], > >> >> [ 20, -20], > >> >> [ 20, 20], > >> >> [-20, 20], > >> >> [-20, -20], > >> >> ]; > >> >> > >> >> intersection() { > >> >> > >> >> linear_sweep( > >> >> region = path, > >> >> height = 40, > >> >> ); > >> >> > >> >> sphere(r = 40, $fn = 120); > >> >> } > >> >> > >> >> I try to create a fillet with r = 1 at the curved top edges of the > resulting part. I have no idea how to do this. I tried all of linear_sweep, > rounded_prism, offset_sweep, join_prism but never came to a solution. > >> >> > >> >> My first idea was that this could possibly be done without the > intersection but only with the rounding options of offset_sweep etc. But I > couldn't get it done. It is important that the top surface of the prism is > - except for the small fillet I try to create - part of a sphere with fixed > radius since it moves and turns inside a tube with that inner radius and > the contact surface must be maximal. > >> >> > >> >> Please note that the path is a simplification of the real part's > base polygon. I just wanted to make clear that the base polygon is concave > and that it is constructed by extruding a path. > >> >> > >> >> Thanks, > >> >> Thomas > >> >> _______________________________________________ > >> >> 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 > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
TR
Thomas Richter
Tue, May 26, 2026 1:02 PM

Thank you for pointing me in the right direction. The 850 lines are at least 50% comments to explain to myself what I did. Without BOSL2 I created everything by hand: offsetting, path joining, flattening, face creation, filleting, ... and a lot of Customizer parameter handling.

You are right: I might not be able to create the full part with one function but I can probably replace my self made functions with the BISL2 ones.

Btw: vertical rounding is already part of the base path. So this i just about top and bottom rounding.

Am 26.05.2026 um 12:30 schrieb Adrian Mariano via Discuss <discuss@lists.openscad.org>:

Are you using a dev snapshot with the manifold backend? If not, you will find minkowski() is faster (and so is everything else) if you switch. But that won't provide teardrop.

It seems like 850 lines of code is more than should be needed for the analytical approach you describe. If you're building a polyhedron vnf_vertex_array() or skin() can be helpful. I could see an approach where you convert a point in your polygon to polar, then working at fixed theta, intersect it with the circle from the sphere using circle_line_intersection(). Then use path_join() to join the circle arc to the straight arc with a rounding. And if desired add a rounding or teardrop at the bottom by concatenating the points. Collect all the paths for your polygon and use vnf_vertex_array(). This strategy seems like it should more like 50 lines of code. You were a bit vague about what roundings you want---the strategy I describe rounds the top and bottom edges. If you need to also round the vertical ones you do that by passing your polygon to round_corners() before starting the algorithm. This can make a chamfer at the top or a (non-circular) rounding at the top, chamfer or rounding on the vertical edges, and chamfer, rounding or teardrop at the bottom.

On Tue, May 26, 2026 at 3:37 AM Thomas Richter via Discuss <discuss@lists.openscad.org> wrote:

I had already solved the fillet problem analytically a while ago by building the prism layer by layer and using trigonometry to calculate the vertices of the polyhedron with the fillets. But that solution has - including extensive comments as well as Customizer options - about 850 lines of code. Back then I didn't know much about BOSL2.

Now I wanted to extend it to be able to use teardrops and chamfers too and thought it would be easy to rewrite the whole thing with BOSL2 and reduce the code to about 50 lines. Unfortunately it isn't as simple as I thought. In the meantime I thought about BOSL2 attachables but that doesn't provide a simple "create-this-fillet-at-that-edge-of-the-child" solution either.

Minkowski was the very first solution. Rendering a prism extruded from a base polygon with 200 to 400 edges took about five minutes. That's why I solved it analytically in the first place, reducing the rendering time to less than a second.

I think I will leave it as it is and build the teardrop myself with the current analytical approach.

> Am 26.05.2026 um 01:28 schrieb Adrian Mariano via Discuss <discuss@lists.openscad.org>:
>
> This is a very difficult fillet problem. The angle between the sphere and the side is not constant, so if you want a fillet that is tangent at both sides, the curve needs to change along its length. The easiest way to apply a roundover to this is probably to use minkowski(). The strategy of using path_sweep to sweep some mask (perhaps a chamfer?) around the arcs could work, but it would be a lot of trouble to figure out what all those arcs are, especially if the extruded polygon is more complex.
>
>> On Mon, May 25, 2026 at 8:11 AM Thomas Richter via Discuss <discuss@lists.openscad.org> wrote:
>> Dear Dan,
>>
>> thank you for the response. The base polygon's path of the actual part is way more complicated with several dozens of edges pointing inward.
>>
>> I will take another look at the mask functions but I'm not very confident.
>>
>> Best, Thomas
>>
>>
>> > Am 25.05.2026 um 13:47 schrieb Dan Perry via Discuss <discuss@lists.openscad.org>:
>> >
>> > You can use path_sweep() following the arc() on the left/right/back sides. You'll have to play around with the mask_angle argument of mask2d_roundover() to fit the shape. The front edge of your shape is going to be really difficult. If you also intend to add a roundover to the vertical edges, it will be even more complicated.
>> > Dan
>> >
>> >> On Mon, May 25, 2026 at 10:44 AM Thomas Richter via Discuss <discuss@lists.openscad.org> wrote:
>> >> I use the rounding features BOSL2 a lot to create fillets and teardrop-shaped edges for 3d printed parts. Many things work very nicely.
>> >>
>> >> Recently I came over a problem that seemed to be solveable quite easy but appeared to be too hard for me to solve with the rounding features of BOSL2.
>> >>
>> >> Consider the following simplified example code:
>> >>
>> >> include <BOSL2/std.scad>
>> >>
>> >> path = [
>> >> [ 0, -10],
>> >> [ 20, -20],
>> >> [ 20, 20],
>> >> [-20, 20],
>> >> [-20, -20],
>> >> ];
>> >>
>> >> intersection() {
>> >>
>> >> linear_sweep(
>> >> region = path,
>> >> height = 40,
>> >> );
>> >>
>> >> sphere(r = 40, $fn = 120);
>> >> }
>> >>
>> >> I try to create a fillet with r = 1 at the curved top edges of the resulting part. I have no idea how to do this. I tried all of linear_sweep, rounded_prism, offset_sweep, join_prism but never came to a solution.
>> >>
>> >> My first idea was that this could possibly be done without the intersection but only with the rounding options of offset_sweep etc. But I couldn't get it done. It is important that the top surface of the prism is - except for the small fillet I try to create - part of a sphere with fixed radius since it moves and turns inside a tube with that inner radius and the contact surface must be maximal.
>> >>
>> >> Please note that the path is a simplification of the real part's base polygon. I just wanted to make clear that the base polygon is concave and that it is constructed by extruding a path.
>> >>
>> >> Thanks,
>> >> Thomas
>> >> _______________________________________________
>> >> 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

_______________________________________________
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

YV
yur_vol@yahoo.com
Wed, May 27, 2026 11:14 AM

If calculations take long time I save part to STL
And the import to continue modelling

> If calculations take long time I save part to STL \ And the import to continue modelling