discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

How to get a reasonable program flow for this situation?

T
Troberg
Mon, Feb 4, 2019 1:58 PM

I'm trying to design a box with dividers, to be lasercut, with tabs to fit
things together.

My plan is to put tabs on one of the parts which mesh, then then put them
together and difference(). to put the corresponding tabs/slots in the other
part.

Tre problem is that to do this, I woill need to put all the parts together,
and do most of the parts twice (one positive, one for the difference(). Once
I've done all the parts, due to the way OpenSCAD works, they'll be "lost". I
can't move them about to break it apart and get a template to cut. I need to
put them together, but once I do put it all together, I can't take it apart.

Is there a smart way to work this?

--
Sent from: http://forum.openscad.org/

I'm trying to design a box with dividers, to be lasercut, with tabs to fit things together. My plan is to put tabs on one of the parts which mesh, then then put them together and difference(). to put the corresponding tabs/slots in the other part. Tre problem is that to do this, I woill need to put all the parts together, and do most of the parts twice (one positive, one for the difference(). Once I've done all the parts, due to the way OpenSCAD works, they'll be "lost". I can't move them about to break it apart and get a template to cut. I need to put them together, but once I do put it all together, I can't take it apart. Is there a smart way to work this? -- Sent from: http://forum.openscad.org/
WA
William Adams
Mon, Feb 4, 2019 2:11 PM

I worked up similar code for a CNC machine at:
http://community.carbide3d.com/t/cnc-finger-joint-box/8880 and wound up
extracting the parameters for the box from the JSON file and then working
up a LuaLaTeX / METAPOST file which creates an SVG.

I'm now experimenting with doing something similar using tplang instead of
lualatex/mp

You should be able to use my code to work out how to have an arrangement
where the box is flattened out and arranged for cutting on the laser.

I'm trying to get all this put together as a Kickstarter --- drop me a line
at willadams@aol.com and I'll see what I can work out which might help you.

William

On Mon, Feb 4, 2019 at 9:01 AM Troberg troberg.anders@gmail.com wrote:

I'm trying to design a box with dividers, to be lasercut, with tabs to fit
things together.

My plan is to put tabs on one of the parts which mesh, then then put them
together and difference(). to put the corresponding tabs/slots in the other
part.

Tre problem is that to do this, I woill need to put all the parts together,
and do most of the parts twice (one positive, one for the difference().
Once
I've done all the parts, due to the way OpenSCAD works, they'll be "lost".
I
can't move them about to break it apart and get a template to cut. I need
to
put them together, but once I do put it all together, I can't take it
apart.

Is there a smart way to work this?

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

I worked up similar code for a CNC machine at: http://community.carbide3d.com/t/cnc-finger-joint-box/8880 and wound up extracting the parameters for the box from the JSON file and then working up a LuaLaTeX / METAPOST file which creates an SVG. I'm now experimenting with doing something similar using tplang instead of lualatex/mp You should be able to use my code to work out how to have an arrangement where the box is flattened out and arranged for cutting on the laser. I'm trying to get all this put together as a Kickstarter --- drop me a line at willadams@aol.com and I'll see what I can work out which might help you. William On Mon, Feb 4, 2019 at 9:01 AM Troberg <troberg.anders@gmail.com> wrote: > I'm trying to design a box with dividers, to be lasercut, with tabs to fit > things together. > > My plan is to put tabs on one of the parts which mesh, then then put them > together and difference(). to put the corresponding tabs/slots in the other > part. > > Tre problem is that to do this, I woill need to put all the parts together, > and do most of the parts twice (one positive, one for the difference(). > Once > I've done all the parts, due to the way OpenSCAD works, they'll be "lost". > I > can't move them about to break it apart and get a template to cut. I need > to > put them together, but once I do put it all together, I can't take it > apart. > > Is there a smart way to work this? > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
FV
Frank van der Hulst
Mon, Feb 4, 2019 5:16 PM

Typically, people use a variable to control the final position of the
parts; if it's set to true, translate & rotate into the correct position
for lasercutting, else if it's false leave the parts in their assembled
positions.

On Mon, Feb 4, 2019 at 9:01 AM Troberg troberg.anders@gmail.com wrote:

I'm trying to design a box with dividers, to be lasercut, with tabs to fit

things together.

My plan is to put tabs on one of the parts which mesh, then then put them
together and difference(). to put the corresponding tabs/slots in the
other
part.

Tre problem is that to do this, I woill need to put all the parts
together,
and do most of the parts twice (one positive, one for the difference().
Once
I've done all the parts, due to the way OpenSCAD works, they'll be
"lost". I
can't move them about to break it apart and get a template to cut. I need
to
put them together, but once I do put it all together, I can't take it
apart.

Is there a smart way to work this?

Typically, people use a variable to control the final position of the parts; if it's set to true, translate & rotate into the correct position for lasercutting, else if it's false leave the parts in their assembled positions. On Mon, Feb 4, 2019 at 9:01 AM Troberg <troberg.anders@gmail.com> wrote: > I'm trying to design a box with dividers, to be lasercut, with tabs to fit >> things together. >> >> My plan is to put tabs on one of the parts which mesh, then then put them >> together and difference(). to put the corresponding tabs/slots in the >> other >> part. >> >> Tre problem is that to do this, I woill need to put all the parts >> together, >> and do most of the parts twice (one positive, one for the difference(). >> Once >> I've done all the parts, due to the way OpenSCAD works, they'll be >> "lost". I >> can't move them about to break it apart and get a template to cut. I need >> to >> put them together, but once I do put it all together, I can't take it >> apart. >> >> Is there a smart way to work this? >> >>
RW
Rogier Wolff
Mon, Feb 4, 2019 5:46 PM

On Tue, Feb 05, 2019 at 06:16:39AM +1300, Frank van der Hulst wrote:

Typically, people use a variable to control the final position of the
parts; if it's set to true, translate & rotate into the correct position
for lasercutting, else if it's false leave the parts in their assembled
positions.

That's the way I normally work too. Although I've switched from a
boolean to a "small integer". That way I can select any of a bunch of
configurations.

For another project I've made a module that will instantiate one of
the children and then subtract (difference) all of the following
children.

The children then need to start out in "assembled" locations. For the
lasercutting locations I rotate them back to planar in the "laser"
module.

if (show == 1) {
assembled ();
}
if (show == 2) {
alternative_assembly ();
}
if (show == 3) {
laser ();
}
if (show == 4) {
projection (cut=true) translate ([0,0,-mt/2]) laser ();
}

Actually, Openscad is much faster working with 3D objects. The
projection is really slow. So for viewing and adjusting the laser
configuration I use show=3, and then for exporting to DXF I use the
show=4. mt is material thickness.

Roger. 

On Mon, Feb 4, 2019 at 9:01 AM Troberg troberg.anders@gmail.com wrote:

I'm trying to design a box with dividers, to be lasercut, with tabs to fit

things together.

My plan is to put tabs on one of the parts which mesh, then then put them
together and difference(). to put the corresponding tabs/slots in the
other
part.

Tre problem is that to do this, I woill need to put all the parts
together,
and do most of the parts twice (one positive, one for the difference().
Once
I've done all the parts, due to the way OpenSCAD works, they'll be
"lost". I
can't move them about to break it apart and get a template to cut. I need
to
put them together, but once I do put it all together, I can't take it
apart.

Is there a smart way to work this?

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.

On Tue, Feb 05, 2019 at 06:16:39AM +1300, Frank van der Hulst wrote: > Typically, people use a variable to control the final position of the > parts; if it's set to true, translate & rotate into the correct position > for lasercutting, else if it's false leave the parts in their assembled > positions. That's the way I normally work too. Although I've switched from a boolean to a "small integer". That way I can select any of a bunch of configurations. For another project I've made a module that will instantiate one of the children and then subtract (difference) all of the following children. The children then need to start out in "assembled" locations. For the lasercutting locations I rotate them back to planar in the "laser" module. if (show == 1) { assembled (); } if (show == 2) { alternative_assembly (); } if (show == 3) { laser (); } if (show == 4) { projection (cut=true) translate ([0,0,-mt/2]) laser (); } Actually, Openscad is much faster working with 3D objects. The projection is really slow. So for viewing and adjusting the laser configuration I use show=3, and then for exporting to DXF I use the show=4. mt is material thickness. Roger. > > On Mon, Feb 4, 2019 at 9:01 AM Troberg <troberg.anders@gmail.com> wrote: > > > I'm trying to design a box with dividers, to be lasercut, with tabs to fit > >> things together. > >> > >> My plan is to put tabs on one of the parts which mesh, then then put them > >> together and difference(). to put the corresponding tabs/slots in the > >> other > >> part. > >> > >> Tre problem is that to do this, I woill need to put all the parts > >> together, > >> and do most of the parts twice (one positive, one for the difference(). > >> Once > >> I've done all the parts, due to the way OpenSCAD works, they'll be > >> "lost". I > >> can't move them about to break it apart and get a template to cut. I need > >> to > >> put them together, but once I do put it all together, I can't take it > >> apart. > >> > >> Is there a smart way to work this? > >> > >> > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** The plan was simple, like my brother-in-law Phil. But unlike Phil, this plan just might work.
JG
Juliean Galak
Mon, Feb 4, 2019 6:01 PM

You can also write a module that generates the positive part, and call it
twice - once for the positive, once for the subtractive element for the
negative.

On Mon, Feb 4, 2019 at 9:01 AM Troberg troberg.anders@gmail.com wrote:

I'm trying to design a box with dividers, to be lasercut, with tabs to fit
things together.

My plan is to put tabs on one of the parts which mesh, then then put them
together and difference(). to put the corresponding tabs/slots in the other
part.

Tre problem is that to do this, I woill need to put all the parts together,
and do most of the parts twice (one positive, one for the difference().
Once
I've done all the parts, due to the way OpenSCAD works, they'll be "lost".
I
can't move them about to break it apart and get a template to cut. I need
to
put them together, but once I do put it all together, I can't take it
apart.

Is there a smart way to work this?

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

--
Juliean Galak
jgalak@gmail.com

You can also write a module that generates the positive part, and call it twice - once for the positive, once for the subtractive element for the negative. On Mon, Feb 4, 2019 at 9:01 AM Troberg <troberg.anders@gmail.com> wrote: > I'm trying to design a box with dividers, to be lasercut, with tabs to fit > things together. > > My plan is to put tabs on one of the parts which mesh, then then put them > together and difference(). to put the corresponding tabs/slots in the other > part. > > Tre problem is that to do this, I woill need to put all the parts together, > and do most of the parts twice (one positive, one for the difference(). > Once > I've done all the parts, due to the way OpenSCAD works, they'll be "lost". > I > can't move them about to break it apart and get a template to cut. I need > to > put them together, but once I do put it all together, I can't take it > apart. > > Is there a smart way to work this? > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > -- Juliean Galak jgalak@gmail.com
JF
Joe Francis
Mon, Feb 4, 2019 6:08 PM

On 2/4/19 11:46 AM, Rogier Wolff wrote:

 <snip>
Actually, Openscad is much faster working with 3D objects. The
projection is really slow. So for viewing and adjusting the laser
configuration I use show=3, and then for exporting to DXF I use the
show=4. mt is material thickness.

For building up laser-cut parts, it can also be useful to draw all the
components as 2d modules.  Then you can arrange them in 2d space for
laser cutting and avoid the projection altogether, but still extrude
them out for the as-assembled view.

Roger.

On Mon, Feb 4, 2019 at 9:01 AM Troberg troberg.anders@gmail.com wrote:

I'm trying to design a box with dividers, to be lasercut, with tabs to fit

things together.

My plan is to put tabs on one of the parts which mesh, then then put them
together and difference(). to put the corresponding tabs/slots in the
other
part.

Tre problem is that to do this, I woill need to put all the parts
together,
and do most of the parts twice (one positive, one for the difference().
Once
I've done all the parts, due to the way OpenSCAD works, they'll be
"lost". I
can't move them about to break it apart and get a template to cut. I need
to
put them together, but once I do put it all together, I can't take it
apart.

Is there a smart way to work this?

On 2/4/19 11:46 AM, Rogier Wolff wrote: >  <snip> > Actually, Openscad is much faster working with 3D objects. The > projection is really slow. So for viewing and adjusting the laser > configuration I use show=3, and then for exporting to DXF I use the > show=4. mt is material thickness. For building up laser-cut parts, it can also be useful to draw all the components as 2d modules.  Then you can arrange them in 2d space for laser cutting and avoid the projection altogether, but still extrude them out for the as-assembled view. > > Roger. > > > >> On Mon, Feb 4, 2019 at 9:01 AM Troberg <troberg.anders@gmail.com> wrote: >> >>> I'm trying to design a box with dividers, to be lasercut, with tabs to fit >>>> things together. >>>> >>>> My plan is to put tabs on one of the parts which mesh, then then put them >>>> together and difference(). to put the corresponding tabs/slots in the >>>> other >>>> part. >>>> >>>> Tre problem is that to do this, I woill need to put all the parts >>>> together, >>>> and do most of the parts twice (one positive, one for the difference(). >>>> Once >>>> I've done all the parts, due to the way OpenSCAD works, they'll be >>>> "lost". I >>>> can't move them about to break it apart and get a template to cut. I need >>>> to >>>> put them together, but once I do put it all together, I can't take it >>>> apart. >>>> >>>> Is there a smart way to work this? >>>> >>>> >> _______________________________________________ >> OpenSCAD mailing list >> Discuss@lists.openscad.org >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
EN
Ed Nisley
Mon, Feb 4, 2019 8:25 PM

On 2/4/19 12:46 PM, Rogier Wolff wrote:

switched from a boolean to a "small integer"

I use strings tucked into Customizer variable:

Layout = "Show";          // [Show,Fit,Build]

Part = "Shell";          //
[Cradle,Shell,Clamp,ShellSections,M20,Interposer,Battery,Buttons]

… then near the bottom of the file …

if (Layout == "Show")

if (Part == "Battery")
BatteryShape();

else if (Part == "Buttons")
Buttons();

else if (Part == "Interposer")
InterposerShape(Embiggen = false);

else if etc etc etc

if (Layout == "Build")

if (Part == "Cradle")
Cradle();

else if (Part == "Clamp") {
translate([0,0.7ClampOA.y,0])
difference() {
translate([0,0,-Kerf/2])
Clamp(Support = true);
translate([0,0,-ClampOA.z])
cube(2
ClampOA,center=true);
}
translate([0,-0.7ClampOA.y,-0])
difference() {
translate([0,0,-Kerf/2])
rotate([0,180,0])
Clamp(Support = true);
translate([0,0,-ClampOA.z])
cube(2
ClampOA,center=true);
}
}

else if etc etc etc

The "Show" layouts present each part, pretty much as-designed, with the
intent of letting me build each one in isolation.

The "Build" layouts consist of totally ad-hoc translates & rotates
arranging the pieces as needed on the printer platform.

The "Fit" layout tediously assembles everything more-or-less as it
should fit together in space, so as to see whether it does. The
motivation for a completely different chunk of code is a cross-check on
the dimensions, as debugging the Fit layout generally reveals a screwup
in a "Show" design. [sigh]

Suffices for my simple needs, anyhow.

--
Ed
https://softsolder.com

On 2/4/19 12:46 PM, Rogier Wolff wrote: > switched from a boolean to a "small integer" I use strings tucked into Customizer variable: Layout = "Show"; // [Show,Fit,Build] Part = "Shell"; // [Cradle,Shell,Clamp,ShellSections,M20,Interposer,Battery,Buttons] … then near the bottom of the file … if (Layout == "Show") if (Part == "Battery") BatteryShape(); else if (Part == "Buttons") Buttons(); else if (Part == "Interposer") InterposerShape(Embiggen = false); else if etc etc etc if (Layout == "Build") if (Part == "Cradle") Cradle(); else if (Part == "Clamp") { translate([0,0.7*ClampOA.y,0]) difference() { translate([0,0,-Kerf/2]) Clamp(Support = true); translate([0,0,-ClampOA.z]) cube(2*ClampOA,center=true); } translate([0,-0.7*ClampOA.y,-0]) difference() { translate([0,0,-Kerf/2]) rotate([0,180,0]) Clamp(Support = true); translate([0,0,-ClampOA.z]) cube(2*ClampOA,center=true); } } else if etc etc etc The "Show" layouts present each part, pretty much as-designed, with the intent of letting me build each one in isolation. The "Build" layouts consist of totally ad-hoc translates & rotates arranging the pieces as needed on the printer platform. The "Fit" layout tediously assembles everything more-or-less as it should fit together in space, so as to see whether it does. The motivation for a completely different chunk of code is a cross-check on the dimensions, as debugging the Fit layout generally reveals a screwup in a "Show" design. [sigh] Suffices for my simple needs, anyhow. -- Ed https://softsolder.com
RP
Ronaldo Persiano
Mon, Feb 4, 2019 8:42 PM

I figure out the following scheme:

module assemble(miss=-1)
if(miss<0 || miss>=nparts)
for( i=[0:nparts-1] )
rotate(rot[i])
translate(pos[i])
part(i) ;
else {
for(i=[0:1:miss-1]) linear_extrude(thick) bPart[i];
for(i=[miss+1:1:nparts-1]) linear_extrude(thick) bPart[i];
}

module part(i)
translate(-pos[i])
rotate(-rot[i]) // transform back to xy plane
difference() {
rotate(rot[i])
translate(pos[i]) // transformed to assembly position
linear_extrude(thick) bPart(i);
assemble(i);
}

module bPart(part) {
if(part==0)
<basic definition of part 0 on xy plane> ;
else if(part==1)
<basic definition of part 0 on xy plane> ;
...
}

pos = [ pos0, pos1, pos2, ...];
rot = [ rot0, rot1, rot2, ...];

The module assemble() is able to assemble the full model (as default) or
with one part missing whose index is its argument. The full assembly uses
the parts cut using the assembly of basic parts.

The module part(i) computes the difference between the i-th basic part and
the others basic parts in the assembly. That part is brought back to xy
plane after cut by the other parts.

The module bPart(i) generates the 2D shape of the part i . That basic part
definitions should have the extra material to be cut by the other basic
parts in the assembly.

The vectors pos and rot store the translation vector and rotation vector to
bring the linear_extrude() of the basic parts from the xy plane to their
assembly positions.

I have not tried this scheme so ...

I figure out the following scheme: module assemble(miss=-1) if(miss<0 || miss>=nparts) for( i=[0:nparts-1] ) rotate(rot[i]) translate(pos[i]) part(i) ; else { for(i=[0:1:miss-1]) linear_extrude(thick) bPart[i]; for(i=[miss+1:1:nparts-1]) linear_extrude(thick) bPart[i]; } module part(i) translate(-pos[i]) rotate(-rot[i]) // transform back to xy plane difference() { rotate(rot[i]) translate(pos[i]) // transformed to assembly position linear_extrude(thick) bPart(i); assemble(i); } module bPart(part) { if(part==0) <basic definition of part 0 on xy plane> ; else if(part==1) <basic definition of part 0 on xy plane> ; ... } pos = [ pos0, pos1, pos2, ...]; rot = [ rot0, rot1, rot2, ...]; The module assemble() is able to assemble the full model (as default) or with one part missing whose index is its argument. The full assembly uses the parts cut using the assembly of basic parts. The module part(i) computes the difference between the i-th basic part and the others basic parts in the assembly. That part is brought back to xy plane after cut by the other parts. The module bPart(i) generates the 2D shape of the part i . That basic part definitions should have the extra material to be cut by the other basic parts in the assembly. The vectors pos and rot store the translation vector and rotation vector to bring the linear_extrude() of the basic parts from the xy plane to their assembly positions. I have not tried this scheme so ...
JB
Jordan Brown
Tue, Feb 5, 2019 1:22 AM

On 2/4/2019 9:46 AM, Rogier Wolff wrote:

That's the way I normally work too. Although I've switched from a
boolean to a "small integer". That way I can select any of a bunch of
configurations.

I'm not sure whether it's valuable or just for fun, but I've had cases
where I made it an animation, where it would animate back and forth
between the assembled view and the as-printed view.  (Linear
interpolation between the two translations and the two rotations, with
small "pause" periods at each end.)

// Given a value and a table of value/position pairs, interpolate a
// position for that value.
// It seems like lookup() should do this sort of vector interpolation
// on its own, but it doesn't seem to.
function xyzinterp(v, table) =
    let (x= [for (i=[0:len(table)-1]) [table[i][0], table[i][1][0]]])
    let (y= [for (i=[0:len(table)-1]) [table[i][0], table[i][1][1]]])
    let (z= [for (i=[0:len(table)-1]) [table[i][0], table[i][1][2]]])
        [lookup(v, x), lookup(v, y), lookup(v,z)];

// Given a table of animation time values (from zero to one) and
// positions for each of those time values, translate the children
// to the appropriate position.
module atranslate(table) {
    translate(xyzinterp($t, table)) children();
}

// Given a table of animation time values (from zero to one) and
// rotations for each of those time values, rotate the children
// to the appropriate position.
module arotate(table) {
    rotate(xyzinterp($t, table)) children();
}

// Given a start point and an end point, translate the children
// from the start to the end and back in each animation cycle.
// Pause briefly at the start and end.
module a2translate(p1, p2) {
    atranslate([[0.05, p1], [0.45, p2], [0.55, p2], [0.95, p1]]) children();
}

// Given a start rotation and an end rotation, rotate the children
// from the start to the end and back in each animation cycle.
// Pause briefly at the start and end.
module a2rotate(p1, p2) {
    arotate([[0.05, p1], [0.45, p2], [0.55, p2], [0.95, p1]]) children();
}

Thus, given a couple of modules and positions and rotations for each view:

a2translate([0,0,0], [0,0,d]) a2rotate([0,0,0], [-90,0,0])
    color("SandyBrown") body();
a2translate([0,0,0], [w+5,0,door_t]) a2rotate([0,0,0], [-90,0,0])
    color("SandyBrown") doors();

(As it happens, the modules are positioned to "as assembled" at t=0 and
"as printed" at t=0.5, but it could be the other way 'round.)

On 2/4/2019 9:46 AM, Rogier Wolff wrote: > That's the way I normally work too. Although I've switched from a > boolean to a "small integer". That way I can select any of a bunch of > configurations. I'm not sure whether it's valuable or just for fun, but I've had cases where I made it an animation, where it would animate back and forth between the assembled view and the as-printed view.  (Linear interpolation between the two translations and the two rotations, with small "pause" periods at each end.) // Given a value and a table of value/position pairs, interpolate a // position for that value. // It seems like lookup() should do this sort of vector interpolation // on its own, but it doesn't seem to. function xyzinterp(v, table) = let (x= [for (i=[0:len(table)-1]) [table[i][0], table[i][1][0]]]) let (y= [for (i=[0:len(table)-1]) [table[i][0], table[i][1][1]]]) let (z= [for (i=[0:len(table)-1]) [table[i][0], table[i][1][2]]]) [lookup(v, x), lookup(v, y), lookup(v,z)]; // Given a table of animation time values (from zero to one) and // positions for each of those time values, translate the children // to the appropriate position. module atranslate(table) { translate(xyzinterp($t, table)) children(); } // Given a table of animation time values (from zero to one) and // rotations for each of those time values, rotate the children // to the appropriate position. module arotate(table) { rotate(xyzinterp($t, table)) children(); } // Given a start point and an end point, translate the children // from the start to the end and back in each animation cycle. // Pause briefly at the start and end. module a2translate(p1, p2) { atranslate([[0.05, p1], [0.45, p2], [0.55, p2], [0.95, p1]]) children(); } // Given a start rotation and an end rotation, rotate the children // from the start to the end and back in each animation cycle. // Pause briefly at the start and end. module a2rotate(p1, p2) { arotate([[0.05, p1], [0.45, p2], [0.55, p2], [0.95, p1]]) children(); } Thus, given a couple of modules and positions and rotations for each view: a2translate([0,0,0], [0,0,d]) a2rotate([0,0,0], [-90,0,0]) color("SandyBrown") body(); a2translate([0,0,0], [w+5,0,door_t]) a2rotate([0,0,0], [-90,0,0]) color("SandyBrown") doors(); (As it happens, the modules are positioned to "as assembled" at t=0 and "as printed" at t=0.5, but it could be the other way 'round.)
T
Troberg
Tue, Feb 5, 2019 9:39 AM

I use that a lot in other cases, such as when I want to make "exploded views"
showing disassembly.

The problem here, is that the placement of a part is part of making other
parts. I place a part to "poke holes" in other parts using difference(), to
ensure a correct fit. Now, say that this part pokes holes in three other
parts, I can't now move them, because they aren't available as objects
anymore.

Sure, I could do the math, calculate every position of every tab so that it
lines up, but it's a lot more work, and it makes for a much more error prone
process, likely to waste expensive material.

--
Sent from: http://forum.openscad.org/

I use that a lot in other cases, such as when I want to make "exploded views" showing disassembly. The problem here, is that the placement of a part is part of making other parts. I place a part to "poke holes" in other parts using difference(), to ensure a correct fit. Now, say that this part pokes holes in three other parts, I can't now move them, because they aren't available as objects anymore. Sure, I could do the math, calculate every position of every tab so that it lines up, but it's a lot more work, and it makes for a much more error prone process, likely to waste expensive material. -- Sent from: http://forum.openscad.org/