discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

BOSL2 and attach()

JW
Joe Weinpert
Sun, Mar 27, 2022 6:30 PM

Using the attach( TOP, BOTTOM ) command, how can I attach the bottom of
two different objects to the top of the single parent object?

Say I have a 4" x 4" x .5" parent plate and I want to attach a 1" x 1" x
.5" child block and a 1" dia x .5" child cylinder next to each other on top
of the parent plate.  What would the code structure be like?

Using the *attach( TOP, BOTTOM )* command, how can I attach the bottom of two different objects to the top of the single parent object? Say I have a 4" x 4" x .5" parent plate and I want to attach a 1" x 1" x .5" child block and a 1" dia x .5" child cylinder next to each other on top of the parent plate. What would the code structure be like?
RD
Revar Desmera
Sun, Mar 27, 2022 10:48 PM

Off the top of my head, it’d look something like:

include <BOSL2/std.scad>
cube([4,4,0.5]INCH, center=true) {
attach(TOP,BOT) {
xdistribute(1
INCH) {
cube([1,1,0.5]INCH);
cyl(d=1
INCH, h=0.5*INCH);
}
}
}

  • Revar

On Mar 27, 2022, at 11:30 AM, Joe Weinpert joe.weinpert@gmail.com wrote:

Using the attach( TOP, BOTTOM ) command, how can I attach the bottom of two different objects to the top of the single parent object?

Say I have a 4" x 4" x .5" parent plate and I want to attach a 1" x 1" x .5" child block and a 1" dia x .5" child cylinder next to each other on top of the parent plate.  What would the code structure be like?


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

Off the top of my head, it’d look something like: include <BOSL2/std.scad> cube([4,4,0.5]*INCH, center=true) { attach(TOP,BOT) { xdistribute(1*INCH) { cube([1,1,0.5]*INCH); cyl(d=1*INCH, h=0.5*INCH); } } } - Revar > On Mar 27, 2022, at 11:30 AM, Joe Weinpert <joe.weinpert@gmail.com> wrote: > > > Using the attach( TOP, BOTTOM ) command, how can I attach the bottom of two different objects to the top of the single parent object? > > Say I have a 4" x 4" x .5" parent plate and I want to attach a 1" x 1" x .5" child block and a 1" dia x .5" child cylinder next to each other on top of the parent plate. What would the code structure be like? > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
JW
Joe Weinpert
Mon, Mar 28, 2022 1:37 PM

Well, you may be right in having to use a distribution style command to
wrap different child object bottoms to a single parent's top.

I tried with an attach() command for each child object, but then the 2nd
child object was considered the parent of the third child object ... like
stacking boxes.

On Sun, Mar 27, 2022 at 6:48 PM Revar Desmera revarbat@gmail.com wrote:

Off the top of my head, it’d look something like:

include <BOSL2/std.scad>
cube([4,4,0.5]INCH, center=true) {
attach(TOP,BOT) {
xdistribute(1
INCH) {
cube([1,1,0.5]INCH);
cyl(d=1
INCH, h=0.5*INCH);
}
}
}

  • Revar

On Mar 27, 2022, at 11:30 AM, Joe Weinpert joe.weinpert@gmail.com wrote:

Using the attach( TOP, BOTTOM ) command, how can I attach the bottom of
two different objects to the top of the single parent object?

Say I have a 4" x 4" x .5" parent plate and I want to attach a 1" x 1" x
.5" child block and a 1" dia x .5" child cylinder next to each other on top
of the parent plate.  What would the code structure be like?


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

Well, you may be right in having to use a distribution style command to wrap different child object bottoms to a single parent's top. I tried with an attach() command for each child object, but then the 2nd child object was considered the parent of the third child object ... like stacking boxes. On Sun, Mar 27, 2022 at 6:48 PM Revar Desmera <revarbat@gmail.com> wrote: > Off the top of my head, it’d look something like: > > include <BOSL2/std.scad> > cube([4,4,0.5]*INCH, center=true) { > attach(TOP,BOT) { > xdistribute(1*INCH) { > cube([1,1,0.5]*INCH); > cyl(d=1*INCH, h=0.5*INCH); > } > } > } > > > - Revar > > > > > > On Mar 27, 2022, at 11:30 AM, Joe Weinpert <joe.weinpert@gmail.com> wrote: > > > Using the *attach( TOP, BOTTOM )* command, how can I attach the bottom of > two different objects to the top of the single parent object? > > Say I have a 4" x 4" x .5" parent plate and I want to attach a 1" x 1" x > .5" child block and a 1" dia x .5" child cylinder next to each other on top > of the parent plate. What would the code structure be like? > > > _______________________________________________ > 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 >