I have a more-less functioning polyhedron but it does not render properly, so
i would like to create trapezoid a few different ways. I use them to build
dovetails, and to be able to mount them on walls and ceilings I want to
really customize them. For ceilings i print them in them upright instead of
flat and I use 30+ angles, up to 60.
This is the best I could come up with so far, but the script really falls
apart on extereme values. Maybe there is a much simpler way to do this
(besides polyhedron, which I have and works great for printing but not for
animation and such).
// CC-BY-SA 4.0 - Factory 4.0 Open Initiative, LLC 2019
// https://welcome.factoryfouroh.net/dokuwiki
*/
planeZ=1.0000+0.0060; // Galvanized 20 gauge
meshZ=0.0008;
*/
goodZ=0.4;
badZ=0.6;
createTrapezoid(baseA=80, baseX=2.4, baseY=5.4, baseZ=goodZ);
module createTrapezoid(baseA, baseX, baseY, baseZ) {
/* Set the narrower side, called the base. Must be wide enough to carry the
load, and we recommend the absolute minimum of 10 mm
-------------------- */
setNarrowX=baseX;
/* Set the dove tail lenght or depth.
------------------- */
setBaseY=baseY;
/* Set the dove tail height. Must be high enough to hide any screw heads,
bolts or over-hanging screw shaft. Load requirements should also be
considered.
------------------- */
setBaseZ=baseZ;
/* Critical for wall or ceiling mounted assemblies, set it to 30 degrees or
more.
------------------- */
setBaseAngle=baseA;
levelZ=((setBaseZ/2)+(planeZ/2))-meshZ; // Raise to the bounding planeZ
translate([0, 0, levelZ ])
solidCostructionTrapezoidVersionA(baseAngle=setBaseAngle, baseX=setNarrowX,
baseY=setBaseY, baseZ=setBaseZ);
}
/*
*/
module solidCostructionTrapezoidVersionA(baseAngle, baseX, baseY, baseZ) {
sideAngle=baseAngle;
cubeX=baseX;
cubeY=baseY;
cubeZ=baseX;
sideA=cubeZtan(sideAngle);
wideSide=cubeX+(2sideA);
calculatedHeight=cubeZ*sin(90-sideAngle);
finalHeight=calculatedHeight-baseZ;
translate([0, 0, -(baseZ/2)]) difference() {
translate([-cubeX/2, -cubeY/2, 0]) union() { // union 1
cube([cubeX, cubeY, cubeZ], center=false);
rotate([0, -sideAngle, 0])
cube([cubeZ, cubeY, cubeX], center=false);
translate([cubeX, cubeY, 0])
rotate([0, -sideAngle, 180])
cube([cubeZ, cubeY, cubeX], center=false);
} // end union 1
union() { // union 2
trimHeight=sideA+finalHeight;
moveX=((wideSide/2)+(meshZ/2));
moveY=((cubeY/2)+(meshZ/2));
moveZ=calculatedHeight-finalHeight;
translate([-moveX, -moveY, moveZ])
cube([wideSide+meshZ, cubeY+meshZ, trimHeight+meshZ], center=false);
} // end union 2
} // end difference
} // end module
Sent from: http://forum.openscad.org/
You might find this interesting:
https://github.com/revarbat/BOSL2/wiki/joiners.scad#module-dovetail
You can take a look at the library code. It makes dovetails that can be
tapered.
fouroh-llc wrote
I have a more-less functioning polyhedron but it does not render properly,
so
i would like to create trapezoid a few different ways. I use them to build
dovetails, and to be able to mount them on walls and ceilings I want to
really customize them. For ceilings i print them in them upright instead
of
flat and I use 30+ angles, up to 60.
This is the best I could come up with so far, but the script really falls
apart on extereme values. Maybe there is a much simpler way to do this
(besides polyhedron, which I have and works great for printing but not for
animation and such).
// CC-BY-SA 4.0 - Factory 4.0 Open Initiative, LLC 2019
// https://welcome.factoryfouroh.net/dokuwiki
*/
planeZ=1.0000+0.0060; // Galvanized 20 gauge
meshZ=0.0008;
*/
goodZ=0.4;
badZ=0.6;
createTrapezoid(baseA=80, baseX=2.4, baseY=5.4, baseZ=goodZ);
module createTrapezoid(baseA, baseX, baseY, baseZ) {
/* Set the narrower side, called the base. Must be wide enough to carry
the
load, and we recommend the absolute minimum of 10 mm
-------------------- */
setNarrowX=baseX;
/* Set the dove tail lenght or depth.
------------------- */
setBaseY=baseY;
/* Set the dove tail height. Must be high enough to hide any screw heads,
bolts or over-hanging screw shaft. Load requirements should also be
considered.
------------------- */
setBaseZ=baseZ;
/* Critical for wall or ceiling mounted assemblies, set it to 30 degrees
or
more.
------------------- */
setBaseAngle=baseA;
levelZ=((setBaseZ/2)+(planeZ/2))-meshZ; // Raise to the bounding planeZ
translate([0, 0, levelZ ])
solidCostructionTrapezoidVersionA(baseAngle=setBaseAngle,
baseX=setNarrowX,
baseY=setBaseY, baseZ=setBaseZ);
}
/*
*/
module solidCostructionTrapezoidVersionA(baseAngle, baseX, baseY, baseZ) {
sideAngle=baseAngle;
cubeX=baseX;
cubeY=baseY;
cubeZ=baseX;
sideA=cubeZtan(sideAngle);
wideSide=cubeX+(2sideA);
calculatedHeight=cubeZ*sin(90-sideAngle);
finalHeight=calculatedHeight-baseZ;
translate([0, 0, -(baseZ/2)]) difference() {
translate([-cubeX/2, -cubeY/2, 0]) union() { // union 1
cube([cubeX, cubeY, cubeZ], center=false);
rotate([0, -sideAngle, 0])
cube([cubeZ, cubeY, cubeX], center=false);
translate([cubeX, cubeY, 0])
rotate([0, -sideAngle, 180])
cube([cubeZ, cubeY, cubeX], center=false);
} // end union 1
union() { // union 2
trimHeight=sideA+finalHeight;
moveX=((wideSide/2)+(meshZ/2));
moveY=((cubeY/2)+(meshZ/2));
moveZ=calculatedHeight-finalHeight;
translate([-moveX, -moveY, moveZ])
cube([wideSide+meshZ, cubeY+meshZ, trimHeight+meshZ], center=false);
} // end union 2
} // end difference
} // end module
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@.openscad
--
Sent from: http://forum.openscad.org/
Fantastic, thanks!
Sent from: http://forum.openscad.org/