discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

BOSL2: Filleted prisms between a variety of objects

AM
Adrian Mariano
Thu, Mar 27, 2025 11:49 PM

A while back I wrote join_prism() which could construct an arbitrary prism
that was filleted at one or both ends to a variety of object types.  The
problem with this was that application to real models turns out to be
remarkably difficult.

I'm now announcing what I believe to be a huge API improvement that should
make this feature much more accessible.  It's called prism_connector and
lets you construct a filleted prism between two objects using the anchor
points on the two objects.  Note that being able to refer to two objects in
this way is not a simple matter in OpenSCAD, and I had to develop a new
mechanism for this purpose that can also be used for things like measuring
distance between objects in the model, or otherwise making use of
relationships between objects, as long as one object is a child of the
other.  (Without that, the information cannot be shared, since information
only flows downward.)

include <BOSL2/std.scad>
include <BOSL2/rounding.scad>
circ = circle(r=3, $fn=48);
prismoid(20,13,shift=[-2,1],h=15) let(prism=parent())
right(30) zrot(20) yrot(12) spheroid(r=10,circum=true,$fn=48)
let(ball=parent())
prism_connector(circ,prism,RIGHT,ball,LEFT,fillet1=4,fillet2=1);

[image: image.png]
For more details and more examples, see the BOSL2 wiki:

https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#module-prism_connector
https://github.com/BelfrySCAD/BOSL2/wiki/attachments.scad#section-attachable-descriptions-for-operating-on-attachables-or-restoring-a-previous-state

A while back I wrote join_prism() which could construct an arbitrary prism that was filleted at one or both ends to a variety of object types. The problem with this was that application to real models turns out to be remarkably difficult. I'm now announcing what I believe to be a huge API improvement that should make this feature much more accessible. It's called prism_connector and lets you construct a filleted prism between two objects using the anchor points on the two objects. Note that being able to refer to two objects in this way is not a simple matter in OpenSCAD, and I had to develop a new mechanism for this purpose that can also be used for things like measuring distance between objects in the model, or otherwise making use of relationships between objects, as long as one object is a child of the other. (Without that, the information cannot be shared, since information only flows downward.) include <BOSL2/std.scad> include <BOSL2/rounding.scad> circ = circle(r=3, $fn=48); prismoid(20,13,shift=[-2,1],h=15) let(prism=parent()) right(30) zrot(20) yrot(12) spheroid(r=10,circum=true,$fn=48) let(ball=parent()) prism_connector(circ,prism,RIGHT,ball,LEFT,fillet1=4,fillet2=1); [image: image.png] For more details and more examples, see the BOSL2 wiki: https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#module-prism_connector https://github.com/BelfrySCAD/BOSL2/wiki/attachments.scad#section-attachable-descriptions-for-operating-on-attachables-or-restoring-a-previous-state
PK
Peter Kriens
Fri, Mar 28, 2025 10:08 AM

I highly recommend looking at this feature. Adrian gave me early access and it is a bit like magic. Being able to make something like the following image in a few lines is quite stunning after I struggled so much with beveling and rounding in my previous project:

diff() {
rounded_prism(
bottom=rect(30),
top=rect(20),
height=20,
joint_top=5, joint_bot=0.5, joint_sides=8);

tag("remove") 
down(0.5)     
rounded_prism( 
	bottom=rect(29),
	top=rect(19), 
	height=19, 
	joint_top=5, joint_bot=-0.5, joint_sides=8, atype="prismoid") 
let( inside = parent() )
tag("keep") 
cyl(
	r=4,
	h=19, 
	rounding2=-1, rounding1=1) 

for ( anch =[ LEFT, RIGHT, FWD, BACK ] )
	prism_connector(
		rect([2,14], rounding=1 ), 
		inside, anch, 
		parent(), anch, 
		fillet=1, overlap=0);

}

I love the model where you can use the shape information of shape A to calculate its connection/relation to shape B and C. The twiddling with parameters to achieve this always drives me nuts and then when you make a small change you can start over. Adrian places the geometric information including anchors into a descriptor. These descriptors open up an enormous potential to make flexible beautiful 3D models with a lot less work. I find the fact that you can now reason between shapes like from going to black and white to color TV.

I've been tempting to move to pythonscad but BOSL2 keeps me in the Openscad world although I find the language quite sadistic sometimes. No objects ... really?

Anyway, it is quite a feat that Adrian got this to work, chapeau. Check it out highly recommended.

Kind regards,

Peter Kriens

On 28 Mar 2025, at 00:49, Adrian Mariano via Discuss discuss@lists.openscad.org wrote:

A while back I wrote join_prism() which could construct an arbitrary prism that was filleted at one or both ends to a variety of object types.  The problem with this was that application to real models turns out to be remarkably difficult.

I'm now announcing what I believe to be a huge API improvement that should make this feature much more accessible.  It's called prism_connector and lets you construct a filleted prism between two objects using the anchor points on the two objects.  Note that being able to refer to two objects in this way is not a simple matter in OpenSCAD, and I had to develop a new mechanism for this purpose that can also be used for things like measuring distance between objects in the model, or otherwise making use of relationships between objects, as long as one object is a child of the other.  (Without that, the information cannot be shared, since information only flows downward.)

include <BOSL2/std.scad>
include <BOSL2/rounding.scad>
circ = circle(r=3, $fn=48);
prismoid(20,13,shift=[-2,1],h=15) let(prism=parent())
right(30) zrot(20) yrot(12) spheroid(r=10,circum=true,$fn=48) let(ball=parent())
prism_connector(circ,prism,RIGHT,ball,LEFT,fillet1=4,fillet2=1);

<image.png>
For more details and more examples, see the BOSL2 wiki:

https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#module-prism_connector
https://github.com/BelfrySCAD/BOSL2/wiki/attachments.scad#section-attachable-descriptions-for-operating-on-attachables-or-restoring-a-previous-state


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

I highly recommend looking at this feature. Adrian gave me early access and it is a bit like magic. Being able to make something like the following image in a few lines is quite stunning after I struggled so much with beveling and rounding in my previous project:  diff() { rounded_prism( bottom=rect(30), top=rect(20), height=20, joint_top=5, joint_bot=0.5, joint_sides=8); tag("remove") down(0.5) rounded_prism( bottom=rect(29), top=rect(19), height=19, joint_top=5, joint_bot=-0.5, joint_sides=8, atype="prismoid") let( inside = parent() ) tag("keep") cyl( r=4, h=19, rounding2=-1, rounding1=1) for ( anch =[ LEFT, RIGHT, FWD, BACK ] ) prism_connector( rect([2,14], rounding=1 ), inside, anch, parent(), anch, fillet=1, overlap=0); } I love the model where you can use the shape information of shape A to calculate its connection/relation to shape B and C. The twiddling with parameters to achieve this always drives me nuts and then when you make a small change you can start over. Adrian places the geometric information including anchors into a _descriptor_. These descriptors open up an enormous potential to make flexible beautiful 3D models with a lot less work. I find the fact that you can now reason between shapes like from going to black and white to color TV. I've been tempting to move to pythonscad but BOSL2 keeps me in the Openscad world although I find the language quite sadistic sometimes. No objects ... really? Anyway, it is quite a feat that Adrian got this to work, chapeau. Check it out highly recommended. Kind regards, Peter Kriens > On 28 Mar 2025, at 00:49, Adrian Mariano via Discuss <discuss@lists.openscad.org> wrote: > > A while back I wrote join_prism() which could construct an arbitrary prism that was filleted at one or both ends to a variety of object types. The problem with this was that application to real models turns out to be remarkably difficult. > > I'm now announcing what I believe to be a huge API improvement that should make this feature much more accessible. It's called prism_connector and lets you construct a filleted prism between two objects using the anchor points on the two objects. Note that being able to refer to two objects in this way is not a simple matter in OpenSCAD, and I had to develop a new mechanism for this purpose that can also be used for things like measuring distance between objects in the model, or otherwise making use of relationships between objects, as long as one object is a child of the other. (Without that, the information cannot be shared, since information only flows downward.) > > include <BOSL2/std.scad> > include <BOSL2/rounding.scad> > circ = circle(r=3, $fn=48); > prismoid(20,13,shift=[-2,1],h=15) let(prism=parent()) > right(30) zrot(20) yrot(12) spheroid(r=10,circum=true,$fn=48) let(ball=parent()) > prism_connector(circ,prism,RIGHT,ball,LEFT,fillet1=4,fillet2=1); > > <image.png> > For more details and more examples, see the BOSL2 wiki: > > https://github.com/BelfrySCAD/BOSL2/wiki/rounding.scad#module-prism_connector > https://github.com/BelfrySCAD/BOSL2/wiki/attachments.scad#section-attachable-descriptions-for-operating-on-attachables-or-restoring-a-previous-state > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org