From 04b5a1306bb7547639d5275f815eb37d6ee20317 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 14 Jul 2019 10:22:19 +0200 Subject: [PATCH 001/191] Add FC case --- rcmodels/fc-case.scad | 190 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 rcmodels/fc-case.scad diff --git a/rcmodels/fc-case.scad b/rcmodels/fc-case.scad new file mode 100644 index 0000000..9a97d81 --- /dev/null +++ b/rcmodels/fc-case.scad @@ -0,0 +1,190 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2019 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A case to enclose a flight controller in order to use it for simulator connection. + * + * @author jsconan + * @version 0.1.0 + */ + +// As we need to use some shapes, use the right entry point of the library. +use <../lib/camelSCAD/shapes.scad> + +// To be able to use the library shared constants we import the definition file. +include <../lib/camelSCAD/core/constants.scad> + +// We will render the object using the specifications of this mode +renderMode = MODE_PROD; + +// Defines the constraints of the print. +printResolution = 0.2; // the target layer height +nozzle = 0.4; // the size of the print nozzle +wallDistance = 0.1; // the distance between the walls of two objects + +// Defines the constraints of the object. +frameWidth = 30; +frameHeight = 2.5; +mountHoleDiameter = 3; +mountHoleDistance = 26; +boxCorner = 1; +bottomHeight = 6; +topHeight = 3; +thickness = .8; +usbWidth = 7.5; +usbThickness = 2.6; +usbPosition = 8.2; +usbAngle = 45; +ventThickness = 1; + +// Defines the dimensions of the object. +caseWidth = frameWidth + thickness * 2; +diagonal = pythagoras(frameWidth, frameWidth); +usbOffset = diagonal / 2 - usbPosition; +boxChamfer = frameWidth - mountHoleDistance + mountHoleDiameter; +boxPocket = bottomHeight - frameHeight; +distribution = caseWidth + 5; +pillarHeight = bottomHeight + topHeight; + +/** + * Draws the case shape + * @param Number width + * @param Number corner + * @param Number distance + */ +module fcCaseShape(width, corner, distance = 0) { + polygon( + points = outline( + points = drawRoundedRectangle(size=width, r=corner), + distance = distance + ), + convexity = 10 + ); +} + +/** + * Draws the case + * @param Number width + * @param Number height + * @param Number corner + * @param Number distance + */ +module fcCase(width, height, corner, distance = 0) { + negativeExtrude(height=height) { + fcCaseShape(width=width, corner=corner, distance=distance); + } +} + +/** + * Draws a case rim + * @param Number width + * @param Number height + * @param Number corner + * @param Number rim + * @param Number distance + */ +module fcCaseRim(width, height, corner, rim, distance = 0) { + negativeExtrude(height=height) { + difference() { + fcCaseShape(width=width, corner=corner, distance=distance + rim); + fcCaseShape(width=width, corner=corner, distance=distance - rim); + } + } +} + +/** + * Draws the case vents + * @param Number diameter + * @param Number thickness + * @param Number height + */ +module circleVents(diameter, thickness, height) { + interval = thickness + roundBy(thickness, nozzle); + radius = diameter / 2; + count = floor(radius / interval); + rotateZ(-45) { + repeatMirror() { + for(i = [0 : count]) { + offset = (i + .5) * interval; + translateX(offset) { + slot([thickness, 2 * pythagoras(b=offset, c=radius), height], d=thickness); + } + } + } + } +} + +// Sets the minimum facet angle and size using the defined render mode. +// Displays a build box visualization to preview the printer area. +buildBox(mode=renderMode) { + translateY(-distribution / 2) { + distributeGrid(intervalX=[0, distribution, 0]) { + // top box + difference() { + fcCase(width=frameWidth, height=topHeight + thickness, corner=boxCorner, distance=thickness); + translateZ(-printResolution) { + fcCaseRim(width=frameWidth, height=printResolution * 2, corner=boxCorner, rim=nozzle / 2, distance=thickness); + } + translateZ(thickness) { + chamferedBox([frameWidth, frameWidth, topHeight + thickness], chamfer=boxChamfer); + translate(-[mountHoleDistance, mountHoleDistance, 0] / 2) { + repeat2D(countX=2, countY=2, intervalX=[mountHoleDistance, 0, 0], intervalY=[0, mountHoleDistance, 0]) { + cylinder(d=mountHoleDiameter, h=topHeight + thickness); + } + } + } + translateZ(-thickness) { + circleVents(diameter=caseWidth / 2, thickness=ventThickness, height=topHeight); + } + } + + // bottom box + union() { + translate(-[mountHoleDistance, mountHoleDistance, 0] / 2) { + repeat2D(countX=2, countY=2, intervalX=[mountHoleDistance, 0, 0], intervalY=[0, mountHoleDistance, 0]) { + bullet([mountHoleDiameter, mountHoleDiameter, pillarHeight], d=mountHoleDiameter / 2); + } + } + difference() { + fcCase(width=frameWidth, height=bottomHeight + thickness, corner=boxCorner, distance=thickness); + translateZ(-printResolution) { + fcCaseRim(width=frameWidth, height=printResolution * 2, corner=boxCorner, rim=nozzle / 2, distance=thickness); + } + translateZ(thickness) { + chamferedBox([frameWidth, frameWidth, boxPocket], chamfer=boxChamfer); + } + translateZ(thickness + boxPocket) { + fcCase(width=frameWidth, height=bottomHeight, corner=boxCorner); + } + translateZ(-thickness) { + circleVents(diameter=caseWidth / 2, thickness=ventThickness, height=bottomHeight); + rotateZ(usbAngle) { + translateY(usbOffset) { + box([usbWidth, usbThickness, bottomHeight]); + } + } + } + } + } + } + } +} From 0afae828f6ca10f5057f58b896310f4ef16c8d2f Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 14 Jul 2019 16:40:04 +0200 Subject: [PATCH 002/191] Improve FC case with bind switch --- rcmodels/fc-case.scad | 72 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 58 insertions(+), 14 deletions(-) diff --git a/rcmodels/fc-case.scad b/rcmodels/fc-case.scad index 9a97d81..c71e96d 100644 --- a/rcmodels/fc-case.scad +++ b/rcmodels/fc-case.scad @@ -24,7 +24,7 @@ * A case to enclose a flight controller in order to use it for simulator connection. * * @author jsconan - * @version 0.1.0 + * @version 0.2.0 */ // As we need to use some shapes, use the right entry point of the library. @@ -39,7 +39,6 @@ renderMode = MODE_PROD; // Defines the constraints of the print. printResolution = 0.2; // the target layer height nozzle = 0.4; // the size of the print nozzle -wallDistance = 0.1; // the distance between the walls of two objects // Defines the constraints of the object. frameWidth = 30; @@ -54,16 +53,26 @@ usbWidth = 7.5; usbThickness = 2.6; usbPosition = 8.2; usbAngle = 45; +bindPegDiameter = 3; +bindPosition = 8; +bindHeight = 3; +bindAngle = 45; +bindSwitchLength = 6; +bindSwitchWidth = 9; +bindSwitchDistance = nozzle; ventThickness = 1; // Defines the dimensions of the object. caseWidth = frameWidth + thickness * 2; +placementDistribution = caseWidth + 5; diagonal = pythagoras(frameWidth, frameWidth); -usbOffset = diagonal / 2 - usbPosition; -boxChamfer = frameWidth - mountHoleDistance + mountHoleDiameter; -boxPocket = bottomHeight - frameHeight; -distribution = caseWidth + 5; -pillarHeight = bottomHeight + topHeight; +usbPlugOffset = diagonal / 2 - usbPosition; +bindPegOffset = diagonal / 2 - bindPosition; +bindPegHeight = bottomHeight - bindHeight; +bindSwitchOffset = bindPegOffset + bindPegDiameter / 2; +boxPocketChamfer = frameWidth - mountHoleDistance + mountHoleDiameter; +boxPocketHeight = bottomHeight - frameHeight; +mountPegHeight = bottomHeight + topHeight; /** * Draws the case shape @@ -136,22 +145,27 @@ module circleVents(diameter, thickness, height) { // Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. buildBox(mode=renderMode) { - translateY(-distribution / 2) { - distributeGrid(intervalX=[0, distribution, 0]) { + translateY(-placementDistribution / 2) { + distributeGrid(intervalX=[0, placementDistribution, 0]) { // top box difference() { + // box ouline fcCase(width=frameWidth, height=topHeight + thickness, corner=boxCorner, distance=thickness); + // elephant feet counter measure translateZ(-printResolution) { fcCaseRim(width=frameWidth, height=printResolution * 2, corner=boxCorner, rim=nozzle / 2, distance=thickness); } translateZ(thickness) { - chamferedBox([frameWidth, frameWidth, topHeight + thickness], chamfer=boxChamfer); + // box hollow + chamferedBox([frameWidth, frameWidth, topHeight + thickness], chamfer=boxPocketChamfer); + // mount peg drills translate(-[mountHoleDistance, mountHoleDistance, 0] / 2) { repeat2D(countX=2, countY=2, intervalX=[mountHoleDistance, 0, 0], intervalY=[0, mountHoleDistance, 0]) { cylinder(d=mountHoleDiameter, h=topHeight + thickness); } } } + // vents translateZ(-thickness) { circleVents(diameter=caseWidth / 2, thickness=ventThickness, height=topHeight); } @@ -159,29 +173,59 @@ buildBox(mode=renderMode) { // bottom box union() { + // mount pegs translate(-[mountHoleDistance, mountHoleDistance, 0] / 2) { repeat2D(countX=2, countY=2, intervalX=[mountHoleDistance, 0, 0], intervalY=[0, mountHoleDistance, 0]) { - bullet([mountHoleDiameter, mountHoleDiameter, pillarHeight], d=mountHoleDiameter / 2); + bullet([mountHoleDiameter, mountHoleDiameter, mountPegHeight], d=mountHoleDiameter / 2); + } + } + // bind switch peg + rotateZ(bindAngle) { + translate([0, -bindPegOffset], thickness) { + bullet([bindPegDiameter, bindPegDiameter, bindPegHeight], d=bindPegDiameter / 2); } } difference() { + // box outline fcCase(width=frameWidth, height=bottomHeight + thickness, corner=boxCorner, distance=thickness); + // elephant feet counter measure translateZ(-printResolution) { fcCaseRim(width=frameWidth, height=printResolution * 2, corner=boxCorner, rim=nozzle / 2, distance=thickness); } + // lower box hollow, will be under the FC translateZ(thickness) { - chamferedBox([frameWidth, frameWidth, boxPocket], chamfer=boxChamfer); + chamferedBox([frameWidth, frameWidth, boxPocketHeight], chamfer=boxPocketChamfer); } - translateZ(thickness + boxPocket) { + // upper box hollow, will be at the FC level + translateZ(thickness + boxPocketHeight) { fcCase(width=frameWidth, height=bottomHeight, corner=boxCorner); } translateZ(-thickness) { + // vents circleVents(diameter=caseWidth / 2, thickness=ventThickness, height=bottomHeight); + // drill for the USB plug rotateZ(usbAngle) { - translateY(usbOffset) { + translateY(usbPlugOffset) { box([usbWidth, usbThickness, bottomHeight]); } } + // bind switch + rotateZ(bindAngle) { + translateY(-bindSwitchOffset) { + negativeExtrude(height=bottomHeight) { + polygon( + points = path([ + ["P", bindSwitchWidth / 2, bindSwitchLength], + ["C", bindSwitchDistance / 2, 180, 0], + ["C", [bindSwitchWidth / 2 + bindSwitchDistance, bindSwitchLength + bindSwitchDistance], 360, 180], + ["C", bindSwitchDistance / 2, 180, 0], + ["C", [bindSwitchWidth / 2, bindSwitchLength], 180, 360], + ]), + convexity = 10 + ); + } + } + } } } } From f48b7da0fd4b609d794c78b87db8ea8df03c1e21 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 16 Aug 2019 18:16:18 +0200 Subject: [PATCH 003/191] Update camelSCAD to v0.7.0 --- lib/camelSCAD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/camelSCAD b/lib/camelSCAD index e536ce0..38004d1 160000 --- a/lib/camelSCAD +++ b/lib/camelSCAD @@ -1 +1 @@ -Subproject commit e536ce0370d03ec257a11712d5cc88084108a803 +Subproject commit 38004d162e0fbb8bb116c0bf9572160b90468e78 From ddd85a61988d7cae0d74af1c2974c55be1708b43 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 16 Aug 2019 18:16:50 +0200 Subject: [PATCH 004/191] Use scripts utils in Whoop Box project --- rcmodels/whoop-box/render.sh | 119 ++++------------------------------- 1 file changed, 12 insertions(+), 107 deletions(-) diff --git a/rcmodels/whoop-box/render.sh b/rcmodels/whoop-box/render.sh index dab5129..e9e2a32 100755 --- a/rcmodels/whoop-box/render.sh +++ b/rcmodels/whoop-box/render.sh @@ -33,43 +33,14 @@ boxY= drawerX= drawerY= drawers= -whoopCountBox= -whoopCountDrawer= -drawerCountCupboard= - -# script params -output="output" -fileext=".scad" # script config -scriptPath=$(dirname $0) +scriptpath=$(dirname $0) project=$(pwd) -dstpath=${project}/${output} -src=${project}/*${fileext} - -# color codes -C_ERR="\033[31m" -C_SEL="\033[32m" -C_SPE="\033[33m" -C_CTX="\033[36m" -C_RST="\033[0m" -C_MSG="\033[1m" -C_INF="\033[32m" - -# renders a file -# @param fileName -render() { - dst="${dstpath}/${whoop}-$(basename $1 ${fileext}).stl" - echo -e "${C_RST}Rendering of ${C_SEL}$(basename $1)${C_RST} to ${C_SEL}${dst}" - openscad --render -o "${dst}" "$1" \ - -D "renderMode=\"prod\"" \ - -D "whoopType=\"${whoop}\"" \ - -D "${whoopCountBox}" \ - -D "${whoopCountDrawer}" \ - -D "${drawerCountCupboard}" -} +srcpath=${project} +dstpath=${project}/output -echo -e "${C_RST}" +source "${scriptpath}/../../lib/camelSCAD/scripts/utils.sh" # load parameters while (( "$#" )); do @@ -140,87 +111,21 @@ while (( "$#" )); do *) ls $1 >/dev/null 2>&1 if [ "$?" == "0" ]; then - src=$1 + srcpath=$1 else - echo -e "${C_ERR}" - echo -e "${C_ERR}Unknown parameter ${1}${C_RST}" - echo -e "${C_RST}" - exit 1 + printerror "Unknown parameter ${1}" fi ;; esac shift done -# compose value for the number of tiny-whoops per container -if [ "${boxX}" != "" ] || [ "${boxY}" != "" ]; then - if [ "${boxX}" == "" ]; then - boxX="1" - fi - if [ "${boxY}" == "" ]; then - boxY="1" - fi - whoopCountBox="whoopCountBox=[${boxX}, ${boxY}]" -fi - -# compose value for the number of tiny-whoops per drawer -if [ "${drawerX}" != "" ] || [ "${drawerY}" != "" ]; then - if [ "${drawerX}" == "" ]; then - drawerX="1" - fi - if [ "${drawerY}" == "" ]; then - drawerY="1" - fi - whoopCountDrawer="whoopCountDrawer=[${drawerX}, ${drawerY}]" -fi - -# compose value for the number of drawers -if [ "${drawers}" != "" ]; then - drawerCountCupboard="drawerCountCupboard=${drawers}" -fi - -# create the output folder if needed -if [ ! -d "${dstpath}" ]; then - echo -e "${C_SEL}Create output folder.${C_RST}" - mkdir -p "${dstpath}" >/dev/null - - if [ ! -d "${dstpath}" ]; then - echo -e "${C_ERR}" - echo "Cannot create output folder!" - echo -e "${C_RST}" - exit 1 - fi -fi - # check OpenSCAD -echo -e "Detecting ${C_SPE}OpenSCAD${C_RST}..." -openscad -v >/dev/null 2>&1 -if [ "$?" != "0" ]; then - echo -e "${C_ERR}" - echo "It seems OpenSCAD has not been installed on your system." - echo "Or perhaps is it just not reachable..." - echo "Have you placed it in your environment PATH variable?" - echo -e "${C_RST}" - exit 3 -fi - -echo -e "${C_SPE}OpenSCAD${C_RST} has been detected." -echo -e "${C_RST}" -echo -e "${C_RST}Processing rendering from ${C_CTX}${project}" -echo -e "${C_RST}" +scadcheck # render the files, if exist -ls ${src} >/dev/null 2>&1 -if [ "$?" == "0" ]; then - for filename in ${src}; do - render "${filename}" - done -else - echo -e "${C_ERR}" - echo "There is nothing to render!" - echo -e "${C_RST}" - exit 1 -fi - -echo -e "${C_RST}" -echo "Done!" +scadtostlall "${srcpath}" "${dstpath}" "${whoop}" \ + "whoopType=\"${whoop}\"" \ + "$(vectorif "whoopCountBox" ${boxX} ${boxY})" \ + "$(vectorif "whoopCountDrawer" ${drawerX} ${drawerY})" \ + "$(varif "drawerCountCupboard" ${drawers})" From cce11e6c5137bfa928dfe22ab7cbf94407407ee4 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 22 Jan 2020 21:48:25 +0100 Subject: [PATCH 005/191] Use recursive paths in the dehydrator spool holder --- printer/dehydratator-spool-holder.scad | 29 ++++++++++++-------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/printer/dehydratator-spool-holder.scad b/printer/dehydratator-spool-holder.scad index 3954f18..03c440e 100644 --- a/printer/dehydratator-spool-holder.scad +++ b/printer/dehydratator-spool-holder.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019 Jean-Sebastien CONAN + * Copyright (c) 2019-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,7 +24,7 @@ * A spool holder that mounts on a cylindric food dehydratator. * * @author jsconan - * @version 0.1.0 + * @version 0.2.0 */ // As we need to use some shapes, use the right entry point of the library. @@ -84,25 +84,22 @@ buildBox(mode=renderMode) { ["H", mountWall], // plate side - ["V", plateHeight] - ], flatten([ - for(i=[0:plateRidgeCount - 1]) [ - ["L", -plateRidgeInterval * and(i, 1), 0], - ["L", - plateRidgeX, plateRidgeY], - ["H", - plateRidgeWidth + plateRidgeX * 2], - ["L", - plateRidgeX, -plateRidgeY] - ] - ]), [ + ["V", plateHeight], + ["R", plateRidgeCount, [ + ["L", -plateRidgeX, plateRidgeY], + ["H", -plateRidgeWidth + plateRidgeX * 2], + ["L", -plateRidgeX, -plateRidgeY], + ["L", -plateRidgeInterval, 0] + ]], + // spool hole side ["P", spoolHoleInnerDiameter / 2, plateHeight], - ], flatten([ - for(i=[1:spoolHoleRidgeCount]) [ - ["L", 0, spoolHoleRidgeInterval * and(i, 1)], + ["R", spoolHoleRidgeCount, [ + ["L", 0, spoolHoleRidgeInterval], ["L", spoolHoleRidgeX, spoolHoleRidgeY], ["V", spoolHoleRidgeWidth - spoolHoleRidgeY * 2], ["L", -spoolHoleRidgeX, spoolHoleRidgeY], - ] - ]), [ + ]], ["L", -spoolHoleChamfer, spoolHoleChamfer], ["H", -spoolHoleInnerDiameter / 2 + spoolHoleChamfer], ])), From 4464739f46ee858ac07756edbcdbda3925a56607 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 22 Jan 2020 21:49:18 +0100 Subject: [PATCH 006/191] New version of the dehydrator spool holder --- printer/dehydratator-spool-holder-v2.scad | 106 ++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 printer/dehydratator-spool-holder-v2.scad diff --git a/printer/dehydratator-spool-holder-v2.scad b/printer/dehydratator-spool-holder-v2.scad new file mode 100644 index 0000000..767aa62 --- /dev/null +++ b/printer/dehydratator-spool-holder-v2.scad @@ -0,0 +1,106 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2019-2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A spool holder that mounts on a cylindric food dehydratator. + * + * @author jsconan + * @version 0.1.0 + */ + +// As we need to use some shapes, use the right entry point of the library. +use <../lib/camelSCAD/shapes.scad> + +// To be able to use the library shared constants we import the definition file. +include <../lib/camelSCAD/core/constants.scad> + +// We will render the object using the specifications of this mode +renderMode = MODE_PROD; + +// Defines the constraints of the print. +printResolution = 0.2; + +// Defines the constraints of the object. +holeDiameter = 62.7; // the diameter of the hole in the dehydratator plate +holeDepth = 6; // the depth in the dehydratator plate +flange = 4; // the width of the flange that will overflow the hole +edge = 2; // the thickness of the flange edge +height = 10; // the height of a spool holder + +plateRidgeWidth = 1; // the width of a ridge on the plates +plateRidgeHeight = .4; // the height of a ridge on the plates +plateRidgeCount = 3; // the number of ridges on the plates + +wallRidgeWidth = 1; // the width of a ridge on the walls +wallRidgeHeight = .4; // the height of a ridge on the walls +wallRidgeCount = 2; // the number of ridges on the walls + +spoolDiameters = [50, 26]; // diameters of each spool to support + +// Defines the dimensions of the object. +plateDiameter = holeDiameter + flange * 2; +diameters = unshift([ for (i = [0 : len(spoolDiameters) - 1]) spoolDiameters[i] - wallRidgeHeight * 2 ], plateDiameter); +count = len(diameters); +heights = [ for (i = [0 : count - 1]) i * height + holeDepth + flange + edge ]; +brims = [ for (i = [1 : count - 1]) (diameters[i - 1] - diameters[i]) / 2 ]; +intervalX = [ for (i = [0 : count - 1]) brims[i] / plateRidgeCount - plateRidgeWidth ]; +intervalY = height / wallRidgeCount - wallRidgeWidth; + +plateRidgeX = plateRidgeWidth / 2 * cos(60); +plateRidgeY = plateRidgeHeight; +wallRidgeX = wallRidgeHeight; +wallRidgeY = wallRidgeWidth / 2 * cos(60); + +// Sets the minimum facet angle and size using the defined render mode. +// Displays a build box visualization to preview the printer area. +buildBox(mode=renderMode) { + rotate_extrude() { + polygon( + points=path(concat([ + ["P", 0, 0], + ["H", holeDiameter / 2], + ["V", holeDepth], + ["L", flange, flange], + ["V", edge], + ["N", [ for(i = [0 : count - 2]) + ["N", [ + ["R", plateRidgeCount, [ + ["L", -plateRidgeX, plateRidgeY], + ["H", -plateRidgeWidth + plateRidgeX * 2], + ["L", -plateRidgeX, -plateRidgeY], + ["L", -intervalX[i], 0] + ]], + ["P", diameters[i + 1] / 2, heights[i]], + ["R", wallRidgeCount, [ + ["L", 0, intervalY], + ["L", wallRidgeX, wallRidgeY], + ["V", wallRidgeWidth - wallRidgeY * 2], + ["L", -wallRidgeX, wallRidgeY], + ]] + ]] + ]], + ["P", 0, heights[count -1]] + ])), + convexity=10 + ); + } +} From e2f00655bc34faef14812d09b52c0035d7c73dda Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 22 Jan 2020 21:53:57 +0100 Subject: [PATCH 007/191] Add a filament passage groove for the LACK enclosure --- .../enclosure-filament-passage-groove.scad | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 printer/enclosure-filament-passage-groove.scad diff --git a/printer/enclosure-filament-passage-groove.scad b/printer/enclosure-filament-passage-groove.scad new file mode 100644 index 0000000..5eebf70 --- /dev/null +++ b/printer/enclosure-filament-passage-groove.scad @@ -0,0 +1,112 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2019-2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A filament passage groove for the LACK enclosure. + * + * @author jsconan + * @version 0.1.0 + */ + +// As we need to use some shapes, use the right entry point of the library. +use <../lib/camelSCAD/shapes.scad> + +// To be able to use the library shared constants we import the definition file. +include <../lib/camelSCAD/core/constants.scad> + +// We will render the object using the specifications of this mode +renderMode = MODE_PROD; + +// Defines the constraints of the print. +printResolution = 0.2; // the target layer height +nozzle = 0.4; // the size of the print nozzle +wallDistance = 0.1; // the distance between the walls of two objects + +// Defines the constraints of the object. +grooveLength = 200; +grooveWidth = 12; +mainWallThickness = nozzle * 3; +capWallThickness = nozzle * 2; +boardHeight = 50; +flangeWidth = 20; +flangeThickness = printResolution * 8; +capFlange = 8; +capHeight = 15; + +module passageGroove(size, flange, thickness, wall, distance=0) { + hole = vector3D(size) + 2 * [distance, distance, 0]; + tube = vadd(hole, wall * 2); + outer = vadd(hole, flange * 2); + height = hole[2] + thickness; + holeBevel = vadd(hole, 2 * thickness); + outerBevel = vsub(outer, 2 * thickness); + + difference() { + union() { + linear_extrude(height=thickness, scale=vector2D(vdiv(outer, outerBevel))) { + stadium(outerBevel); + } + slot(size=tube, h=height); + } + negativeExtrude(height=thickness, scale=vector2D(vdiv(hole, holeBevel))) { + stadium(holeBevel); + } + negativeExtrude(height=printResolution) { + difference() { + stadium(outer); + stadium(vsub(outerBevel, 2 * nozzle)); + } + } + negativeExtrude(height=height) { + stadium(hole); + } + } +} + + +// Sets the minimum facet angle and size using the defined render mode. +// Displays a build box visualization to preview the printer area. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + union() { + rotateZ(90) { + translateX(grooveWidth + flangeWidth) { + passageGroove( + size=[grooveWidth, grooveLength, boardHeight], + flange=flangeWidth, + thickness=flangeThickness, + wall=mainWallThickness + ); + } + translateX(-grooveWidth - flangeWidth) { + passageGroove( + size=[grooveWidth, grooveLength, capHeight], + flange=capFlange, + thickness=flangeThickness, + wall=capWallThickness, + distance=-capWallThickness + ); + } + } + } +} From 43f4377b35c7898680ec4c88e677013b14c10b7a Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 22 Jan 2020 21:57:31 +0100 Subject: [PATCH 008/191] Use recursive paths in the triominos holder --- misc/triominos-holder.scad | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/misc/triominos-holder.scad b/misc/triominos-holder.scad index 15957d6..a1b7289 100644 --- a/misc/triominos-holder.scad +++ b/misc/triominos-holder.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019 Jean-Sebastien CONAN + * Copyright (c) 2019-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,7 +24,7 @@ * A parametric holder for triominos. * * @author jsconan - * @version 0.1.0 + * @version 0.2.0 */ // As we need to use some shapes, use the right entry point of the library. @@ -70,23 +70,20 @@ boardInterval = pieceHeight * 1.3; module standBoardEdge(width, height, thickness, count, distance=0) { polygon( points=outline(points=path( - p=concat([ + p=[ ["P", 0, 0], - ["H", thickness] - ], flatten([ - for(i = [0 : count - 1]) [ + ["H", thickness], + ["R", count, [ ["H", width + thickness], ["V", height] - ] - ]), [ + ]], ["V", thickness], - ["H", -thickness] - ], flatten([ - for(i = [0 : count - 1]) [ + ["H", -thickness], + ["R", count, [ ["V", -height], ["H", -width - thickness] - ] - ])) + ]] + ] ), distance=distance), convexity=10 ); @@ -186,8 +183,6 @@ module standBoard(pieceSize, count, thickness, padding) { } } - - // Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. buildBox(mode=renderMode) { From fbee672f7dce03a8057cfd3cf6e687067522781e Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 22 Jan 2020 22:00:44 +0100 Subject: [PATCH 009/191] Add fasteners to attach a cover door to a fridge --- misc/fridge-door-fastener.scad | 187 +++++++++++++++++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100644 misc/fridge-door-fastener.scad diff --git a/misc/fridge-door-fastener.scad b/misc/fridge-door-fastener.scad new file mode 100644 index 0000000..48cd334 --- /dev/null +++ b/misc/fridge-door-fastener.scad @@ -0,0 +1,187 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2019-2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A fastener to attach a cover door to a fridge + * + * @author jsconan + * @version 0.1.0 + */ + +// As we need to use some shapes, use the right entry point of the library. +use <../lib/camelSCAD/shapes.scad> + +// To be able to use the library shared constants we import the definition file. +include <../lib/camelSCAD/core/constants.scad> + +// We will render the object using the specifications of this mode +renderMode = MODE_PROD; + +// Defines the constraints of the print. +printResolution = 0.2; // the target layer height +nozzle = 0.4; // the size of the print nozzle +wallDistance = 0.1; // the distance between the walls of two objects + +/** + * Draws the shape of a fastener to attach a cover door to a fridge. + * @param Number screwCount - The number of screws to attach the fastener + * @param Number screwDiameter - The diameter of each screw + * @param Number screwHeadDiameter - The diameter for the room reserved for a screw head + * @param Number screwThickness - The thickness of the plate the screw must link + * @param Number screwInterval - The disrance between two screws + * @param Number screwPaddingX - The horizontal padding around screws + * @param Number screwPaddingY - The vertical padding around screws + * @param Number flangeWidth - The width of the flange from the border of the fastener to the border of the screwed plate + * @param Number flangeThickness - The thickness of the flange + * @param Number spacerSide - The side where to place the spacer: -1=left, 1=right + * @param Number spacerLength - The length of the optional spacer area to add + * @param Number spacerThickness - The thickness of the optional spacer area to add + * @param Number thickness - The overall thickness of the fastener (the distance between the fridge and the cover door) + * @param Number roundCorner - The radius of the rounded corners + */ +module fridgeDoorFastener( + screwCount, + screwDiameter, + screwHeadDiameter, + screwThickness, + screwInterval, + screwPaddingX, + screwPaddingY, + flangeWidth, + flangeThickness, + spacerSide, + spacerLength, + spacerThickness, + thickness, + roundCorner +) { + intervalLength = screwInterval * (screwCount - 1); + bodyWidth = screwDiameter + screwPaddingY * 2; + length = intervalLength + screwDiameter + screwPaddingX * 2; + width = bodyWidth + flangeWidth; + height = thickness + spacerThickness; + screwHeadHole = height - screwThickness - spacerThickness; + spacerHole = length - abs(spacerLength); + + echo("Overall size:", length, width, height); + + difference() { + // the main body, including the flange + translateY(flangeWidth / 2) { + cushion(size=[length, width, height], r=roundCorner); + } + + // drill the flange + translate([-length, (width - flangeWidth) / 2 + flangeWidth, height + flangeThickness]) { + rotateY(90) { + cushion(size=[height, flangeWidth, length] * 2, r=1); + } + } + + // dril the screw holes + translateX(-intervalLength / 2) { + repeat(count=screwCount, interval=[screwInterval, 0, 0]) { + // head + translateZ(-ALIGN) { + cylinder(d=screwHeadDiameter, h=screwHeadHole + ALIGN); + + } + // body + translateZ(screwThickness) { + cylinder(d=screwDiameter, h=height); + } + } + } + + // optional spacer + translate([spacerSide * (spacerLength + ALIGN) / 2, 0, height - spacerThickness]) { + box([spacerHole + ALIGN2, width, spacerThickness + ALIGN]); + + translateX(-spacerSide * (spacerHole + bodyWidth + ALIGN2) / 2) { + negativeExtrude(height=spacerThickness + ALIGN2) { + difference() { + translateX(spacerSide * bodyWidth / 4 - ALIGN) { + rectangle([bodyWidth / 2 + ALIGN, bodyWidth + ALIGN2]); + } + circle(d=bodyWidth); + } + } + } + } + } +} + +// Defines the constraints of the object. +roundCorner = 3; // The radius of the rounded corners +screwCount = 3; // The number of screws to attach the fastener +screwDiameter = 4; // The diameter of each screw +screwHeadDiameter = 10; // The diameter for the room reserved for a screw head +screwThickness = 3; // The thickness of the plate the screw must link +screwInterval = 37.5; // The disrance between two screws +screwPaddingX = 13.5; // The horizontal padding around screws +screwPaddingY = 5.5; // The vertical padding around screws +flangeWidth = 10; // The width of the flange from the border of the fastener to the border of the screwed plate +flangeThickness = 2; // The thickness of the flange +models = [ + [ + ["thickness", 18], // The overall thickness of the fastener (the distance between the fridge and the cover door) + ["spacerSide", 0], // The side where to place the spacer: -1=left, 1=right + ["spacerLength", 0], // The length of the optional spacer area to add + ["spacerThickness", 0], // The thickness of the optional spacer area to add + ], + [ + ["thickness", 13], // The overall thickness of the fastener (the distance between the fridge and the cover door) + ["spacerSide", -1], // The side where to place the spacer: -1=left, 1=right + ["spacerLength", 55], // The length of the optional spacer area to add + ["spacerThickness", 4.4], // The thickness of the optional spacer area to add + ] +]; + +// Sets the minimum facet angle and size using the defined render mode. +// Displays a build box visualization to preview the printer area. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + interval = screwDiameter + screwPaddingY * 3 + flangeWidth; + count = len(models) - 1; + for(i = [0 : count]) { + model = models[i]; + translateY(-(count * interval / 2) + (interval * i)) { + fridgeDoorFastener( + screwCount = screwCount, + screwDiameter = screwDiameter, + screwHeadDiameter = screwHeadDiameter, + screwThickness = screwThickness, + screwInterval = screwInterval, + screwPaddingX = screwPaddingX, + screwPaddingY = screwPaddingY, + flangeWidth = flangeWidth, + flangeThickness = flangeThickness, + spacerSide = fetch(model, "spacerSide")[1], + spacerLength = fetch(model, "spacerLength")[1], + spacerThickness = fetch(model, "spacerThickness")[1], + thickness = fetch(model, "thickness")[1], + roundCorner = roundCorner + ); + } + } +} From abd805956b562def2cfd8289982d48359b578808 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 22 Jan 2020 22:01:30 +0100 Subject: [PATCH 010/191] Add spacer with a truncated pyramid shape --- misc/spacer.scad | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 misc/spacer.scad diff --git a/misc/spacer.scad b/misc/spacer.scad new file mode 100644 index 0000000..89a9b4e --- /dev/null +++ b/misc/spacer.scad @@ -0,0 +1,67 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2019-2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A spacer with a truncated pyramid shape. + * + * @author jsconan + * @version 0.1.0 + */ + +// As we need to use some shapes, use the right entry point of the library. +use <../lib/camelSCAD/shapes.scad> + +// To be able to use the library shared constants we import the definition file. +include <../lib/camelSCAD/core/constants.scad> + +// We will render the object using the specifications of this mode +renderMode = MODE_PROD; + +// Defines the constraints of the print. +printResolution = 0.2; // the target layer height +nozzle = 0.4; // the size of the print nozzle +wallDistance = 0.1; // the distance between the walls of two objects + +// Defines the constraints of the object. +bottomLength = 80; +bottomWidth = 23; +topLength = 28; +topWidth = 18; +height = 15; +fillet = 3; +diameter = 8; + +// Sets the minimum facet angle and size using the defined render mode. +// Displays a build box visualization to preview the printer area. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + difference() { + hull() { + cushion(size=[bottomLength, bottomWidth, printResolution], r=fillet); + cushion(size=[topLength, topWidth, height], r=fillet); + } + translateZ(-1) { + cylinder(d=diameter, h=height + 2); + } + } +} From 754e93fcda6ff2915383c4ca7697962c75fca096 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 22 Jan 2020 22:06:58 +0100 Subject: [PATCH 011/191] Bootstrap the RC track project --- rcmodels/tracks/config/config.scad | 48 +++++++++++++++++++++++++++++ rcmodels/tracks/shapes/common.scad | 31 +++++++++++++++++++ rcmodels/tracks/util/functions.scad | 44 ++++++++++++++++++++++++++ rcmodels/tracks/util/setup.scad | 40 ++++++++++++++++++++++++ 4 files changed, 163 insertions(+) create mode 100644 rcmodels/tracks/config/config.scad create mode 100644 rcmodels/tracks/shapes/common.scad create mode 100644 rcmodels/tracks/util/functions.scad create mode 100644 rcmodels/tracks/util/setup.scad diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad new file mode 100644 index 0000000..463cc87 --- /dev/null +++ b/rcmodels/tracks/config/config.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A 1/24 RC track system. + * + * Defines the config. + * + * @author jsconan + * @version 0.1.0 + */ + +// We will render the object using the specifications of this mode +renderMode = MODE_PROD; + +// Defines the constraints of the print. +printResolution = 0.2; // the target layer height +nozzle = 0.4; // the size of the print nozzle +wallDistance = 0.1; // the distance between the walls of two objects + +// The dimensions of a track chunk +chunkLength = 200; + +// The constraints of the track border +borderHeight = 50; +borderSheetThickness = 3 * printResolution; +borderClipThickness = 1; +borderMountEdge = 2; +borderMountSlotDepth = 6; diff --git a/rcmodels/tracks/shapes/common.scad b/rcmodels/tracks/shapes/common.scad new file mode 100644 index 0000000..5ab977c --- /dev/null +++ b/rcmodels/tracks/shapes/common.scad @@ -0,0 +1,31 @@ + +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A 1/24 RC track system. + * + * Defines some shared shapes. + * + * @author jsconan + * @version 0.1.0 + */ diff --git a/rcmodels/tracks/util/functions.scad b/rcmodels/tracks/util/functions.scad new file mode 100644 index 0000000..9477b3f --- /dev/null +++ b/rcmodels/tracks/util/functions.scad @@ -0,0 +1,44 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A 1/24 RC track system. + * + * Defines some functions. + * + * @author jsconan + * @version 0.1.0 + */ + +/** + * Ajust a height with respect to the target layer height + * @param Number height + * @returns Number + */ +function adjustToLayer(height) = roundBy(height, printResolution); + +/** + * Ajust a width with respect to the target nozzle size + * @param Number width + * @returns Number + */ +function adjustToNozzle(width) = roundBy(width, nozzle); diff --git a/rcmodels/tracks/util/setup.scad b/rcmodels/tracks/util/setup.scad new file mode 100644 index 0000000..c001ae9 --- /dev/null +++ b/rcmodels/tracks/util/setup.scad @@ -0,0 +1,40 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A 1/24 RC track system. + * + * Setup the context. + * + * @author jsconan + * @version 0.1.0 + */ + +// As we need to use some shapes, use the right entry point of the library. +include <../../../lib/camelSCAD/shapes.scad> + +// Then we need the config for the project, as well as the related functions +include <../config/config.scad> +include + +// Finally, include the shapes +include <../shapes/common.scad> From e9e35636c06db340a46e00a65807cf961fa385d2 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 22 Jan 2020 22:25:02 +0100 Subject: [PATCH 012/191] Better naming in config --- rcmodels/tracks/config/config.scad | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 463cc87..f080282 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -42,7 +42,7 @@ chunkLength = 200; // The constraints of the track border borderHeight = 50; -borderSheetThickness = 3 * printResolution; -borderClipThickness = 1; -borderMountEdge = 2; -borderMountSlotDepth = 6; +borderThickness = 3 * printResolution; +borderTopEdge = 1; +borderBottomEdge = 2; +borderSlotDepth = 6; From d14d864250a1a115770b74491990cf009cdc7db7 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 22 Jan 2020 22:25:31 +0100 Subject: [PATCH 013/191] Add the bottom profile --- rcmodels/tracks/shapes/common.scad | 39 ++++++++++++++++++++++++++ rcmodels/tracks/test/wip.scad | 44 ++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 rcmodels/tracks/test/wip.scad diff --git a/rcmodels/tracks/shapes/common.scad b/rcmodels/tracks/shapes/common.scad index 5ab977c..c50ca28 100644 --- a/rcmodels/tracks/shapes/common.scad +++ b/rcmodels/tracks/shapes/common.scad @@ -29,3 +29,42 @@ * @author jsconan * @version 0.1.0 */ + +/** + * Computes the points defining the profile of the bottom border mount. + * @param Number slotWidth - The width of the slot that will hold the border sheet. + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number edge - The width of each edge of the border mount. + * @returns Vector[] + */ +function getBorderBottomProfile(slotWidth, slotDepth, edge) = + let( + width = edge * 4 + slotWidth + ) + path([ + ["P", -width / 2, 0], + ["V", edge], + ["L", edge, slotDepth], + ["H", edge], + ["V", -slotDepth], + ["H", slotWidth], + ["V", slotDepth], + ["H", edge], + ["L", edge, -slotDepth], + ["V", -edge] + ]) +; + +/** + * Draws the shape of a the bottom border mount. + * @param Number slotWidth - The width of the slot that will hold the border sheet. + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number edge - The width of each edge of the border mount. + */ +module drawBorderBottomShape(slotWidth, slotDepth, edge) { + polygon(getBorderBottomProfile( + slotWidth = slotWidth, + slotDepth = slotDepth, + edge = edge + )); +} diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad new file mode 100644 index 0000000..2100f4d --- /dev/null +++ b/rcmodels/tracks/test/wip.scad @@ -0,0 +1,44 @@ + +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A 1/24 RC track system. + * + * Work in progress. + * + * @author jsconan + * @version 0.1.0 + */ + +// Import the project's setup. +include <../util/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // test the bottom shape profile + drawBorderBottomShape( + slotWidth = borderThickness, + slotDepth = borderSlotDepth, + edge = borderBottomEdge + ); +} From 37fd4b57754d48bd63e1c20cf2ded02448f2f475 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 22 Jan 2020 22:31:01 +0100 Subject: [PATCH 014/191] Add tolerance on the border mount --- rcmodels/tracks/test/wip.scad | 2 +- rcmodels/tracks/util/functions.scad | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 2100f4d..3a64dfb 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -37,7 +37,7 @@ include <../util/setup.scad> applyMode(mode=renderMode) { // test the bottom shape profile drawBorderBottomShape( - slotWidth = borderThickness, + slotWidth = getSlotWidth(), slotDepth = borderSlotDepth, edge = borderBottomEdge ); diff --git a/rcmodels/tracks/util/functions.scad b/rcmodels/tracks/util/functions.scad index 9477b3f..cb62b1b 100644 --- a/rcmodels/tracks/util/functions.scad +++ b/rcmodels/tracks/util/functions.scad @@ -42,3 +42,9 @@ function adjustToLayer(height) = roundBy(height, printResolution); * @returns Number */ function adjustToNozzle(width) = roundBy(width, nozzle); + +/** + * Gets the width of the slot that will hold the border sheet. + * @returns Number + */ +function getSlotWidth() = borderThickness + wallDistance; From 35560194d310f0eb0b715fac77039bb4a30eec86 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 22 Jan 2020 22:35:44 +0100 Subject: [PATCH 015/191] Add the top profile --- rcmodels/tracks/shapes/common.scad | 38 ++++++++++++++++++++++++++++++ rcmodels/tracks/test/wip.scad | 6 +++++ 2 files changed, 44 insertions(+) diff --git a/rcmodels/tracks/shapes/common.scad b/rcmodels/tracks/shapes/common.scad index c50ca28..c16c314 100644 --- a/rcmodels/tracks/shapes/common.scad +++ b/rcmodels/tracks/shapes/common.scad @@ -55,6 +55,30 @@ function getBorderBottomProfile(slotWidth, slotDepth, edge) = ]) ; +/** + * Computes the points defining the profile of the top border mount. + * @param Number slotWidth - The width of the slot that will hold the border sheet. + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number edge - The width of each edge of the border mount. + * @returns Vector[] + */ +function getBorderTopProfile(slotWidth, slotDepth, edge) = + let( + width = edge * 2 + slotWidth, + height = edge + slotDepth + ) + path([ + ["P", -width / 2, 0], + ["V", height], + ["H", edge], + ["V", -slotDepth], + ["H", slotWidth], + ["V", slotDepth], + ["H", edge], + ["V", -height] + ]) +; + /** * Draws the shape of a the bottom border mount. * @param Number slotWidth - The width of the slot that will hold the border sheet. @@ -68,3 +92,17 @@ module drawBorderBottomShape(slotWidth, slotDepth, edge) { edge = edge )); } + +/** + * Draws the shape of a the top border mount. + * @param Number slotWidth - The width of the slot that will hold the border sheet. + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number edge - The width of each edge of the border mount. + */ +module drawBorderTopShape(slotWidth, slotDepth, edge) { + polygon(getBorderTopProfile( + slotWidth = slotWidth, + slotDepth = slotDepth, + edge = edge + )); +} diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 3a64dfb..8c7cdfd 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -41,4 +41,10 @@ applyMode(mode=renderMode) { slotDepth = borderSlotDepth, edge = borderBottomEdge ); + // test the top shape profile + %drawBorderTopShape( + slotWidth = getSlotWidth(), + slotDepth = borderSlotDepth, + edge = borderTopEdge + ); } From d62e4a4d9042f8d5c9b8a4b6690b8511e398b5a0 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 22 Jan 2020 22:44:53 +0100 Subject: [PATCH 016/191] Better naming for the functions and modules --- rcmodels/tracks/shapes/common.scad | 16 ++++++++-------- rcmodels/tracks/test/wip.scad | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/rcmodels/tracks/shapes/common.scad b/rcmodels/tracks/shapes/common.scad index c16c314..a33b186 100644 --- a/rcmodels/tracks/shapes/common.scad +++ b/rcmodels/tracks/shapes/common.scad @@ -37,7 +37,7 @@ * @param Number edge - The width of each edge of the border mount. * @returns Vector[] */ -function getBorderBottomProfile(slotWidth, slotDepth, edge) = +function getBorderBottomPoints(slotWidth, slotDepth, edge) = let( width = edge * 4 + slotWidth ) @@ -62,7 +62,7 @@ function getBorderBottomProfile(slotWidth, slotDepth, edge) = * @param Number edge - The width of each edge of the border mount. * @returns Vector[] */ -function getBorderTopProfile(slotWidth, slotDepth, edge) = +function getBorderTopPoints(slotWidth, slotDepth, edge) = let( width = edge * 2 + slotWidth, height = edge + slotDepth @@ -80,13 +80,13 @@ function getBorderTopProfile(slotWidth, slotDepth, edge) = ; /** - * Draws the shape of a the bottom border mount. + * Draws the profile of the bottom border mount. * @param Number slotWidth - The width of the slot that will hold the border sheet. * @param Number slotDepth - The depth of the slot that will hold the border sheet. * @param Number edge - The width of each edge of the border mount. */ -module drawBorderBottomShape(slotWidth, slotDepth, edge) { - polygon(getBorderBottomProfile( +module borderBottomProfile(slotWidth, slotDepth, edge) { + polygon(getBorderBottomPoints( slotWidth = slotWidth, slotDepth = slotDepth, edge = edge @@ -94,13 +94,13 @@ module drawBorderBottomShape(slotWidth, slotDepth, edge) { } /** - * Draws the shape of a the top border mount. + * Draws the profile of the top border mount. * @param Number slotWidth - The width of the slot that will hold the border sheet. * @param Number slotDepth - The depth of the slot that will hold the border sheet. * @param Number edge - The width of each edge of the border mount. */ -module drawBorderTopShape(slotWidth, slotDepth, edge) { - polygon(getBorderTopProfile( +module borderTopProfile(slotWidth, slotDepth, edge) { + polygon(getBorderTopPoints( slotWidth = slotWidth, slotDepth = slotDepth, edge = edge diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 8c7cdfd..c2182d6 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -35,14 +35,14 @@ include <../util/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { - // test the bottom shape profile - drawBorderBottomShape( + // test the bottom border profile + borderBottomProfile( slotWidth = getSlotWidth(), slotDepth = borderSlotDepth, edge = borderBottomEdge ); - // test the top shape profile - %drawBorderTopShape( + // test the top border profile + %borderTopProfile( slotWidth = getSlotWidth(), slotDepth = borderSlotDepth, edge = borderTopEdge From a47e54e013bb2c422feeaab439f9bdf1afc17d77 Mon Sep 17 00:00:00 2001 From: jsconan Date: Thu, 23 Jan 2020 21:04:41 +0100 Subject: [PATCH 017/191] Add the tooth profile --- rcmodels/tracks/shapes/common.scad | 39 ++++++++++++++++++++++++++++++ rcmodels/tracks/test/wip.scad | 17 +++++++++++-- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/rcmodels/tracks/shapes/common.scad b/rcmodels/tracks/shapes/common.scad index a33b186..8d46d23 100644 --- a/rcmodels/tracks/shapes/common.scad +++ b/rcmodels/tracks/shapes/common.scad @@ -79,6 +79,29 @@ function getBorderTopPoints(slotWidth, slotDepth, edge) = ]) ; +/** + * Computes the points defining the profile of a border mount tooth. + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number edge - The width of each edge of the border mount. + * @param Number [direction] - The direction of the shape (1: right, -1: left) + * @param Boolean [negative] - The shape will be used in a difference operation + * @returns Vector[] + */ +function getBorderToothPoints(slotDepth, edge, direction=1, negative=false) = + let( + start = negative ? 1 : 0, + direction = direction >= 0 ? 1 : -1, + width = edge * 2 + ) + path([ + ["P", direction * -start, slotDepth], + ["H", direction * (edge + start)], + ["L", direction * edge, -slotDepth], + ["V", -start], + ["H", direction * -(width + start)] + ]) +; + /** * Draws the profile of the bottom border mount. * @param Number slotWidth - The width of the slot that will hold the border sheet. @@ -106,3 +129,19 @@ module borderTopProfile(slotWidth, slotDepth, edge) { edge = edge )); } + +/** + * Draws the profile of a border mount tooth. + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number edge - The width of each edge of the border mount. + * @param Number [direction] - The direction of the shape (1: right, -1: left) + * @param Boolean [negative] - The shape will be used in a difference operation + */ +module borderToothProfile(slotDepth, edge, direction=1, negative=false) { + polygon(getBorderToothPoints( + slotDepth = slotDepth, + edge = edge, + direction = direction, + negative = negative + )); +} diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index c2182d6..b01131c 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -36,15 +36,28 @@ include <../util/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { // test the bottom border profile - borderBottomProfile( + *borderBottomProfile( slotWidth = getSlotWidth(), slotDepth = borderSlotDepth, edge = borderBottomEdge ); // test the top border profile - %borderTopProfile( + *borderTopProfile( slotWidth = getSlotWidth(), slotDepth = borderSlotDepth, edge = borderTopEdge ); + // test the border tooth profile + borderToothProfile( + slotDepth = borderSlotDepth, + edge = borderBottomEdge, + direction = -1, + negative = true + ); + borderToothProfile( + slotDepth = borderSlotDepth, + edge = borderBottomEdge, + direction = 1, + negative = true + ); } From 25f10951163223d1c134ce4cc0c4a02cb238900d Mon Sep 17 00:00:00 2001 From: jsconan Date: Thu, 23 Jan 2020 21:05:43 +0100 Subject: [PATCH 018/191] Rename common.scad to profiles.scad --- rcmodels/tracks/shapes/{common.scad => profiles.scad} | 2 +- rcmodels/tracks/util/setup.scad | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename rcmodels/tracks/shapes/{common.scad => profiles.scad} (96%) diff --git a/rcmodels/tracks/shapes/common.scad b/rcmodels/tracks/shapes/profiles.scad similarity index 96% rename from rcmodels/tracks/shapes/common.scad rename to rcmodels/tracks/shapes/profiles.scad index 8d46d23..da91fd4 100644 --- a/rcmodels/tracks/shapes/common.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -24,7 +24,7 @@ /** * A 1/24 RC track system. * - * Defines some shared shapes. + * Defines some profile shapes. * * @author jsconan * @version 0.1.0 diff --git a/rcmodels/tracks/util/setup.scad b/rcmodels/tracks/util/setup.scad index c001ae9..c560878 100644 --- a/rcmodels/tracks/util/setup.scad +++ b/rcmodels/tracks/util/setup.scad @@ -37,4 +37,4 @@ include <../config/config.scad> include // Finally, include the shapes -include <../shapes/common.scad> +include <../shapes/profiles.scad> From b4d925b27868b4307c4956b19549b6b74be048ae Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 24 Jan 2020 09:42:09 +0100 Subject: [PATCH 019/191] Add profiles for teeth sets --- rcmodels/tracks/shapes/profiles.scad | 42 ++++++++++++++++++++++++++++ rcmodels/tracks/test/wip.scad | 18 ++++++++++-- 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index da91fd4..148ef33 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -145,3 +145,45 @@ module borderToothProfile(slotDepth, edge, direction=1, negative=false) { negative = negative )); } + +/** + * Draws the profile of a set of border mount teeth. + * @param Number length - The length of the set + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number edge - The width of each edge of the border mount. + * @param Boolean [negative] - The shape will be used in a difference operation + */ +module borderTeethProfile(length, slotDepth, edge, negative=false) { + borderToothProfile( + slotDepth = slotDepth, + edge = edge, + direction = 1, + negative = negative + ); + translateX(length) { + borderToothProfile( + slotDepth = slotDepth, + edge = edge, + direction = -1, + negative = negative + ); + } +} + +/** + * Draws the profile of border mount teeth for a complete chunk. + * @param Number length - The length of the chunk + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number edge - The width of each edge of the border mount. + * @param Boolean [negative] - The shape will be used in a difference operation + */ +module borderTeethChunkProfile(length, slotDepth, edge, negative=false) { + repeatMirror() { + borderTeethProfile( + length = chunkLength / 2, + slotDepth = slotDepth, + edge = edge, + negative = negative + ); + } +} diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index b01131c..e3a0b65 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -48,16 +48,30 @@ applyMode(mode=renderMode) { edge = borderTopEdge ); // test the border tooth profile - borderToothProfile( + *borderToothProfile( slotDepth = borderSlotDepth, edge = borderBottomEdge, direction = -1, negative = true ); - borderToothProfile( + *borderToothProfile( slotDepth = borderSlotDepth, edge = borderBottomEdge, direction = 1, negative = true ); + // test the border teeth profile + *borderTeethProfile( + length = chunkLength / 2, + slotDepth = borderSlotDepth, + edge = borderBottomEdge, + negative = true + ); + // test the border teeth profile for a complete chunk + borderTeethChunkProfile( + length = chunkLength, + slotDepth = borderSlotDepth, + edge = borderBottomEdge, + negative = true + ); } From 795fab1d7070925a7d7eea1048bfe85a5f72c511 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 24 Jan 2020 10:07:31 +0100 Subject: [PATCH 020/191] Add shape for the bottom border mount of a straight chunk --- rcmodels/tracks/shapes/straight.scad | 82 ++++++++++++++++++++++++++++ rcmodels/tracks/test/wip.scad | 18 +++++- rcmodels/tracks/util/setup.scad | 1 + 3 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 rcmodels/tracks/shapes/straight.scad diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad new file mode 100644 index 0000000..9576c7c --- /dev/null +++ b/rcmodels/tracks/shapes/straight.scad @@ -0,0 +1,82 @@ + +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A 1/24 RC track system. + * + * Defines some straight chunk shapes. + * + * @author jsconan + * @version 0.1.0 + */ + +/** + * Draws the extrusion of border mount teeth for a complete chunk. + * @param Number length - The length of the chunk + * @param Number thickness - The thickness of the extrusion + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number edge - The width of each edge of the border mount. + * @param Boolean [negative] - The shape will be used in a difference operation + * @param Boolean [center] - The shape is centered vertically + */ +module borderTeethChunk(length, thickness, slotDepth, edge, negative=false, center=false) { + negativeExtrude(height=thickness, center=center) { + borderTeethChunkProfile( + length = length / 2, + slotDepth = slotDepth, + edge = edge, + negative = negative + ); + } +} + +/** + * Draws the bottom border mount for a straight chunk + * @param Number length - The length of the chunk + * @param Number sheetThickness - The thickness of the sheet the border mount will hold. + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number edge - The width of each edge of the border mount. + */ +module straightBorderBottom(length, sheetThickness, slotDepth, edge) { + rotate([90, 0, 90]) { + negativeExtrude(height=length, center=true) { + borderBottomProfile( + slotWidth = sheetThickness, + slotDepth = slotDepth, + edge = edge + ); + } + } + translateZ(edge) { + rotateX(90) { + borderTeethChunk( + length = length, + thickness = sheetThickness * 2, + slotDepth = slotDepth, + edge = edge, + negative = false, + center = true + ); + } + } +} diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index e3a0b65..86ccfae 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -68,10 +68,26 @@ applyMode(mode=renderMode) { negative = true ); // test the border teeth profile for a complete chunk - borderTeethChunkProfile( + *borderTeethChunkProfile( length = chunkLength, slotDepth = borderSlotDepth, edge = borderBottomEdge, negative = true ); + // test the border teeth extrusion for a complete chunk + *borderTeethChunk( + length = chunkLength, + thickness = borderThickness * 2, + slotDepth = borderSlotDepth, + edge = borderBottomEdge, + negative = true, + center = true + ); + // test the bottom border mount shape for a straight chunk + straightBorderBottom( + length = chunkLength, + sheetThickness = borderThickness, + slotDepth = borderSlotDepth, + edge = borderBottomEdge + ); } diff --git a/rcmodels/tracks/util/setup.scad b/rcmodels/tracks/util/setup.scad index c560878..c97454a 100644 --- a/rcmodels/tracks/util/setup.scad +++ b/rcmodels/tracks/util/setup.scad @@ -38,3 +38,4 @@ include // Finally, include the shapes include <../shapes/profiles.scad> +include <../shapes/straight.scad> From 2243260c422306e4a414f9c367b7fcd85f46ee58 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 24 Jan 2020 17:16:33 +0100 Subject: [PATCH 021/191] Add shape for the top border mount of a straight chunk --- rcmodels/tracks/config/config.scad | 1 + rcmodels/tracks/shapes/straight.scad | 43 ++++++++++++++++++++++++---- rcmodels/tracks/test/wip.scad | 13 +++++++-- 3 files changed, 50 insertions(+), 7 deletions(-) diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index f080282..3c264d2 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -44,5 +44,6 @@ chunkLength = 200; borderHeight = 50; borderThickness = 3 * printResolution; borderTopEdge = 1; +borderToothEdge = 2; borderBottomEdge = 2; borderSlotDepth = 6; diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 9576c7c..3aee1f1 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -55,25 +55,58 @@ module borderTeethChunk(length, thickness, slotDepth, edge, negative=false, cent * @param Number length - The length of the chunk * @param Number sheetThickness - The thickness of the sheet the border mount will hold. * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the border mount. + * @param Number borderEdge - The width of each edge of the border mount. + * @param Number toothEdge - The width of a tooth edge. */ -module straightBorderBottom(length, sheetThickness, slotDepth, edge) { +module straightBorderBottom(length, sheetThickness, slotDepth, borderEdge, toothEdge) { rotate([90, 0, 90]) { negativeExtrude(height=length, center=true) { borderBottomProfile( slotWidth = sheetThickness, slotDepth = slotDepth, - edge = edge + edge = borderEdge + ); + } + } + translateZ(borderEdge) { + rotateX(90) { + borderTeethChunk( + length = length, + thickness = sheetThickness * 2, + slotDepth = slotDepth, + edge = toothEdge, + negative = false, + center = true + ); + } + } +} + +/** + * Draws the top border mount for a straight chunk + * @param Number length - The length of the chunk + * @param Number sheetThickness - The thickness of the sheet the border mount will hold. + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number borderEdge - The width of each edge of the border mount. + * @param Number toothEdge - The width of a tooth edge. + */ +module straightBorderTop(length, sheetThickness, slotDepth, borderEdge, toothEdge) { + rotate([90, 0, 90]) { + negativeExtrude(height=length, center=true) { + borderTopProfile( + slotWidth = sheetThickness, + slotDepth = slotDepth, + edge = borderEdge ); } } - translateZ(edge) { + translateZ(borderEdge) { rotateX(90) { borderTeethChunk( length = length, thickness = sheetThickness * 2, slotDepth = slotDepth, - edge = edge, + edge = toothEdge, negative = false, center = true ); diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 86ccfae..644ffb0 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -84,10 +84,19 @@ applyMode(mode=renderMode) { center = true ); // test the bottom border mount shape for a straight chunk - straightBorderBottom( + *straightBorderBottom( length = chunkLength, sheetThickness = borderThickness, slotDepth = borderSlotDepth, - edge = borderBottomEdge + borderEdge = borderBottomEdge, + toothEdge = borderToothEdge + ); + // test the top border mount shape for a straight chunk + straightBorderTop( + length = chunkLength, + sheetThickness = borderThickness, + slotDepth = borderSlotDepth, + borderEdge = borderTopEdge, + toothEdge = borderToothEdge ); } From 104d50ea381cee643c4c07aa49aaa5c60e63e315 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 24 Jan 2020 19:26:24 +0100 Subject: [PATCH 022/191] Rework the profile and the shapes --- rcmodels/tracks/shapes/profiles.scad | 18 ------------- rcmodels/tracks/shapes/straight.scad | 38 ++++++++++++++++++++++------ rcmodels/tracks/test/wip.scad | 16 +++++++----- 3 files changed, 39 insertions(+), 33 deletions(-) diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index 148ef33..534d3af 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -169,21 +169,3 @@ module borderTeethProfile(length, slotDepth, edge, negative=false) { ); } } - -/** - * Draws the profile of border mount teeth for a complete chunk. - * @param Number length - The length of the chunk - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the border mount. - * @param Boolean [negative] - The shape will be used in a difference operation - */ -module borderTeethChunkProfile(length, slotDepth, edge, negative=false) { - repeatMirror() { - borderTeethProfile( - length = chunkLength / 2, - slotDepth = slotDepth, - edge = edge, - negative = negative - ); - } -} diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 3aee1f1..1e6b759 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -31,7 +31,7 @@ */ /** - * Draws the extrusion of border mount teeth for a complete chunk. + * Draws the extrusion of border mount teeth. * @param Number length - The length of the chunk * @param Number thickness - The thickness of the extrusion * @param Number slotDepth - The depth of the slot that will hold the border sheet. @@ -39,10 +39,10 @@ * @param Boolean [negative] - The shape will be used in a difference operation * @param Boolean [center] - The shape is centered vertically */ -module borderTeethChunk(length, thickness, slotDepth, edge, negative=false, center=false) { +module borderTeeth(length, thickness, slotDepth, edge, negative=false, center=false) { negativeExtrude(height=thickness, center=center) { - borderTeethChunkProfile( - length = length / 2, + borderTeethProfile( + length = length, slotDepth = slotDepth, edge = edge, negative = negative @@ -50,6 +50,28 @@ module borderTeethChunk(length, thickness, slotDepth, edge, negative=false, cent } } +/** + * Draws the extrusion of border mount teeth for a complete chunk. + * @param Number length - The length of the chunk + * @param Number thickness - The thickness of the extrusion + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number edge - The width of each edge of the border mount. + * @param Boolean [negative] - The shape will be used in a difference operation + * @param Boolean [center] - The shape is centered vertically + */ +module borderTeethComplete(length, thickness, slotDepth, edge, negative=false, center=false) { + repeatMirror() { + borderTeeth( + length = length / 2, + thickness = thickness, + slotDepth = slotDepth, + edge = edge, + negative = negative, + center = center + ); + } +} + /** * Draws the bottom border mount for a straight chunk * @param Number length - The length of the chunk @@ -70,9 +92,9 @@ module straightBorderBottom(length, sheetThickness, slotDepth, borderEdge, tooth } translateZ(borderEdge) { rotateX(90) { - borderTeethChunk( + borderTeethComplete( length = length, - thickness = sheetThickness * 2, + thickness = sheetThickness, slotDepth = slotDepth, edge = toothEdge, negative = false, @@ -102,9 +124,9 @@ module straightBorderTop(length, sheetThickness, slotDepth, borderEdge, toothEdg } translateZ(borderEdge) { rotateX(90) { - borderTeethChunk( + borderTeethComplete( length = length, - thickness = sheetThickness * 2, + thickness = sheetThickness, slotDepth = slotDepth, edge = toothEdge, negative = false, diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 644ffb0..d131909 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -67,17 +67,19 @@ applyMode(mode=renderMode) { edge = borderBottomEdge, negative = true ); - // test the border teeth profile for a complete chunk - *borderTeethChunkProfile( + // test the border teeth extrusion + *borderTeeth( length = chunkLength, + thickness = getSlotWidth(), slotDepth = borderSlotDepth, edge = borderBottomEdge, - negative = true + negative = true, + center = true ); // test the border teeth extrusion for a complete chunk - *borderTeethChunk( + *borderTeethComplete( length = chunkLength, - thickness = borderThickness * 2, + thickness = getSlotWidth(), slotDepth = borderSlotDepth, edge = borderBottomEdge, negative = true, @@ -86,7 +88,7 @@ applyMode(mode=renderMode) { // test the bottom border mount shape for a straight chunk *straightBorderBottom( length = chunkLength, - sheetThickness = borderThickness, + sheetThickness = getSlotWidth(), slotDepth = borderSlotDepth, borderEdge = borderBottomEdge, toothEdge = borderToothEdge @@ -94,7 +96,7 @@ applyMode(mode=renderMode) { // test the top border mount shape for a straight chunk straightBorderTop( length = chunkLength, - sheetThickness = borderThickness, + sheetThickness = getSlotWidth(), slotDepth = borderSlotDepth, borderEdge = borderTopEdge, toothEdge = borderToothEdge From 0beb32a691f773805926a841054d87799cba73b7 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 24 Jan 2020 19:29:34 +0100 Subject: [PATCH 023/191] Add border sheet shapes for straight chunks --- rcmodels/tracks/shapes/straight.scad | 56 ++++++++++++++++++++++++++++ rcmodels/tracks/test/wip.scad | 18 ++++++++- 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 1e6b759..1ebf4da 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -135,3 +135,59 @@ module straightBorderTop(length, sheetThickness, slotDepth, borderEdge, toothEdg } } } + +/** + * Draws the border sheet for a straight chunk + * @param Number length - The length of the chunk + * @param Number height - The height of the chunk + * @param Number thickness - The thickness of the border sheet. + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number toothEdge - The width of a tooth edge. + */ +module borderSheet(length, height, thickness, slotDepth, toothEdge) { + difference() { + box(size = [length, height, thickness], center = true); + + repeatMirror(axis=[0, 1, 0]) { + translateY(-height / 2) { + translateX(-length / 2) { + borderTeeth( + length = length, + thickness = thickness + 1, + slotDepth = slotDepth, + edge = toothEdge, + negative = true, + center = true + ); + } + } + } + } +} + +/** + * Draws the complete border sheet for a straight chunk + * @param Number length - The length of the chunk + * @param Number height - The height of the chunk + * @param Number thickness - The thickness of the border sheet. + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number toothEdge - The width of a tooth edge. + */ +module borderSheetComplete(length, height, thickness, slotDepth, toothEdge) { + difference() { + box(size = [length, height, thickness], center = true); + + repeatMirror(axis=[0, 1, 0]) { + translateY(-height / 2) { + borderTeethComplete( + length = length, + thickness = thickness + 1, + slotDepth = slotDepth, + edge = toothEdge, + negative = true, + center = true + ); + } + } + } +} diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index d131909..9a3a059 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -94,11 +94,27 @@ applyMode(mode=renderMode) { toothEdge = borderToothEdge ); // test the top border mount shape for a straight chunk - straightBorderTop( + *straightBorderTop( length = chunkLength, sheetThickness = getSlotWidth(), slotDepth = borderSlotDepth, borderEdge = borderTopEdge, toothEdge = borderToothEdge ); + // test the border sheet shape for a straight chunk + *borderSheet( + length = chunkLength / 2, + height = borderHeight, + thickness = borderThickness, + slotDepth = borderSlotDepth, + toothEdge = borderToothEdge + ); + // test the complete border sheet shape for a straight chunk + borderSheetComplete( + length = chunkLength, + height = borderHeight, + thickness = borderThickness, + slotDepth = borderSlotDepth, + toothEdge = borderToothEdge + ); } From ad8883d3c8de2faab3eabaed61ec009232a8f229 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 24 Jan 2020 22:28:22 +0100 Subject: [PATCH 024/191] Add shape for the single tooth --- rcmodels/tracks/shapes/straight.scad | 20 ++++++++++++++++++++ rcmodels/tracks/test/wip.scad | 11 ++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 1ebf4da..a113a61 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -30,6 +30,26 @@ * @version 0.1.0 */ +/** + * Draws the extrusion of border mount tooth. + * @param Number thickness - The thickness of the extrusion + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number edge - The width of each edge of the border mount. + * @param Number [direction] - The direction of the shape (1: right, -1: left) + * @param Boolean [negative] - The shape will be used in a difference operation + * @param Boolean [center] - The shape is centered vertically + */ +module borderTooth(thickness, slotDepth, edge, direction=1, negative=false, center=false) { + negativeExtrude(height=thickness, center=center) { + polygon(getBorderToothPoints( + slotDepth = slotDepth, + edge = edge, + direction = direction, + negative = negative + )); + } +} + /** * Draws the extrusion of border mount teeth. * @param Number length - The length of the chunk diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 9a3a059..d2a569d 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -67,6 +67,15 @@ applyMode(mode=renderMode) { edge = borderBottomEdge, negative = true ); + // test the border tooth extrusion + borderTooth( + thickness = getSlotWidth(), + slotDepth = borderSlotDepth, + edge = borderBottomEdge, + direction = -1, + negative = true, + center = true + ); // test the border teeth extrusion *borderTeeth( length = chunkLength, @@ -110,7 +119,7 @@ applyMode(mode=renderMode) { toothEdge = borderToothEdge ); // test the complete border sheet shape for a straight chunk - borderSheetComplete( + *borderSheetComplete( length = chunkLength, height = borderHeight, thickness = borderThickness, From 5fa7db30b1276e79d826938ebfdb439b5580e057 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 25 Jan 2020 13:27:06 +0100 Subject: [PATCH 025/191] Update camelSCAD to v0.8.0 --- lib/camelSCAD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/camelSCAD b/lib/camelSCAD index 38004d1..01f316f 160000 --- a/lib/camelSCAD +++ b/lib/camelSCAD @@ -1 +1 @@ -Subproject commit 38004d162e0fbb8bb116c0bf9572160b90468e78 +Subproject commit 01f316fd6c1e190e756b9e09a97760e85c7d2ce5 From 79de37790bf3f964697376601eb59f194e156bbc Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 25 Jan 2020 13:45:56 +0100 Subject: [PATCH 026/191] Add shapes for the border mounts of a curved chunk --- rcmodels/tracks/shapes/curve.scad | 192 ++++++++++++++++++++++++++++++ rcmodels/tracks/test/wip.scad | 29 ++++- rcmodels/tracks/util/setup.scad | 1 + 3 files changed, 221 insertions(+), 1 deletion(-) create mode 100644 rcmodels/tracks/shapes/curve.scad diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad new file mode 100644 index 0000000..abe6195 --- /dev/null +++ b/rcmodels/tracks/shapes/curve.scad @@ -0,0 +1,192 @@ + +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A 1/24 RC track system. + * + * Defines some curved chunk shapes. + * + * @author jsconan + * @version 0.1.0 + */ + +/** + * Draws the shape of a curved border mount tooth. + * @param Number radius - The radius of the curve. + * @param Number thickness - The thickness of the shape + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number edge - The width of each edge of the border mount. + * @param Number [direction] - The direction of the shape (1: right, -1: left) + * @param Boolean [negative] - The shape will be used in a difference operation + */ +module curveBorderTooth(radius, thickness, slotDepth, edge, direction=1, negative=false) { + start = negative ? 1 : 0; + direction = direction >= 0 ? 1 : -1; + length = edge * 2; + angle = getArcAngle(radius = radius, length = length); + chord = getChordLength(radius = radius, angle = angle / 2); + + difference() { + translateZ(-start) { + pipeSegment( + r = radius + thickness / 2, + h = slotDepth + start, + w = thickness, + a1 = -direction * getArcAngle(radius = radius, length = start), + a2 = direction * angle + ); + } + + rotateZ(direction * angle) { + translateX(radius) { + rotate([90, 0, 270]) { + negativeExtrude(height = thickness + 1, center = true) { + polygon([ + [0, 0], + [direction * chord, slotDepth], + [direction * chord, slotDepth + 1], + [direction * -1, slotDepth + 1], + [direction * -1, 0], + ]); + } + } + } + } + } +} + +/** + * Draws the shape of a curved border mount teeth for a complete chunk. + * @param Number radius - The radius of the curve. + * @param Number length - The length of a chunk + * @param Number angle - The angle of the curve + * @param Number thickness - The thickness of the shape + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number edge - The width of each edge of the border mount. + * @param Boolean [negative] - The shape will be used in a difference operation + */ +module curveBorderTeeth(radius, length, angle, thickness, slotDepth, edge, negative=false) { + rotateZ(angle) { + repeatMirror(axis=[0, 1, 0]) { + rotateZ(-angle) { + curveBorderTooth( + radius = radius, + thickness = thickness, + slotDepth = slotDepth, + edge = edge, + direction = 1, + negative = negative + ); + rotateZ(getArcAngle(radius = radius, length = length / 2)) { + repeatMirror(axis=[0, 1, 0]) { + curveBorderTooth( + radius = radius, + thickness = thickness, + slotDepth = slotDepth, + edge = edge, + direction = -1, + negative = negative + ); + } + } + } + } + } +} + +/** + * Draws the bottom border mount for a curved chunk + * @param Number length - The length of a chunk + * @param Number sheetThickness - The thickness of the sheet the border mount will hold. + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number borderEdge - The width of each edge of the border mount. + * @param Number toothEdge - The width of a tooth edge. + * @param Number ratio - The ratio of the chunk + */ +module curveBorderBottom(length, sheetThickness, slotDepth, borderEdge, toothEdge, ratio = 1) { + radius = length * ratio; + defaultAngle = 90; + angle = defaultAngle / ratio; + + rotateZ((defaultAngle - angle) / 2) { + rotate_extrude(angle=angle, convexity=10) { + translateX(radius) { + borderBottomProfile( + slotWidth = sheetThickness, + slotDepth = slotDepth, + edge = borderEdge + ); + } + } + + translateZ(borderEdge) { + curveBorderTeeth( + radius = radius, + length = length, + angle = angle / 2, + thickness = borderEdge, + slotDepth = slotDepth, + edge = toothEdge, + negative=false + ); + } + } +} +/** + * Draws the top border mount for a curved chunk + * @param Number length - The length of a chunk + * @param Number sheetThickness - The thickness of the sheet the border mount will hold. + * @param Number slotDepth - The depth of the slot that will hold the border sheet. + * @param Number borderEdge - The width of each edge of the border mount. + * @param Number toothEdge - The width of a tooth edge. + * @param Number ratio - The ratio of the chunk + */ +module curveBorderTop(length, sheetThickness, slotDepth, borderEdge, toothEdge, ratio = 1) { + radius = length * ratio; + defaultAngle = 90; + angle = defaultAngle / ratio; + + rotateZ((defaultAngle - angle) / 2) { + rotate_extrude(angle=angle, convexity=10) { + translateX(radius) { + borderTopProfile( + slotWidth = sheetThickness, + slotDepth = slotDepth, + edge = borderEdge + ); + } + } + + translateZ(borderEdge) { + curveBorderTeeth( + radius = radius, + length = length, + angle = angle / 2, + thickness = borderEdge, + slotDepth = slotDepth, + edge = toothEdge, + negative=false + ); + } + } +} diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index d2a569d..c12e58d 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -68,7 +68,7 @@ applyMode(mode=renderMode) { negative = true ); // test the border tooth extrusion - borderTooth( + *borderTooth( thickness = getSlotWidth(), slotDepth = borderSlotDepth, edge = borderBottomEdge, @@ -110,6 +110,33 @@ applyMode(mode=renderMode) { borderEdge = borderTopEdge, toothEdge = borderToothEdge ); + // test the curved border tooth + *curveBorderTooth( + radius = chunkLength, + thickness = getSlotWidth(), + slotDepth = borderSlotDepth, + edge = borderToothEdge, + direction = 1, + negative = true + ); + // test the bottom border mount shape for a curved chunk + curveBorderBottom( + length = chunkLength, + sheetThickness = getSlotWidth(), + slotDepth = borderSlotDepth, + borderEdge = borderBottomEdge, + toothEdge = borderToothEdge, + ratio = 1 + ); + // test the top border mount shape for a curved chunk + *curveBorderTop( + length = chunkLength, + sheetThickness = getSlotWidth(), + slotDepth = borderSlotDepth, + borderEdge = borderTopEdge, + toothEdge = borderToothEdge, + ratio = 1 + ); // test the border sheet shape for a straight chunk *borderSheet( length = chunkLength / 2, diff --git a/rcmodels/tracks/util/setup.scad b/rcmodels/tracks/util/setup.scad index c97454a..d15c993 100644 --- a/rcmodels/tracks/util/setup.scad +++ b/rcmodels/tracks/util/setup.scad @@ -39,3 +39,4 @@ include // Finally, include the shapes include <../shapes/profiles.scad> include <../shapes/straight.scad> +include <../shapes/curve.scad> From 59b09768e8de6d9eca614b803f3f45284eca9816 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 25 Jan 2020 13:54:38 +0100 Subject: [PATCH 027/191] Add util functions, check constraints on bootstrap --- rcmodels/tracks/config/config.scad | 5 ++- rcmodels/tracks/test/wip.scad | 2 +- rcmodels/tracks/util/functions.scad | 58 ++++++++++++++++++++++++++++- rcmodels/tracks/util/setup.scad | 20 ++++++++++ 4 files changed, 82 insertions(+), 3 deletions(-) diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 3c264d2..6e2a5af 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -35,7 +35,10 @@ renderMode = MODE_PROD; // Defines the constraints of the print. printResolution = 0.2; // the target layer height nozzle = 0.4; // the size of the print nozzle -wallDistance = 0.1; // the distance between the walls of two objects +printTolerance = 0.1; // the print tolerance when pieces need to be assembled + +// Defines options +heightWithFasteners = true; // Should the height be with or without the fastener elements? // The dimensions of a track chunk chunkLength = 200; diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index c12e58d..ac85404 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -139,7 +139,7 @@ applyMode(mode=renderMode) { ); // test the border sheet shape for a straight chunk *borderSheet( - length = chunkLength / 2, + length = getCurveRemainingLength(chunkLength), height = borderHeight, thickness = borderThickness, slotDepth = borderSlotDepth, diff --git a/rcmodels/tracks/util/functions.scad b/rcmodels/tracks/util/functions.scad index cb62b1b..03f1645 100644 --- a/rcmodels/tracks/util/functions.scad +++ b/rcmodels/tracks/util/functions.scad @@ -47,4 +47,60 @@ function adjustToNozzle(width) = roundBy(width, nozzle); * Gets the width of the slot that will hold the border sheet. * @returns Number */ -function getSlotWidth() = borderThickness + wallDistance; +function getSlotWidth() = borderThickness + printTolerance; + +/** + * Gets the length of a curved chunk (the length of the arc of the curve). + * @param Number chunkLength - The length of a straight chunk + * @returns Number + */ +function getCurveLength(chunkLength) = getArcLength(radius = chunkLength, angle = 90); + +/** + * Gets the difference between the length of a curved chunk and a regular straight chunk + * @param Number chunkLength - The length of a straight chunk + * @returns Number + */ +function getCurveRemainingLength(chunkLength) = getCurveLength(chunkLength) - chunkLength; + +/** + * Gets the height of the border sheet, depending on the option heightWithFasteners + * @returns Number + */ +function getSheetHeight() = + let( + correction = heightWithFasteners + ?-(borderBottomEdge + borderTopEdge) + :borderSlotDepth * 2 + ) + borderHeight + correction +; + +/** + * Gets the height of the assembled border, depending on the option heightWithFasteners + * @returns Number + */ +function getBorderHeight() = + let( + correction = heightWithFasteners ? 0 : borderBottomEdge + borderTopEdge + borderSlotDepth * 2 + ) + borderHeight + correction +; + +/** + * Gets the minimal length for a simple sheet (a sheet that should fit between 2 border teeth) + * @returns Number + */ +function getMinSheetLength() = 5 * borderToothEdge; + +/** + * Gets the minimal length for a complete straight sheet + * @returns Number + */ +function getMinStraightLength() = 2 * getMinSheetLength(); + +/** + * Gets the minimal length for a complete curved sheet + * @returns Number + */ +function getMinCurveLength() = 3 * getMinSheetLength(); diff --git a/rcmodels/tracks/util/setup.scad b/rcmodels/tracks/util/setup.scad index d15c993..fdcfb4f 100644 --- a/rcmodels/tracks/util/setup.scad +++ b/rcmodels/tracks/util/setup.scad @@ -40,3 +40,23 @@ include include <../shapes/profiles.scad> include <../shapes/straight.scad> include <../shapes/curve.scad> + +// Validate the critical constraints +assert( + chunkLength >= getMinStraightLength(), + str( + "The length for a track chunk is too small! The minimum length for a straight element is ", + getMinStraightLength(), + ". The current value is ", + chunkLength + ) +); +assert( + getArcLength(radius = chunkLength, angle = 90) >= getMinCurveLength(), + str( + "The length for a track chunk is too small! The minimum arc length for a curved element is ", + getMinCurveLength(), + ". The current value is ", + getArcLength(radius = chunkLength, angle = 90) + ) +); From 80f29d2ea5fa018f7133e6e4effd0b3e98e3aadf Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 25 Jan 2020 14:17:11 +0100 Subject: [PATCH 028/191] Rename and typo fix --- rcmodels/tracks/shapes/curve.scad | 2 +- rcmodels/tracks/shapes/straight.scad | 24 ++++++++++++------------ rcmodels/tracks/test/wip.scad | 12 ++++++------ rcmodels/tracks/util/functions.scad | 4 ++-- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad index abe6195..d0cfe00 100644 --- a/rcmodels/tracks/shapes/curve.scad +++ b/rcmodels/tracks/shapes/curve.scad @@ -76,7 +76,7 @@ module curveBorderTooth(radius, thickness, slotDepth, edge, direction=1, negativ } /** - * Draws the shape of a curved border mount teeth for a complete chunk. + * Draws the shape of a curved border mount teeth for a full chunk. * @param Number radius - The radius of the curve. * @param Number length - The length of a chunk * @param Number angle - The angle of the curve diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index a113a61..f9070b2 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -31,8 +31,8 @@ */ /** - * Draws the extrusion of border mount tooth. - * @param Number thickness - The thickness of the extrusion + * Draws the shape of border mount tooth. + * @param Number thickness - The thickness of the shape * @param Number slotDepth - The depth of the slot that will hold the border sheet. * @param Number edge - The width of each edge of the border mount. * @param Number [direction] - The direction of the shape (1: right, -1: left) @@ -51,9 +51,9 @@ module borderTooth(thickness, slotDepth, edge, direction=1, negative=false, cent } /** - * Draws the extrusion of border mount teeth. + * Draws the shape of border mount teeth. * @param Number length - The length of the chunk - * @param Number thickness - The thickness of the extrusion + * @param Number thickness - The thickness of the shape * @param Number slotDepth - The depth of the slot that will hold the border sheet. * @param Number edge - The width of each edge of the border mount. * @param Boolean [negative] - The shape will be used in a difference operation @@ -71,15 +71,15 @@ module borderTeeth(length, thickness, slotDepth, edge, negative=false, center=fa } /** - * Draws the extrusion of border mount teeth for a complete chunk. + * Draws the shape of border mount teeth for a full chunk. * @param Number length - The length of the chunk - * @param Number thickness - The thickness of the extrusion + * @param Number thickness - The thickness of the shape * @param Number slotDepth - The depth of the slot that will hold the border sheet. * @param Number edge - The width of each edge of the border mount. * @param Boolean [negative] - The shape will be used in a difference operation * @param Boolean [center] - The shape is centered vertically */ -module borderTeethComplete(length, thickness, slotDepth, edge, negative=false, center=false) { +module borderTeethFull(length, thickness, slotDepth, edge, negative=false, center=false) { repeatMirror() { borderTeeth( length = length / 2, @@ -112,7 +112,7 @@ module straightBorderBottom(length, sheetThickness, slotDepth, borderEdge, tooth } translateZ(borderEdge) { rotateX(90) { - borderTeethComplete( + borderTeethFull( length = length, thickness = sheetThickness, slotDepth = slotDepth, @@ -144,7 +144,7 @@ module straightBorderTop(length, sheetThickness, slotDepth, borderEdge, toothEdg } translateZ(borderEdge) { rotateX(90) { - borderTeethComplete( + borderTeethFull( length = length, thickness = sheetThickness, slotDepth = slotDepth, @@ -186,20 +186,20 @@ module borderSheet(length, height, thickness, slotDepth, toothEdge) { } /** - * Draws the complete border sheet for a straight chunk + * Draws the full border sheet for a straight chunk * @param Number length - The length of the chunk * @param Number height - The height of the chunk * @param Number thickness - The thickness of the border sheet. * @param Number slotDepth - The depth of the slot that will hold the border sheet. * @param Number toothEdge - The width of a tooth edge. */ -module borderSheetComplete(length, height, thickness, slotDepth, toothEdge) { +module borderSheetFull(length, height, thickness, slotDepth, toothEdge) { difference() { box(size = [length, height, thickness], center = true); repeatMirror(axis=[0, 1, 0]) { translateY(-height / 2) { - borderTeethComplete( + borderTeethFull( length = length, thickness = thickness + 1, slotDepth = slotDepth, diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index ac85404..f978591 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -67,7 +67,7 @@ applyMode(mode=renderMode) { edge = borderBottomEdge, negative = true ); - // test the border tooth extrusion + // test the border tooth shape *borderTooth( thickness = getSlotWidth(), slotDepth = borderSlotDepth, @@ -76,7 +76,7 @@ applyMode(mode=renderMode) { negative = true, center = true ); - // test the border teeth extrusion + // test the border teeth shape *borderTeeth( length = chunkLength, thickness = getSlotWidth(), @@ -85,8 +85,8 @@ applyMode(mode=renderMode) { negative = true, center = true ); - // test the border teeth extrusion for a complete chunk - *borderTeethComplete( + // test the border teeth shape for a full chunk + *borderTeethFull( length = chunkLength, thickness = getSlotWidth(), slotDepth = borderSlotDepth, @@ -145,8 +145,8 @@ applyMode(mode=renderMode) { slotDepth = borderSlotDepth, toothEdge = borderToothEdge ); - // test the complete border sheet shape for a straight chunk - *borderSheetComplete( + // test the full border sheet shape for a straight chunk + *borderSheetFull( length = chunkLength, height = borderHeight, thickness = borderThickness, diff --git a/rcmodels/tracks/util/functions.scad b/rcmodels/tracks/util/functions.scad index 03f1645..74fac44 100644 --- a/rcmodels/tracks/util/functions.scad +++ b/rcmodels/tracks/util/functions.scad @@ -94,13 +94,13 @@ function getBorderHeight() = function getMinSheetLength() = 5 * borderToothEdge; /** - * Gets the minimal length for a complete straight sheet + * Gets the minimal length for a straight chunk * @returns Number */ function getMinStraightLength() = 2 * getMinSheetLength(); /** - * Gets the minimal length for a complete curved sheet + * Gets the minimal arc length for a curved chunk * @returns Number */ function getMinCurveLength() = 3 * getMinSheetLength(); From 5a521894bec2521c97f9f8dad9003483f2d192e5 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 25 Jan 2020 14:19:34 +0100 Subject: [PATCH 029/191] Straight chunk elements --- rcmodels/tracks/border-sheet-full.scad | 47 +++++++++++++++++++++ rcmodels/tracks/bottom-border-straight.scad | 47 +++++++++++++++++++++ rcmodels/tracks/top-border-straight.scad | 47 +++++++++++++++++++++ 3 files changed, 141 insertions(+) create mode 100644 rcmodels/tracks/border-sheet-full.scad create mode 100644 rcmodels/tracks/bottom-border-straight.scad create mode 100644 rcmodels/tracks/top-border-straight.scad diff --git a/rcmodels/tracks/border-sheet-full.scad b/rcmodels/tracks/border-sheet-full.scad new file mode 100644 index 0000000..f289194 --- /dev/null +++ b/rcmodels/tracks/border-sheet-full.scad @@ -0,0 +1,47 @@ + +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A 1/24 RC track system. + * + * A full border sheet for a straight track chunk. + * + * @author jsconan + * @version 0.1.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + borderSheetFull( + length = chunkLength, + height = getSheetHeight(), + thickness = borderThickness, + slotDepth = borderSlotDepth, + toothEdge = borderToothEdge + ); +} diff --git a/rcmodels/tracks/bottom-border-straight.scad b/rcmodels/tracks/bottom-border-straight.scad new file mode 100644 index 0000000..9c807db --- /dev/null +++ b/rcmodels/tracks/bottom-border-straight.scad @@ -0,0 +1,47 @@ + +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A 1/24 RC track system. + * + * A bottom border mount for a straight track chunk. + * + * @author jsconan + * @version 0.1.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + straightBorderBottom( + length = chunkLength, + sheetThickness = getSlotWidth(), + slotDepth = borderSlotDepth, + borderEdge = borderBottomEdge, + toothEdge = borderToothEdge + ); +} diff --git a/rcmodels/tracks/top-border-straight.scad b/rcmodels/tracks/top-border-straight.scad new file mode 100644 index 0000000..4a2b999 --- /dev/null +++ b/rcmodels/tracks/top-border-straight.scad @@ -0,0 +1,47 @@ + +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A 1/24 RC track system. + * + * A top border mount for a straight track chunk. + * + * @author jsconan + * @version 0.1.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + straightBorderTop( + length = chunkLength, + sheetThickness = getSlotWidth(), + slotDepth = borderSlotDepth, + borderEdge = borderTopEdge, + toothEdge = borderToothEdge + ); +} From 43547dbf281a6552159edb1c045059909f10af93 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 25 Jan 2020 14:19:55 +0100 Subject: [PATCH 030/191] Curved chunk elements --- rcmodels/tracks/border-sheet-curve.scad | 47 ++++++++++++++++++++++ rcmodels/tracks/bottom-border-curved.scad | 48 +++++++++++++++++++++++ rcmodels/tracks/top-border-curved.scad | 48 +++++++++++++++++++++++ 3 files changed, 143 insertions(+) create mode 100644 rcmodels/tracks/border-sheet-curve.scad create mode 100644 rcmodels/tracks/bottom-border-curved.scad create mode 100644 rcmodels/tracks/top-border-curved.scad diff --git a/rcmodels/tracks/border-sheet-curve.scad b/rcmodels/tracks/border-sheet-curve.scad new file mode 100644 index 0000000..923fb78 --- /dev/null +++ b/rcmodels/tracks/border-sheet-curve.scad @@ -0,0 +1,47 @@ + +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A 1/24 RC track system. + * + * An additional border sheet for a curved track chunk. + * + * @author jsconan + * @version 0.1.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + borderSheet( + length = getCurveRemainingLength(chunkLength), + height = getSheetHeight(), + thickness = borderThickness, + slotDepth = borderSlotDepth, + toothEdge = borderToothEdge + ); +} diff --git a/rcmodels/tracks/bottom-border-curved.scad b/rcmodels/tracks/bottom-border-curved.scad new file mode 100644 index 0000000..ff5155f --- /dev/null +++ b/rcmodels/tracks/bottom-border-curved.scad @@ -0,0 +1,48 @@ + +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A 1/24 RC track system. + * + * A bottom border mount for a curved track chunk. + * + * @author jsconan + * @version 0.1.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curveBorderBottom( + length = chunkLength, + sheetThickness = getSlotWidth(), + slotDepth = borderSlotDepth, + borderEdge = borderBottomEdge, + toothEdge = borderToothEdge, + ratio = 1 + ); +} diff --git a/rcmodels/tracks/top-border-curved.scad b/rcmodels/tracks/top-border-curved.scad new file mode 100644 index 0000000..931fe49 --- /dev/null +++ b/rcmodels/tracks/top-border-curved.scad @@ -0,0 +1,48 @@ + +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A 1/24 RC track system. + * + * A top border mount for a curved track chunk. + * + * @author jsconan + * @version 0.1.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curveBorderTop( + length = chunkLength, + sheetThickness = getSlotWidth(), + slotDepth = borderSlotDepth, + borderEdge = borderTopEdge, + toothEdge = borderToothEdge, + ratio = 1 + ); +} From 15fae3f136bfed463aeb5ddf3990d39b19375b55 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 25 Jan 2020 14:38:09 +0100 Subject: [PATCH 031/191] Add render script --- rcmodels/tracks/render.sh | 91 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100755 rcmodels/tracks/render.sh diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh new file mode 100755 index 0000000..50dd898 --- /dev/null +++ b/rcmodels/tracks/render.sh @@ -0,0 +1,91 @@ +#!/bin/bash +# +# GPLv3 License +# +# Copyright (c) 2020 Jean-Sebastien CONAN +# +# This file is part of jsconan/things. +# +# jsconan/things is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# jsconan/things is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with jsconan/things. If not, see . +# + +# +# Generates the STL files for the 1/24 RC track system. +# +# @author jsconan +# + +# application params +heightWithFasteners=1 +chunkLength=200 +borderHeight=50 + +# script config +scriptpath=$(dirname $0) +project=$(pwd) +srcpath=${project} +dstpath=${project}/output + +source "${scriptpath}/../../lib/camelSCAD/scripts/utils.sh" + +# load parameters +while (( "$#" )); do + case $1 in + "-l"|"--chunkLength") + chunkLength=$2 + shift + ;; + "-w"|"--borderHeight") + borderHeight=$2 + shift + ;; + "-i"|"--innerHeight") + heightWithFasteners=0 + ;; + "-o"|"--outerHeight") + heightWithFasteners=1 + ;; + "-h"|"--help") + echo -e "${C_INF}Renders OpenSCAD files${C_RST}" + echo -e " ${C_INF}Usage:${C_RST}" + echo -e "${C_CTX}\t$0 [-h|--help] [-o|--option value] files${C_RST}" + echo + echo -e "${C_MSG} -h, --help ${C_RST}Show this help" + echo -e "${C_MSG} -l, --chunkLength ${C_RST}Set the length of a track chunk (default: ${chunkLength}" + echo -e "${C_MSG} -w --borderHeight ${C_RST}Set the height of the track border (default: ${borderHeight}" + echo -e "${C_MSG} -i, --innerHeight ${C_RST}The height of the border does not contains the size of the mount fasteners" + echo -e "${C_MSG} -o, --outerHeight ${C_RST}The height of the border contains the size of the mount fasteners" + echo + exit 0 + ;; + *) + ls $1 >/dev/null 2>&1 + if [ "$?" == "0" ]; then + srcpath=$1 + else + printerror "Unknown parameter ${1}" + fi + ;; + esac + shift +done + +# check OpenSCAD +scadcheck + +# render the files, if exist +scadtostlall "${srcpath}" "${dstpath}" "" \ + "chunkLength=${chunkLength}" \ + "borderHeight=${borderHeight}" \ + "heightWithFasteners=${heightWithFasteners}" From 6bd9ed6409bf6840967f2e10b049f1cbc9d40e41 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 25 Jan 2020 14:41:02 +0100 Subject: [PATCH 032/191] Fix code style --- rcmodels/tracks/shapes/curve.scad | 1 + 1 file changed, 1 insertion(+) diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad index d0cfe00..2b339a7 100644 --- a/rcmodels/tracks/shapes/curve.scad +++ b/rcmodels/tracks/shapes/curve.scad @@ -152,6 +152,7 @@ module curveBorderBottom(length, sheetThickness, slotDepth, borderEdge, toothEdg } } } + /** * Draws the top border mount for a curved chunk * @param Number length - The length of a chunk From d3ec279d220d15601dc6129f5885c14b732f9c13 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 25 Jan 2020 18:52:24 +0100 Subject: [PATCH 033/191] Add functions to apply printer constraints --- rcmodels/tracks/border-sheet-curve.scad | 8 +- rcmodels/tracks/border-sheet-full.scad | 8 +- rcmodels/tracks/bottom-border-curved.scad | 8 +- rcmodels/tracks/bottom-border-straight.scad | 8 +- rcmodels/tracks/config/config.scad | 4 +- rcmodels/tracks/test/wip.scad | 102 +++++++++----------- rcmodels/tracks/top-border-curved.scad | 8 +- rcmodels/tracks/top-border-straight.scad | 8 +- rcmodels/tracks/util/functions.scad | 42 +++++++- 9 files changed, 113 insertions(+), 83 deletions(-) diff --git a/rcmodels/tracks/border-sheet-curve.scad b/rcmodels/tracks/border-sheet-curve.scad index 923fb78..b901f95 100644 --- a/rcmodels/tracks/border-sheet-curve.scad +++ b/rcmodels/tracks/border-sheet-curve.scad @@ -38,10 +38,10 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) borderSheet( - length = getCurveRemainingLength(chunkLength), + length = getCurveRemainingLength(getChunkLength()), height = getSheetHeight(), - thickness = borderThickness, - slotDepth = borderSlotDepth, - toothEdge = borderToothEdge + thickness = getSheetThickness(), + slotDepth = getSlotDepth(), + toothEdge = getToothEdge() ); } diff --git a/rcmodels/tracks/border-sheet-full.scad b/rcmodels/tracks/border-sheet-full.scad index f289194..0d05585 100644 --- a/rcmodels/tracks/border-sheet-full.scad +++ b/rcmodels/tracks/border-sheet-full.scad @@ -38,10 +38,10 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) borderSheetFull( - length = chunkLength, + length = getChunkLength(), height = getSheetHeight(), - thickness = borderThickness, - slotDepth = borderSlotDepth, - toothEdge = borderToothEdge + thickness = getSheetThickness(), + slotDepth = getSlotDepth(), + toothEdge = getToothEdge() ); } diff --git a/rcmodels/tracks/bottom-border-curved.scad b/rcmodels/tracks/bottom-border-curved.scad index ff5155f..168a461 100644 --- a/rcmodels/tracks/bottom-border-curved.scad +++ b/rcmodels/tracks/bottom-border-curved.scad @@ -38,11 +38,11 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) curveBorderBottom( - length = chunkLength, + length = getChunkLength(), sheetThickness = getSlotWidth(), - slotDepth = borderSlotDepth, - borderEdge = borderBottomEdge, - toothEdge = borderToothEdge, + slotDepth = getSlotDepth(), + borderEdge = getBottomEdge(), + toothEdge = getToothEdge(), ratio = 1 ); } diff --git a/rcmodels/tracks/bottom-border-straight.scad b/rcmodels/tracks/bottom-border-straight.scad index 9c807db..ca2a5ac 100644 --- a/rcmodels/tracks/bottom-border-straight.scad +++ b/rcmodels/tracks/bottom-border-straight.scad @@ -38,10 +38,10 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) straightBorderBottom( - length = chunkLength, + length = getChunkLength(), sheetThickness = getSlotWidth(), - slotDepth = borderSlotDepth, - borderEdge = borderBottomEdge, - toothEdge = borderToothEdge + slotDepth = getSlotDepth(), + borderEdge = getBottomEdge(), + toothEdge = getToothEdge() ); } diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 6e2a5af..32f258e 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -34,7 +34,7 @@ renderMode = MODE_PROD; // Defines the constraints of the print. printResolution = 0.2; // the target layer height -nozzle = 0.4; // the size of the print nozzle +nozzleWidth = 0.4; // the size of the print nozzle printTolerance = 0.1; // the print tolerance when pieces need to be assembled // Defines options @@ -45,7 +45,7 @@ chunkLength = 200; // The constraints of the track border borderHeight = 50; -borderThickness = 3 * printResolution; +borderThickness = 0.6; borderTopEdge = 1; borderToothEdge = 2; borderBottomEdge = 2; diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index f978591..8d34856 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -38,119 +38,113 @@ applyMode(mode=renderMode) { // test the bottom border profile *borderBottomProfile( slotWidth = getSlotWidth(), - slotDepth = borderSlotDepth, - edge = borderBottomEdge + slotDepth = getSlotDepth(), + edge = getBottomEdge() ); // test the top border profile *borderTopProfile( slotWidth = getSlotWidth(), - slotDepth = borderSlotDepth, - edge = borderTopEdge + slotDepth = getSlotDepth(), + edge = getTopEdge() ); // test the border tooth profile *borderToothProfile( - slotDepth = borderSlotDepth, - edge = borderBottomEdge, + slotDepth = getSlotDepth(), + edge = getBottomEdge(), direction = -1, negative = true ); - *borderToothProfile( - slotDepth = borderSlotDepth, - edge = borderBottomEdge, - direction = 1, - negative = true - ); // test the border teeth profile *borderTeethProfile( - length = chunkLength / 2, - slotDepth = borderSlotDepth, - edge = borderBottomEdge, + length = getChunkLength() / 2, + slotDepth = getSlotDepth(), + edge = getBottomEdge(), negative = true ); // test the border tooth shape *borderTooth( thickness = getSlotWidth(), - slotDepth = borderSlotDepth, - edge = borderBottomEdge, + slotDepth = getSlotDepth(), + edge = getBottomEdge(), direction = -1, negative = true, center = true ); // test the border teeth shape *borderTeeth( - length = chunkLength, + length = getChunkLength(), thickness = getSlotWidth(), - slotDepth = borderSlotDepth, - edge = borderBottomEdge, + slotDepth = getSlotDepth(), + edge = getBottomEdge(), negative = true, center = true ); // test the border teeth shape for a full chunk *borderTeethFull( - length = chunkLength, + length = getChunkLength(), thickness = getSlotWidth(), - slotDepth = borderSlotDepth, - edge = borderBottomEdge, + slotDepth = getSlotDepth(), + edge = getBottomEdge(), negative = true, center = true ); // test the bottom border mount shape for a straight chunk *straightBorderBottom( - length = chunkLength, + length = getChunkLength(), sheetThickness = getSlotWidth(), - slotDepth = borderSlotDepth, - borderEdge = borderBottomEdge, - toothEdge = borderToothEdge + slotDepth = getSlotDepth(), + borderEdge = getBottomEdge(), + toothEdge = getToothEdge() ); // test the top border mount shape for a straight chunk *straightBorderTop( - length = chunkLength, + length = getChunkLength(), sheetThickness = getSlotWidth(), - slotDepth = borderSlotDepth, - borderEdge = borderTopEdge, - toothEdge = borderToothEdge + slotDepth = getSlotDepth(), + borderEdge = getTopEdge(), + toothEdge = getToothEdge() ); // test the curved border tooth *curveBorderTooth( - radius = chunkLength, + radius = getChunkLength(), thickness = getSlotWidth(), - slotDepth = borderSlotDepth, - edge = borderToothEdge, + slotDepth = getSlotDepth(), + edge = getToothEdge(), direction = 1, negative = true ); // test the bottom border mount shape for a curved chunk - curveBorderBottom( - length = chunkLength, + *curveBorderBottom( + length = getChunkLength(), sheetThickness = getSlotWidth(), - slotDepth = borderSlotDepth, - borderEdge = borderBottomEdge, - toothEdge = borderToothEdge, + slotDepth = getSlotDepth(), + borderEdge = getBottomEdge(), + toothEdge = getToothEdge(), ratio = 1 ); // test the top border mount shape for a curved chunk *curveBorderTop( - length = chunkLength, + length = getChunkLength(), sheetThickness = getSlotWidth(), - slotDepth = borderSlotDepth, - borderEdge = borderTopEdge, - toothEdge = borderToothEdge, + slotDepth = getSlotDepth(), + borderEdge = getTopEdge(), + toothEdge = getToothEdge(), ratio = 1 ); // test the border sheet shape for a straight chunk *borderSheet( - length = getCurveRemainingLength(chunkLength), - height = borderHeight, - thickness = borderThickness, - slotDepth = borderSlotDepth, - toothEdge = borderToothEdge + length = getCurveRemainingLength(getChunkLength()), + height = getSheetHeight(), + thickness = getSheetThickness(), + slotDepth = getSlotDepth(), + toothEdge = getToothEdge() ); // test the full border sheet shape for a straight chunk - *borderSheetFull( - length = chunkLength, - height = borderHeight, - thickness = borderThickness, - slotDepth = borderSlotDepth, - toothEdge = borderToothEdge + borderSheetFull( + length = getChunkLength(), + height = getSheetHeight(), + thickness = getSheetThickness(), + slotDepth = getSlotDepth(), + toothEdge = getToothEdge() ); } diff --git a/rcmodels/tracks/top-border-curved.scad b/rcmodels/tracks/top-border-curved.scad index 931fe49..f1904a1 100644 --- a/rcmodels/tracks/top-border-curved.scad +++ b/rcmodels/tracks/top-border-curved.scad @@ -38,11 +38,11 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) curveBorderTop( - length = chunkLength, + length = getChunkLength(), sheetThickness = getSlotWidth(), - slotDepth = borderSlotDepth, - borderEdge = borderTopEdge, - toothEdge = borderToothEdge, + slotDepth = getSlotDepth(), + borderEdge = getTopEdge(), + toothEdge = getToothEdge(), ratio = 1 ); } diff --git a/rcmodels/tracks/top-border-straight.scad b/rcmodels/tracks/top-border-straight.scad index 4a2b999..77f5b78 100644 --- a/rcmodels/tracks/top-border-straight.scad +++ b/rcmodels/tracks/top-border-straight.scad @@ -38,10 +38,10 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) straightBorderTop( - length = chunkLength, + length = getChunkLength(), sheetThickness = getSlotWidth(), - slotDepth = borderSlotDepth, - borderEdge = borderTopEdge, - toothEdge = borderToothEdge + slotDepth = getSlotDepth(), + borderEdge = getTopEdge(), + toothEdge = getToothEdge() ); } diff --git a/rcmodels/tracks/util/functions.scad b/rcmodels/tracks/util/functions.scad index 74fac44..19e0045 100644 --- a/rcmodels/tracks/util/functions.scad +++ b/rcmodels/tracks/util/functions.scad @@ -41,13 +41,49 @@ function adjustToLayer(height) = roundBy(height, printResolution); * @param Number width * @returns Number */ -function adjustToNozzle(width) = roundBy(width, nozzle); +function adjustToNozzle(width) = roundBy(width, nozzleWidth); + +/** + * Gets the thickness of the border sheet, adjusted to better fit the printer. + * @returns Number + */ +function getSheetThickness() = adjustToLayer(borderThickness); + +/** + * Gets the width of the bottom border edge, adjusted to better fit the printer. + * @returns Number + */ +function getBottomEdge() = adjustToNozzle(borderBottomEdge); + +/** + * Gets the width of the top border edge, adjusted to better fit the printer. + * @returns Number + */ +function getTopEdge() = adjustToNozzle(borderTopEdge); + +/** + * Gets the width of the border tooth edge, adjusted to better fit the printer. + * @returns Number + */ +function getToothEdge() = adjustToNozzle(borderToothEdge); /** * Gets the width of the slot that will hold the border sheet. * @returns Number */ -function getSlotWidth() = borderThickness + printTolerance; +function getSlotWidth() = getSheetThickness() + printTolerance; + +/** + * Gets the depth of the slot that will hold the border sheet. + * @returns Number + */ +function getSlotDepth() = adjustToLayer(borderSlotDepth); + +/** + * Gets the length of a track chunk. + * @returns Number + */ +function getChunkLength() = chunkLength; /** * Gets the length of a curved chunk (the length of the arc of the curve). @@ -91,7 +127,7 @@ function getBorderHeight() = * Gets the minimal length for a simple sheet (a sheet that should fit between 2 border teeth) * @returns Number */ -function getMinSheetLength() = 5 * borderToothEdge; +function getMinSheetLength() = 5 * getToothEdge(); /** * Gets the minimal length for a straight chunk From 2b5d06b0e2bd4f497da6033ee41d111a80587a93 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 25 Jan 2020 19:37:31 +0100 Subject: [PATCH 034/191] Use borderToothProfile() instead of getBorderToothPoints() in borderTooth() --- rcmodels/tracks/shapes/straight.scad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index f9070b2..dbf0f4d 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -41,12 +41,12 @@ */ module borderTooth(thickness, slotDepth, edge, direction=1, negative=false, center=false) { negativeExtrude(height=thickness, center=center) { - polygon(getBorderToothPoints( + borderToothProfile( slotDepth = slotDepth, edge = edge, direction = direction, negative = negative - )); + ); } } From a66ee53ebb427d32b25e247d938252e269fe2344 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 25 Jan 2020 20:37:30 +0100 Subject: [PATCH 035/191] Remove default values from the render script --- rcmodels/tracks/render.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index 50dd898..ce7922b 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -27,9 +27,9 @@ # # application params -heightWithFasteners=1 -chunkLength=200 -borderHeight=50 +heightWithFasteners= +chunkLength= +borderHeight= # script config scriptpath=$(dirname $0) @@ -62,8 +62,8 @@ while (( "$#" )); do echo -e "${C_CTX}\t$0 [-h|--help] [-o|--option value] files${C_RST}" echo echo -e "${C_MSG} -h, --help ${C_RST}Show this help" - echo -e "${C_MSG} -l, --chunkLength ${C_RST}Set the length of a track chunk (default: ${chunkLength}" - echo -e "${C_MSG} -w --borderHeight ${C_RST}Set the height of the track border (default: ${borderHeight}" + echo -e "${C_MSG} -l, --chunkLength ${C_RST}Set the length of a track chunk" + echo -e "${C_MSG} -w --borderHeight ${C_RST}Set the height of the track border" echo -e "${C_MSG} -i, --innerHeight ${C_RST}The height of the border does not contains the size of the mount fasteners" echo -e "${C_MSG} -o, --outerHeight ${C_RST}The height of the border contains the size of the mount fasteners" echo @@ -86,6 +86,6 @@ scadcheck # render the files, if exist scadtostlall "${srcpath}" "${dstpath}" "" \ - "chunkLength=${chunkLength}" \ - "borderHeight=${borderHeight}" \ - "heightWithFasteners=${heightWithFasteners}" + "$(varif "chunkLength" ${chunkLength})" \ + "$(varif "borderHeight" ${borderHeight})" \ + "$(varif "heightWithFasteners" ${heightWithFasteners})" From 915bd1d5730fade5d5c3d74485d2315125d712a3 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 25 Jan 2020 20:51:21 +0100 Subject: [PATCH 036/191] Tweak the fit tolerance --- rcmodels/tracks/border-sheet-curve.scad | 2 +- rcmodels/tracks/border-sheet-full.scad | 2 +- rcmodels/tracks/bottom-border-curved.scad | 2 +- rcmodels/tracks/bottom-border-straight.scad | 2 +- rcmodels/tracks/test/wip.scad | 12 ++++++------ rcmodels/tracks/top-border-curved.scad | 2 +- rcmodels/tracks/top-border-straight.scad | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/rcmodels/tracks/border-sheet-curve.scad b/rcmodels/tracks/border-sheet-curve.scad index b901f95..b40c64c 100644 --- a/rcmodels/tracks/border-sheet-curve.scad +++ b/rcmodels/tracks/border-sheet-curve.scad @@ -42,6 +42,6 @@ applyMode(mode=renderMode) { height = getSheetHeight(), thickness = getSheetThickness(), slotDepth = getSlotDepth(), - toothEdge = getToothEdge() + toothEdge = getToothEdge() + printTolerance ); } diff --git a/rcmodels/tracks/border-sheet-full.scad b/rcmodels/tracks/border-sheet-full.scad index 0d05585..75bb5b4 100644 --- a/rcmodels/tracks/border-sheet-full.scad +++ b/rcmodels/tracks/border-sheet-full.scad @@ -42,6 +42,6 @@ applyMode(mode=renderMode) { height = getSheetHeight(), thickness = getSheetThickness(), slotDepth = getSlotDepth(), - toothEdge = getToothEdge() + toothEdge = getToothEdge() + printTolerance ); } diff --git a/rcmodels/tracks/bottom-border-curved.scad b/rcmodels/tracks/bottom-border-curved.scad index 168a461..0dae807 100644 --- a/rcmodels/tracks/bottom-border-curved.scad +++ b/rcmodels/tracks/bottom-border-curved.scad @@ -42,7 +42,7 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getBottomEdge(), - toothEdge = getToothEdge(), + toothEdge = getToothEdge() - printTolerance, ratio = 1 ); } diff --git a/rcmodels/tracks/bottom-border-straight.scad b/rcmodels/tracks/bottom-border-straight.scad index ca2a5ac..36b8ecf 100644 --- a/rcmodels/tracks/bottom-border-straight.scad +++ b/rcmodels/tracks/bottom-border-straight.scad @@ -42,6 +42,6 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getBottomEdge(), - toothEdge = getToothEdge() + toothEdge = getToothEdge() - printTolerance ); } diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 8d34856..472afc9 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -94,7 +94,7 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getBottomEdge(), - toothEdge = getToothEdge() + toothEdge = getToothEdge() - printTolerance ); // test the top border mount shape for a straight chunk *straightBorderTop( @@ -102,7 +102,7 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getTopEdge(), - toothEdge = getToothEdge() + toothEdge = getToothEdge() - printTolerance ); // test the curved border tooth *curveBorderTooth( @@ -119,7 +119,7 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getBottomEdge(), - toothEdge = getToothEdge(), + toothEdge = getToothEdge() - printTolerance, ratio = 1 ); // test the top border mount shape for a curved chunk @@ -128,7 +128,7 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getTopEdge(), - toothEdge = getToothEdge(), + toothEdge = getToothEdge() - printTolerance, ratio = 1 ); // test the border sheet shape for a straight chunk @@ -137,7 +137,7 @@ applyMode(mode=renderMode) { height = getSheetHeight(), thickness = getSheetThickness(), slotDepth = getSlotDepth(), - toothEdge = getToothEdge() + toothEdge = getToothEdge() + printTolerance ); // test the full border sheet shape for a straight chunk borderSheetFull( @@ -145,6 +145,6 @@ applyMode(mode=renderMode) { height = getSheetHeight(), thickness = getSheetThickness(), slotDepth = getSlotDepth(), - toothEdge = getToothEdge() + toothEdge = getToothEdge() + printTolerance ); } diff --git a/rcmodels/tracks/top-border-curved.scad b/rcmodels/tracks/top-border-curved.scad index f1904a1..d7e649e 100644 --- a/rcmodels/tracks/top-border-curved.scad +++ b/rcmodels/tracks/top-border-curved.scad @@ -42,7 +42,7 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getTopEdge(), - toothEdge = getToothEdge(), + toothEdge = getToothEdge() - printTolerance, ratio = 1 ); } diff --git a/rcmodels/tracks/top-border-straight.scad b/rcmodels/tracks/top-border-straight.scad index 77f5b78..9cd675b 100644 --- a/rcmodels/tracks/top-border-straight.scad +++ b/rcmodels/tracks/top-border-straight.scad @@ -42,6 +42,6 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getTopEdge(), - toothEdge = getToothEdge() + toothEdge = getToothEdge() - printTolerance ); } From 6011b1327b54bd5406542f3e1f18b42817230b00 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 25 Jan 2020 21:39:13 +0100 Subject: [PATCH 037/191] Tweak the config --- rcmodels/tracks/config/config.scad | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 32f258e..f895c38 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -44,9 +44,9 @@ heightWithFasteners = true; // Should the height be with or without the faste chunkLength = 200; // The constraints of the track border -borderHeight = 50; +borderHeight = 40; borderThickness = 0.6; borderTopEdge = 1; -borderToothEdge = 2; +borderToothEdge = 1; borderBottomEdge = 2; -borderSlotDepth = 6; +borderSlotDepth = 8; From ec1de37ad41bb028d7653e05d8dd3dedac4823ec Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 26 Jan 2020 14:17:08 +0100 Subject: [PATCH 038/191] Use better name (notch instead of tooth) --- rcmodels/tracks/border-sheet-curve.scad | 2 +- rcmodels/tracks/border-sheet-full.scad | 2 +- rcmodels/tracks/bottom-border-curved.scad | 2 +- rcmodels/tracks/bottom-border-straight.scad | 2 +- rcmodels/tracks/config/config.scad | 2 +- rcmodels/tracks/shapes/curve.scad | 32 ++++++------ rcmodels/tracks/shapes/profiles.scad | 24 ++++----- rcmodels/tracks/shapes/straight.scad | 56 ++++++++++----------- rcmodels/tracks/test/wip.scad | 48 +++++++++--------- rcmodels/tracks/top-border-curved.scad | 2 +- rcmodels/tracks/top-border-straight.scad | 2 +- rcmodels/tracks/util/functions.scad | 8 +-- 12 files changed, 91 insertions(+), 91 deletions(-) diff --git a/rcmodels/tracks/border-sheet-curve.scad b/rcmodels/tracks/border-sheet-curve.scad index b40c64c..35b9cbf 100644 --- a/rcmodels/tracks/border-sheet-curve.scad +++ b/rcmodels/tracks/border-sheet-curve.scad @@ -42,6 +42,6 @@ applyMode(mode=renderMode) { height = getSheetHeight(), thickness = getSheetThickness(), slotDepth = getSlotDepth(), - toothEdge = getToothEdge() + printTolerance + notchEdge = getNotchEdge() + printTolerance ); } diff --git a/rcmodels/tracks/border-sheet-full.scad b/rcmodels/tracks/border-sheet-full.scad index 75bb5b4..7a2c79a 100644 --- a/rcmodels/tracks/border-sheet-full.scad +++ b/rcmodels/tracks/border-sheet-full.scad @@ -42,6 +42,6 @@ applyMode(mode=renderMode) { height = getSheetHeight(), thickness = getSheetThickness(), slotDepth = getSlotDepth(), - toothEdge = getToothEdge() + printTolerance + notchEdge = getNotchEdge() + printTolerance ); } diff --git a/rcmodels/tracks/bottom-border-curved.scad b/rcmodels/tracks/bottom-border-curved.scad index 0dae807..77b908d 100644 --- a/rcmodels/tracks/bottom-border-curved.scad +++ b/rcmodels/tracks/bottom-border-curved.scad @@ -42,7 +42,7 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getBottomEdge(), - toothEdge = getToothEdge() - printTolerance, + notchEdge = getNotchEdge() - printTolerance, ratio = 1 ); } diff --git a/rcmodels/tracks/bottom-border-straight.scad b/rcmodels/tracks/bottom-border-straight.scad index 36b8ecf..41c6880 100644 --- a/rcmodels/tracks/bottom-border-straight.scad +++ b/rcmodels/tracks/bottom-border-straight.scad @@ -42,6 +42,6 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getBottomEdge(), - toothEdge = getToothEdge() - printTolerance + notchEdge = getNotchEdge() - printTolerance ); } diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index f895c38..19341d8 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -47,6 +47,6 @@ chunkLength = 200; borderHeight = 40; borderThickness = 0.6; borderTopEdge = 1; -borderToothEdge = 1; +borderNotchEdge = 1; borderBottomEdge = 2; borderSlotDepth = 8; diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad index 2b339a7..d50a9ce 100644 --- a/rcmodels/tracks/shapes/curve.scad +++ b/rcmodels/tracks/shapes/curve.scad @@ -31,15 +31,15 @@ */ /** - * Draws the shape of a curved border mount tooth. + * Draws the shape of a curved border mount notch. * @param Number radius - The radius of the curve. * @param Number thickness - The thickness of the shape * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the border mount. + * @param Number edge - The width of each edge of the notch. * @param Number [direction] - The direction of the shape (1: right, -1: left) * @param Boolean [negative] - The shape will be used in a difference operation */ -module curveBorderTooth(radius, thickness, slotDepth, edge, direction=1, negative=false) { +module curveBorderNotch(radius, thickness, slotDepth, edge, direction=1, negative=false) { start = negative ? 1 : 0; direction = direction >= 0 ? 1 : -1; length = edge * 2; @@ -76,20 +76,20 @@ module curveBorderTooth(radius, thickness, slotDepth, edge, direction=1, negativ } /** - * Draws the shape of a curved border mount teeth for a full chunk. + * Draws the shape of a curved border mount notches for a full chunk. * @param Number radius - The radius of the curve. * @param Number length - The length of a chunk * @param Number angle - The angle of the curve * @param Number thickness - The thickness of the shape * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the border mount. + * @param Number edge - The width of each edge of the notch. * @param Boolean [negative] - The shape will be used in a difference operation */ -module curveBorderTeeth(radius, length, angle, thickness, slotDepth, edge, negative=false) { +module curveBorderNotches(radius, length, angle, thickness, slotDepth, edge, negative=false) { rotateZ(angle) { repeatMirror(axis=[0, 1, 0]) { rotateZ(-angle) { - curveBorderTooth( + curveBorderNotch( radius = radius, thickness = thickness, slotDepth = slotDepth, @@ -99,7 +99,7 @@ module curveBorderTeeth(radius, length, angle, thickness, slotDepth, edge, negat ); rotateZ(getArcAngle(radius = radius, length = length / 2)) { repeatMirror(axis=[0, 1, 0]) { - curveBorderTooth( + curveBorderNotch( radius = radius, thickness = thickness, slotDepth = slotDepth, @@ -120,10 +120,10 @@ module curveBorderTeeth(radius, length, angle, thickness, slotDepth, edge, negat * @param Number sheetThickness - The thickness of the sheet the border mount will hold. * @param Number slotDepth - The depth of the slot that will hold the border sheet. * @param Number borderEdge - The width of each edge of the border mount. - * @param Number toothEdge - The width of a tooth edge. + * @param Number notchEdge - The width of a notch edge. * @param Number ratio - The ratio of the chunk */ -module curveBorderBottom(length, sheetThickness, slotDepth, borderEdge, toothEdge, ratio = 1) { +module curveBorderBottom(length, sheetThickness, slotDepth, borderEdge, notchEdge, ratio = 1) { radius = length * ratio; defaultAngle = 90; angle = defaultAngle / ratio; @@ -140,13 +140,13 @@ module curveBorderBottom(length, sheetThickness, slotDepth, borderEdge, toothEdg } translateZ(borderEdge) { - curveBorderTeeth( + curveBorderNotches( radius = radius, length = length, angle = angle / 2, thickness = borderEdge, slotDepth = slotDepth, - edge = toothEdge, + edge = notchEdge, negative=false ); } @@ -159,10 +159,10 @@ module curveBorderBottom(length, sheetThickness, slotDepth, borderEdge, toothEdg * @param Number sheetThickness - The thickness of the sheet the border mount will hold. * @param Number slotDepth - The depth of the slot that will hold the border sheet. * @param Number borderEdge - The width of each edge of the border mount. - * @param Number toothEdge - The width of a tooth edge. + * @param Number notchEdge - The width of a notch edge. * @param Number ratio - The ratio of the chunk */ -module curveBorderTop(length, sheetThickness, slotDepth, borderEdge, toothEdge, ratio = 1) { +module curveBorderTop(length, sheetThickness, slotDepth, borderEdge, notchEdge, ratio = 1) { radius = length * ratio; defaultAngle = 90; angle = defaultAngle / ratio; @@ -179,13 +179,13 @@ module curveBorderTop(length, sheetThickness, slotDepth, borderEdge, toothEdge, } translateZ(borderEdge) { - curveBorderTeeth( + curveBorderNotches( radius = radius, length = length, angle = angle / 2, thickness = borderEdge, slotDepth = slotDepth, - edge = toothEdge, + edge = notchEdge, negative=false ); } diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index 534d3af..f77c47b 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -80,14 +80,14 @@ function getBorderTopPoints(slotWidth, slotDepth, edge) = ; /** - * Computes the points defining the profile of a border mount tooth. + * Computes the points defining the profile of a border mount notch. * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the border mount. + * @param Number edge - The width of each edge of the notch. * @param Number [direction] - The direction of the shape (1: right, -1: left) * @param Boolean [negative] - The shape will be used in a difference operation * @returns Vector[] */ -function getBorderToothPoints(slotDepth, edge, direction=1, negative=false) = +function getBorderNotchPoints(slotDepth, edge, direction=1, negative=false) = let( start = negative ? 1 : 0, direction = direction >= 0 ? 1 : -1, @@ -131,14 +131,14 @@ module borderTopProfile(slotWidth, slotDepth, edge) { } /** - * Draws the profile of a border mount tooth. + * Draws the profile of a border mount notch. * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the border mount. + * @param Number edge - The width of each edge of the notch. * @param Number [direction] - The direction of the shape (1: right, -1: left) * @param Boolean [negative] - The shape will be used in a difference operation */ -module borderToothProfile(slotDepth, edge, direction=1, negative=false) { - polygon(getBorderToothPoints( +module borderNotchProfile(slotDepth, edge, direction=1, negative=false) { + polygon(getBorderNotchPoints( slotDepth = slotDepth, edge = edge, direction = direction, @@ -147,21 +147,21 @@ module borderToothProfile(slotDepth, edge, direction=1, negative=false) { } /** - * Draws the profile of a set of border mount teeth. + * Draws the profile of a set of border mount notches. * @param Number length - The length of the set * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the border mount. + * @param Number edge - The width of each edge of the notch. * @param Boolean [negative] - The shape will be used in a difference operation */ -module borderTeethProfile(length, slotDepth, edge, negative=false) { - borderToothProfile( +module borderNotchesProfile(length, slotDepth, edge, negative=false) { + borderNotchProfile( slotDepth = slotDepth, edge = edge, direction = 1, negative = negative ); translateX(length) { - borderToothProfile( + borderNotchProfile( slotDepth = slotDepth, edge = edge, direction = -1, diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index dbf0f4d..fd168c6 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -31,17 +31,17 @@ */ /** - * Draws the shape of border mount tooth. + * Draws the shape of border mount notch. * @param Number thickness - The thickness of the shape * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the border mount. + * @param Number edge - The width of each edge of the notch. * @param Number [direction] - The direction of the shape (1: right, -1: left) * @param Boolean [negative] - The shape will be used in a difference operation * @param Boolean [center] - The shape is centered vertically */ -module borderTooth(thickness, slotDepth, edge, direction=1, negative=false, center=false) { +module borderNotch(thickness, slotDepth, edge, direction=1, negative=false, center=false) { negativeExtrude(height=thickness, center=center) { - borderToothProfile( + borderNotchProfile( slotDepth = slotDepth, edge = edge, direction = direction, @@ -51,17 +51,17 @@ module borderTooth(thickness, slotDepth, edge, direction=1, negative=false, cent } /** - * Draws the shape of border mount teeth. + * Draws the shape of border mount notches. * @param Number length - The length of the chunk * @param Number thickness - The thickness of the shape * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the border mount. + * @param Number edge - The width of each edge of the notch. * @param Boolean [negative] - The shape will be used in a difference operation * @param Boolean [center] - The shape is centered vertically */ -module borderTeeth(length, thickness, slotDepth, edge, negative=false, center=false) { +module borderNotches(length, thickness, slotDepth, edge, negative=false, center=false) { negativeExtrude(height=thickness, center=center) { - borderTeethProfile( + borderNotchesProfile( length = length, slotDepth = slotDepth, edge = edge, @@ -71,17 +71,17 @@ module borderTeeth(length, thickness, slotDepth, edge, negative=false, center=fa } /** - * Draws the shape of border mount teeth for a full chunk. + * Draws the shape of border mount notches for a full chunk. * @param Number length - The length of the chunk * @param Number thickness - The thickness of the shape * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the border mount. + * @param Number edge - The width of each edge of the notch. * @param Boolean [negative] - The shape will be used in a difference operation * @param Boolean [center] - The shape is centered vertically */ -module borderTeethFull(length, thickness, slotDepth, edge, negative=false, center=false) { +module borderNotchesFull(length, thickness, slotDepth, edge, negative=false, center=false) { repeatMirror() { - borderTeeth( + borderNotches( length = length / 2, thickness = thickness, slotDepth = slotDepth, @@ -98,9 +98,9 @@ module borderTeethFull(length, thickness, slotDepth, edge, negative=false, cente * @param Number sheetThickness - The thickness of the sheet the border mount will hold. * @param Number slotDepth - The depth of the slot that will hold the border sheet. * @param Number borderEdge - The width of each edge of the border mount. - * @param Number toothEdge - The width of a tooth edge. + * @param Number notchEdge - The width of a notch edge. */ -module straightBorderBottom(length, sheetThickness, slotDepth, borderEdge, toothEdge) { +module straightBorderBottom(length, sheetThickness, slotDepth, borderEdge, notchEdge) { rotate([90, 0, 90]) { negativeExtrude(height=length, center=true) { borderBottomProfile( @@ -112,11 +112,11 @@ module straightBorderBottom(length, sheetThickness, slotDepth, borderEdge, tooth } translateZ(borderEdge) { rotateX(90) { - borderTeethFull( + borderNotchesFull( length = length, thickness = sheetThickness, slotDepth = slotDepth, - edge = toothEdge, + edge = notchEdge, negative = false, center = true ); @@ -130,9 +130,9 @@ module straightBorderBottom(length, sheetThickness, slotDepth, borderEdge, tooth * @param Number sheetThickness - The thickness of the sheet the border mount will hold. * @param Number slotDepth - The depth of the slot that will hold the border sheet. * @param Number borderEdge - The width of each edge of the border mount. - * @param Number toothEdge - The width of a tooth edge. + * @param Number notchEdge - The width of a notch edge. */ -module straightBorderTop(length, sheetThickness, slotDepth, borderEdge, toothEdge) { +module straightBorderTop(length, sheetThickness, slotDepth, borderEdge, notchEdge) { rotate([90, 0, 90]) { negativeExtrude(height=length, center=true) { borderTopProfile( @@ -144,11 +144,11 @@ module straightBorderTop(length, sheetThickness, slotDepth, borderEdge, toothEdg } translateZ(borderEdge) { rotateX(90) { - borderTeethFull( + borderNotchesFull( length = length, thickness = sheetThickness, slotDepth = slotDepth, - edge = toothEdge, + edge = notchEdge, negative = false, center = true ); @@ -162,20 +162,20 @@ module straightBorderTop(length, sheetThickness, slotDepth, borderEdge, toothEdg * @param Number height - The height of the chunk * @param Number thickness - The thickness of the border sheet. * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number toothEdge - The width of a tooth edge. + * @param Number notchEdge - The width of a notch edge. */ -module borderSheet(length, height, thickness, slotDepth, toothEdge) { +module borderSheet(length, height, thickness, slotDepth, notchEdge) { difference() { box(size = [length, height, thickness], center = true); repeatMirror(axis=[0, 1, 0]) { translateY(-height / 2) { translateX(-length / 2) { - borderTeeth( + borderNotches( length = length, thickness = thickness + 1, slotDepth = slotDepth, - edge = toothEdge, + edge = notchEdge, negative = true, center = true ); @@ -191,19 +191,19 @@ module borderSheet(length, height, thickness, slotDepth, toothEdge) { * @param Number height - The height of the chunk * @param Number thickness - The thickness of the border sheet. * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number toothEdge - The width of a tooth edge. + * @param Number notchEdge - The width of a notch edge. */ -module borderSheetFull(length, height, thickness, slotDepth, toothEdge) { +module borderSheetFull(length, height, thickness, slotDepth, notchEdge) { difference() { box(size = [length, height, thickness], center = true); repeatMirror(axis=[0, 1, 0]) { translateY(-height / 2) { - borderTeethFull( + borderNotchesFull( length = length, thickness = thickness + 1, slotDepth = slotDepth, - edge = toothEdge, + edge = notchEdge, negative = true, center = true ); diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 472afc9..557580d 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -47,44 +47,44 @@ applyMode(mode=renderMode) { slotDepth = getSlotDepth(), edge = getTopEdge() ); - // test the border tooth profile - *borderToothProfile( + // test the border notch profile + *borderNotchProfile( slotDepth = getSlotDepth(), - edge = getBottomEdge(), + edge = getNotchEdge(), direction = -1, negative = true ); - // test the border teeth profile - *borderTeethProfile( + // test the border notches profile + *borderNotchesProfile( length = getChunkLength() / 2, slotDepth = getSlotDepth(), - edge = getBottomEdge(), + edge = getNotchEdge(), negative = true ); - // test the border tooth shape - *borderTooth( + // test the border notch shape + *borderNotch( thickness = getSlotWidth(), slotDepth = getSlotDepth(), - edge = getBottomEdge(), + edge = getNotchEdge(), direction = -1, negative = true, center = true ); - // test the border teeth shape - *borderTeeth( + // test the border notches shape + *borderNotches( length = getChunkLength(), thickness = getSlotWidth(), slotDepth = getSlotDepth(), - edge = getBottomEdge(), + edge = getNotchEdge(), negative = true, center = true ); - // test the border teeth shape for a full chunk - *borderTeethFull( + // test the border notches shape for a full chunk + *borderNotchesFull( length = getChunkLength(), thickness = getSlotWidth(), slotDepth = getSlotDepth(), - edge = getBottomEdge(), + edge = getNotchEdge(), negative = true, center = true ); @@ -94,7 +94,7 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getBottomEdge(), - toothEdge = getToothEdge() - printTolerance + notchEdge = getNotchEdge() ); // test the top border mount shape for a straight chunk *straightBorderTop( @@ -102,14 +102,14 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getTopEdge(), - toothEdge = getToothEdge() - printTolerance + notchEdge = getNotchEdge() ); - // test the curved border tooth - *curveBorderTooth( + // test the curved border notch + *curveBorderNotch( radius = getChunkLength(), thickness = getSlotWidth(), slotDepth = getSlotDepth(), - edge = getToothEdge(), + edge = getNotchEdge(), direction = 1, negative = true ); @@ -119,7 +119,7 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getBottomEdge(), - toothEdge = getToothEdge() - printTolerance, + notchEdge = getNotchEdge(), ratio = 1 ); // test the top border mount shape for a curved chunk @@ -128,7 +128,7 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getTopEdge(), - toothEdge = getToothEdge() - printTolerance, + notchEdge = getNotchEdge(), ratio = 1 ); // test the border sheet shape for a straight chunk @@ -137,7 +137,7 @@ applyMode(mode=renderMode) { height = getSheetHeight(), thickness = getSheetThickness(), slotDepth = getSlotDepth(), - toothEdge = getToothEdge() + printTolerance + notchEdge = getNotchEdge() ); // test the full border sheet shape for a straight chunk borderSheetFull( @@ -145,6 +145,6 @@ applyMode(mode=renderMode) { height = getSheetHeight(), thickness = getSheetThickness(), slotDepth = getSlotDepth(), - toothEdge = getToothEdge() + printTolerance + notchEdge = getNotchEdge() ); } diff --git a/rcmodels/tracks/top-border-curved.scad b/rcmodels/tracks/top-border-curved.scad index d7e649e..e4d09bd 100644 --- a/rcmodels/tracks/top-border-curved.scad +++ b/rcmodels/tracks/top-border-curved.scad @@ -42,7 +42,7 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getTopEdge(), - toothEdge = getToothEdge() - printTolerance, + notchEdge = getNotchEdge() - printTolerance, ratio = 1 ); } diff --git a/rcmodels/tracks/top-border-straight.scad b/rcmodels/tracks/top-border-straight.scad index 9cd675b..4344865 100644 --- a/rcmodels/tracks/top-border-straight.scad +++ b/rcmodels/tracks/top-border-straight.scad @@ -42,6 +42,6 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getTopEdge(), - toothEdge = getToothEdge() - printTolerance + notchEdge = getNotchEdge() - printTolerance ); } diff --git a/rcmodels/tracks/util/functions.scad b/rcmodels/tracks/util/functions.scad index 19e0045..2c4816c 100644 --- a/rcmodels/tracks/util/functions.scad +++ b/rcmodels/tracks/util/functions.scad @@ -62,10 +62,10 @@ function getBottomEdge() = adjustToNozzle(borderBottomEdge); function getTopEdge() = adjustToNozzle(borderTopEdge); /** - * Gets the width of the border tooth edge, adjusted to better fit the printer. + * Gets the width of the border notch edge, adjusted to better fit the printer. * @returns Number */ -function getToothEdge() = adjustToNozzle(borderToothEdge); +function getNotchEdge() = adjustToNozzle(borderNotchEdge); /** * Gets the width of the slot that will hold the border sheet. @@ -124,10 +124,10 @@ function getBorderHeight() = ; /** - * Gets the minimal length for a simple sheet (a sheet that should fit between 2 border teeth) + * Gets the minimal length for a simple sheet (a sheet that should fit between 2 border notches) * @returns Number */ -function getMinSheetLength() = 5 * getToothEdge(); +function getMinSheetLength() = 5 * getNotchEdge(); /** * Gets the minimal length for a straight chunk From c6af719fc21c6f9cd239c131a82c420864c894cc Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 26 Jan 2020 19:42:58 +0100 Subject: [PATCH 039/191] Add a hook to better fasten chunks together --- rcmodels/tracks/border-sheet-curve.scad | 2 +- rcmodels/tracks/border-sheet-full.scad | 2 +- rcmodels/tracks/bottom-border-curved.scad | 2 +- rcmodels/tracks/bottom-border-straight.scad | 2 +- rcmodels/tracks/config/config.scad | 6 +- rcmodels/tracks/shapes/curve.scad | 121 +++++++++++++------ rcmodels/tracks/shapes/straight.scad | 125 ++++++++++++++------ rcmodels/tracks/test/wip.scad | 6 + rcmodels/tracks/top-border-curved.scad | 2 +- rcmodels/tracks/top-border-straight.scad | 2 +- rcmodels/tracks/util/functions.scad | 2 +- 11 files changed, 188 insertions(+), 84 deletions(-) diff --git a/rcmodels/tracks/border-sheet-curve.scad b/rcmodels/tracks/border-sheet-curve.scad index 35b9cbf..c2e525f 100644 --- a/rcmodels/tracks/border-sheet-curve.scad +++ b/rcmodels/tracks/border-sheet-curve.scad @@ -42,6 +42,6 @@ applyMode(mode=renderMode) { height = getSheetHeight(), thickness = getSheetThickness(), slotDepth = getSlotDepth(), - notchEdge = getNotchEdge() + printTolerance + notchEdge = getNotchEdge() ); } diff --git a/rcmodels/tracks/border-sheet-full.scad b/rcmodels/tracks/border-sheet-full.scad index 7a2c79a..8f7d5aa 100644 --- a/rcmodels/tracks/border-sheet-full.scad +++ b/rcmodels/tracks/border-sheet-full.scad @@ -42,6 +42,6 @@ applyMode(mode=renderMode) { height = getSheetHeight(), thickness = getSheetThickness(), slotDepth = getSlotDepth(), - notchEdge = getNotchEdge() + printTolerance + notchEdge = getNotchEdge() ); } diff --git a/rcmodels/tracks/bottom-border-curved.scad b/rcmodels/tracks/bottom-border-curved.scad index 77b908d..94f5e91 100644 --- a/rcmodels/tracks/bottom-border-curved.scad +++ b/rcmodels/tracks/bottom-border-curved.scad @@ -42,7 +42,7 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getBottomEdge(), - notchEdge = getNotchEdge() - printTolerance, + notchEdge = getNotchEdge(), ratio = 1 ); } diff --git a/rcmodels/tracks/bottom-border-straight.scad b/rcmodels/tracks/bottom-border-straight.scad index 41c6880..0225021 100644 --- a/rcmodels/tracks/bottom-border-straight.scad +++ b/rcmodels/tracks/bottom-border-straight.scad @@ -42,6 +42,6 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getBottomEdge(), - notchEdge = getNotchEdge() - printTolerance + notchEdge = getNotchEdge() ); } diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 19341d8..88c4a65 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -46,7 +46,7 @@ chunkLength = 200; // The constraints of the track border borderHeight = 40; borderThickness = 0.6; -borderTopEdge = 1; -borderNotchEdge = 1; +borderTopEdge = 2; borderBottomEdge = 2; -borderSlotDepth = 8; +borderNotchEdge = 2; +borderSlotDepth = 6; diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad index d50a9ce..845eaaf 100644 --- a/rcmodels/tracks/shapes/curve.scad +++ b/rcmodels/tracks/shapes/curve.scad @@ -127,29 +127,51 @@ module curveBorderBottom(length, sheetThickness, slotDepth, borderEdge, notchEdg radius = length * ratio; defaultAngle = 90; angle = defaultAngle / ratio; + ratioAngle = defaultAngle - angle; - rotateZ((defaultAngle - angle) / 2) { - rotate_extrude(angle=angle, convexity=10) { + rotateZ(ratioAngle / 2) { + difference() { + union() { + rotate_extrude(angle=angle, convexity=10) { + translateX(radius) { + borderBottomProfile( + slotWidth = sheetThickness + printTolerance, + slotDepth = slotDepth, + edge = borderEdge + ); + } + } + translateZ(borderEdge) { + curveBorderNotches( + radius = radius, + length = length, + angle = angle / 2, + thickness = borderEdge + borderEdge, + slotDepth = slotDepth, + edge = notchEdge - printTolerance, + negative=false + ); + } + rotateZ(-ratioAngle) { + translateY(radius) { + borderHook( + edge = notchEdge, + thickness = borderEdge - printResolution * 2, + negative = false + ); + } + } + } translateX(radius) { - borderBottomProfile( - slotWidth = sheetThickness, - slotDepth = slotDepth, - edge = borderEdge - ); + rotateZ(-90) { + borderHook( + edge = notchEdge + printTolerance, + thickness = borderEdge - printResolution, + negative = true + ); + } } } - - translateZ(borderEdge) { - curveBorderNotches( - radius = radius, - length = length, - angle = angle / 2, - thickness = borderEdge, - slotDepth = slotDepth, - edge = notchEdge, - negative=false - ); - } } } @@ -166,28 +188,51 @@ module curveBorderTop(length, sheetThickness, slotDepth, borderEdge, notchEdge, radius = length * ratio; defaultAngle = 90; angle = defaultAngle / ratio; + ratioAngle = defaultAngle - angle; - rotateZ((defaultAngle - angle) / 2) { - rotate_extrude(angle=angle, convexity=10) { + rotateZ(ratioAngle / 2) { + difference() { + union() { + rotate_extrude(angle=angle, convexity=10) { + translateX(radius) { + borderTopProfile( + slotWidth = sheetThickness + printTolerance, + slotDepth = slotDepth, + edge = borderEdge + ); + } + } + + translateZ(borderEdge) { + curveBorderNotches( + radius = radius, + length = length, + angle = angle / 2, + thickness = borderEdge + borderEdge, + slotDepth = slotDepth, + edge = notchEdge - printTolerance, + negative=false + ); + } + rotateZ(-ratioAngle) { + translateY(radius) { + borderHook( + edge = notchEdge, + thickness = borderEdge - printResolution * 2, + negative = false + ); + } + } + } translateX(radius) { - borderTopProfile( - slotWidth = sheetThickness, - slotDepth = slotDepth, - edge = borderEdge - ); + rotateZ(-90) { + borderHook( + edge = notchEdge + printTolerance, + thickness = borderEdge - printResolution, + negative = true + ); + } } } - - translateZ(borderEdge) { - curveBorderNotches( - radius = radius, - length = length, - angle = angle / 2, - thickness = borderEdge, - slotDepth = slotDepth, - edge = notchEdge, - negative=false - ); - } } } diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index fd168c6..520dabc 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -30,6 +30,23 @@ * @version 0.1.0 */ +/** + * Draws the shape of a border mount hook. + * @param Number edge - The width of each edge of the hook. + * @param Number thickness - The thickness of the hook + * @param Boolean [negative] - The shape will be used in a difference operation + */ +module borderHook(edge, thickness, negative=false) { + start = negative ? 1 : 0; + edge = adjustToNozzle(edge / 2) * 2; + translateZ(-start) { + box([edge * 2, edge, thickness + start]); + translateX(-edge) { + slot([edge, edge * 2, thickness + start]); + } + } +} + /** * Draws the shape of border mount notch. * @param Number thickness - The thickness of the shape @@ -101,24 +118,42 @@ module borderNotchesFull(length, thickness, slotDepth, edge, negative=false, cen * @param Number notchEdge - The width of a notch edge. */ module straightBorderBottom(length, sheetThickness, slotDepth, borderEdge, notchEdge) { - rotate([90, 0, 90]) { - negativeExtrude(height=length, center=true) { - borderBottomProfile( - slotWidth = sheetThickness, - slotDepth = slotDepth, - edge = borderEdge - ); + difference() { + union() { + rotate([90, 0, 90]) { + negativeExtrude(height=length, center=true) { + borderBottomProfile( + slotWidth = sheetThickness + printTolerance, + slotDepth = slotDepth, + edge = borderEdge + ); + } + } + translateZ(borderEdge) { + rotateX(90) { + borderNotchesFull( + length = length, + thickness = sheetThickness + borderEdge, + slotDepth = slotDepth, + edge = notchEdge - printTolerance, + negative = false, + center = true + ); + } + } + translateX(-length / 2) { + borderHook( + edge = notchEdge, + thickness = borderEdge - printResolution * 2, + negative = false + ); + } } - } - translateZ(borderEdge) { - rotateX(90) { - borderNotchesFull( - length = length, - thickness = sheetThickness, - slotDepth = slotDepth, - edge = notchEdge, - negative = false, - center = true + translateX(length / 2) { + borderHook( + edge = notchEdge + printTolerance, + thickness = borderEdge - printResolution, + negative = true ); } } @@ -133,24 +168,42 @@ module straightBorderBottom(length, sheetThickness, slotDepth, borderEdge, notch * @param Number notchEdge - The width of a notch edge. */ module straightBorderTop(length, sheetThickness, slotDepth, borderEdge, notchEdge) { - rotate([90, 0, 90]) { - negativeExtrude(height=length, center=true) { - borderTopProfile( - slotWidth = sheetThickness, - slotDepth = slotDepth, - edge = borderEdge - ); + difference() { + union() { + rotate([90, 0, 90]) { + negativeExtrude(height=length, center=true) { + borderTopProfile( + slotWidth = sheetThickness + printTolerance, + slotDepth = slotDepth, + edge = borderEdge + ); + } + } + translateZ(borderEdge) { + rotateX(90) { + borderNotchesFull( + length = length, + thickness = sheetThickness + borderEdge, + slotDepth = slotDepth, + edge = notchEdge - printTolerance, + negative = false, + center = true + ); + } + } + translateX(-length / 2) { + borderHook( + edge = notchEdge, + thickness = borderEdge - printResolution * 2, + negative = false + ); + } } - } - translateZ(borderEdge) { - rotateX(90) { - borderNotchesFull( - length = length, - thickness = sheetThickness, - slotDepth = slotDepth, - edge = notchEdge, - negative = false, - center = true + translateX(length / 2) { + borderHook( + edge = notchEdge + printTolerance, + thickness = borderEdge - printResolution, + negative = true ); } } @@ -175,7 +228,7 @@ module borderSheet(length, height, thickness, slotDepth, notchEdge) { length = length, thickness = thickness + 1, slotDepth = slotDepth, - edge = notchEdge, + edge = notchEdge + printTolerance, negative = true, center = true ); @@ -203,7 +256,7 @@ module borderSheetFull(length, height, thickness, slotDepth, notchEdge) { length = length, thickness = thickness + 1, slotDepth = slotDepth, - edge = notchEdge, + edge = notchEdge + printTolerance, negative = true, center = true ); diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 557580d..b1e4aa0 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -61,6 +61,12 @@ applyMode(mode=renderMode) { edge = getNotchEdge(), negative = true ); + // test the border hook shape + *borderHook( + edge = getNotchEdge(), + thickness = getNotchEdge(), + negative=false + ); // test the border notch shape *borderNotch( thickness = getSlotWidth(), diff --git a/rcmodels/tracks/top-border-curved.scad b/rcmodels/tracks/top-border-curved.scad index e4d09bd..0ca129a 100644 --- a/rcmodels/tracks/top-border-curved.scad +++ b/rcmodels/tracks/top-border-curved.scad @@ -42,7 +42,7 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getTopEdge(), - notchEdge = getNotchEdge() - printTolerance, + notchEdge = getNotchEdge(), ratio = 1 ); } diff --git a/rcmodels/tracks/top-border-straight.scad b/rcmodels/tracks/top-border-straight.scad index 4344865..b3296a8 100644 --- a/rcmodels/tracks/top-border-straight.scad +++ b/rcmodels/tracks/top-border-straight.scad @@ -42,6 +42,6 @@ applyMode(mode=renderMode) { sheetThickness = getSlotWidth(), slotDepth = getSlotDepth(), borderEdge = getTopEdge(), - notchEdge = getNotchEdge() - printTolerance + notchEdge = getNotchEdge() ); } diff --git a/rcmodels/tracks/util/functions.scad b/rcmodels/tracks/util/functions.scad index 2c4816c..2ac7f20 100644 --- a/rcmodels/tracks/util/functions.scad +++ b/rcmodels/tracks/util/functions.scad @@ -71,7 +71,7 @@ function getNotchEdge() = adjustToNozzle(borderNotchEdge); * Gets the width of the slot that will hold the border sheet. * @returns Number */ -function getSlotWidth() = getSheetThickness() + printTolerance; +function getSlotWidth() = getSheetThickness(); /** * Gets the depth of the slot that will hold the border sheet. From 94d8f0c5e6374e2e6fa58c9105ab4f9b2eb2415c Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 26 Jan 2020 19:48:18 +0100 Subject: [PATCH 040/191] Give a better project description --- rcmodels/tracks/border-sheet-curve.scad | 2 +- rcmodels/tracks/border-sheet-full.scad | 2 +- rcmodels/tracks/bottom-border-curved.scad | 2 +- rcmodels/tracks/bottom-border-straight.scad | 2 +- rcmodels/tracks/config/config.scad | 2 +- rcmodels/tracks/render.sh | 4 +++- rcmodels/tracks/shapes/curve.scad | 2 +- rcmodels/tracks/shapes/profiles.scad | 2 +- rcmodels/tracks/shapes/straight.scad | 2 +- rcmodels/tracks/test/wip.scad | 2 +- rcmodels/tracks/top-border-curved.scad | 2 +- rcmodels/tracks/top-border-straight.scad | 2 +- rcmodels/tracks/util/functions.scad | 2 +- rcmodels/tracks/util/setup.scad | 2 +- 14 files changed, 16 insertions(+), 14 deletions(-) diff --git a/rcmodels/tracks/border-sheet-curve.scad b/rcmodels/tracks/border-sheet-curve.scad index c2e525f..4c03065 100644 --- a/rcmodels/tracks/border-sheet-curve.scad +++ b/rcmodels/tracks/border-sheet-curve.scad @@ -22,7 +22,7 @@ */ /** - * A 1/24 RC track system. + * A race track system for 1/24 to 1/32 scale RC cars. * * An additional border sheet for a curved track chunk. * diff --git a/rcmodels/tracks/border-sheet-full.scad b/rcmodels/tracks/border-sheet-full.scad index 8f7d5aa..4b44539 100644 --- a/rcmodels/tracks/border-sheet-full.scad +++ b/rcmodels/tracks/border-sheet-full.scad @@ -22,7 +22,7 @@ */ /** - * A 1/24 RC track system. + * A race track system for 1/24 to 1/32 scale RC cars. * * A full border sheet for a straight track chunk. * diff --git a/rcmodels/tracks/bottom-border-curved.scad b/rcmodels/tracks/bottom-border-curved.scad index 94f5e91..f6f75a6 100644 --- a/rcmodels/tracks/bottom-border-curved.scad +++ b/rcmodels/tracks/bottom-border-curved.scad @@ -22,7 +22,7 @@ */ /** - * A 1/24 RC track system. + * A race track system for 1/24 to 1/32 scale RC cars. * * A bottom border mount for a curved track chunk. * diff --git a/rcmodels/tracks/bottom-border-straight.scad b/rcmodels/tracks/bottom-border-straight.scad index 0225021..3803d03 100644 --- a/rcmodels/tracks/bottom-border-straight.scad +++ b/rcmodels/tracks/bottom-border-straight.scad @@ -22,7 +22,7 @@ */ /** - * A 1/24 RC track system. + * A race track system for 1/24 to 1/32 scale RC cars. * * A bottom border mount for a straight track chunk. * diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 88c4a65..d9b4b99 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -21,7 +21,7 @@ */ /** - * A 1/24 RC track system. + * A race track system for 1/24 to 1/32 scale RC cars. * * Defines the config. * diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index ce7922b..73d92c9 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -21,7 +21,9 @@ # # -# Generates the STL files for the 1/24 RC track system. +# A race track system for 1/24 to 1/32 scale RC cars. +# +# Generates the STL files for the project. # # @author jsconan # diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad index 845eaaf..ca03ea2 100644 --- a/rcmodels/tracks/shapes/curve.scad +++ b/rcmodels/tracks/shapes/curve.scad @@ -22,7 +22,7 @@ */ /** - * A 1/24 RC track system. + * A race track system for 1/24 to 1/32 scale RC cars. * * Defines some curved chunk shapes. * diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index f77c47b..c31a87d 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -22,7 +22,7 @@ */ /** - * A 1/24 RC track system. + * A race track system for 1/24 to 1/32 scale RC cars. * * Defines some profile shapes. * diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 520dabc..c005828 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -22,7 +22,7 @@ */ /** - * A 1/24 RC track system. + * A race track system for 1/24 to 1/32 scale RC cars. * * Defines some straight chunk shapes. * diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index b1e4aa0..192f9d7 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -22,7 +22,7 @@ */ /** - * A 1/24 RC track system. + * A race track system for 1/24 to 1/32 scale RC cars. * * Work in progress. * diff --git a/rcmodels/tracks/top-border-curved.scad b/rcmodels/tracks/top-border-curved.scad index 0ca129a..8c15bbb 100644 --- a/rcmodels/tracks/top-border-curved.scad +++ b/rcmodels/tracks/top-border-curved.scad @@ -22,7 +22,7 @@ */ /** - * A 1/24 RC track system. + * A race track system for 1/24 to 1/32 scale RC cars. * * A top border mount for a curved track chunk. * diff --git a/rcmodels/tracks/top-border-straight.scad b/rcmodels/tracks/top-border-straight.scad index b3296a8..5b1b291 100644 --- a/rcmodels/tracks/top-border-straight.scad +++ b/rcmodels/tracks/top-border-straight.scad @@ -22,7 +22,7 @@ */ /** - * A 1/24 RC track system. + * A race track system for 1/24 to 1/32 scale RC cars. * * A top border mount for a straight track chunk. * diff --git a/rcmodels/tracks/util/functions.scad b/rcmodels/tracks/util/functions.scad index 2ac7f20..5e97013 100644 --- a/rcmodels/tracks/util/functions.scad +++ b/rcmodels/tracks/util/functions.scad @@ -21,7 +21,7 @@ */ /** - * A 1/24 RC track system. + * A race track system for 1/24 to 1/32 scale RC cars. * * Defines some functions. * diff --git a/rcmodels/tracks/util/setup.scad b/rcmodels/tracks/util/setup.scad index fdcfb4f..60ac35c 100644 --- a/rcmodels/tracks/util/setup.scad +++ b/rcmodels/tracks/util/setup.scad @@ -21,7 +21,7 @@ */ /** - * A 1/24 RC track system. + * A race track system for 1/24 to 1/32 scale RC cars. * * Setup the context. * From 94955d47d283fb3def43a76263eb710d2abf0863 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 26 Jan 2020 22:16:43 +0100 Subject: [PATCH 041/191] Rename and simplify the shapes (no more bottom and top) --- ...heet-full.scad => barrier-body-curve.scad} | 14 +- ...curved.scad => barrier-body-straight.scad} | 15 +- ...-curved.scad => barrier-holder-curve.scad} | 14 +- ...urve.scad => barrier-holder-straight.scad} | 14 +- rcmodels/tracks/bottom-border-straight.scad | 47 ----- rcmodels/tracks/config/config.scad | 23 ++- rcmodels/tracks/render.sh | 24 +-- rcmodels/tracks/shapes/curve.scad | 128 ++++--------- rcmodels/tracks/shapes/profiles.scad | 118 +++++------- rcmodels/tracks/shapes/straight.scad | 168 ++++++------------ rcmodels/tracks/test/wip.scad | 151 +++++++--------- rcmodels/tracks/top-border-straight.scad | 47 ----- rcmodels/tracks/util/functions.scad | 64 +++---- rcmodels/tracks/util/setup.scad | 12 +- 14 files changed, 282 insertions(+), 557 deletions(-) rename rcmodels/tracks/{border-sheet-full.scad => barrier-body-curve.scad} (80%) rename rcmodels/tracks/{top-border-curved.scad => barrier-body-straight.scad} (81%) rename rcmodels/tracks/{bottom-border-curved.scad => barrier-holder-curve.scad} (81%) rename rcmodels/tracks/{border-sheet-curve.scad => barrier-holder-straight.scad} (81%) delete mode 100644 rcmodels/tracks/bottom-border-straight.scad delete mode 100644 rcmodels/tracks/top-border-straight.scad diff --git a/rcmodels/tracks/border-sheet-full.scad b/rcmodels/tracks/barrier-body-curve.scad similarity index 80% rename from rcmodels/tracks/border-sheet-full.scad rename to rcmodels/tracks/barrier-body-curve.scad index 4b44539..e4fb50a 100644 --- a/rcmodels/tracks/border-sheet-full.scad +++ b/rcmodels/tracks/barrier-body-curve.scad @@ -24,7 +24,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A full border sheet for a straight track chunk. + * An additional barrier body for a curved track part. * * @author jsconan * @version 0.1.0 @@ -37,11 +37,11 @@ include applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - borderSheetFull( - length = getChunkLength(), - height = getSheetHeight(), - thickness = getSheetThickness(), - slotDepth = getSlotDepth(), - notchEdge = getNotchEdge() + barrierBody( + length = getCurveRemainingLength(getChunkSize()), + height = getBarrierBodyHeight(), + thickness = getBarrierThickness(), + slotDepth = getBarrierHolderDepth(), + notchBase = getBarrierNotchBase() ); } diff --git a/rcmodels/tracks/top-border-curved.scad b/rcmodels/tracks/barrier-body-straight.scad similarity index 81% rename from rcmodels/tracks/top-border-curved.scad rename to rcmodels/tracks/barrier-body-straight.scad index 8c15bbb..156ac85 100644 --- a/rcmodels/tracks/top-border-curved.scad +++ b/rcmodels/tracks/barrier-body-straight.scad @@ -24,7 +24,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A top border mount for a curved track chunk. + * A barrier body for a straight track part. * * @author jsconan * @version 0.1.0 @@ -37,12 +37,11 @@ include applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - curveBorderTop( - length = getChunkLength(), - sheetThickness = getSlotWidth(), - slotDepth = getSlotDepth(), - borderEdge = getTopEdge(), - notchEdge = getNotchEdge(), - ratio = 1 + barrierBodyFull( + length = getChunkSize(), + height = getBarrierBodyHeight(), + thickness = getBarrierThickness(), + slotDepth = getBarrierHolderDepth(), + notchBase = getBarrierNotchBase() ); } diff --git a/rcmodels/tracks/bottom-border-curved.scad b/rcmodels/tracks/barrier-holder-curve.scad similarity index 81% rename from rcmodels/tracks/bottom-border-curved.scad rename to rcmodels/tracks/barrier-holder-curve.scad index f6f75a6..48398aa 100644 --- a/rcmodels/tracks/bottom-border-curved.scad +++ b/rcmodels/tracks/barrier-holder-curve.scad @@ -24,7 +24,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A bottom border mount for a curved track chunk. + * A barrier holder for a curved track part. * * @author jsconan * @version 0.1.0 @@ -37,12 +37,12 @@ include applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - curveBorderBottom( - length = getChunkLength(), - sheetThickness = getSlotWidth(), - slotDepth = getSlotDepth(), - borderEdge = getBottomEdge(), - notchEdge = getNotchEdge(), + curveBarrierHolder( + length = getChunkSize(), + bodyThickness = getSlotWidth(), + slotDepth = getBarrierHolderDepth(), + barrierBase = getBarrierHolderBase(), + notchBase = getBarrierNotchBase(), ratio = 1 ); } diff --git a/rcmodels/tracks/border-sheet-curve.scad b/rcmodels/tracks/barrier-holder-straight.scad similarity index 81% rename from rcmodels/tracks/border-sheet-curve.scad rename to rcmodels/tracks/barrier-holder-straight.scad index 4c03065..647cada 100644 --- a/rcmodels/tracks/border-sheet-curve.scad +++ b/rcmodels/tracks/barrier-holder-straight.scad @@ -24,7 +24,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * An additional border sheet for a curved track chunk. + * A barrier holder for a straight track part. * * @author jsconan * @version 0.1.0 @@ -37,11 +37,11 @@ include applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - borderSheet( - length = getCurveRemainingLength(getChunkLength()), - height = getSheetHeight(), - thickness = getSheetThickness(), - slotDepth = getSlotDepth(), - notchEdge = getNotchEdge() + straightBarrierHolder( + length = getChunkSize(), + bodyThickness = getSlotWidth(), + slotDepth = getBarrierHolderDepth(), + barrierBase = getBarrierHolderBase(), + notchBase = getBarrierNotchBase() ); } diff --git a/rcmodels/tracks/bottom-border-straight.scad b/rcmodels/tracks/bottom-border-straight.scad deleted file mode 100644 index 3803d03..0000000 --- a/rcmodels/tracks/bottom-border-straight.scad +++ /dev/null @@ -1,47 +0,0 @@ - -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A bottom border mount for a straight track chunk. - * - * @author jsconan - * @version 0.1.0 - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - straightBorderBottom( - length = getChunkLength(), - sheetThickness = getSlotWidth(), - slotDepth = getSlotDepth(), - borderEdge = getBottomEdge(), - notchEdge = getNotchEdge() - ); -} diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index d9b4b99..6b82dea 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -33,20 +33,19 @@ renderMode = MODE_PROD; // Defines the constraints of the print. -printResolution = 0.2; // the target layer height -nozzleWidth = 0.4; // the size of the print nozzle -printTolerance = 0.1; // the print tolerance when pieces need to be assembled +printResolution = 0.2; // The target layer height +nozzleWidth = 0.4; // The size of the print nozzle +printTolerance = 0.1; // The print tolerance when pieces need to be assembled // Defines options -heightWithFasteners = true; // Should the height be with or without the fastener elements? +heightWithFasteners = true; // Should the height be with or without the fastener elements? // The dimensions of a track chunk -chunkLength = 200; +chunkSize = 200; // The nominal size of a chunk: the length for straight chunk, or the width for a curved chunk -// The constraints of the track border -borderHeight = 40; -borderThickness = 0.6; -borderTopEdge = 2; -borderBottomEdge = 2; -borderNotchEdge = 2; -borderSlotDepth = 6; +// The constraints of the track barrier +barrierThickness = 0.6; // The thickness of the barrier body +barrierHeight = 40; // The height of the barrier, depending on the option heightWithFasteners +barrierHolderDepth = 6; // The depth of the barrier holder to clamp the barrier body +barrierHolderBase = 2; // The base value used to design the barrier holder +barrierNotchBase = 2; // The base value used to design the barrier notches diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index 73d92c9..8640c6d 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -30,8 +30,8 @@ # application params heightWithFasteners= -chunkLength= -borderHeight= +chunkSize= +barrierHeight= # script config scriptpath=$(dirname $0) @@ -44,12 +44,12 @@ source "${scriptpath}/../../lib/camelSCAD/scripts/utils.sh" # load parameters while (( "$#" )); do case $1 in - "-l"|"--chunkLength") - chunkLength=$2 + "-l"|"--chunkSize") + chunkSize=$2 shift ;; - "-w"|"--borderHeight") - borderHeight=$2 + "-w"|"--barrierHeight") + barrierHeight=$2 shift ;; "-i"|"--innerHeight") @@ -64,10 +64,10 @@ while (( "$#" )); do echo -e "${C_CTX}\t$0 [-h|--help] [-o|--option value] files${C_RST}" echo echo -e "${C_MSG} -h, --help ${C_RST}Show this help" - echo -e "${C_MSG} -l, --chunkLength ${C_RST}Set the length of a track chunk" - echo -e "${C_MSG} -w --borderHeight ${C_RST}Set the height of the track border" - echo -e "${C_MSG} -i, --innerHeight ${C_RST}The height of the border does not contains the size of the mount fasteners" - echo -e "${C_MSG} -o, --outerHeight ${C_RST}The height of the border contains the size of the mount fasteners" + echo -e "${C_MSG} -l, --chunkSize ${C_RST}Set the length of a track chunk" + echo -e "${C_MSG} -w --barrierHeight ${C_RST}Set the height of the track barrier" + echo -e "${C_MSG} -i, --innerHeight ${C_RST}The height of the barrier does not contains the size of the holders" + echo -e "${C_MSG} -o, --outerHeight ${C_RST}The height of the barrier contains the size of the holders" echo exit 0 ;; @@ -88,6 +88,6 @@ scadcheck # render the files, if exist scadtostlall "${srcpath}" "${dstpath}" "" \ - "$(varif "chunkLength" ${chunkLength})" \ - "$(varif "borderHeight" ${borderHeight})" \ + "$(varif "chunkSize" ${chunkSize})" \ + "$(varif "barrierHeight" ${barrierHeight})" \ "$(varif "heightWithFasteners" ${heightWithFasteners})" diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad index ca03ea2..cfa0987 100644 --- a/rcmodels/tracks/shapes/curve.scad +++ b/rcmodels/tracks/shapes/curve.scad @@ -24,25 +24,25 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * Defines some curved chunk shapes. + * Defines some curved track parts. * * @author jsconan * @version 0.1.0 */ /** - * Draws the shape of a curved border mount notch. + * Draws the shape of a curved barrier holder notch. * @param Number radius - The radius of the curve. * @param Number thickness - The thickness of the shape - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the notch. + * @param Number slotDepth - The depth of the slot that will hold the barrier body. + * @param Number base - The base value used to design the barrier notches. * @param Number [direction] - The direction of the shape (1: right, -1: left) * @param Boolean [negative] - The shape will be used in a difference operation */ -module curveBorderNotch(radius, thickness, slotDepth, edge, direction=1, negative=false) { +module curveBarrierNotch(radius, thickness, slotDepth, base, direction=1, negative=false) { start = negative ? 1 : 0; direction = direction >= 0 ? 1 : -1; - length = edge * 2; + length = base * 2; angle = getArcAngle(radius = radius, length = length); chord = getChordLength(radius = radius, angle = angle / 2); @@ -76,34 +76,34 @@ module curveBorderNotch(radius, thickness, slotDepth, edge, direction=1, negativ } /** - * Draws the shape of a curved border mount notches for a full chunk. + * Draws the shape of a curved barrier holder notches for a full chunk. * @param Number radius - The radius of the curve. * @param Number length - The length of a chunk * @param Number angle - The angle of the curve * @param Number thickness - The thickness of the shape - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the notch. + * @param Number slotDepth - The depth of the slot that will hold the barrier body. + * @param Number base - The base value used to design the barrier notches. * @param Boolean [negative] - The shape will be used in a difference operation */ -module curveBorderNotches(radius, length, angle, thickness, slotDepth, edge, negative=false) { +module curveBarrierNotches(radius, length, angle, thickness, slotDepth, base, negative=false) { rotateZ(angle) { repeatMirror(axis=[0, 1, 0]) { rotateZ(-angle) { - curveBorderNotch( + curveBarrierNotch( radius = radius, thickness = thickness, slotDepth = slotDepth, - edge = edge, + base = base, direction = 1, negative = negative ); rotateZ(getArcAngle(radius = radius, length = length / 2)) { repeatMirror(axis=[0, 1, 0]) { - curveBorderNotch( + curveBarrierNotch( radius = radius, thickness = thickness, slotDepth = slotDepth, - edge = edge, + base = base, direction = -1, negative = negative ); @@ -115,15 +115,15 @@ module curveBorderNotches(radius, length, angle, thickness, slotDepth, edge, neg } /** - * Draws the bottom border mount for a curved chunk + * Draws the barrier holder for a curved chunk * @param Number length - The length of a chunk - * @param Number sheetThickness - The thickness of the sheet the border mount will hold. - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number borderEdge - The width of each edge of the border mount. - * @param Number notchEdge - The width of a notch edge. + * @param Number bodyThickness - The thickness of the barrier body. + * @param Number slotDepth - The depth of the slot that will hold the barrier body. + * @param Number barrierBase - The base value used to design the barrier holder. + * @param Number notchBase - The width of a notch base. * @param Number ratio - The ratio of the chunk */ -module curveBorderBottom(length, sheetThickness, slotDepth, borderEdge, notchEdge, ratio = 1) { +module curveBarrierHolder(length, bodyThickness, slotDepth, barrierBase, notchBase, ratio = 1) { radius = length * ratio; defaultAngle = 90; angle = defaultAngle / ratio; @@ -134,29 +134,29 @@ module curveBorderBottom(length, sheetThickness, slotDepth, borderEdge, notchEdg union() { rotate_extrude(angle=angle, convexity=10) { translateX(radius) { - borderBottomProfile( - slotWidth = sheetThickness + printTolerance, + barrierHolderProfile( + slotWidth = bodyThickness + printTolerance, slotDepth = slotDepth, - edge = borderEdge + base = barrierBase ); } } - translateZ(borderEdge) { - curveBorderNotches( + translateZ(barrierBase) { + curveBarrierNotches( radius = radius, length = length, angle = angle / 2, - thickness = borderEdge + borderEdge, + thickness = barrierBase + barrierBase, slotDepth = slotDepth, - edge = notchEdge - printTolerance, + base = notchBase - printTolerance, negative=false ); } rotateZ(-ratioAngle) { translateY(radius) { - borderHook( - edge = notchEdge, - thickness = borderEdge - printResolution * 2, + barrierHook( + base = notchBase, + thickness = barrierBase - printResolution * 2, negative = false ); } @@ -164,71 +164,9 @@ module curveBorderBottom(length, sheetThickness, slotDepth, borderEdge, notchEdg } translateX(radius) { rotateZ(-90) { - borderHook( - edge = notchEdge + printTolerance, - thickness = borderEdge - printResolution, - negative = true - ); - } - } - } - } -} - -/** - * Draws the top border mount for a curved chunk - * @param Number length - The length of a chunk - * @param Number sheetThickness - The thickness of the sheet the border mount will hold. - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number borderEdge - The width of each edge of the border mount. - * @param Number notchEdge - The width of a notch edge. - * @param Number ratio - The ratio of the chunk - */ -module curveBorderTop(length, sheetThickness, slotDepth, borderEdge, notchEdge, ratio = 1) { - radius = length * ratio; - defaultAngle = 90; - angle = defaultAngle / ratio; - ratioAngle = defaultAngle - angle; - - rotateZ(ratioAngle / 2) { - difference() { - union() { - rotate_extrude(angle=angle, convexity=10) { - translateX(radius) { - borderTopProfile( - slotWidth = sheetThickness + printTolerance, - slotDepth = slotDepth, - edge = borderEdge - ); - } - } - - translateZ(borderEdge) { - curveBorderNotches( - radius = radius, - length = length, - angle = angle / 2, - thickness = borderEdge + borderEdge, - slotDepth = slotDepth, - edge = notchEdge - printTolerance, - negative=false - ); - } - rotateZ(-ratioAngle) { - translateY(radius) { - borderHook( - edge = notchEdge, - thickness = borderEdge - printResolution * 2, - negative = false - ); - } - } - } - translateX(radius) { - rotateZ(-90) { - borderHook( - edge = notchEdge + printTolerance, - thickness = borderEdge - printResolution, + barrierHook( + base = notchBase + printTolerance, + thickness = barrierBase - printResolution, negative = true ); } diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index c31a87d..2386853 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -31,139 +31,101 @@ */ /** - * Computes the points defining the profile of the bottom border mount. - * @param Number slotWidth - The width of the slot that will hold the border sheet. - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the border mount. + * Computes the points defining the profile of the barrier holder. + * @param Number slotWidth - The width of the slot that will hold the barrier body. + * @param Number slotDepth - The depth of the slot that will hold the barrier body. + * @param Number base - The base value used to design the barrier holder. * @returns Vector[] */ -function getBorderBottomPoints(slotWidth, slotDepth, edge) = +function getBarrierHolderPoints(slotWidth, slotDepth, base) = let( - width = edge * 4 + slotWidth + width = base * 4 + slotWidth ) path([ ["P", -width / 2, 0], - ["V", edge], - ["L", edge, slotDepth], - ["H", edge], + ["V", base], + ["L", base, slotDepth], + ["H", base], ["V", -slotDepth], ["H", slotWidth], ["V", slotDepth], - ["H", edge], - ["L", edge, -slotDepth], - ["V", -edge] + ["H", base], + ["L", base, -slotDepth], + ["V", -base] ]) ; /** - * Computes the points defining the profile of the top border mount. - * @param Number slotWidth - The width of the slot that will hold the border sheet. - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the border mount. - * @returns Vector[] - */ -function getBorderTopPoints(slotWidth, slotDepth, edge) = - let( - width = edge * 2 + slotWidth, - height = edge + slotDepth - ) - path([ - ["P", -width / 2, 0], - ["V", height], - ["H", edge], - ["V", -slotDepth], - ["H", slotWidth], - ["V", slotDepth], - ["H", edge], - ["V", -height] - ]) -; - -/** - * Computes the points defining the profile of a border mount notch. - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the notch. + * Computes the points defining the profile of a barrier holder notch. + * @param Number slotDepth - The depth of the slot that will hold the barrier body. + * @param Number base - The base value used to design the barrier notches. * @param Number [direction] - The direction of the shape (1: right, -1: left) * @param Boolean [negative] - The shape will be used in a difference operation * @returns Vector[] */ -function getBorderNotchPoints(slotDepth, edge, direction=1, negative=false) = +function getBarrierNotchPoints(slotDepth, base, direction=1, negative=false) = let( start = negative ? 1 : 0, direction = direction >= 0 ? 1 : -1, - width = edge * 2 + width = base * 2 ) path([ ["P", direction * -start, slotDepth], - ["H", direction * (edge + start)], - ["L", direction * edge, -slotDepth], + ["H", direction * (base + start)], + ["L", direction * base, -slotDepth], ["V", -start], ["H", direction * -(width + start)] ]) ; /** - * Draws the profile of the bottom border mount. - * @param Number slotWidth - The width of the slot that will hold the border sheet. - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the border mount. - */ -module borderBottomProfile(slotWidth, slotDepth, edge) { - polygon(getBorderBottomPoints( - slotWidth = slotWidth, - slotDepth = slotDepth, - edge = edge - )); -} - -/** - * Draws the profile of the top border mount. - * @param Number slotWidth - The width of the slot that will hold the border sheet. - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the border mount. + * Draws the profile of the barrier holder. + * @param Number slotWidth - The width of the slot that will hold the barrier body. + * @param Number slotDepth - The depth of the slot that will hold the barrier body. + * @param Number base - The base value used to design the barrier holder. */ -module borderTopProfile(slotWidth, slotDepth, edge) { - polygon(getBorderTopPoints( +module barrierHolderProfile(slotWidth, slotDepth, base) { + polygon(getBarrierHolderPoints( slotWidth = slotWidth, slotDepth = slotDepth, - edge = edge + base = base )); } /** - * Draws the profile of a border mount notch. - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the notch. + * Draws the profile of a barrier holder notch. + * @param Number slotDepth - The depth of the slot that will hold the barrier body. + * @param Number base - The base value used to design the barrier notches. * @param Number [direction] - The direction of the shape (1: right, -1: left) * @param Boolean [negative] - The shape will be used in a difference operation */ -module borderNotchProfile(slotDepth, edge, direction=1, negative=false) { - polygon(getBorderNotchPoints( +module barrierNotchProfile(slotDepth, base, direction=1, negative=false) { + polygon(getBarrierNotchPoints( slotDepth = slotDepth, - edge = edge, + base = base, direction = direction, negative = negative )); } /** - * Draws the profile of a set of border mount notches. + * Draws the profile of a set of barrier holder notches. * @param Number length - The length of the set - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the notch. + * @param Number slotDepth - The depth of the slot that will hold the barrier body. + * @param Number base - The base value used to design the barrier notches. * @param Boolean [negative] - The shape will be used in a difference operation */ -module borderNotchesProfile(length, slotDepth, edge, negative=false) { - borderNotchProfile( +module barrierNotchesProfile(length, slotDepth, base, negative=false) { + barrierNotchProfile( slotDepth = slotDepth, - edge = edge, + base = base, direction = 1, negative = negative ); translateX(length) { - borderNotchProfile( + barrierNotchProfile( slotDepth = slotDepth, - edge = edge, + base = base, direction = -1, negative = negative ); diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index c005828..2d41183 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -24,43 +24,43 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * Defines some straight chunk shapes. + * Defines some straight track parts. * * @author jsconan * @version 0.1.0 */ /** - * Draws the shape of a border mount hook. - * @param Number edge - The width of each edge of the hook. + * Draws the shape of a barrier holder hook. + * @param Number base - The width of each base of the hook. * @param Number thickness - The thickness of the hook * @param Boolean [negative] - The shape will be used in a difference operation */ -module borderHook(edge, thickness, negative=false) { +module barrierHook(base, thickness, negative=false) { start = negative ? 1 : 0; - edge = adjustToNozzle(edge / 2) * 2; + base = adjustToNozzle(base / 2) * 2; translateZ(-start) { - box([edge * 2, edge, thickness + start]); - translateX(-edge) { - slot([edge, edge * 2, thickness + start]); + box([base * 2, base, thickness + start]); + translateX(-base) { + slot([base, base * 2, thickness + start]); } } } /** - * Draws the shape of border mount notch. + * Draws the shape of barrier holder notch. * @param Number thickness - The thickness of the shape - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the notch. + * @param Number slotDepth - The depth of the slot that will hold the barrier body. + * @param Number base - The base value used to design the barrier notches. * @param Number [direction] - The direction of the shape (1: right, -1: left) * @param Boolean [negative] - The shape will be used in a difference operation * @param Boolean [center] - The shape is centered vertically */ -module borderNotch(thickness, slotDepth, edge, direction=1, negative=false, center=false) { +module barrierNotch(thickness, slotDepth, base, direction=1, negative=false, center=false) { negativeExtrude(height=thickness, center=center) { - borderNotchProfile( + barrierNotchProfile( slotDepth = slotDepth, - edge = edge, + base = base, direction = direction, negative = negative ); @@ -68,41 +68,41 @@ module borderNotch(thickness, slotDepth, edge, direction=1, negative=false, cent } /** - * Draws the shape of border mount notches. + * Draws the shape of barrier holder notches. * @param Number length - The length of the chunk * @param Number thickness - The thickness of the shape - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the notch. + * @param Number slotDepth - The depth of the slot that will hold the barrier body. + * @param Number base - The base value used to design the barrier notches. * @param Boolean [negative] - The shape will be used in a difference operation * @param Boolean [center] - The shape is centered vertically */ -module borderNotches(length, thickness, slotDepth, edge, negative=false, center=false) { +module barrierNotches(length, thickness, slotDepth, base, negative=false, center=false) { negativeExtrude(height=thickness, center=center) { - borderNotchesProfile( + barrierNotchesProfile( length = length, slotDepth = slotDepth, - edge = edge, + base = base, negative = negative ); } } /** - * Draws the shape of border mount notches for a full chunk. + * Draws the shape of barrier holder notches for a full chunk. * @param Number length - The length of the chunk * @param Number thickness - The thickness of the shape - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number edge - The width of each edge of the notch. + * @param Number slotDepth - The depth of the slot that will hold the barrier body. + * @param Number base - The base value used to design the barrier notches. * @param Boolean [negative] - The shape will be used in a difference operation * @param Boolean [center] - The shape is centered vertically */ -module borderNotchesFull(length, thickness, slotDepth, edge, negative=false, center=false) { +module barrierNotchesFull(length, thickness, slotDepth, base, negative=false, center=false) { repeatMirror() { - borderNotches( + barrierNotches( length = length / 2, thickness = thickness, slotDepth = slotDepth, - edge = edge, + base = base, negative = negative, center = center ); @@ -110,49 +110,49 @@ module borderNotchesFull(length, thickness, slotDepth, edge, negative=false, cen } /** - * Draws the bottom border mount for a straight chunk + * Draws the barrier holder for a straight chunk * @param Number length - The length of the chunk - * @param Number sheetThickness - The thickness of the sheet the border mount will hold. - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number borderEdge - The width of each edge of the border mount. - * @param Number notchEdge - The width of a notch edge. + * @param Number bodyThickness - The thickness of the barrier body. + * @param Number slotDepth - The depth of the slot that will hold the barrier body. + * @param Number barrierBase - The base value used to design the barrier holder. + * @param Number notchBase - The width of a notch base. */ -module straightBorderBottom(length, sheetThickness, slotDepth, borderEdge, notchEdge) { +module straightBarrierHolder(length, bodyThickness, slotDepth, barrierBase, notchBase) { difference() { union() { rotate([90, 0, 90]) { negativeExtrude(height=length, center=true) { - borderBottomProfile( - slotWidth = sheetThickness + printTolerance, + barrierHolderProfile( + slotWidth = bodyThickness + printTolerance, slotDepth = slotDepth, - edge = borderEdge + base = barrierBase ); } } - translateZ(borderEdge) { + translateZ(barrierBase) { rotateX(90) { - borderNotchesFull( + barrierNotchesFull( length = length, - thickness = sheetThickness + borderEdge, + thickness = bodyThickness + barrierBase, slotDepth = slotDepth, - edge = notchEdge - printTolerance, + base = notchBase - printTolerance, negative = false, center = true ); } } translateX(-length / 2) { - borderHook( - edge = notchEdge, - thickness = borderEdge - printResolution * 2, + barrierHook( + base = notchBase, + thickness = barrierBase - printResolution * 2, negative = false ); } } translateX(length / 2) { - borderHook( - edge = notchEdge + printTolerance, - thickness = borderEdge - printResolution, + barrierHook( + base = notchBase + printTolerance, + thickness = barrierBase - printResolution, negative = true ); } @@ -160,75 +160,25 @@ module straightBorderBottom(length, sheetThickness, slotDepth, borderEdge, notch } /** - * Draws the top border mount for a straight chunk - * @param Number length - The length of the chunk - * @param Number sheetThickness - The thickness of the sheet the border mount will hold. - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number borderEdge - The width of each edge of the border mount. - * @param Number notchEdge - The width of a notch edge. - */ -module straightBorderTop(length, sheetThickness, slotDepth, borderEdge, notchEdge) { - difference() { - union() { - rotate([90, 0, 90]) { - negativeExtrude(height=length, center=true) { - borderTopProfile( - slotWidth = sheetThickness + printTolerance, - slotDepth = slotDepth, - edge = borderEdge - ); - } - } - translateZ(borderEdge) { - rotateX(90) { - borderNotchesFull( - length = length, - thickness = sheetThickness + borderEdge, - slotDepth = slotDepth, - edge = notchEdge - printTolerance, - negative = false, - center = true - ); - } - } - translateX(-length / 2) { - borderHook( - edge = notchEdge, - thickness = borderEdge - printResolution * 2, - negative = false - ); - } - } - translateX(length / 2) { - borderHook( - edge = notchEdge + printTolerance, - thickness = borderEdge - printResolution, - negative = true - ); - } - } -} - -/** - * Draws the border sheet for a straight chunk + * Draws the barrier body for a straight chunk * @param Number length - The length of the chunk * @param Number height - The height of the chunk - * @param Number thickness - The thickness of the border sheet. - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number notchEdge - The width of a notch edge. + * @param Number thickness - The thickness of the barrier body. + * @param Number slotDepth - The depth of the slot that will hold the barrier body. + * @param Number notchBase - The width of a notch base. */ -module borderSheet(length, height, thickness, slotDepth, notchEdge) { +module barrierBody(length, height, thickness, slotDepth, notchBase) { difference() { box(size = [length, height, thickness], center = true); repeatMirror(axis=[0, 1, 0]) { translateY(-height / 2) { translateX(-length / 2) { - borderNotches( + barrierNotches( length = length, thickness = thickness + 1, slotDepth = slotDepth, - edge = notchEdge + printTolerance, + base = notchBase + printTolerance, negative = true, center = true ); @@ -239,24 +189,24 @@ module borderSheet(length, height, thickness, slotDepth, notchEdge) { } /** - * Draws the full border sheet for a straight chunk + * Draws the full barrier body for a straight chunk * @param Number length - The length of the chunk * @param Number height - The height of the chunk - * @param Number thickness - The thickness of the border sheet. - * @param Number slotDepth - The depth of the slot that will hold the border sheet. - * @param Number notchEdge - The width of a notch edge. + * @param Number thickness - The thickness of the barrier body. + * @param Number slotDepth - The depth of the slot that will hold the barrier body. + * @param Number notchBase - The width of a notch base. */ -module borderSheetFull(length, height, thickness, slotDepth, notchEdge) { +module barrierBodyFull(length, height, thickness, slotDepth, notchBase) { difference() { box(size = [length, height, thickness], center = true); repeatMirror(axis=[0, 1, 0]) { translateY(-height / 2) { - borderNotchesFull( + barrierNotchesFull( length = length, thickness = thickness + 1, slotDepth = slotDepth, - edge = notchEdge + printTolerance, + base = notchBase + printTolerance, negative = true, center = true ); diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 192f9d7..20cc2a5 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -35,122 +35,99 @@ include <../util/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { - // test the bottom border profile - *borderBottomProfile( + // test the barrier profile + *barrierHolderProfile( slotWidth = getSlotWidth(), - slotDepth = getSlotDepth(), - edge = getBottomEdge() + slotDepth = getBarrierHolderDepth(), + base = getBarrierHolderBase() ); - // test the top border profile - *borderTopProfile( - slotWidth = getSlotWidth(), - slotDepth = getSlotDepth(), - edge = getTopEdge() - ); - // test the border notch profile - *borderNotchProfile( - slotDepth = getSlotDepth(), - edge = getNotchEdge(), + // test the barrier notch profile + *barrierNotchProfile( + slotDepth = getBarrierHolderDepth(), + base = getBarrierNotchBase(), direction = -1, negative = true ); - // test the border notches profile - *borderNotchesProfile( - length = getChunkLength() / 2, - slotDepth = getSlotDepth(), - edge = getNotchEdge(), + // test the barrier notches profile + *barrierNotchesProfile( + length = getChunkSize() / 2, + slotDepth = getBarrierHolderDepth(), + base = getBarrierNotchBase(), negative = true ); - // test the border hook shape - *borderHook( - edge = getNotchEdge(), - thickness = getNotchEdge(), + // test the barrier hook shape + *barrierHook( + base = getBarrierNotchBase(), + thickness = getBarrierNotchBase(), negative=false ); - // test the border notch shape - *borderNotch( + // test the barrier notch shape + *barrierNotch( thickness = getSlotWidth(), - slotDepth = getSlotDepth(), - edge = getNotchEdge(), + slotDepth = getBarrierHolderDepth(), + base = getBarrierNotchBase(), direction = -1, negative = true, center = true ); - // test the border notches shape - *borderNotches( - length = getChunkLength(), + // test the barrier notches shape + *barrierNotches( + length = getChunkSize(), thickness = getSlotWidth(), - slotDepth = getSlotDepth(), - edge = getNotchEdge(), + slotDepth = getBarrierHolderDepth(), + base = getBarrierNotchBase(), negative = true, center = true ); - // test the border notches shape for a full chunk - *borderNotchesFull( - length = getChunkLength(), + // test the barrier notches shape for a full chunk + *barrierNotchesFull( + length = getChunkSize(), thickness = getSlotWidth(), - slotDepth = getSlotDepth(), - edge = getNotchEdge(), + slotDepth = getBarrierHolderDepth(), + base = getBarrierNotchBase(), negative = true, center = true ); - // test the bottom border mount shape for a straight chunk - *straightBorderBottom( - length = getChunkLength(), - sheetThickness = getSlotWidth(), - slotDepth = getSlotDepth(), - borderEdge = getBottomEdge(), - notchEdge = getNotchEdge() - ); - // test the top border mount shape for a straight chunk - *straightBorderTop( - length = getChunkLength(), - sheetThickness = getSlotWidth(), - slotDepth = getSlotDepth(), - borderEdge = getTopEdge(), - notchEdge = getNotchEdge() + // test the barrier holder shape for a straight chunk + *straightBarrierHolder( + length = getChunkSize(), + bodyThickness = getSlotWidth(), + slotDepth = getBarrierHolderDepth(), + barrierBase = getBarrierHolderBase(), + notchBase = getBarrierNotchBase() ); - // test the curved border notch - *curveBorderNotch( - radius = getChunkLength(), + // test the curved barrier notch + *curveBarrierNotch( + radius = getChunkSize(), thickness = getSlotWidth(), - slotDepth = getSlotDepth(), - edge = getNotchEdge(), + slotDepth = getBarrierHolderDepth(), + base = getBarrierNotchBase(), direction = 1, negative = true ); - // test the bottom border mount shape for a curved chunk - *curveBorderBottom( - length = getChunkLength(), - sheetThickness = getSlotWidth(), - slotDepth = getSlotDepth(), - borderEdge = getBottomEdge(), - notchEdge = getNotchEdge(), - ratio = 1 - ); - // test the top border mount shape for a curved chunk - *curveBorderTop( - length = getChunkLength(), - sheetThickness = getSlotWidth(), - slotDepth = getSlotDepth(), - borderEdge = getTopEdge(), - notchEdge = getNotchEdge(), + // test the barrier holder shape for a curved chunk + *curveBarrierHolder( + length = getChunkSize(), + bodyThickness = getSlotWidth(), + slotDepth = getBarrierHolderDepth(), + barrierBase = getBarrierHolderBase(), + notchBase = getBarrierNotchBase(), ratio = 1 ); - // test the border sheet shape for a straight chunk - *borderSheet( - length = getCurveRemainingLength(getChunkLength()), - height = getSheetHeight(), - thickness = getSheetThickness(), - slotDepth = getSlotDepth(), - notchEdge = getNotchEdge() + // test the barrier body shape for a straight chunk + *barrierBody( + length = getCurveRemainingLength(getChunkSize()), + height = getBarrierBodyHeight(), + thickness = getBarrierThickness(), + slotDepth = getBarrierHolderDepth(), + notchBase = getBarrierNotchBase() ); - // test the full border sheet shape for a straight chunk - borderSheetFull( - length = getChunkLength(), - height = getSheetHeight(), - thickness = getSheetThickness(), - slotDepth = getSlotDepth(), - notchEdge = getNotchEdge() + // test the full barrier body shape for a straight chunk + *barrierBodyFull( + length = getChunkSize(), + height = getBarrierBodyHeight(), + thickness = getBarrierThickness(), + slotDepth = getBarrierHolderDepth(), + notchBase = getBarrierNotchBase() ); } diff --git a/rcmodels/tracks/top-border-straight.scad b/rcmodels/tracks/top-border-straight.scad deleted file mode 100644 index 5b1b291..0000000 --- a/rcmodels/tracks/top-border-straight.scad +++ /dev/null @@ -1,47 +0,0 @@ - -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A top border mount for a straight track chunk. - * - * @author jsconan - * @version 0.1.0 - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - straightBorderTop( - length = getChunkLength(), - sheetThickness = getSlotWidth(), - slotDepth = getSlotDepth(), - borderEdge = getTopEdge(), - notchEdge = getNotchEdge() - ); -} diff --git a/rcmodels/tracks/util/functions.scad b/rcmodels/tracks/util/functions.scad index 5e97013..49578fd 100644 --- a/rcmodels/tracks/util/functions.scad +++ b/rcmodels/tracks/util/functions.scad @@ -44,99 +44,93 @@ function adjustToLayer(height) = roundBy(height, printResolution); function adjustToNozzle(width) = roundBy(width, nozzleWidth); /** - * Gets the thickness of the border sheet, adjusted to better fit the printer. + * Gets the thickness of the barrier body, adjusted to better fit the printer. * @returns Number */ -function getSheetThickness() = adjustToLayer(borderThickness); +function getBarrierThickness() = adjustToLayer(barrierThickness); /** - * Gets the width of the bottom border edge, adjusted to better fit the printer. + * Gets the base value used to design the barrier holder, adjusted to better fit the printer. * @returns Number */ -function getBottomEdge() = adjustToNozzle(borderBottomEdge); +function getBarrierHolderBase() = adjustToNozzle(barrierHolderBase); /** - * Gets the width of the top border edge, adjusted to better fit the printer. + * Gets the base value used to design the barrier notches, adjusted to better fit the printer. * @returns Number */ -function getTopEdge() = adjustToNozzle(borderTopEdge); +function getBarrierNotchBase() = adjustToNozzle(barrierNotchBase); /** - * Gets the width of the border notch edge, adjusted to better fit the printer. + * Gets the width of the slot that will hold the barrier body. * @returns Number */ -function getNotchEdge() = adjustToNozzle(borderNotchEdge); +function getSlotWidth() = getBarrierThickness(); /** - * Gets the width of the slot that will hold the border sheet. + * Gets the depth of the slot that will hold the barrier body. * @returns Number */ -function getSlotWidth() = getSheetThickness(); +function getBarrierHolderDepth() = adjustToLayer(barrierHolderDepth); /** - * Gets the depth of the slot that will hold the border sheet. + * Gets the nominal size of a track chunk. * @returns Number */ -function getSlotDepth() = adjustToLayer(borderSlotDepth); - -/** - * Gets the length of a track chunk. - * @returns Number - */ -function getChunkLength() = chunkLength; +function getChunkSize() = chunkSize; /** * Gets the length of a curved chunk (the length of the arc of the curve). - * @param Number chunkLength - The length of a straight chunk + * @param Number chunkSize - The length of a straight chunk * @returns Number */ -function getCurveLength(chunkLength) = getArcLength(radius = chunkLength, angle = 90); +function getCurveLength(chunkSize) = getArcLength(radius = chunkSize, angle = 90); /** * Gets the difference between the length of a curved chunk and a regular straight chunk - * @param Number chunkLength - The length of a straight chunk + * @param Number chunkSize - The length of a straight chunk * @returns Number */ -function getCurveRemainingLength(chunkLength) = getCurveLength(chunkLength) - chunkLength; +function getCurveRemainingLength(chunkSize) = getCurveLength(chunkSize) - chunkSize; /** - * Gets the height of the border sheet, depending on the option heightWithFasteners + * Gets the height of the barrier body, depending on the option heightWithFasteners * @returns Number */ -function getSheetHeight() = +function getBarrierBodyHeight() = let( correction = heightWithFasteners - ?-(borderBottomEdge + borderTopEdge) - :borderSlotDepth * 2 + ?-barrierHolderBase * 2 + :barrierHolderDepth * 2 ) - borderHeight + correction + barrierHeight + correction ; /** - * Gets the height of the assembled border, depending on the option heightWithFasteners + * Gets the height of the assembled barrier, depending on the option heightWithFasteners * @returns Number */ -function getBorderHeight() = +function getBarrierHeight() = let( - correction = heightWithFasteners ? 0 : borderBottomEdge + borderTopEdge + borderSlotDepth * 2 + correction = heightWithFasteners ? 0 : (barrierHolderBase + barrierHolderDepth) * 2 ) - borderHeight + correction + barrierHeight + correction ; /** - * Gets the minimal length for a simple sheet (a sheet that should fit between 2 border notches) + * Gets the minimal length for a simple body body (a body that should fit between 2 barrier notches) * @returns Number */ -function getMinSheetLength() = 5 * getNotchEdge(); +function getMinBodyLength() = 5 * getBarrierNotchBase(); /** * Gets the minimal length for a straight chunk * @returns Number */ -function getMinStraightLength() = 2 * getMinSheetLength(); +function getMinStraightLength() = 2 * getMinBodyLength(); /** * Gets the minimal arc length for a curved chunk * @returns Number */ -function getMinCurveLength() = 3 * getMinSheetLength(); +function getMinCurveLength() = 3 * getMinBodyLength(); diff --git a/rcmodels/tracks/util/setup.scad b/rcmodels/tracks/util/setup.scad index 60ac35c..661c59a 100644 --- a/rcmodels/tracks/util/setup.scad +++ b/rcmodels/tracks/util/setup.scad @@ -43,20 +43,20 @@ include <../shapes/curve.scad> // Validate the critical constraints assert( - chunkLength >= getMinStraightLength(), + chunkSize >= getMinStraightLength(), str( - "The length for a track chunk is too small! The minimum length for a straight element is ", + "The size for a straight chunk is too small! The minimum length is ", getMinStraightLength(), ". The current value is ", - chunkLength + chunkSize ) ); assert( - getArcLength(radius = chunkLength, angle = 90) >= getMinCurveLength(), + getArcLength(radius = chunkSize, angle = 90) >= getMinCurveLength(), str( - "The length for a track chunk is too small! The minimum arc length for a curved element is ", + "The length for a curved chunk is too small! The minimum arc length is ", getMinCurveLength(), ". The current value is ", - getArcLength(radius = chunkLength, angle = 90) + getArcLength(radius = chunkSize, angle = 90) ) ); From 20111e8d7df8e563ea8d5ca91d345b7e8f0e77d6 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 1 Feb 2020 19:58:21 +0100 Subject: [PATCH 042/191] Update camelSCAD to v0.9.0 --- lib/camelSCAD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/camelSCAD b/lib/camelSCAD index 01f316f..214f808 160000 --- a/lib/camelSCAD +++ b/lib/camelSCAD @@ -1 +1 @@ -Subproject commit 01f316fd6c1e190e756b9e09a97760e85c7d2ce5 +Subproject commit 214f808728703a36435019b5e7dfbe3939097ea1 From 223d314cf69fcb94ca82347ac1a9b761a987d9c7 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 1 Feb 2020 20:09:10 +0100 Subject: [PATCH 043/191] Rework the file structure for better consistency --- rcmodels/tracks/barrier-body-curve.scad | 2 +- rcmodels/tracks/barrier-body-straight.scad | 2 +- rcmodels/tracks/barrier-holder-curve.scad | 2 +- rcmodels/tracks/barrier-holder-straight.scad | 2 +- rcmodels/tracks/{util => config}/functions.scad | 0 rcmodels/tracks/{util => config}/setup.scad | 2 +- rcmodels/tracks/test/wip.scad | 2 +- 7 files changed, 6 insertions(+), 6 deletions(-) rename rcmodels/tracks/{util => config}/functions.scad (100%) rename rcmodels/tracks/{util => config}/setup.scad (95%) diff --git a/rcmodels/tracks/barrier-body-curve.scad b/rcmodels/tracks/barrier-body-curve.scad index e4fb50a..208cb59 100644 --- a/rcmodels/tracks/barrier-body-curve.scad +++ b/rcmodels/tracks/barrier-body-curve.scad @@ -31,7 +31,7 @@ */ // Import the project's setup. -include +include // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { diff --git a/rcmodels/tracks/barrier-body-straight.scad b/rcmodels/tracks/barrier-body-straight.scad index 156ac85..68bdd72 100644 --- a/rcmodels/tracks/barrier-body-straight.scad +++ b/rcmodels/tracks/barrier-body-straight.scad @@ -31,7 +31,7 @@ */ // Import the project's setup. -include +include // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { diff --git a/rcmodels/tracks/barrier-holder-curve.scad b/rcmodels/tracks/barrier-holder-curve.scad index 48398aa..6e04fba 100644 --- a/rcmodels/tracks/barrier-holder-curve.scad +++ b/rcmodels/tracks/barrier-holder-curve.scad @@ -31,7 +31,7 @@ */ // Import the project's setup. -include +include // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { diff --git a/rcmodels/tracks/barrier-holder-straight.scad b/rcmodels/tracks/barrier-holder-straight.scad index 647cada..8928938 100644 --- a/rcmodels/tracks/barrier-holder-straight.scad +++ b/rcmodels/tracks/barrier-holder-straight.scad @@ -31,7 +31,7 @@ */ // Import the project's setup. -include +include // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { diff --git a/rcmodels/tracks/util/functions.scad b/rcmodels/tracks/config/functions.scad similarity index 100% rename from rcmodels/tracks/util/functions.scad rename to rcmodels/tracks/config/functions.scad diff --git a/rcmodels/tracks/util/setup.scad b/rcmodels/tracks/config/setup.scad similarity index 95% rename from rcmodels/tracks/util/setup.scad rename to rcmodels/tracks/config/setup.scad index 661c59a..353f643 100644 --- a/rcmodels/tracks/util/setup.scad +++ b/rcmodels/tracks/config/setup.scad @@ -33,7 +33,7 @@ include <../../../lib/camelSCAD/shapes.scad> // Then we need the config for the project, as well as the related functions -include <../config/config.scad> +include include // Finally, include the shapes diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 20cc2a5..9c000c5 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -31,7 +31,7 @@ */ // Import the project's setup. -include <../util/setup.scad> +include <../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { From ba96081d8d84c45f5a8964e248866bc173e20d4b Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 1 Feb 2020 20:12:25 +0100 Subject: [PATCH 044/191] Remove dummy starting line --- rcmodels/tracks/barrier-body-curve.scad | 1 - rcmodels/tracks/barrier-body-straight.scad | 1 - rcmodels/tracks/barrier-holder-curve.scad | 1 - rcmodels/tracks/barrier-holder-straight.scad | 1 - rcmodels/tracks/shapes/curve.scad | 1 - rcmodels/tracks/shapes/profiles.scad | 1 - rcmodels/tracks/shapes/straight.scad | 1 - rcmodels/tracks/test/wip.scad | 1 - 8 files changed, 8 deletions(-) diff --git a/rcmodels/tracks/barrier-body-curve.scad b/rcmodels/tracks/barrier-body-curve.scad index 208cb59..c840b82 100644 --- a/rcmodels/tracks/barrier-body-curve.scad +++ b/rcmodels/tracks/barrier-body-curve.scad @@ -1,4 +1,3 @@ - /** * @license * GPLv3 License diff --git a/rcmodels/tracks/barrier-body-straight.scad b/rcmodels/tracks/barrier-body-straight.scad index 68bdd72..b74d676 100644 --- a/rcmodels/tracks/barrier-body-straight.scad +++ b/rcmodels/tracks/barrier-body-straight.scad @@ -1,4 +1,3 @@ - /** * @license * GPLv3 License diff --git a/rcmodels/tracks/barrier-holder-curve.scad b/rcmodels/tracks/barrier-holder-curve.scad index 6e04fba..c3bd201 100644 --- a/rcmodels/tracks/barrier-holder-curve.scad +++ b/rcmodels/tracks/barrier-holder-curve.scad @@ -1,4 +1,3 @@ - /** * @license * GPLv3 License diff --git a/rcmodels/tracks/barrier-holder-straight.scad b/rcmodels/tracks/barrier-holder-straight.scad index 8928938..c22f922 100644 --- a/rcmodels/tracks/barrier-holder-straight.scad +++ b/rcmodels/tracks/barrier-holder-straight.scad @@ -1,4 +1,3 @@ - /** * @license * GPLv3 License diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad index cfa0987..aa1a516 100644 --- a/rcmodels/tracks/shapes/curve.scad +++ b/rcmodels/tracks/shapes/curve.scad @@ -1,4 +1,3 @@ - /** * @license * GPLv3 License diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index 2386853..396565f 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -1,4 +1,3 @@ - /** * @license * GPLv3 License diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 2d41183..561eabd 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -1,4 +1,3 @@ - /** * @license * GPLv3 License diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 9c000c5..b9a0c40 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -1,4 +1,3 @@ - /** * @license * GPLv3 License From a07dd8bb1ac7e35c589397488b983c732d0fba75 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 1 Feb 2020 20:19:27 +0100 Subject: [PATCH 045/191] Remove option heightWithFasteners --- rcmodels/tracks/config/config.scad | 5 +---- rcmodels/tracks/config/functions.scad | 20 ++++---------------- rcmodels/tracks/render.sh | 12 +----------- 3 files changed, 6 insertions(+), 31 deletions(-) diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 6b82dea..6d56545 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -37,15 +37,12 @@ printResolution = 0.2; // The target layer height nozzleWidth = 0.4; // The size of the print nozzle printTolerance = 0.1; // The print tolerance when pieces need to be assembled -// Defines options -heightWithFasteners = true; // Should the height be with or without the fastener elements? - // The dimensions of a track chunk chunkSize = 200; // The nominal size of a chunk: the length for straight chunk, or the width for a curved chunk // The constraints of the track barrier barrierThickness = 0.6; // The thickness of the barrier body -barrierHeight = 40; // The height of the barrier, depending on the option heightWithFasteners +barrierHeight = 40; // The height of the barrier barrierHolderDepth = 6; // The depth of the barrier holder to clamp the barrier body barrierHolderBase = 2; // The base value used to design the barrier holder barrierNotchBase = 2; // The base value used to design the barrier notches diff --git a/rcmodels/tracks/config/functions.scad b/rcmodels/tracks/config/functions.scad index 49578fd..35b1a9a 100644 --- a/rcmodels/tracks/config/functions.scad +++ b/rcmodels/tracks/config/functions.scad @@ -94,28 +94,16 @@ function getCurveLength(chunkSize) = getArcLength(radius = chunkSize, angle = 90 function getCurveRemainingLength(chunkSize) = getCurveLength(chunkSize) - chunkSize; /** - * Gets the height of the barrier body, depending on the option heightWithFasteners + * Gets the height of the barrier body * @returns Number */ -function getBarrierBodyHeight() = - let( - correction = heightWithFasteners - ?-barrierHolderBase * 2 - :barrierHolderDepth * 2 - ) - barrierHeight + correction -; +function getBarrierBodyHeight() = barrierHeight - barrierHolderBase * 2; /** - * Gets the height of the assembled barrier, depending on the option heightWithFasteners + * Gets the height of the assembled barrier * @returns Number */ -function getBarrierHeight() = - let( - correction = heightWithFasteners ? 0 : (barrierHolderBase + barrierHolderDepth) * 2 - ) - barrierHeight + correction -; +function getBarrierHeight() = barrierHeight; /** * Gets the minimal length for a simple body body (a body that should fit between 2 barrier notches) diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index 8640c6d..8bfa438 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -29,7 +29,6 @@ # # application params -heightWithFasteners= chunkSize= barrierHeight= @@ -52,12 +51,6 @@ while (( "$#" )); do barrierHeight=$2 shift ;; - "-i"|"--innerHeight") - heightWithFasteners=0 - ;; - "-o"|"--outerHeight") - heightWithFasteners=1 - ;; "-h"|"--help") echo -e "${C_INF}Renders OpenSCAD files${C_RST}" echo -e " ${C_INF}Usage:${C_RST}" @@ -66,8 +59,6 @@ while (( "$#" )); do echo -e "${C_MSG} -h, --help ${C_RST}Show this help" echo -e "${C_MSG} -l, --chunkSize ${C_RST}Set the length of a track chunk" echo -e "${C_MSG} -w --barrierHeight ${C_RST}Set the height of the track barrier" - echo -e "${C_MSG} -i, --innerHeight ${C_RST}The height of the barrier does not contains the size of the holders" - echo -e "${C_MSG} -o, --outerHeight ${C_RST}The height of the barrier contains the size of the holders" echo exit 0 ;; @@ -89,5 +80,4 @@ scadcheck # render the files, if exist scadtostlall "${srcpath}" "${dstpath}" "" \ "$(varif "chunkSize" ${chunkSize})" \ - "$(varif "barrierHeight" ${barrierHeight})" \ - "$(varif "heightWithFasteners" ${heightWithFasteners})" + "$(varif "barrierHeight" ${barrierHeight})" From 4779d925fb6fc299531c88a3a7fb0604e7b4f4de Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 1 Feb 2020 21:07:11 +0100 Subject: [PATCH 046/191] Rename config variables --- rcmodels/tracks/barrier-body-curve.scad | 6 +- rcmodels/tracks/barrier-body-straight.scad | 6 +- rcmodels/tracks/barrier-holder-curve.scad | 4 +- rcmodels/tracks/barrier-holder-straight.scad | 4 +- rcmodels/tracks/config/config.scad | 20 +++-- rcmodels/tracks/config/setup.scad | 22 +---- .../config/{functions.scad => values.scad} | 81 +++++++++++-------- rcmodels/tracks/render.sh | 14 ++-- rcmodels/tracks/shapes/straight.scad | 2 +- rcmodels/tracks/test/wip.scad | 38 ++++----- 10 files changed, 93 insertions(+), 104 deletions(-) rename rcmodels/tracks/config/{functions.scad => values.scad} (53%) diff --git a/rcmodels/tracks/barrier-body-curve.scad b/rcmodels/tracks/barrier-body-curve.scad index c840b82..aac5d6c 100644 --- a/rcmodels/tracks/barrier-body-curve.scad +++ b/rcmodels/tracks/barrier-body-curve.scad @@ -37,9 +37,9 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) barrierBody( - length = getCurveRemainingLength(getChunkSize()), - height = getBarrierBodyHeight(), - thickness = getBarrierThickness(), + length = getCurveRemainingLength(trackSectionSize), + height = barrierHeight, + thickness = getBarrierBodyThickness(), slotDepth = getBarrierHolderDepth(), notchBase = getBarrierNotchBase() ); diff --git a/rcmodels/tracks/barrier-body-straight.scad b/rcmodels/tracks/barrier-body-straight.scad index b74d676..2ffd739 100644 --- a/rcmodels/tracks/barrier-body-straight.scad +++ b/rcmodels/tracks/barrier-body-straight.scad @@ -37,9 +37,9 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) barrierBodyFull( - length = getChunkSize(), - height = getBarrierBodyHeight(), - thickness = getBarrierThickness(), + length = trackSectionSize, + height = barrierHeight, + thickness = getBarrierBodyThickness(), slotDepth = getBarrierHolderDepth(), notchBase = getBarrierNotchBase() ); diff --git a/rcmodels/tracks/barrier-holder-curve.scad b/rcmodels/tracks/barrier-holder-curve.scad index c3bd201..1245da8 100644 --- a/rcmodels/tracks/barrier-holder-curve.scad +++ b/rcmodels/tracks/barrier-holder-curve.scad @@ -37,8 +37,8 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) curveBarrierHolder( - length = getChunkSize(), - bodyThickness = getSlotWidth(), + length = trackSectionSize, + bodyThickness = getBarrierBodyThickness(), slotDepth = getBarrierHolderDepth(), barrierBase = getBarrierHolderBase(), notchBase = getBarrierNotchBase(), diff --git a/rcmodels/tracks/barrier-holder-straight.scad b/rcmodels/tracks/barrier-holder-straight.scad index c22f922..53b9362 100644 --- a/rcmodels/tracks/barrier-holder-straight.scad +++ b/rcmodels/tracks/barrier-holder-straight.scad @@ -37,8 +37,8 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) straightBarrierHolder( - length = getChunkSize(), - bodyThickness = getSlotWidth(), + length = trackSectionSize, + bodyThickness = getBarrierBodyThickness(), slotDepth = getBarrierHolderDepth(), barrierBase = getBarrierHolderBase(), notchBase = getBarrierNotchBase() diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 6d56545..f2de7f0 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * Defines the config. + * Configures the project. * * @author jsconan * @version 0.1.0 @@ -32,17 +32,15 @@ // We will render the object using the specifications of this mode renderMode = MODE_PROD; -// Defines the constraints of the print. -printResolution = 0.2; // The target layer height -nozzleWidth = 0.4; // The size of the print nozzle -printTolerance = 0.1; // The print tolerance when pieces need to be assembled +// Defines the constraints of the printer. +printResolution = 0.2; // The target layer height +nozzleWidth = 0.4; // The size of the print nozzle +printTolerance = 0.1; // The print tolerance when pieces need to be assembled -// The dimensions of a track chunk -chunkSize = 200; // The nominal size of a chunk: the length for straight chunk, or the width for a curved chunk - -// The constraints of the track barrier -barrierThickness = 0.6; // The thickness of the barrier body -barrierHeight = 40; // The height of the barrier +// The dimensions and constraints of a track element +trackSectionSize = 200; // The nominal size of a track element: the length for straight element, or the width for a curved element +barrierHeight = 40; // The height of the barrier, including the holders +barrierBodyThickness = 0.6; // The thickness of the barrier body barrierHolderDepth = 6; // The depth of the barrier holder to clamp the barrier body barrierHolderBase = 2; // The base value used to design the barrier holder barrierNotchBase = 2; // The base value used to design the barrier notches diff --git a/rcmodels/tracks/config/setup.scad b/rcmodels/tracks/config/setup.scad index 353f643..3401573 100644 --- a/rcmodels/tracks/config/setup.scad +++ b/rcmodels/tracks/config/setup.scad @@ -34,29 +34,9 @@ include <../../../lib/camelSCAD/shapes.scad> // Then we need the config for the project, as well as the related functions include -include +include // Finally, include the shapes include <../shapes/profiles.scad> include <../shapes/straight.scad> include <../shapes/curve.scad> - -// Validate the critical constraints -assert( - chunkSize >= getMinStraightLength(), - str( - "The size for a straight chunk is too small! The minimum length is ", - getMinStraightLength(), - ". The current value is ", - chunkSize - ) -); -assert( - getArcLength(radius = chunkSize, angle = 90) >= getMinCurveLength(), - str( - "The length for a curved chunk is too small! The minimum arc length is ", - getMinCurveLength(), - ". The current value is ", - getArcLength(radius = chunkSize, angle = 90) - ) -); diff --git a/rcmodels/tracks/config/functions.scad b/rcmodels/tracks/config/values.scad similarity index 53% rename from rcmodels/tracks/config/functions.scad rename to rcmodels/tracks/config/values.scad index 35b1a9a..69922d4 100644 --- a/rcmodels/tracks/config/functions.scad +++ b/rcmodels/tracks/config/values.scad @@ -23,87 +23,77 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * Defines some functions. + * Refines values and defines functions. * * @author jsconan * @version 0.1.0 */ /** - * Ajust a height with respect to the target layer height - * @param Number height + * Alligns a value with respect to the target layer height + * @param Number value * @returns Number */ -function adjustToLayer(height) = roundBy(height, printResolution); +function layerAligned(value) = roundBy(value, printResolution); /** - * Ajust a width with respect to the target nozzle size - * @param Number width + * Alligns a value with respect to the target nozzle size + * @param Number value * @returns Number */ -function adjustToNozzle(width) = roundBy(width, nozzleWidth); +function nozzleAligned(value) = roundBy(value, nozzleWidth); /** - * Gets the thickness of the barrier body, adjusted to better fit the printer. + * Gets the thickness of N layers + * @param Number N * @returns Number */ -function getBarrierThickness() = adjustToLayer(barrierThickness); +function layers(N) = N * printResolution; /** - * Gets the base value used to design the barrier holder, adjusted to better fit the printer. + * Gets the width of N times the nozzle width + * @param Number N * @returns Number */ -function getBarrierHolderBase() = adjustToNozzle(barrierHolderBase); +function shells(N) = N * nozzleWidth; /** - * Gets the base value used to design the barrier notches, adjusted to better fit the printer. + * Gets the thickness of the barrier body, adjusted to better fit the printer. * @returns Number */ -function getBarrierNotchBase() = adjustToNozzle(barrierNotchBase); +function getBarrierBodyThickness() = layerAligned(barrierBodyThickness); /** - * Gets the width of the slot that will hold the barrier body. + * Gets the base value used to design the barrier holder, adjusted to better fit the printer. * @returns Number */ -function getSlotWidth() = getBarrierThickness(); +function getBarrierHolderBase() = nozzleAligned(barrierHolderBase); /** - * Gets the depth of the slot that will hold the barrier body. + * Gets the base value used to design the barrier notches, adjusted to better fit the printer. * @returns Number */ -function getBarrierHolderDepth() = adjustToLayer(barrierHolderDepth); +function getBarrierNotchBase() = nozzleAligned(barrierNotchBase); /** - * Gets the nominal size of a track chunk. + * Gets the depth of the slot that will hold the barrier body. * @returns Number */ -function getChunkSize() = chunkSize; +function getBarrierHolderDepth() = layerAligned(barrierHolderDepth); /** * Gets the length of a curved chunk (the length of the arc of the curve). - * @param Number chunkSize - The length of a straight chunk + * @param Number trackSectionSize - The length of a straight chunk * @returns Number */ -function getCurveLength(chunkSize) = getArcLength(radius = chunkSize, angle = 90); +function getCurveLength(trackSectionSize) = getArcLength(radius = trackSectionSize, angle = 90); /** * Gets the difference between the length of a curved chunk and a regular straight chunk - * @param Number chunkSize - The length of a straight chunk - * @returns Number - */ -function getCurveRemainingLength(chunkSize) = getCurveLength(chunkSize) - chunkSize; - -/** - * Gets the height of the barrier body + * @param Number trackSectionSize - The length of a straight chunk * @returns Number */ -function getBarrierBodyHeight() = barrierHeight - barrierHolderBase * 2; - -/** - * Gets the height of the assembled barrier - * @returns Number - */ -function getBarrierHeight() = barrierHeight; +function getCurveRemainingLength(trackSectionSize) = getCurveLength(trackSectionSize) - trackSectionSize; /** * Gets the minimal length for a simple body body (a body that should fit between 2 barrier notches) @@ -122,3 +112,24 @@ function getMinStraightLength() = 2 * getMinBodyLength(); * @returns Number */ function getMinCurveLength() = 3 * getMinBodyLength(); + + +// Validate the critical constraints +assert( + trackSectionSize >= getMinStraightLength(), + str( + "The size for a straight chunk is too small! The minimum length is ", + getMinStraightLength(), + ". The current value is ", + trackSectionSize + ) +); +assert( + getArcLength(radius = trackSectionSize, angle = 90) >= getMinCurveLength(), + str( + "The length for a curved chunk is too small! The minimum arc length is ", + getMinCurveLength(), + ". The current value is ", + getArcLength(radius = trackSectionSize, angle = 90) + ) +); diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index 8bfa438..8cc271e 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -29,7 +29,7 @@ # # application params -chunkSize= +trackSectionSize= barrierHeight= # script config @@ -43,11 +43,11 @@ source "${scriptpath}/../../lib/camelSCAD/scripts/utils.sh" # load parameters while (( "$#" )); do case $1 in - "-l"|"--chunkSize") - chunkSize=$2 + "-l"|"--length") + trackSectionSize=$2 shift ;; - "-w"|"--barrierHeight") + "-w"|"--height") barrierHeight=$2 shift ;; @@ -57,8 +57,8 @@ while (( "$#" )); do echo -e "${C_CTX}\t$0 [-h|--help] [-o|--option value] files${C_RST}" echo echo -e "${C_MSG} -h, --help ${C_RST}Show this help" - echo -e "${C_MSG} -l, --chunkSize ${C_RST}Set the length of a track chunk" - echo -e "${C_MSG} -w --barrierHeight ${C_RST}Set the height of the track barrier" + echo -e "${C_MSG} -l, --length ${C_RST}Set the size of a track section" + echo -e "${C_MSG} -w --height ${C_RST}Set the height of the track barrier" echo exit 0 ;; @@ -79,5 +79,5 @@ scadcheck # render the files, if exist scadtostlall "${srcpath}" "${dstpath}" "" \ - "$(varif "chunkSize" ${chunkSize})" \ + "$(varif "trackSectionSize" ${trackSectionSize})" \ "$(varif "barrierHeight" ${barrierHeight})" diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 561eabd..1936b8d 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -37,7 +37,7 @@ */ module barrierHook(base, thickness, negative=false) { start = negative ? 1 : 0; - base = adjustToNozzle(base / 2) * 2; + base = nozzleAligned(base / 2) * 2; translateZ(-start) { box([base * 2, base, thickness + start]); translateX(-base) { diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index b9a0c40..5a20d08 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -36,7 +36,7 @@ include <../config/setup.scad> applyMode(mode=renderMode) { // test the barrier profile *barrierHolderProfile( - slotWidth = getSlotWidth(), + slotWidth = getBarrierBodyThickness(), slotDepth = getBarrierHolderDepth(), base = getBarrierHolderBase() ); @@ -49,7 +49,7 @@ applyMode(mode=renderMode) { ); // test the barrier notches profile *barrierNotchesProfile( - length = getChunkSize() / 2, + length = trackSectionSize / 2, slotDepth = getBarrierHolderDepth(), base = getBarrierNotchBase(), negative = true @@ -62,7 +62,7 @@ applyMode(mode=renderMode) { ); // test the barrier notch shape *barrierNotch( - thickness = getSlotWidth(), + thickness = getBarrierBodyThickness(), slotDepth = getBarrierHolderDepth(), base = getBarrierNotchBase(), direction = -1, @@ -71,8 +71,8 @@ applyMode(mode=renderMode) { ); // test the barrier notches shape *barrierNotches( - length = getChunkSize(), - thickness = getSlotWidth(), + length = trackSectionSize, + thickness = getBarrierBodyThickness(), slotDepth = getBarrierHolderDepth(), base = getBarrierNotchBase(), negative = true, @@ -80,8 +80,8 @@ applyMode(mode=renderMode) { ); // test the barrier notches shape for a full chunk *barrierNotchesFull( - length = getChunkSize(), - thickness = getSlotWidth(), + length = trackSectionSize, + thickness = getBarrierBodyThickness(), slotDepth = getBarrierHolderDepth(), base = getBarrierNotchBase(), negative = true, @@ -89,16 +89,16 @@ applyMode(mode=renderMode) { ); // test the barrier holder shape for a straight chunk *straightBarrierHolder( - length = getChunkSize(), - bodyThickness = getSlotWidth(), + length = trackSectionSize, + bodyThickness = getBarrierBodyThickness(), slotDepth = getBarrierHolderDepth(), barrierBase = getBarrierHolderBase(), notchBase = getBarrierNotchBase() ); // test the curved barrier notch *curveBarrierNotch( - radius = getChunkSize(), - thickness = getSlotWidth(), + radius = trackSectionSize, + thickness = getBarrierBodyThickness(), slotDepth = getBarrierHolderDepth(), base = getBarrierNotchBase(), direction = 1, @@ -106,8 +106,8 @@ applyMode(mode=renderMode) { ); // test the barrier holder shape for a curved chunk *curveBarrierHolder( - length = getChunkSize(), - bodyThickness = getSlotWidth(), + length = trackSectionSize, + bodyThickness = getBarrierBodyThickness(), slotDepth = getBarrierHolderDepth(), barrierBase = getBarrierHolderBase(), notchBase = getBarrierNotchBase(), @@ -115,17 +115,17 @@ applyMode(mode=renderMode) { ); // test the barrier body shape for a straight chunk *barrierBody( - length = getCurveRemainingLength(getChunkSize()), - height = getBarrierBodyHeight(), - thickness = getBarrierThickness(), + length = getCurveRemainingLength(trackSectionSize), + height = barrierHeight, + thickness = getBarrierBodyThickness(), slotDepth = getBarrierHolderDepth(), notchBase = getBarrierNotchBase() ); // test the full barrier body shape for a straight chunk *barrierBodyFull( - length = getChunkSize(), - height = getBarrierBodyHeight(), - thickness = getBarrierThickness(), + length = trackSectionSize, + height = barrierHeight, + thickness = getBarrierBodyThickness(), slotDepth = getBarrierHolderDepth(), notchBase = getBarrierNotchBase() ); From 7e3048ce296999ea7ba5f1eb67fcf718bedbb227 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 1 Feb 2020 21:12:01 +0100 Subject: [PATCH 047/191] Rework the test bed --- rcmodels/tracks/test/wip.scad | 217 +++++++++++++++++++--------------- 1 file changed, 122 insertions(+), 95 deletions(-) diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 5a20d08..7984d36 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -34,99 +34,126 @@ include <../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { - // test the barrier profile - *barrierHolderProfile( - slotWidth = getBarrierBodyThickness(), - slotDepth = getBarrierHolderDepth(), - base = getBarrierHolderBase() - ); - // test the barrier notch profile - *barrierNotchProfile( - slotDepth = getBarrierHolderDepth(), - base = getBarrierNotchBase(), - direction = -1, - negative = true - ); - // test the barrier notches profile - *barrierNotchesProfile( - length = trackSectionSize / 2, - slotDepth = getBarrierHolderDepth(), - base = getBarrierNotchBase(), - negative = true - ); - // test the barrier hook shape - *barrierHook( - base = getBarrierNotchBase(), - thickness = getBarrierNotchBase(), - negative=false - ); - // test the barrier notch shape - *barrierNotch( - thickness = getBarrierBodyThickness(), - slotDepth = getBarrierHolderDepth(), - base = getBarrierNotchBase(), - direction = -1, - negative = true, - center = true - ); - // test the barrier notches shape - *barrierNotches( - length = trackSectionSize, - thickness = getBarrierBodyThickness(), - slotDepth = getBarrierHolderDepth(), - base = getBarrierNotchBase(), - negative = true, - center = true - ); - // test the barrier notches shape for a full chunk - *barrierNotchesFull( - length = trackSectionSize, - thickness = getBarrierBodyThickness(), - slotDepth = getBarrierHolderDepth(), - base = getBarrierNotchBase(), - negative = true, - center = true - ); - // test the barrier holder shape for a straight chunk - *straightBarrierHolder( - length = trackSectionSize, - bodyThickness = getBarrierBodyThickness(), - slotDepth = getBarrierHolderDepth(), - barrierBase = getBarrierHolderBase(), - notchBase = getBarrierNotchBase() - ); - // test the curved barrier notch - *curveBarrierNotch( - radius = trackSectionSize, - thickness = getBarrierBodyThickness(), - slotDepth = getBarrierHolderDepth(), - base = getBarrierNotchBase(), - direction = 1, - negative = true - ); - // test the barrier holder shape for a curved chunk - *curveBarrierHolder( - length = trackSectionSize, - bodyThickness = getBarrierBodyThickness(), - slotDepth = getBarrierHolderDepth(), - barrierBase = getBarrierHolderBase(), - notchBase = getBarrierNotchBase(), - ratio = 1 - ); - // test the barrier body shape for a straight chunk - *barrierBody( - length = getCurveRemainingLength(trackSectionSize), - height = barrierHeight, - thickness = getBarrierBodyThickness(), - slotDepth = getBarrierHolderDepth(), - notchBase = getBarrierNotchBase() - ); - // test the full barrier body shape for a straight chunk - *barrierBodyFull( - length = trackSectionSize, - height = barrierHeight, - thickness = getBarrierBodyThickness(), - slotDepth = getBarrierHolderDepth(), - notchBase = getBarrierNotchBase() - ); + + length = 50; + height = 30; + thickness = 0.6; + slotDepth = 6; + base = 2; + + distribute([length, 0, 0], center=true) { + distribute([0, height, 0], center=true) { + + // test the barrier holder shape for a straight chunk + straightBarrierHolder( + length = length, + bodyThickness = thickness, + slotDepth = slotDepth, + barrierBase = base, + notchBase = base + ); + + // test the full barrier body shape for a straight chunk + barrierBodyFull( + length = length, + height = height, + thickness = thickness, + slotDepth = slotDepth, + notchBase = base + ); + + // test the barrier hook shape + barrierHook( + base = base, + thickness = base, + negative=false + ); + + // test the barrier body shape for a straight chunk + barrierBody( + length = getCurveRemainingLength(length), + height = height, + thickness = thickness, + slotDepth = slotDepth, + notchBase = base + ); + + // test the barrier notch shape + barrierNotch( + thickness = thickness, + slotDepth = slotDepth, + base = base, + direction = -1, + negative = true, + center = true + ); + + } + distribute([0, 10, 0], center=true) { + + // test the curved barrier notch + curveBarrierNotch( + radius = length, + thickness = thickness, + slotDepth = slotDepth, + base = base, + direction = 1, + negative = true + ); + + // test the barrier profile + barrierHolderProfile( + slotWidth = thickness, + slotDepth = slotDepth, + base = base + ); + + // test the barrier notch profile + barrierNotchProfile( + slotDepth = slotDepth, + base = base, + direction = -1, + negative = true + ); + + // test the barrier notches profile + barrierNotchesProfile( + length = length / 2, + slotDepth = slotDepth, + base = base, + negative = true + ); + + // test the barrier notches shape + barrierNotches( + length = length, + thickness = thickness, + slotDepth = slotDepth, + base = base, + negative = true, + center = true + ); + + // test the barrier notches shape for a full chunk + barrierNotchesFull( + length = length, + thickness = thickness, + slotDepth = slotDepth, + base = base, + negative = true, + center = true + ); + + // test the barrier holder shape for a curved chunk + curveBarrierHolder( + length = length, + bodyThickness = thickness, + slotDepth = slotDepth, + barrierBase = base, + notchBase = base, + ratio = 1 + ); + + } + } } From 3a8251b6571a52cacce06ef756a1e6305ce7f2c8 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 1 Feb 2020 21:31:48 +0100 Subject: [PATCH 048/191] Rework the shape of the barrier link --- rcmodels/tracks/shapes/curve.scad | 17 ++++++------ rcmodels/tracks/shapes/profiles.scad | 32 ++++++++++++++++++++++ rcmodels/tracks/shapes/straight.scad | 40 +++++++++++++--------------- rcmodels/tracks/test/wip.scad | 16 ++++++++--- 4 files changed, 71 insertions(+), 34 deletions(-) diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad index aa1a516..0b8eaed 100644 --- a/rcmodels/tracks/shapes/curve.scad +++ b/rcmodels/tracks/shapes/curve.scad @@ -153,20 +153,19 @@ module curveBarrierHolder(length, bodyThickness, slotDepth, barrierBase, notchBa } rotateZ(-ratioAngle) { translateY(radius) { - barrierHook( - base = notchBase, - thickness = barrierBase - printResolution * 2, - negative = false + barrierLink( + height = barrierBase - printResolution * 2, + base = notchBase ); } } } - translateX(radius) { + translate([radius, 0, -1]) { rotateZ(-90) { - barrierHook( - base = notchBase + printTolerance, - thickness = barrierBase - printResolution, - negative = true + barrierLink( + height = barrierBase - printResolution + 1, + base = notchBase, + distance = printTolerance ); } } diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index 396565f..8925124 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -29,6 +29,38 @@ * @version 0.1.0 */ +/** + * Computes the points defining the profile of a barrier link. + * @param Number base - The base value used to design the barrier link. + * @param Number [distance] - An additional distance added to the outline. + * @returns Vector[] + */ +function getBarrierLinkPoints(base, distance = 0) = + let( + half = base / 2 + ) + outline(path([ + ["P", half, half], + ["H", -base], + ["C", [half, half], 0, 180], + ["V", -base], + ["C", [half, half], 180, 360], + ["H", base], + ]), distance) +; + +/** + * Draws the profile of a barrier link. + * @param Number base - The base value used to design the barrier link. + * @param Number [distance] - The additional distance added to the outline. + */ +module barrierLinkProfile(base, distance = 0) { + polygon(getBarrierLinkPoints( + base = base, + distance = distance + )); +} + /** * Computes the points defining the profile of the barrier holder. * @param Number slotWidth - The width of the slot that will hold the barrier body. diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 1936b8d..53d098f 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -30,19 +30,18 @@ */ /** - * Draws the shape of a barrier holder hook. - * @param Number base - The width of each base of the hook. - * @param Number thickness - The thickness of the hook - * @param Boolean [negative] - The shape will be used in a difference operation + * Draws the shape of a barrier link. + * @param Number height - The height of the link. + * @param Number base - The base value used to design the barrier link. + * @param Number [distance] - The additional distance added to the outline. + * @param Boolean [center] - The shape is centered vertically. */ -module barrierHook(base, thickness, negative=false) { - start = negative ? 1 : 0; - base = nozzleAligned(base / 2) * 2; - translateZ(-start) { - box([base * 2, base, thickness + start]); - translateX(-base) { - slot([base, base * 2, thickness + start]); - } +module barrierLink(height, base, distance = 0, center = false) { + negativeExtrude(height=height, center=center) { + barrierLinkProfile( + base = base, + distance = distance + ); } } @@ -141,18 +140,17 @@ module straightBarrierHolder(length, bodyThickness, slotDepth, barrierBase, notc } } translateX(-length / 2) { - barrierHook( - base = notchBase, - thickness = barrierBase - printResolution * 2, - negative = false + barrierLink( + height = barrierBase - printResolution * 2, + base = notchBase ); } } - translateX(length / 2) { - barrierHook( - base = notchBase + printTolerance, - thickness = barrierBase - printResolution, - negative = true + translate([length / 2, 0, -1]) { + barrierLink( + height = barrierBase - printResolution + 1, + base = notchBase, + distance = printTolerance ); } } diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 7984d36..94da988 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -40,6 +40,7 @@ applyMode(mode=renderMode) { thickness = 0.6; slotDepth = 6; base = 2; + distance = 0.1; distribute([length, 0, 0], center=true) { distribute([0, height, 0], center=true) { @@ -62,11 +63,12 @@ applyMode(mode=renderMode) { notchBase = base ); - // test the barrier hook shape - barrierHook( + // test the barrier link shape + barrierLink( + height = 5, base = base, - thickness = base, - negative=false + distance = distance, + center = false ); // test the barrier body shape for a straight chunk @@ -101,6 +103,12 @@ applyMode(mode=renderMode) { negative = true ); + // test the barrier link profile + barrierLinkProfile( + base = base, + distance = distance + ); + // test the barrier profile barrierHolderProfile( slotWidth = thickness, From 66b0db48fb3964566cfb56950763b7d5141592d2 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 1 Feb 2020 21:47:36 +0100 Subject: [PATCH 049/191] Rework the shape of the barrier holders --- rcmodels/tracks/barrier-body-curve.scad | 9 +- rcmodels/tracks/barrier-body-straight.scad | 11 +- rcmodels/tracks/barrier-holder-curve.scad | 11 +- rcmodels/tracks/barrier-holder-straight.scad | 9 +- rcmodels/tracks/config/config.scad | 6 +- rcmodels/tracks/config/values.scad | 88 +++++--- rcmodels/tracks/shapes/curve.scad | 195 ++++++++-------- rcmodels/tracks/shapes/profiles.scad | 135 +++++------ rcmodels/tracks/shapes/straight.scad | 223 +++++++------------ rcmodels/tracks/test/wip.scad | 104 ++++----- 10 files changed, 364 insertions(+), 427 deletions(-) diff --git a/rcmodels/tracks/barrier-body-curve.scad b/rcmodels/tracks/barrier-body-curve.scad index aac5d6c..32ef101 100644 --- a/rcmodels/tracks/barrier-body-curve.scad +++ b/rcmodels/tracks/barrier-body-curve.scad @@ -39,8 +39,11 @@ applyMode(mode=renderMode) { barrierBody( length = getCurveRemainingLength(trackSectionSize), height = barrierHeight, - thickness = getBarrierBodyThickness(), - slotDepth = getBarrierHolderDepth(), - notchBase = getBarrierNotchBase() + thickness = barrierBodyThickness, + base = barrierLinkBase, + strip = barrierStripHeight, + indent = barrierStripIndent, + notches = 1, + distance = printTolerance ); } diff --git a/rcmodels/tracks/barrier-body-straight.scad b/rcmodels/tracks/barrier-body-straight.scad index 2ffd739..3e9d87d 100644 --- a/rcmodels/tracks/barrier-body-straight.scad +++ b/rcmodels/tracks/barrier-body-straight.scad @@ -36,11 +36,14 @@ include applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - barrierBodyFull( + barrierBody( length = trackSectionSize, height = barrierHeight, - thickness = getBarrierBodyThickness(), - slotDepth = getBarrierHolderDepth(), - notchBase = getBarrierNotchBase() + thickness = barrierBodyThickness, + base = barrierLinkBase, + strip = barrierStripHeight, + indent = barrierStripIndent, + notches = 2, + distance = printTolerance ); } diff --git a/rcmodels/tracks/barrier-holder-curve.scad b/rcmodels/tracks/barrier-holder-curve.scad index 1245da8..e9b7a70 100644 --- a/rcmodels/tracks/barrier-holder-curve.scad +++ b/rcmodels/tracks/barrier-holder-curve.scad @@ -36,12 +36,13 @@ include applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - curveBarrierHolder( + curvedBarrierHolder( length = trackSectionSize, - bodyThickness = getBarrierBodyThickness(), - slotDepth = getBarrierHolderDepth(), - barrierBase = getBarrierHolderBase(), - notchBase = getBarrierNotchBase(), + thickness = barrierBodyThickness, + base = barrierLinkBase, + strip = barrierStripHeight, + indent = barrierStripIndent, + distance = printTolerance, ratio = 1 ); } diff --git a/rcmodels/tracks/barrier-holder-straight.scad b/rcmodels/tracks/barrier-holder-straight.scad index 53b9362..c421e9d 100644 --- a/rcmodels/tracks/barrier-holder-straight.scad +++ b/rcmodels/tracks/barrier-holder-straight.scad @@ -38,9 +38,10 @@ applyMode(mode=renderMode) { //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) straightBarrierHolder( length = trackSectionSize, - bodyThickness = getBarrierBodyThickness(), - slotDepth = getBarrierHolderDepth(), - barrierBase = getBarrierHolderBase(), - notchBase = getBarrierNotchBase() + thickness = barrierBodyThickness, + base = barrierLinkBase, + strip = barrierStripHeight, + indent = barrierStripIndent, + distance = printTolerance ); } diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index f2de7f0..3ef020f 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -41,6 +41,6 @@ printTolerance = 0.1; // The print tolerance when pieces need to be assembled trackSectionSize = 200; // The nominal size of a track element: the length for straight element, or the width for a curved element barrierHeight = 40; // The height of the barrier, including the holders barrierBodyThickness = 0.6; // The thickness of the barrier body -barrierHolderDepth = 6; // The depth of the barrier holder to clamp the barrier body -barrierHolderBase = 2; // The base value used to design the barrier holder -barrierNotchBase = 2; // The base value used to design the barrier notches +barrierStripHeight = 6; // The height of the barrier body part that will be inserted in the holder +barrierStripIndent = 1; // The indent of the barrier body strip +barrierLinkBase = 2; // The base value used to design the barrier link diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 69922d4..fef918a 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -58,78 +58,112 @@ function layers(N) = N * printResolution; function shells(N) = N * nozzleWidth; /** - * Gets the thickness of the barrier body, adjusted to better fit the printer. + * Computes the outer length of a barrier link. + * @param Number base - The base value used to design the barrier link. + * @param Number [distance] - An additional distance added to the outline. * @returns Number */ -function getBarrierBodyThickness() = layerAligned(barrierBodyThickness); +function getBarrierLinkLength(base, distance = 0) = base * 1.5 + distance; /** - * Gets the base value used to design the barrier holder, adjusted to better fit the printer. + * Computes the outer width of a barrier link. + * @param Number base - The base value used to design the barrier link. + * @param Number [distance] - An additional distance added to the outline. * @returns Number */ -function getBarrierHolderBase() = nozzleAligned(barrierHolderBase); +function getBarrierLinkWidth(base, distance = 0) = (base + distance) * 2; /** - * Gets the base value used to design the barrier notches, adjusted to better fit the printer. + * Computes the outer width of a barrier holder notch. + * @param Number base - The base value used to design the barrier link. + * @param Number indent - The indent of the barrier body strip. + * @param Number [distance] - An additional distance added to the outline. * @returns Number */ -function getBarrierNotchBase() = nozzleAligned(barrierNotchBase); +function getBarrierNotchWidth(base, indent, distance = 0) = (getBarrierLinkWidth(base, distance) + indent + minWidth) * 2; /** - * Gets the depth of the slot that will hold the barrier body. + * Computes the inner width of a barrier holder notch. + * @param Number base - The base value used to design the barrier link. + * @param Number indent - The indent of the barrier body strip. + * @param Number [distance] - An additional distance added to the outline. * @returns Number */ -function getBarrierHolderDepth() = layerAligned(barrierHolderDepth); +function getBarrierNotchDistance(base, indent, distance = 0) = (getBarrierLinkWidth(base, distance) + minWidth) * 2; /** - * Gets the length of a curved chunk (the length of the arc of the curve). - * @param Number trackSectionSize - The length of a straight chunk + * Computes the outer width of a barrier holder. + * @param Number base - The base value used to design the barrier link. + * @param Number [distance] - An additional distance added to the outline. * @returns Number */ -function getCurveLength(trackSectionSize) = getArcLength(radius = trackSectionSize, angle = 90); +function getBarrierHolderWidth(base, distance = 0) = getBarrierLinkWidth(base, distance) + minWidth * 4; /** - * Gets the difference between the length of a curved chunk and a regular straight chunk - * @param Number trackSectionSize - The length of a straight chunk + * Computes the outer height of a barrier holder. + * @param Number strip - The height of the barrier body part that will be inserted in the holder. * @returns Number */ -function getCurveRemainingLength(trackSectionSize) = getCurveLength(trackSectionSize) - trackSectionSize; +function getBarrierHolderHeight(strip) = strip + minThickness + printResolution; /** - * Gets the minimal length for a simple body body (a body that should fit between 2 barrier notches) + * Computes the inner height of the barrier body. + * @param Number height - The height of the barrier body. + * @param Number strip - The height of the barrier body part that will be inserted in the holder. * @returns Number */ -function getMinBodyLength() = 5 * getBarrierNotchBase(); +function getBarrierInnerHeight(height, strip, indent) = height - strip * 2; /** - * Gets the minimal length for a straight chunk + * Gets the length of a curved ctrack elementhunk (the length of the arc of the curve). + * @param Number length - The length of the track element. * @returns Number */ -function getMinStraightLength() = 2 * getMinBodyLength(); +function getCurveLength(length) = getArcLength(radius = length, angle = 90); /** - * Gets the minimal arc length for a curved chunk + * Gets the difference between the length of a curved track element chunk and a straight track element + * @param Number length - The length of the track element. * @returns Number */ -function getMinCurveLength() = 3 * getMinBodyLength(); +function getCurveRemainingLength(length) = getCurveLength(length) - length; +/** + * Computes the minimal length of a track element. + * @param Number base - The base value used to design the barrier link. + * @param Number indent - The indent of the barrier body strip. + * @param Number [distance] - An additional distance added to the outline. + * @returns Number + */ +function getMinLength(base, indent, distance = 0) = getBarrierNotchWidth(base, indent, distance) * 4; + + +// The minimal thickness of a part +minThickness = layers(2); + +// The minimal width of a part +minWidth = shells(2); + +// The minimal size for a track element +minTrackSectionSize = getBarrierNotchWidth(barrierLinkBase, barrierStripIndent, printTolerance) * 4; +minBarrierHeight = barrierStripHeight * 3; // Validate the critical constraints assert( - trackSectionSize >= getMinStraightLength(), + trackSectionSize >= minTrackSectionSize, str( - "The size for a straight chunk is too small! The minimum length is ", - getMinStraightLength(), + "The size for a track element is too small! The minimum length is ", + minTrackSectionSize, ". The current value is ", trackSectionSize ) ); assert( - getArcLength(radius = trackSectionSize, angle = 90) >= getMinCurveLength(), + barrierHeight >= minBarrierHeight, str( - "The length for a curved chunk is too small! The minimum arc length is ", - getMinCurveLength(), + "The height for a track barrier is too small! The minimum height is ", + minBarrierHeight, ". The current value is ", - getArcLength(radius = trackSectionSize, angle = 90) + barrierHeight ) ); diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad index 0b8eaed..cd4558c 100644 --- a/rcmodels/tracks/shapes/curve.scad +++ b/rcmodels/tracks/shapes/curve.scad @@ -23,50 +23,52 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * Defines some curved track parts. + * Defines the curved track parts. * * @author jsconan * @version 0.1.0 */ /** - * Draws the shape of a curved barrier holder notch. + * Draws the shape of a barrier holder notch for a curved track element. * @param Number radius - The radius of the curve. - * @param Number thickness - The thickness of the shape - * @param Number slotDepth - The depth of the slot that will hold the barrier body. - * @param Number base - The base value used to design the barrier notches. - * @param Number [direction] - The direction of the shape (1: right, -1: left) - * @param Boolean [negative] - The shape will be used in a difference operation + * @param Number thickness - The thickness of the shape. + * @param Number base - The base value used to design the barrier link. + * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number indent - The indent of the barrier body strip. + * @param Number [distance] - An additional distance added to the outline. */ -module curveBarrierNotch(radius, thickness, slotDepth, base, direction=1, negative=false) { - start = negative ? 1 : 0; - direction = direction >= 0 ? 1 : -1; - length = base * 2; - angle = getArcAngle(radius = radius, length = length); - chord = getChordLength(radius = radius, angle = angle / 2); +module barrierNotchCurved(radius, thickness, base, strip, indent, distance = 0) { + width = getBarrierNotchWidth(base, indent, distance); + height = strip - indent; + angle = getArcAngle(radius = radius, length = width); + chord = getChordLength(radius = radius, angle = getArcAngle(radius = radius, length = indent)); + startAngle = angle / 2; difference() { - translateZ(-start) { + translateZ(-base) { pipeSegment( r = radius + thickness / 2, - h = slotDepth + start, + h = height + base, w = thickness, - a1 = -direction * getArcAngle(radius = radius, length = start), - a2 = direction * angle + a = angle, + a1 = -startAngle ); } - - rotateZ(direction * angle) { - translateX(radius) { - rotate([90, 0, 270]) { - negativeExtrude(height = thickness + 1, center = true) { - polygon([ - [0, 0], - [direction * chord, slotDepth], - [direction * chord, slotDepth + 1], - [direction * -1, slotDepth + 1], - [direction * -1, 0], - ]); + repeatMirror(axis = [0, 1, 0]) { + rotateZ(startAngle) { + translateX(radius) { + rotate([90, 0, 270]) { + negativeExtrude(height = thickness + 1, center = true) { + polygon(path([ + ["P", 0, -base], + ["V", base], + ["L", chord, height], + ["V", base], + ["H", -base], + ["V", -height - base * 2] + ])); + } } } } @@ -75,98 +77,79 @@ module curveBarrierNotch(radius, thickness, slotDepth, base, direction=1, negati } /** - * Draws the shape of a curved barrier holder notches for a full chunk. - * @param Number radius - The radius of the curve. - * @param Number length - The length of a chunk - * @param Number angle - The angle of the curve - * @param Number thickness - The thickness of the shape - * @param Number slotDepth - The depth of the slot that will hold the barrier body. - * @param Number base - The base value used to design the barrier notches. - * @param Boolean [negative] - The shape will be used in a difference operation + * Draws the barrier holder for a straight track element. + * @param Number length - The length of the element. + * @param Number base - The base value used to design the barrier link. + * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number indent - The indent of the barrier body strip. + * @param Number thickness - The thickness of the barrier body. + * @param Number [distance] - An additional distance added to the outline. + * @param Number ratio - The ratio to apply on the radius */ -module curveBarrierNotches(radius, length, angle, thickness, slotDepth, base, negative=false) { - rotateZ(angle) { - repeatMirror(axis=[0, 1, 0]) { - rotateZ(-angle) { - curveBarrierNotch( - radius = radius, - thickness = thickness, - slotDepth = slotDepth, - base = base, - direction = 1, - negative = negative - ); - rotateZ(getArcAngle(radius = radius, length = length / 2)) { - repeatMirror(axis=[0, 1, 0]) { - curveBarrierNotch( - radius = radius, - thickness = thickness, - slotDepth = slotDepth, - base = base, - direction = -1, - negative = negative - ); - } - } - } - } - } -} - -/** - * Draws the barrier holder for a curved chunk - * @param Number length - The length of a chunk - * @param Number bodyThickness - The thickness of the barrier body. - * @param Number slotDepth - The depth of the slot that will hold the barrier body. - * @param Number barrierBase - The base value used to design the barrier holder. - * @param Number notchBase - The width of a notch base. - * @param Number ratio - The ratio of the chunk - */ -module curveBarrierHolder(length, bodyThickness, slotDepth, barrierBase, notchBase, ratio = 1) { +module curvedBarrierHolder(length, thickness, base, strip, indent, distance = 0, ratio = 1) { radius = length * ratio; defaultAngle = 90; angle = defaultAngle / ratio; ratioAngle = defaultAngle - angle; + linkHeight = getBarrierHolderHeight(strip) - base; + thickness = thickness + distance; rotateZ(ratioAngle / 2) { + rotateZ(-ratioAngle) { + translateY(radius) { + barrierLink( + height = linkHeight - printResolution, + base = base + ); + } + } difference() { - union() { - rotate_extrude(angle=angle, convexity=10) { - translateX(radius) { - barrierHolderProfile( - slotWidth = bodyThickness + printTolerance, - slotDepth = slotDepth, - base = barrierBase - ); - } - } - translateZ(barrierBase) { - curveBarrierNotches( - radius = radius, - length = length, - angle = angle / 2, - thickness = barrierBase + barrierBase, - slotDepth = slotDepth, - base = notchBase - printTolerance, - negative=false + rotate_extrude(angle=angle, convexity=10) { + translateX(radius) { + barrierHolderProfile( + base = base, + strip = strip, + thickness = thickness, + distance = distance ); } - rotateZ(-ratioAngle) { - translateY(radius) { - barrierLink( - height = barrierBase - printResolution * 2, - base = notchBase - ); - } - } } translate([radius, 0, -1]) { rotateZ(-90) { barrierLink( - height = barrierBase - printResolution + 1, - base = notchBase, - distance = printTolerance + height = linkHeight + printResolution + 1, + base = base, + distance = distance + ); + } + } + translateZ(minThickness) { + difference() { + pipeSegment( + r = radius + thickness / 2, + h = strip * 2, + w = thickness, + a = angle ); + + arcAngle = getArcAngle(radius = radius, length = length / 2); + angles = [ + [0, 0, 0], + [0, 0, arcAngle], + [0, 0, angle - arcAngle], + [0, 0, angle] + ]; + + repeatRotateMap(angles) { + barrierNotchCurved( + radius = radius, + thickness = thickness * 2, + base = base, + strip = strip, + indent = indent, + distance = distance / 2 + ); + } } } } diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index 8925124..2f50246 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * Defines some profile shapes. + * Defines the profile shapes for the track elements. * * @author jsconan * @version 0.1.0 @@ -62,103 +62,84 @@ module barrierLinkProfile(base, distance = 0) { } /** - * Computes the points defining the profile of the barrier holder. - * @param Number slotWidth - The width of the slot that will hold the barrier body. - * @param Number slotDepth - The depth of the slot that will hold the barrier body. - * @param Number base - The base value used to design the barrier holder. + * Computes the points defining the profile of a barrier holder notch. + * @param Number base - The base value used to design the barrier link. + * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number indent - The indent of the barrier body strip. + * @param Number [distance] - An additional distance added to the outline. * @returns Vector[] */ -function getBarrierHolderPoints(slotWidth, slotDepth, base) = +function getBarrierNotchPoints(base, strip, indent, distance = 0) = let( - width = base * 4 + slotWidth + width = getBarrierNotchWidth(base, indent, distance), + top = getBarrierNotchDistance(base, indent, distance), + height = strip - indent ) path([ ["P", -width / 2, 0], - ["V", base], - ["L", base, slotDepth], - ["H", base], - ["V", -slotDepth], - ["H", slotWidth], - ["V", slotDepth], - ["H", base], - ["L", base, -slotDepth], - ["V", -base] + ["L", indent, height], + ["H", top], + ["L", indent, -height], + ["V", -base], + ["H", -width] ]) ; /** - * Computes the points defining the profile of a barrier holder notch. - * @param Number slotDepth - The depth of the slot that will hold the barrier body. - * @param Number base - The base value used to design the barrier notches. - * @param Number [direction] - The direction of the shape (1: right, -1: left) - * @param Boolean [negative] - The shape will be used in a difference operation + * Draws the profile of a barrier holder notch. + * @param Number base - The base value used to design the barrier link. + * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number indent - The indent of the barrier body strip. + * @param Number [distance] - An additional distance added to the outline. + */ +module barrierNotchProfile(base, strip, indent, distance = 0) { + polygon(getBarrierNotchPoints( + base = base, + strip = strip, + indent = indent, + distance = distance + )); +} + +/** + * Computes the points defining the profile of a barrier holder. + * @param Number base - The base value used to design the barrier link. + * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number thickness - The thickness of the barrier body. + * @param Number [distance] - An additional distance added to the outline. * @returns Vector[] */ -function getBarrierNotchPoints(slotDepth, base, direction=1, negative=false) = +function getBarrierHolderPoints(base, strip, thickness, distance = 0) = let( - start = negative ? 1 : 0, - direction = direction >= 0 ? 1 : -1, - width = base * 2 + linkWidth = getBarrierLinkWidth(base, distance), + top = nozzleAligned((linkWidth - thickness) / 2) * 2 + thickness, + width = getBarrierHolderWidth(base, distance), + height = getBarrierHolderHeight(strip), + lineW = (width - top) / 2, + lineH = height - base ) path([ - ["P", direction * -start, slotDepth], - ["H", direction * (base + start)], - ["L", direction * base, -slotDepth], - ["V", -start], - ["H", direction * -(width + start)] + ["P", -width / 2, 0], + ["V", base], + ["L", lineW, lineH], + ["H", top], + ["L", lineW, -lineH], + ["V", -base] ]) ; /** - * Draws the profile of the barrier holder. - * @param Number slotWidth - The width of the slot that will hold the barrier body. - * @param Number slotDepth - The depth of the slot that will hold the barrier body. - * @param Number base - The base value used to design the barrier holder. + * Draws the profile of a barrier holder. + * @param Number base - The base value used to design the barrier link. + * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number thickness - The thickness of the barrier body. + * @param Number [distance] - An additional distance added to the outline. */ -module barrierHolderProfile(slotWidth, slotDepth, base) { +module barrierHolderProfile(base, strip, thickness, distance = 0) { polygon(getBarrierHolderPoints( - slotWidth = slotWidth, - slotDepth = slotDepth, - base = base - )); -} - -/** - * Draws the profile of a barrier holder notch. - * @param Number slotDepth - The depth of the slot that will hold the barrier body. - * @param Number base - The base value used to design the barrier notches. - * @param Number [direction] - The direction of the shape (1: right, -1: left) - * @param Boolean [negative] - The shape will be used in a difference operation - */ -module barrierNotchProfile(slotDepth, base, direction=1, negative=false) { - polygon(getBarrierNotchPoints( - slotDepth = slotDepth, base = base, - direction = direction, - negative = negative + strip = strip, + thickness = thickness, + distance = distance )); } - -/** - * Draws the profile of a set of barrier holder notches. - * @param Number length - The length of the set - * @param Number slotDepth - The depth of the slot that will hold the barrier body. - * @param Number base - The base value used to design the barrier notches. - * @param Boolean [negative] - The shape will be used in a difference operation - */ -module barrierNotchesProfile(length, slotDepth, base, negative=false) { - barrierNotchProfile( - slotDepth = slotDepth, - base = base, - direction = 1, - negative = negative - ); - translateX(length) { - barrierNotchProfile( - slotDepth = slotDepth, - base = base, - direction = -1, - negative = negative - ); - } -} diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 53d098f..0fce3a6 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * Defines some straight track parts. + * Defines the straight track parts. * * @author jsconan * @version 0.1.0 @@ -46,166 +46,113 @@ module barrierLink(height, base, distance = 0, center = false) { } /** - * Draws the shape of barrier holder notch. - * @param Number thickness - The thickness of the shape - * @param Number slotDepth - The depth of the slot that will hold the barrier body. - * @param Number base - The base value used to design the barrier notches. - * @param Number [direction] - The direction of the shape (1: right, -1: left) - * @param Boolean [negative] - The shape will be used in a difference operation - * @param Boolean [center] - The shape is centered vertically + * Draws the shape of a barrier holder notch. + * @param Number thickness - The thickness of the shape. + * @param Number base - The base value used to design the barrier link. + * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number indent - The indent of the barrier body strip. + * @param Number [distance] - An additional distance added to the outline. + * @param Number [interval] - The distance between two notches. + * @param Number [count] - The number of notches. + * @param Boolean [center] - The shape is centered vertically. */ -module barrierNotch(thickness, slotDepth, base, direction=1, negative=false, center=false) { - negativeExtrude(height=thickness, center=center) { - barrierNotchProfile( - slotDepth = slotDepth, - base = base, - direction = direction, - negative = negative - ); +module barrierNotch(thickness, base, strip, indent, distance = 0, interval = 0, count = 1, center = false) { + repeat(count=count, interval=[interval, 0, 0], center=true) { + negativeExtrude(height=thickness, center=center) { + barrierNotchProfile( + base = base, + strip = strip, + indent = indent, + distance = distance + ); + } } } /** - * Draws the shape of barrier holder notches. - * @param Number length - The length of the chunk - * @param Number thickness - The thickness of the shape - * @param Number slotDepth - The depth of the slot that will hold the barrier body. - * @param Number base - The base value used to design the barrier notches. - * @param Boolean [negative] - The shape will be used in a difference operation - * @param Boolean [center] - The shape is centered vertically + * Draws the shape of a barrier body. + * @param Number length - The length of the track element. + * @param Number height - The height of the barrier. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base value used to design the barrier link. + * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number indent - The indent of the barrier body strip. + * @param Number [notches] - The number of notches. + * @param Number [distance] - An additional distance added to the outline. */ -module barrierNotches(length, thickness, slotDepth, base, negative=false, center=false) { - negativeExtrude(height=thickness, center=center) { - barrierNotchesProfile( - length = length, - slotDepth = slotDepth, - base = base, - negative = negative +module barrierBody(length, height, thickness, base, strip, indent, notches = 1, distance = 0) { + count = notches + 1; + interval = length / notches; + + difference() { + box( + size = [length, height, thickness], + center = true ); + + repeatMirror(interval=[0, height, 0], axis=[0, 1, 0], center=true) { + barrierNotch( + thickness = thickness * 2, + base = base, + strip = strip, + indent = indent, + distance = distance, + interval = interval, + count = count, + center = true + ); + } } } /** - * Draws the shape of barrier holder notches for a full chunk. - * @param Number length - The length of the chunk - * @param Number thickness - The thickness of the shape - * @param Number slotDepth - The depth of the slot that will hold the barrier body. - * @param Number base - The base value used to design the barrier notches. - * @param Boolean [negative] - The shape will be used in a difference operation - * @param Boolean [center] - The shape is centered vertically + * Draws the barrier holder for a straight track element. + * @param Number length - The length of the element. + * @param Number base - The base value used to design the barrier link. + * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number indent - The indent of the barrier body strip. + * @param Number thickness - The thickness of the barrier body. + * @param Number [distance] - An additional distance added to the outline. */ -module barrierNotchesFull(length, thickness, slotDepth, base, negative=false, center=false) { - repeatMirror() { - barrierNotches( - length = length / 2, - thickness = thickness, - slotDepth = slotDepth, - base = base, - negative = negative, - center = center +module straightBarrierHolder(length, thickness, base, strip, indent, distance = 0) { + linkHeight = getBarrierHolderHeight(strip) - base; + thickness = thickness + distance; + + translateX(-length / 2) { + barrierLink( + height = linkHeight - printResolution, + base = base ); } -} - -/** - * Draws the barrier holder for a straight chunk - * @param Number length - The length of the chunk - * @param Number bodyThickness - The thickness of the barrier body. - * @param Number slotDepth - The depth of the slot that will hold the barrier body. - * @param Number barrierBase - The base value used to design the barrier holder. - * @param Number notchBase - The width of a notch base. - */ -module straightBarrierHolder(length, bodyThickness, slotDepth, barrierBase, notchBase) { difference() { - union() { - rotate([90, 0, 90]) { - negativeExtrude(height=length, center=true) { - barrierHolderProfile( - slotWidth = bodyThickness + printTolerance, - slotDepth = slotDepth, - base = barrierBase - ); - } - } - translateZ(barrierBase) { - rotateX(90) { - barrierNotchesFull( - length = length, - thickness = bodyThickness + barrierBase, - slotDepth = slotDepth, - base = notchBase - printTolerance, - negative = false, - center = true - ); - } - } - translateX(-length / 2) { - barrierLink( - height = barrierBase - printResolution * 2, - base = notchBase + rotate([90, 0, 90]) { + negativeExtrude(height=length, center=true) { + barrierHolderProfile( + base = base, + strip = strip, + thickness = thickness, + distance = distance ); } } translate([length / 2, 0, -1]) { barrierLink( - height = barrierBase - printResolution + 1, - base = notchBase, - distance = printTolerance + height = linkHeight + printResolution + 1, + base = base, + distance = distance ); } - } -} - -/** - * Draws the barrier body for a straight chunk - * @param Number length - The length of the chunk - * @param Number height - The height of the chunk - * @param Number thickness - The thickness of the barrier body. - * @param Number slotDepth - The depth of the slot that will hold the barrier body. - * @param Number notchBase - The width of a notch base. - */ -module barrierBody(length, height, thickness, slotDepth, notchBase) { - difference() { - box(size = [length, height, thickness], center = true); - - repeatMirror(axis=[0, 1, 0]) { - translateY(-height / 2) { - translateX(-length / 2) { - barrierNotches( - length = length, - thickness = thickness + 1, - slotDepth = slotDepth, - base = notchBase + printTolerance, - negative = true, - center = true - ); - } - } - } - } -} - -/** - * Draws the full barrier body for a straight chunk - * @param Number length - The length of the chunk - * @param Number height - The height of the chunk - * @param Number thickness - The thickness of the barrier body. - * @param Number slotDepth - The depth of the slot that will hold the barrier body. - * @param Number notchBase - The width of a notch base. - */ -module barrierBodyFull(length, height, thickness, slotDepth, notchBase) { - difference() { - box(size = [length, height, thickness], center = true); - - repeatMirror(axis=[0, 1, 0]) { - translateY(-height / 2) { - barrierNotchesFull( + translateZ(length / 2 + minThickness) { + rotateX(90) { + barrierBody( length = length, - thickness = thickness + 1, - slotDepth = slotDepth, - base = notchBase + printTolerance, - negative = true, - center = true + height = length, + thickness = thickness, + base = base, + strip = strip, + indent = indent, + distance = distance / 2, + notches = 2 ); } } diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 94da988..26a7bde 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -38,29 +38,34 @@ applyMode(mode=renderMode) { length = 50; height = 30; thickness = 0.6; - slotDepth = 6; + strip = 6; + indent = 1; base = 2; distance = 0.1; distribute([length, 0, 0], center=true) { distribute([0, height, 0], center=true) { - // test the barrier holder shape for a straight chunk + // test the barrier holder shape for a straight track element straightBarrierHolder( length = length, - bodyThickness = thickness, - slotDepth = slotDepth, - barrierBase = base, - notchBase = base + thickness = thickness, + base = base, + strip = strip, + indent = indent, + distance = distance ); - // test the full barrier body shape for a straight chunk - barrierBodyFull( + // test the barrier body shape + barrierBody( length = length, height = height, thickness = thickness, - slotDepth = slotDepth, - notchBase = base + base = base, + strip = strip, + indent = indent, + notches = 2, + distance = distance ); // test the barrier link shape @@ -71,36 +76,41 @@ applyMode(mode=renderMode) { center = false ); - // test the barrier body shape for a straight chunk + // test the barrier body shape for the remaing of a curve barrierBody( length = getCurveRemainingLength(length), height = height, thickness = thickness, - slotDepth = slotDepth, - notchBase = base + base = base, + strip = strip, + indent = indent, + notches = 1, + distance = distance ); - // test the barrier notch shape + // test the barrier notch shape for a straight track element barrierNotch( thickness = thickness, - slotDepth = slotDepth, base = base, - direction = -1, - negative = true, + strip = strip, + indent = indent, + distance = distance, + interval = length, + count = 2, center = true ); } distribute([0, 10, 0], center=true) { - // test the curved barrier notch - curveBarrierNotch( + // test the barrier notch shape for a curved track element + barrierNotchCurved( radius = length, thickness = thickness, - slotDepth = slotDepth, base = base, - direction = 1, - negative = true + strip = strip, + indent = indent, + distance = distance ); // test the barrier link profile @@ -109,56 +119,30 @@ applyMode(mode=renderMode) { distance = distance ); - // test the barrier profile - barrierHolderProfile( - slotWidth = thickness, - slotDepth = slotDepth, - base = base - ); - // test the barrier notch profile barrierNotchProfile( - slotDepth = slotDepth, base = base, - direction = -1, - negative = true + strip = strip, + indent = indent, + distance = distance ); - // test the barrier notches profile - barrierNotchesProfile( - length = length / 2, - slotDepth = slotDepth, + // test the barrier holder profile + barrierHolderProfile( base = base, - negative = true - ); - - // test the barrier notches shape - barrierNotches( - length = length, + strip = strip, thickness = thickness, - slotDepth = slotDepth, - base = base, - negative = true, - center = true + distance = distance ); - // test the barrier notches shape for a full chunk - barrierNotchesFull( + // test the barrier holder shape for a straight track element + curvedBarrierHolder( length = length, thickness = thickness, - slotDepth = slotDepth, base = base, - negative = true, - center = true - ); - - // test the barrier holder shape for a curved chunk - curveBarrierHolder( - length = length, - bodyThickness = thickness, - slotDepth = slotDepth, - barrierBase = base, - notchBase = base, + strip = strip, + indent = indent, + distance = distance, ratio = 1 ); From 1c89a12b2e03f8b0a6cad8bed3b7095be50ab5c3 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 1 Feb 2020 21:52:12 +0100 Subject: [PATCH 050/191] Bump version --- rcmodels/tracks/barrier-body-curve.scad | 2 +- rcmodels/tracks/barrier-body-straight.scad | 2 +- rcmodels/tracks/barrier-holder-curve.scad | 2 +- rcmodels/tracks/barrier-holder-straight.scad | 2 +- rcmodels/tracks/config/config.scad | 2 +- rcmodels/tracks/config/setup.scad | 2 +- rcmodels/tracks/config/values.scad | 2 +- rcmodels/tracks/shapes/curve.scad | 2 +- rcmodels/tracks/shapes/profiles.scad | 2 +- rcmodels/tracks/shapes/straight.scad | 2 +- rcmodels/tracks/test/wip.scad | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/rcmodels/tracks/barrier-body-curve.scad b/rcmodels/tracks/barrier-body-curve.scad index 32ef101..1266ee8 100644 --- a/rcmodels/tracks/barrier-body-curve.scad +++ b/rcmodels/tracks/barrier-body-curve.scad @@ -26,7 +26,7 @@ * An additional barrier body for a curved track part. * * @author jsconan - * @version 0.1.0 + * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/barrier-body-straight.scad b/rcmodels/tracks/barrier-body-straight.scad index 3e9d87d..f50da4a 100644 --- a/rcmodels/tracks/barrier-body-straight.scad +++ b/rcmodels/tracks/barrier-body-straight.scad @@ -26,7 +26,7 @@ * A barrier body for a straight track part. * * @author jsconan - * @version 0.1.0 + * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/barrier-holder-curve.scad b/rcmodels/tracks/barrier-holder-curve.scad index e9b7a70..491cdea 100644 --- a/rcmodels/tracks/barrier-holder-curve.scad +++ b/rcmodels/tracks/barrier-holder-curve.scad @@ -26,7 +26,7 @@ * A barrier holder for a curved track part. * * @author jsconan - * @version 0.1.0 + * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/barrier-holder-straight.scad b/rcmodels/tracks/barrier-holder-straight.scad index c421e9d..b7d3fbc 100644 --- a/rcmodels/tracks/barrier-holder-straight.scad +++ b/rcmodels/tracks/barrier-holder-straight.scad @@ -26,7 +26,7 @@ * A barrier holder for a straight track part. * * @author jsconan - * @version 0.1.0 + * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 3ef020f..1c2ecd6 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -26,7 +26,7 @@ * Configures the project. * * @author jsconan - * @version 0.1.0 + * @version 0.2.0 */ // We will render the object using the specifications of this mode diff --git a/rcmodels/tracks/config/setup.scad b/rcmodels/tracks/config/setup.scad index 3401573..b76b77b 100644 --- a/rcmodels/tracks/config/setup.scad +++ b/rcmodels/tracks/config/setup.scad @@ -26,7 +26,7 @@ * Setup the context. * * @author jsconan - * @version 0.1.0 + * @version 0.2.0 */ // As we need to use some shapes, use the right entry point of the library. diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index fef918a..c215a4d 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -26,7 +26,7 @@ * Refines values and defines functions. * * @author jsconan - * @version 0.1.0 + * @version 0.2.0 */ /** diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad index cd4558c..831664e 100644 --- a/rcmodels/tracks/shapes/curve.scad +++ b/rcmodels/tracks/shapes/curve.scad @@ -26,7 +26,7 @@ * Defines the curved track parts. * * @author jsconan - * @version 0.1.0 + * @version 0.2.0 */ /** diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index 2f50246..091d055 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -26,7 +26,7 @@ * Defines the profile shapes for the track elements. * * @author jsconan - * @version 0.1.0 + * @version 0.2.0 */ /** diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 0fce3a6..b6fee54 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -26,7 +26,7 @@ * Defines the straight track parts. * * @author jsconan - * @version 0.1.0 + * @version 0.2.0 */ /** diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 26a7bde..85820de 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -26,7 +26,7 @@ * Work in progress. * * @author jsconan - * @version 0.1.0 + * @version 0.2.0 */ // Import the project's setup. From caf5ce2e43b096574f8b6c646eabe2b0e8c3548b Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 1 Feb 2020 22:54:54 +0100 Subject: [PATCH 051/191] Add a wire clip shape --- rcmodels/tracks/barrier-holder-clip.scad | 47 ++++++++++++++++++++++++ rcmodels/tracks/config/config.scad | 2 + rcmodels/tracks/shapes/profiles.scad | 38 +++++++++++++++++++ rcmodels/tracks/shapes/straight.scad | 22 +++++++++++ rcmodels/tracks/test/wip.scad | 21 +++++++++++ 5 files changed, 130 insertions(+) create mode 100644 rcmodels/tracks/barrier-holder-clip.scad diff --git a/rcmodels/tracks/barrier-holder-clip.scad b/rcmodels/tracks/barrier-holder-clip.scad new file mode 100644 index 0000000..86d2477 --- /dev/null +++ b/rcmodels/tracks/barrier-holder-clip.scad @@ -0,0 +1,47 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A wire clip for the barrier holders. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + wireClip( + wall = wireClipWall, + height = wireClipThickness, + base = barrierLinkBase, + strip = barrierStripHeight, + thickness = barrierBodyThickness, + distance = printTolerance + ); +} diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 1c2ecd6..e8b50bd 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -44,3 +44,5 @@ barrierBodyThickness = 0.6; // The thickness of the barrier body barrierStripHeight = 6; // The height of the barrier body part that will be inserted in the holder barrierStripIndent = 1; // The indent of the barrier body strip barrierLinkBase = 2; // The base value used to design the barrier link +wireClipWall = .8; // The thickness of the wire clips wall +wireClipThickness = 2; // The thickness of the wire clips diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index 091d055..5f5f817 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -143,3 +143,41 @@ module barrierHolderProfile(base, strip, thickness, distance = 0) { distance = distance )); } + +/** + * Draws the profile of a wire clip. + * @param Number wall - The thickness of the wire clip lines. + * @param Number base - The base value used to design the barrier link. + * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number thickness - The thickness of the barrier body. + * @param Number [distance] - An additional distance added to the outline. + */ +module wireClipProfile(wall, base, strip, thickness, distance = 0) { + tolerance = distance / 2; + holderWidth = getBarrierHolderWidth(base, distance) + tolerance * 2; + holderHeight = getBarrierHolderHeight(strip) + tolerance * 2; + + difference() { + profile = outline(getBarrierHolderPoints( + base = base, + strip = strip, + thickness = thickness, + distance = distance + ), -tolerance); + + polygon(outline(profile, -wall)); + polygon(profile); + + translateY(holderHeight) { + rectangle([thickness, wall * 2]); + } + } + translateY(-wall - tolerance) { + ringSegment( + r = [1, 1] * (holderWidth / 2 + wall), + w = wall, + a = -180, + $fn = 10 + ); + } +} diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index b6fee54..1ba9359 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -158,3 +158,25 @@ module straightBarrierHolder(length, thickness, base, strip, indent, distance = } } } + +/** + * Draws the shape of a wire clip. + * @param Number wall - The thickness of the wire clip lines. + * @param Number height - The thickness of the clip. + * @param Number base - The base value used to design the barrier link. + * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number thickness - The thickness of the barrier body. + * @param Number [distance] - An additional distance added to the outline. + + */ +module wireClip(wall, height, base, strip, thickness, distance = 0, center = false) { + negativeExtrude(height=height, center=center) { + wireClipProfile( + wall = wall, + base = base, + strip = strip, + thickness = thickness, + distance = distance + ); + } +} diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 85820de..15025b3 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -38,6 +38,8 @@ applyMode(mode=renderMode) { length = 50; height = 30; thickness = 0.6; + wall = 0.8; + clip = 2; strip = 6; indent = 1; base = 2; @@ -76,6 +78,16 @@ applyMode(mode=renderMode) { center = false ); + // test the wire clip profile + wireClip( + wall = wall, + height = clip, + base = base, + strip = strip, + thickness = thickness, + distance = distance + ); + // test the barrier body shape for the remaing of a curve barrierBody( length = getCurveRemainingLength(length), @@ -103,6 +115,15 @@ applyMode(mode=renderMode) { } distribute([0, 10, 0], center=true) { + // test the wire clip profile + wireClipProfile( + wall = wall, + base = base, + strip = strip, + thickness = thickness, + distance = distance + ); + // test the barrier notch shape for a curved track element barrierNotchCurved( radius = length, From 16ae8c6f8627049f7a5528fcd01cfec1d0a46b69 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 2 Feb 2020 10:20:39 +0100 Subject: [PATCH 052/191] Add direction of the curve --- ...ve.scad => barrier-holder-curve-left.scad} | 5 +- .../tracks/barrier-holder-curve-right.scad | 49 +++++++++++++++++++ rcmodels/tracks/shapes/curve.scad | 36 +++++++++----- rcmodels/tracks/test/wip.scad | 15 +++++- 4 files changed, 89 insertions(+), 16 deletions(-) rename rcmodels/tracks/{barrier-holder-curve.scad => barrier-holder-curve-left.scad} (93%) create mode 100644 rcmodels/tracks/barrier-holder-curve-right.scad diff --git a/rcmodels/tracks/barrier-holder-curve.scad b/rcmodels/tracks/barrier-holder-curve-left.scad similarity index 93% rename from rcmodels/tracks/barrier-holder-curve.scad rename to rcmodels/tracks/barrier-holder-curve-left.scad index 491cdea..5c64b36 100644 --- a/rcmodels/tracks/barrier-holder-curve.scad +++ b/rcmodels/tracks/barrier-holder-curve-left.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier holder for a curved track part. + * A barrier holder for a curved track part, left turned. * * @author jsconan * @version 0.2.0 @@ -43,6 +43,7 @@ applyMode(mode=renderMode) { strip = barrierStripHeight, indent = barrierStripIndent, distance = printTolerance, - ratio = 1 + ratio = 1, + right = false ); } diff --git a/rcmodels/tracks/barrier-holder-curve-right.scad b/rcmodels/tracks/barrier-holder-curve-right.scad new file mode 100644 index 0000000..42e1629 --- /dev/null +++ b/rcmodels/tracks/barrier-holder-curve-right.scad @@ -0,0 +1,49 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier holder for a curved track part, right turned. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierHolder( + length = trackSectionSize, + thickness = barrierBodyThickness, + base = barrierLinkBase, + strip = barrierStripHeight, + indent = barrierStripIndent, + distance = printTolerance, + ratio = 1, + right = true + ); +} diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad index 831664e..5d3caef 100644 --- a/rcmodels/tracks/shapes/curve.scad +++ b/rcmodels/tracks/shapes/curve.scad @@ -85,8 +85,9 @@ module barrierNotchCurved(radius, thickness, base, strip, indent, distance = 0) * @param Number thickness - The thickness of the barrier body. * @param Number [distance] - An additional distance added to the outline. * @param Number ratio - The ratio to apply on the radius + * @param Number right - Is the curve oriented to the right ? */ -module curvedBarrierHolder(length, thickness, base, strip, indent, distance = 0, ratio = 1) { +module curvedBarrierHolder(length, thickness, base, strip, indent, distance = 0, ratio = 1, right = false) { radius = length * ratio; defaultAngle = 90; angle = defaultAngle / ratio; @@ -94,13 +95,20 @@ module curvedBarrierHolder(length, thickness, base, strip, indent, distance = 0, linkHeight = getBarrierHolderHeight(strip) - base; thickness = thickness + distance; + outerLinkDirection = right ? 180 : 0; + outerLinkPosition = right ? 270 : -ratioAngle; + innerLinkDirection = right ? 90 : -90; + innerLinkPosition = right ? 90 - ratioAngle : 0; + rotateZ(ratioAngle / 2) { - rotateZ(-ratioAngle) { + rotateZ(outerLinkPosition) { translateY(radius) { - barrierLink( - height = linkHeight - printResolution, - base = base - ); + rotateZ(outerLinkDirection) { + barrierLink( + height = linkHeight - printResolution, + base = base + ); + } } } difference() { @@ -114,13 +122,15 @@ module curvedBarrierHolder(length, thickness, base, strip, indent, distance = 0, ); } } - translate([radius, 0, -1]) { - rotateZ(-90) { - barrierLink( - height = linkHeight + printResolution + 1, - base = base, - distance = distance - ); + rotateZ(innerLinkPosition) { + translate([radius, 0, -1]) { + rotateZ(innerLinkDirection) { + barrierLink( + height = linkHeight + printResolution + 1, + base = base, + distance = distance + ); + } } } translateZ(minThickness) { diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 15025b3..edd74ee 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -134,6 +134,18 @@ applyMode(mode=renderMode) { distance = distance ); + // test the barrier holder shape for a straight track element + curvedBarrierHolder( + length = length, + thickness = thickness, + base = base, + strip = strip, + indent = indent, + distance = distance, + ratio = 1, + right = true + ); + // test the barrier link profile barrierLinkProfile( base = base, @@ -164,7 +176,8 @@ applyMode(mode=renderMode) { strip = strip, indent = indent, distance = distance, - ratio = 1 + ratio = 1, + right = false ); } From 07c1133b6ae88418d0ce9b5958b1f6399e12bb49 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 2 Feb 2020 11:27:58 +0100 Subject: [PATCH 053/191] Remove the print tolerance from the wire clip shape --- rcmodels/tracks/shapes/profiles.scad | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index 5f5f817..d4ade7b 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -153,17 +153,16 @@ module barrierHolderProfile(base, strip, thickness, distance = 0) { * @param Number [distance] - An additional distance added to the outline. */ module wireClipProfile(wall, base, strip, thickness, distance = 0) { - tolerance = distance / 2; - holderWidth = getBarrierHolderWidth(base, distance) + tolerance * 2; - holderHeight = getBarrierHolderHeight(strip) + tolerance * 2; + holderWidth = getBarrierHolderWidth(base, distance); + holderHeight = getBarrierHolderHeight(strip); difference() { - profile = outline(getBarrierHolderPoints( + profile = getBarrierHolderPoints( base = base, strip = strip, thickness = thickness, distance = distance - ), -tolerance); + ); polygon(outline(profile, -wall)); polygon(profile); @@ -172,7 +171,7 @@ module wireClipProfile(wall, base, strip, thickness, distance = 0) { rectangle([thickness, wall * 2]); } } - translateY(-wall - tolerance) { + translateY(-wall) { ringSegment( r = [1, 1] * (holderWidth / 2 + wall), w = wall, From 2a802abdf1e81e50cc29818e587e8ce06c3ab595 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 2 Feb 2020 18:17:32 +0100 Subject: [PATCH 054/191] Rename the parameter 'distance' to 'tolerance' --- rcmodels/tracks/barrier-body-curve.scad | 2 +- rcmodels/tracks/barrier-body-straight.scad | 2 +- rcmodels/tracks/barrier-holder-clip.scad | 2 +- .../tracks/barrier-holder-curve-left.scad | 2 +- .../tracks/barrier-holder-curve-right.scad | 2 +- rcmodels/tracks/barrier-holder-straight.scad | 2 +- rcmodels/tracks/config/values.scad | 24 +++++----- rcmodels/tracks/shapes/curve.scad | 18 +++---- rcmodels/tracks/shapes/profiles.scad | 48 +++++++++---------- rcmodels/tracks/shapes/straight.scad | 36 +++++++------- rcmodels/tracks/test/wip.scad | 30 ++++++------ 11 files changed, 84 insertions(+), 84 deletions(-) diff --git a/rcmodels/tracks/barrier-body-curve.scad b/rcmodels/tracks/barrier-body-curve.scad index 1266ee8..d20afa7 100644 --- a/rcmodels/tracks/barrier-body-curve.scad +++ b/rcmodels/tracks/barrier-body-curve.scad @@ -44,6 +44,6 @@ applyMode(mode=renderMode) { strip = barrierStripHeight, indent = barrierStripIndent, notches = 1, - distance = printTolerance + tolerance = printTolerance ); } diff --git a/rcmodels/tracks/barrier-body-straight.scad b/rcmodels/tracks/barrier-body-straight.scad index f50da4a..6682248 100644 --- a/rcmodels/tracks/barrier-body-straight.scad +++ b/rcmodels/tracks/barrier-body-straight.scad @@ -44,6 +44,6 @@ applyMode(mode=renderMode) { strip = barrierStripHeight, indent = barrierStripIndent, notches = 2, - distance = printTolerance + tolerance = printTolerance ); } diff --git a/rcmodels/tracks/barrier-holder-clip.scad b/rcmodels/tracks/barrier-holder-clip.scad index 86d2477..6f30b79 100644 --- a/rcmodels/tracks/barrier-holder-clip.scad +++ b/rcmodels/tracks/barrier-holder-clip.scad @@ -42,6 +42,6 @@ applyMode(mode=renderMode) { base = barrierLinkBase, strip = barrierStripHeight, thickness = barrierBodyThickness, - distance = printTolerance + tolerance = printTolerance ); } diff --git a/rcmodels/tracks/barrier-holder-curve-left.scad b/rcmodels/tracks/barrier-holder-curve-left.scad index 5c64b36..47001e9 100644 --- a/rcmodels/tracks/barrier-holder-curve-left.scad +++ b/rcmodels/tracks/barrier-holder-curve-left.scad @@ -42,7 +42,7 @@ applyMode(mode=renderMode) { base = barrierLinkBase, strip = barrierStripHeight, indent = barrierStripIndent, - distance = printTolerance, + tolerance = printTolerance, ratio = 1, right = false ); diff --git a/rcmodels/tracks/barrier-holder-curve-right.scad b/rcmodels/tracks/barrier-holder-curve-right.scad index 42e1629..1afa2d0 100644 --- a/rcmodels/tracks/barrier-holder-curve-right.scad +++ b/rcmodels/tracks/barrier-holder-curve-right.scad @@ -42,7 +42,7 @@ applyMode(mode=renderMode) { base = barrierLinkBase, strip = barrierStripHeight, indent = barrierStripIndent, - distance = printTolerance, + tolerance = printTolerance, ratio = 1, right = true ); diff --git a/rcmodels/tracks/barrier-holder-straight.scad b/rcmodels/tracks/barrier-holder-straight.scad index b7d3fbc..d062209 100644 --- a/rcmodels/tracks/barrier-holder-straight.scad +++ b/rcmodels/tracks/barrier-holder-straight.scad @@ -42,6 +42,6 @@ applyMode(mode=renderMode) { base = barrierLinkBase, strip = barrierStripHeight, indent = barrierStripIndent, - distance = printTolerance + tolerance = printTolerance ); } diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index c215a4d..8b5d797 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -60,44 +60,44 @@ function shells(N) = N * nozzleWidth; /** * Computes the outer length of a barrier link. * @param Number base - The base value used to design the barrier link. - * @param Number [distance] - An additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Number */ -function getBarrierLinkLength(base, distance = 0) = base * 1.5 + distance; +function getBarrierLinkLength(base, tolerance = 0) = base * 1.5 + tolerance; /** * Computes the outer width of a barrier link. * @param Number base - The base value used to design the barrier link. - * @param Number [distance] - An additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Number */ -function getBarrierLinkWidth(base, distance = 0) = (base + distance) * 2; +function getBarrierLinkWidth(base, tolerance = 0) = (base + tolerance) * 2; /** * Computes the outer width of a barrier holder notch. * @param Number base - The base value used to design the barrier link. * @param Number indent - The indent of the barrier body strip. - * @param Number [distance] - An additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Number */ -function getBarrierNotchWidth(base, indent, distance = 0) = (getBarrierLinkWidth(base, distance) + indent + minWidth) * 2; +function getBarrierNotchWidth(base, indent, tolerance = 0) = (getBarrierLinkWidth(base, tolerance) + indent + minWidth) * 2; /** * Computes the inner width of a barrier holder notch. * @param Number base - The base value used to design the barrier link. * @param Number indent - The indent of the barrier body strip. - * @param Number [distance] - An additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Number */ -function getBarrierNotchDistance(base, indent, distance = 0) = (getBarrierLinkWidth(base, distance) + minWidth) * 2; +function getBarrierNotchDistance(base, indent, tolerance = 0) = (getBarrierLinkWidth(base, tolerance) + minWidth) * 2; /** * Computes the outer width of a barrier holder. * @param Number base - The base value used to design the barrier link. - * @param Number [distance] - An additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Number */ -function getBarrierHolderWidth(base, distance = 0) = getBarrierLinkWidth(base, distance) + minWidth * 4; +function getBarrierHolderWidth(base, tolerance = 0) = getBarrierLinkWidth(base, tolerance) + minWidth * 4; /** * Computes the outer height of a barrier holder. @@ -132,10 +132,10 @@ function getCurveRemainingLength(length) = getCurveLength(length) - length; * Computes the minimal length of a track element. * @param Number base - The base value used to design the barrier link. * @param Number indent - The indent of the barrier body strip. - * @param Number [distance] - An additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Number */ -function getMinLength(base, indent, distance = 0) = getBarrierNotchWidth(base, indent, distance) * 4; +function getMinLength(base, indent, tolerance = 0) = getBarrierNotchWidth(base, indent, tolerance) * 4; // The minimal thickness of a part diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad index 5d3caef..cc77d54 100644 --- a/rcmodels/tracks/shapes/curve.scad +++ b/rcmodels/tracks/shapes/curve.scad @@ -36,10 +36,10 @@ * @param Number base - The base value used to design the barrier link. * @param Number strip - The height of the barrier body part that will be inserted in the holder. * @param Number indent - The indent of the barrier body strip. - * @param Number [distance] - An additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module barrierNotchCurved(radius, thickness, base, strip, indent, distance = 0) { - width = getBarrierNotchWidth(base, indent, distance); +module barrierNotchCurved(radius, thickness, base, strip, indent, tolerance = 0) { + width = getBarrierNotchWidth(base, indent, tolerance); height = strip - indent; angle = getArcAngle(radius = radius, length = width); chord = getChordLength(radius = radius, angle = getArcAngle(radius = radius, length = indent)); @@ -83,17 +83,17 @@ module barrierNotchCurved(radius, thickness, base, strip, indent, distance = 0) * @param Number strip - The height of the barrier body part that will be inserted in the holder. * @param Number indent - The indent of the barrier body strip. * @param Number thickness - The thickness of the barrier body. - * @param Number [distance] - An additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @param Number ratio - The ratio to apply on the radius * @param Number right - Is the curve oriented to the right ? */ -module curvedBarrierHolder(length, thickness, base, strip, indent, distance = 0, ratio = 1, right = false) { +module curvedBarrierHolder(length, thickness, base, strip, indent, tolerance = 0, ratio = 1, right = false) { radius = length * ratio; defaultAngle = 90; angle = defaultAngle / ratio; ratioAngle = defaultAngle - angle; linkHeight = getBarrierHolderHeight(strip) - base; - thickness = thickness + distance; + thickness = thickness + tolerance; outerLinkDirection = right ? 180 : 0; outerLinkPosition = right ? 270 : -ratioAngle; @@ -118,7 +118,7 @@ module curvedBarrierHolder(length, thickness, base, strip, indent, distance = 0, base = base, strip = strip, thickness = thickness, - distance = distance + tolerance = tolerance ); } } @@ -128,7 +128,7 @@ module curvedBarrierHolder(length, thickness, base, strip, indent, distance = 0, barrierLink( height = linkHeight + printResolution + 1, base = base, - distance = distance + tolerance = tolerance ); } } @@ -157,7 +157,7 @@ module curvedBarrierHolder(length, thickness, base, strip, indent, distance = 0, base = base, strip = strip, indent = indent, - distance = distance / 2 + tolerance = tolerance / 2 ); } } diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index d4ade7b..67a9822 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -32,10 +32,10 @@ /** * Computes the points defining the profile of a barrier link. * @param Number base - The base value used to design the barrier link. - * @param Number [distance] - An additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Vector[] */ -function getBarrierLinkPoints(base, distance = 0) = +function getBarrierLinkPoints(base, tolerance = 0) = let( half = base / 2 ) @@ -46,18 +46,18 @@ function getBarrierLinkPoints(base, distance = 0) = ["V", -base], ["C", [half, half], 180, 360], ["H", base], - ]), distance) + ]), tolerance) ; /** * Draws the profile of a barrier link. * @param Number base - The base value used to design the barrier link. - * @param Number [distance] - The additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module barrierLinkProfile(base, distance = 0) { +module barrierLinkProfile(base, tolerance = 0) { polygon(getBarrierLinkPoints( base = base, - distance = distance + tolerance = tolerance )); } @@ -66,13 +66,13 @@ module barrierLinkProfile(base, distance = 0) { * @param Number base - The base value used to design the barrier link. * @param Number strip - The height of the barrier body part that will be inserted in the holder. * @param Number indent - The indent of the barrier body strip. - * @param Number [distance] - An additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Vector[] */ -function getBarrierNotchPoints(base, strip, indent, distance = 0) = +function getBarrierNotchPoints(base, strip, indent, tolerance = 0) = let( - width = getBarrierNotchWidth(base, indent, distance), - top = getBarrierNotchDistance(base, indent, distance), + width = getBarrierNotchWidth(base, indent, tolerance), + top = getBarrierNotchDistance(base, indent, tolerance), height = strip - indent ) path([ @@ -90,14 +90,14 @@ function getBarrierNotchPoints(base, strip, indent, distance = 0) = * @param Number base - The base value used to design the barrier link. * @param Number strip - The height of the barrier body part that will be inserted in the holder. * @param Number indent - The indent of the barrier body strip. - * @param Number [distance] - An additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module barrierNotchProfile(base, strip, indent, distance = 0) { +module barrierNotchProfile(base, strip, indent, tolerance = 0) { polygon(getBarrierNotchPoints( base = base, strip = strip, indent = indent, - distance = distance + tolerance = tolerance )); } @@ -106,14 +106,14 @@ module barrierNotchProfile(base, strip, indent, distance = 0) { * @param Number base - The base value used to design the barrier link. * @param Number strip - The height of the barrier body part that will be inserted in the holder. * @param Number thickness - The thickness of the barrier body. - * @param Number [distance] - An additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Vector[] */ -function getBarrierHolderPoints(base, strip, thickness, distance = 0) = +function getBarrierHolderPoints(base, strip, thickness, tolerance = 0) = let( - linkWidth = getBarrierLinkWidth(base, distance), + linkWidth = getBarrierLinkWidth(base, tolerance), top = nozzleAligned((linkWidth - thickness) / 2) * 2 + thickness, - width = getBarrierHolderWidth(base, distance), + width = getBarrierHolderWidth(base, tolerance), height = getBarrierHolderHeight(strip), lineW = (width - top) / 2, lineH = height - base @@ -133,14 +133,14 @@ function getBarrierHolderPoints(base, strip, thickness, distance = 0) = * @param Number base - The base value used to design the barrier link. * @param Number strip - The height of the barrier body part that will be inserted in the holder. * @param Number thickness - The thickness of the barrier body. - * @param Number [distance] - An additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module barrierHolderProfile(base, strip, thickness, distance = 0) { +module barrierHolderProfile(base, strip, thickness, tolerance = 0) { polygon(getBarrierHolderPoints( base = base, strip = strip, thickness = thickness, - distance = distance + tolerance = tolerance )); } @@ -150,10 +150,10 @@ module barrierHolderProfile(base, strip, thickness, distance = 0) { * @param Number base - The base value used to design the barrier link. * @param Number strip - The height of the barrier body part that will be inserted in the holder. * @param Number thickness - The thickness of the barrier body. - * @param Number [distance] - An additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module wireClipProfile(wall, base, strip, thickness, distance = 0) { - holderWidth = getBarrierHolderWidth(base, distance); +module wireClipProfile(wall, base, strip, thickness, tolerance = 0) { + holderWidth = getBarrierHolderWidth(base, tolerance); holderHeight = getBarrierHolderHeight(strip); difference() { @@ -161,7 +161,7 @@ module wireClipProfile(wall, base, strip, thickness, distance = 0) { base = base, strip = strip, thickness = thickness, - distance = distance + tolerance = tolerance ); polygon(outline(profile, -wall)); diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 1ba9359..51772b9 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -33,14 +33,14 @@ * Draws the shape of a barrier link. * @param Number height - The height of the link. * @param Number base - The base value used to design the barrier link. - * @param Number [distance] - The additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @param Boolean [center] - The shape is centered vertically. */ -module barrierLink(height, base, distance = 0, center = false) { +module barrierLink(height, base, tolerance = 0, center = false) { negativeExtrude(height=height, center=center) { barrierLinkProfile( base = base, - distance = distance + tolerance = tolerance ); } } @@ -51,19 +51,19 @@ module barrierLink(height, base, distance = 0, center = false) { * @param Number base - The base value used to design the barrier link. * @param Number strip - The height of the barrier body part that will be inserted in the holder. * @param Number indent - The indent of the barrier body strip. - * @param Number [distance] - An additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @param Number [interval] - The distance between two notches. * @param Number [count] - The number of notches. * @param Boolean [center] - The shape is centered vertically. */ -module barrierNotch(thickness, base, strip, indent, distance = 0, interval = 0, count = 1, center = false) { +module barrierNotch(thickness, base, strip, indent, tolerance = 0, interval = 0, count = 1, center = false) { repeat(count=count, interval=[interval, 0, 0], center=true) { negativeExtrude(height=thickness, center=center) { barrierNotchProfile( base = base, strip = strip, indent = indent, - distance = distance + tolerance = tolerance ); } } @@ -78,9 +78,9 @@ module barrierNotch(thickness, base, strip, indent, distance = 0, interval = 0, * @param Number strip - The height of the barrier body part that will be inserted in the holder. * @param Number indent - The indent of the barrier body strip. * @param Number [notches] - The number of notches. - * @param Number [distance] - An additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module barrierBody(length, height, thickness, base, strip, indent, notches = 1, distance = 0) { +module barrierBody(length, height, thickness, base, strip, indent, notches = 1, tolerance = 0) { count = notches + 1; interval = length / notches; @@ -96,7 +96,7 @@ module barrierBody(length, height, thickness, base, strip, indent, notches = 1, base = base, strip = strip, indent = indent, - distance = distance, + tolerance = tolerance, interval = interval, count = count, center = true @@ -112,11 +112,11 @@ module barrierBody(length, height, thickness, base, strip, indent, notches = 1, * @param Number strip - The height of the barrier body part that will be inserted in the holder. * @param Number indent - The indent of the barrier body strip. * @param Number thickness - The thickness of the barrier body. - * @param Number [distance] - An additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module straightBarrierHolder(length, thickness, base, strip, indent, distance = 0) { +module straightBarrierHolder(length, thickness, base, strip, indent, tolerance = 0) { linkHeight = getBarrierHolderHeight(strip) - base; - thickness = thickness + distance; + thickness = thickness + tolerance; translateX(-length / 2) { barrierLink( @@ -131,7 +131,7 @@ module straightBarrierHolder(length, thickness, base, strip, indent, distance = base = base, strip = strip, thickness = thickness, - distance = distance + tolerance = tolerance ); } } @@ -139,7 +139,7 @@ module straightBarrierHolder(length, thickness, base, strip, indent, distance = barrierLink( height = linkHeight + printResolution + 1, base = base, - distance = distance + tolerance = tolerance ); } translateZ(length / 2 + minThickness) { @@ -151,7 +151,7 @@ module straightBarrierHolder(length, thickness, base, strip, indent, distance = base = base, strip = strip, indent = indent, - distance = distance / 2, + tolerance = tolerance / 2, notches = 2 ); } @@ -166,17 +166,17 @@ module straightBarrierHolder(length, thickness, base, strip, indent, distance = * @param Number base - The base value used to design the barrier link. * @param Number strip - The height of the barrier body part that will be inserted in the holder. * @param Number thickness - The thickness of the barrier body. - * @param Number [distance] - An additional distance added to the outline. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module wireClip(wall, height, base, strip, thickness, distance = 0, center = false) { +module wireClip(wall, height, base, strip, thickness, tolerance = 0, center = false) { negativeExtrude(height=height, center=center) { wireClipProfile( wall = wall, base = base, strip = strip, thickness = thickness, - distance = distance + tolerance = tolerance ); } } diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index edd74ee..68e63c4 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -33,7 +33,7 @@ include <../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { +applyMode(mode=MODE_DEV) { length = 50; height = 30; @@ -43,7 +43,7 @@ applyMode(mode=renderMode) { strip = 6; indent = 1; base = 2; - distance = 0.1; + tolerance = 0.1; distribute([length, 0, 0], center=true) { distribute([0, height, 0], center=true) { @@ -55,7 +55,7 @@ applyMode(mode=renderMode) { base = base, strip = strip, indent = indent, - distance = distance + tolerance = tolerance ); // test the barrier body shape @@ -67,14 +67,14 @@ applyMode(mode=renderMode) { strip = strip, indent = indent, notches = 2, - distance = distance + tolerance = tolerance ); // test the barrier link shape barrierLink( height = 5, base = base, - distance = distance, + tolerance = tolerance, center = false ); @@ -85,7 +85,7 @@ applyMode(mode=renderMode) { base = base, strip = strip, thickness = thickness, - distance = distance + tolerance = tolerance ); // test the barrier body shape for the remaing of a curve @@ -97,7 +97,7 @@ applyMode(mode=renderMode) { strip = strip, indent = indent, notches = 1, - distance = distance + tolerance = tolerance ); // test the barrier notch shape for a straight track element @@ -106,7 +106,7 @@ applyMode(mode=renderMode) { base = base, strip = strip, indent = indent, - distance = distance, + tolerance = tolerance, interval = length, count = 2, center = true @@ -121,7 +121,7 @@ applyMode(mode=renderMode) { base = base, strip = strip, thickness = thickness, - distance = distance + tolerance = tolerance ); // test the barrier notch shape for a curved track element @@ -131,7 +131,7 @@ applyMode(mode=renderMode) { base = base, strip = strip, indent = indent, - distance = distance + tolerance = tolerance ); // test the barrier holder shape for a straight track element @@ -141,7 +141,7 @@ applyMode(mode=renderMode) { base = base, strip = strip, indent = indent, - distance = distance, + tolerance = tolerance, ratio = 1, right = true ); @@ -149,7 +149,7 @@ applyMode(mode=renderMode) { // test the barrier link profile barrierLinkProfile( base = base, - distance = distance + tolerance = tolerance ); // test the barrier notch profile @@ -157,7 +157,7 @@ applyMode(mode=renderMode) { base = base, strip = strip, indent = indent, - distance = distance + tolerance = tolerance ); // test the barrier holder profile @@ -165,7 +165,7 @@ applyMode(mode=renderMode) { base = base, strip = strip, thickness = thickness, - distance = distance + tolerance = tolerance ); // test the barrier holder shape for a straight track element @@ -175,7 +175,7 @@ applyMode(mode=renderMode) { base = base, strip = strip, indent = indent, - distance = distance, + tolerance = tolerance, ratio = 1, right = false ); From ec3685cef8dd0ef6fd8c05b8d0996db4f5817e5e Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 2 Feb 2020 23:01:18 +0100 Subject: [PATCH 055/191] Add an arch tower shape --- rcmodels/tracks/barrier-arch-tower.scad | 63 ++++++++++++++++++ rcmodels/tracks/config/config.scad | 1 + rcmodels/tracks/config/values.scad | 13 +++- rcmodels/tracks/shapes/curve.scad | 2 +- rcmodels/tracks/shapes/profiles.scad | 86 +++++++++++++++++++++---- rcmodels/tracks/shapes/straight.scad | 69 +++++++++++++++++++- rcmodels/tracks/test/wip.scad | 66 ++++++++++++++++++- 7 files changed, 278 insertions(+), 22 deletions(-) create mode 100644 rcmodels/tracks/barrier-arch-tower.scad diff --git a/rcmodels/tracks/barrier-arch-tower.scad b/rcmodels/tracks/barrier-arch-tower.scad new file mode 100644 index 0000000..d8dd631 --- /dev/null +++ b/rcmodels/tracks/barrier-arch-tower.scad @@ -0,0 +1,63 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * An arch tower that clamp the barrier holders. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + distribute([0, getBarrierHolderWidth(barrierLinkBase, printTolerance) * 2, 0], center=true) { + archTowerWidthHolder( + wall = archTowerWall, + length = trackSectionSize, + height = barrierHeight, + base = barrierLinkBase, + strip = barrierStripHeight, + indent = barrierStripIndent, + thickness = barrierBodyThickness, + tolerance = printTolerance, + right = false + ); + archTowerWidthHolder( + wall = archTowerWall, + length = trackSectionSize, + height = barrierHeight, + base = barrierLinkBase, + strip = barrierStripHeight, + indent = barrierStripIndent, + thickness = barrierBodyThickness, + tolerance = printTolerance, + right = true + ); + } +} diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index e8b50bd..c390bb3 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -44,5 +44,6 @@ barrierBodyThickness = 0.6; // The thickness of the barrier body barrierStripHeight = 6; // The height of the barrier body part that will be inserted in the holder barrierStripIndent = 1; // The indent of the barrier body strip barrierLinkBase = 2; // The base value used to design the barrier link +archTowerWall = 1.6; // The thickness of the arch tower wall wireClipWall = .8; // The thickness of the wire clips wall wireClipThickness = 2; // The thickness of the wire clips diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 8b5d797..1474fa9 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -107,12 +107,19 @@ function getBarrierHolderWidth(base, tolerance = 0) = getBarrierLinkWidth(base, function getBarrierHolderHeight(strip) = strip + minThickness + printResolution; /** - * Computes the inner height of the barrier body. - * @param Number height - The height of the barrier body. + * Computes the inner height of the barrier body, between the barrier holders. + * @param Number height - The height of the barrier. * @param Number strip - The height of the barrier body part that will be inserted in the holder. * @returns Number */ -function getBarrierInnerHeight(height, strip, indent) = height - strip * 2; +function getBarrierBodyInnerHeight(height, strip) = height - strip * 2; + +/** + * Computes the outer height of the barrier body, taking care of the barrier holders. + * @param Number height - The height of the barrier. + * @returns Number + */ +function getBarrierBodyHeight(height) = height - (minThickness + printResolution) * 2; /** * Gets the length of a curved ctrack elementhunk (the length of the arc of the curve). diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad index cc77d54..63827eb 100644 --- a/rcmodels/tracks/shapes/curve.scad +++ b/rcmodels/tracks/shapes/curve.scad @@ -85,7 +85,7 @@ module barrierNotchCurved(radius, thickness, base, strip, indent, tolerance = 0) * @param Number thickness - The thickness of the barrier body. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @param Number ratio - The ratio to apply on the radius - * @param Number right - Is the curve oriented to the right ? + * @param Number right - Is the curve oriented to the right? */ module curvedBarrierHolder(length, thickness, base, strip, indent, tolerance = 0, ratio = 1, right = false) { radius = length * ratio; diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index 67a9822..c11428f 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -144,39 +144,97 @@ module barrierHolderProfile(base, strip, thickness, tolerance = 0) { )); } +/** + * Draws the outline of a barrier holder. + * @param Number wall - The thickness of the outline. + * @param Number base - The base value used to design the barrier link. + * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number thickness - The thickness of the barrier body. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. + * @param Number [distance] - An additional distance added to the outline of the profile. + */ +module barrierHolderOutline(wall, base, strip, thickness, tolerance = 0, distance = 0) { + translateY(wall) { + difference() { + profile = outline(getBarrierHolderPoints( + base = base, + strip = strip, + thickness = thickness, + tolerance = tolerance + ), -distance); + + polygon(outline(profile, -wall)); + polygon(profile); + } + } +} + /** * Draws the profile of a wire clip. - * @param Number wall - The thickness of the wire clip lines. + * @param Number wall - The thickness of the outline. * @param Number base - The base value used to design the barrier link. * @param Number strip - The height of the barrier body part that will be inserted in the holder. * @param Number thickness - The thickness of the barrier body. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ module wireClipProfile(wall, base, strip, thickness, tolerance = 0) { - holderWidth = getBarrierHolderWidth(base, tolerance); + holderWidth = getBarrierHolderWidth(base, tolerance) + wall * 2; holderHeight = getBarrierHolderHeight(strip); difference() { - profile = getBarrierHolderPoints( + barrierHolderOutline( + wall = wall, base = base, strip = strip, thickness = thickness, - tolerance = tolerance + tolerance = tolerance, + distance = 0 ); - polygon(outline(profile, -wall)); - polygon(profile); - translateY(holderHeight) { rectangle([thickness, wall * 2]); } } - translateY(-wall) { - ringSegment( - r = [1, 1] * (holderWidth / 2 + wall), - w = wall, - a = -180, - $fn = 10 - ); + ringSegment( + r = [1, 1] * (holderWidth / 2), + w = wall, + a = -180, + $fn = 10 + ); +} + +/** + * Draws the profile of an arch tower that will clamp a barrier border. + * @param Number wall - The thickness of the outline. + * @param Number height - The height of the barrier. + * @param Number base - The base value used to design the barrier link. + * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number thickness - The thickness of the barrier body. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. + */ +module archTowerProfile(wall, height, base, strip, thickness, tolerance = 0) { + holderHeight = getBarrierHolderHeight(strip) + wall + tolerance; + bodyHeight = getBarrierBodyInnerHeight(height, strip); + towerWidth = thickness + tolerance + wall * 2; + offset = holderHeight + bodyHeight / 2; + + difference() { + union() { + barrierHolderOutline( + wall = wall, + base = base, + strip = strip, + thickness = thickness, + tolerance = tolerance, + distance = tolerance + ); + translateY(offset) { + rectangle([towerWidth, bodyHeight]); + } + } + + translateY(offset) { + rectangle([thickness + tolerance, bodyHeight + wall]); + } } } diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 51772b9..8b77c2e 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -167,7 +167,7 @@ module straightBarrierHolder(length, thickness, base, strip, indent, tolerance = * @param Number strip - The height of the barrier body part that will be inserted in the holder. * @param Number thickness - The thickness of the barrier body. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. - + * @param Boolean [center] - The shape is centered vertically. */ module wireClip(wall, height, base, strip, thickness, tolerance = 0, center = false) { negativeExtrude(height=height, center=center) { @@ -180,3 +180,70 @@ module wireClip(wall, height, base, strip, thickness, tolerance = 0, center = fa ); } } + +/** + * Draws the shape of an arch tower that will clamp a barrier border. + * @param Number wall - The thickness of the outline. + * @param Number height - The height of the barrier. + * @param Number base - The base value used to design the barrier link. + * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number thickness - The thickness of the barrier body. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. + * @param Boolean [center] - The shape is centered vertically. + */ +module archTower(wall, height, base, strip, thickness, tolerance = 0, center = false) { + holderHeight = getBarrierHolderHeight(strip); + + negativeExtrude(height=holderHeight, center=center) { + archTowerProfile( + wall = wall, + height = height, + base = base, + strip = strip, + thickness = thickness, + tolerance = tolerance + ); + } +} + +/** + * Draws the shape of an arch tower with the barrier holders. + * @param Number wall - The thickness of the outline. + * @param Number height - The length of a track element. + * @param Number height - The height of the barrier. + * @param Number base - The base value used to design the barrier link. + * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number indent - The indent of the barrier body strip. + * @param Number thickness - The thickness of the barrier body. + * @param Number [tolerance] - An additional distance added to the outline of the barrier link. + * @param Number right - Is it the right or the left part of the track element that is added to the tower? + */ +module archTowerWidthHolder(wall, length, height, base, strip, indent, thickness, tolerance = 0, right = false) { + rotateZ(-90) { + archTower( + wall = wall, + height = height, + base = base, + strip = strip, + thickness = thickness, + tolerance = tolerance + ); + } + difference() { + rotateZ(right ? 180 : 0) { + straightBarrierHolder( + length = length, + thickness = thickness, + base = base, + strip = strip, + indent = indent, + tolerance = tolerance + ); + } + translate([length, 0, -length] / 2) { + box(length); + } + } + + +} diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 68e63c4..7233988 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -33,7 +33,7 @@ include <../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=MODE_DEV) { +applyMode(mode=renderMode) { length = 50; height = 30; @@ -88,6 +88,44 @@ applyMode(mode=MODE_DEV) { tolerance = tolerance ); + // test the arch tower shape + rotateZ(-90) { + archTower( + wall = base, + height = height, + base = base, + strip = strip, + thickness = thickness, + tolerance = tolerance + ); + } + + // test the arch tower shape with holders, left side + archTowerWidthHolder( + wall = wall * 2, + length = length, + height = height, + base = base, + strip = strip, + indent = indent, + thickness = thickness, + tolerance = tolerance, + right = false + ); + + // test the arch tower shape with holders, right side + archTowerWidthHolder( + wall = wall * 2, + length = length, + height = height, + base = base, + strip = strip, + indent = indent, + thickness = thickness, + tolerance = tolerance, + right = true + ); + // test the barrier body shape for the remaing of a curve barrierBody( length = getCurveRemainingLength(length), @@ -124,6 +162,16 @@ applyMode(mode=MODE_DEV) { tolerance = tolerance ); + // test the barrier holder outline + barrierHolderOutline( + wall = wall, + base = base, + strip = strip, + thickness = thickness, + tolerance = tolerance, + distance = 0 + ); + // test the barrier notch shape for a curved track element barrierNotchCurved( radius = length, @@ -134,7 +182,19 @@ applyMode(mode=MODE_DEV) { tolerance = tolerance ); - // test the barrier holder shape for a straight track element + // test the arch tower profile + rotateZ(-90) { + archTowerProfile( + wall = wall, + height = height, + base = base, + strip = strip, + thickness = thickness, + tolerance = tolerance + ); + } + + // test the barrier holder shape for a curved track element, right turned curvedBarrierHolder( length = length, thickness = thickness, @@ -168,7 +228,7 @@ applyMode(mode=MODE_DEV) { tolerance = tolerance ); - // test the barrier holder shape for a straight track element + // test the barrier holder shape for a curved track element, left turned curvedBarrierHolder( length = length, thickness = thickness, From f575309dcc617c49db7f23867eb45c63b5c204b0 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 2 Feb 2020 23:50:02 +0100 Subject: [PATCH 056/191] Round the edges of the barrier holder profile --- rcmodels/tracks/shapes/profiles.scad | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index c11428f..44757ff 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -116,15 +116,20 @@ function getBarrierHolderPoints(base, strip, thickness, tolerance = 0) = width = getBarrierHolderWidth(base, tolerance), height = getBarrierHolderHeight(strip), lineW = (width - top) / 2, - lineH = height - base + lineH = height - base, + offset = printResolution * 2 ) path([ - ["P", -width / 2, 0], - ["V", base], - ["L", lineW, lineH], + ["P", -width / 2 + offset, 0], + ["L", -offset, offset], + ["V", base - offset], + ["L", lineW - offset, lineH - offset], + ["L", offset, offset], ["H", top], - ["L", lineW, -lineH], - ["V", -base] + ["L", offset, -offset], + ["L", lineW - offset, -lineH + offset], + ["V", -base + offset], + ["L", -offset, -offset] ]) ; @@ -195,6 +200,11 @@ module wireClipProfile(wall, base, strip, thickness, tolerance = 0) { rectangle([thickness, wall * 2]); } } + repeat(intervalX = holderWidth - wall, center = true) { + translateY(base / 2) { + rectangle([wall, base]); + } + } ringSegment( r = [1, 1] * (holderWidth / 2), w = wall, From f71ba90ea2d7f08730815cba724c20371487a0bb Mon Sep 17 00:00:00 2001 From: jsconan Date: Mon, 3 Feb 2020 22:38:40 +0100 Subject: [PATCH 057/191] Refine the config, computing values with respect to the base unit --- rcmodels/tracks/barrier-arch-tower.scad | 14 ++--- rcmodels/tracks/barrier-body-curve.scad | 4 +- rcmodels/tracks/barrier-body-straight.scad | 4 +- rcmodels/tracks/barrier-holder-clip.scad | 7 +-- .../tracks/barrier-holder-curve-left.scad | 4 +- .../tracks/barrier-holder-curve-right.scad | 4 +- rcmodels/tracks/barrier-holder-straight.scad | 4 +- rcmodels/tracks/config/config.scad | 10 ++- rcmodels/tracks/config/values.scad | 60 +++++++++++------- rcmodels/tracks/shapes/curve.scad | 23 +++---- rcmodels/tracks/shapes/profiles.scad | 61 ++++++++----------- rcmodels/tracks/shapes/straight.scad | 54 +++++----------- rcmodels/tracks/test/wip.scad | 28 --------- 13 files changed, 102 insertions(+), 175 deletions(-) diff --git a/rcmodels/tracks/barrier-arch-tower.scad b/rcmodels/tracks/barrier-arch-tower.scad index d8dd631..ed23b68 100644 --- a/rcmodels/tracks/barrier-arch-tower.scad +++ b/rcmodels/tracks/barrier-arch-tower.scad @@ -36,25 +36,21 @@ include applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - distribute([0, getBarrierHolderWidth(barrierLinkBase, printTolerance) * 2, 0], center=true) { + distribute([0, getBarrierHolderWidth(barrierHolderBase, printTolerance) * 2, 0], center=true) { archTowerWidthHolder( - wall = archTowerWall, + wall = archTowerThickness, length = trackSectionSize, height = barrierHeight, - base = barrierLinkBase, - strip = barrierStripHeight, - indent = barrierStripIndent, + base = barrierHolderBase, thickness = barrierBodyThickness, tolerance = printTolerance, right = false ); archTowerWidthHolder( - wall = archTowerWall, + wall = archTowerThickness, length = trackSectionSize, height = barrierHeight, - base = barrierLinkBase, - strip = barrierStripHeight, - indent = barrierStripIndent, + base = barrierHolderBase, thickness = barrierBodyThickness, tolerance = printTolerance, right = true diff --git a/rcmodels/tracks/barrier-body-curve.scad b/rcmodels/tracks/barrier-body-curve.scad index d20afa7..9cdf1a5 100644 --- a/rcmodels/tracks/barrier-body-curve.scad +++ b/rcmodels/tracks/barrier-body-curve.scad @@ -40,9 +40,7 @@ applyMode(mode=renderMode) { length = getCurveRemainingLength(trackSectionSize), height = barrierHeight, thickness = barrierBodyThickness, - base = barrierLinkBase, - strip = barrierStripHeight, - indent = barrierStripIndent, + base = barrierHolderBase, notches = 1, tolerance = printTolerance ); diff --git a/rcmodels/tracks/barrier-body-straight.scad b/rcmodels/tracks/barrier-body-straight.scad index 6682248..28353be 100644 --- a/rcmodels/tracks/barrier-body-straight.scad +++ b/rcmodels/tracks/barrier-body-straight.scad @@ -40,9 +40,7 @@ applyMode(mode=renderMode) { length = trackSectionSize, height = barrierHeight, thickness = barrierBodyThickness, - base = barrierLinkBase, - strip = barrierStripHeight, - indent = barrierStripIndent, + base = barrierHolderBase, notches = 2, tolerance = printTolerance ); diff --git a/rcmodels/tracks/barrier-holder-clip.scad b/rcmodels/tracks/barrier-holder-clip.scad index 6f30b79..d81ed4e 100644 --- a/rcmodels/tracks/barrier-holder-clip.scad +++ b/rcmodels/tracks/barrier-holder-clip.scad @@ -37,10 +37,9 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) wireClip( - wall = wireClipWall, - height = wireClipThickness, - base = barrierLinkBase, - strip = barrierStripHeight, + wall = wireClipThickness, + height = wireClipWidth, + base = barrierHolderBase, thickness = barrierBodyThickness, tolerance = printTolerance ); diff --git a/rcmodels/tracks/barrier-holder-curve-left.scad b/rcmodels/tracks/barrier-holder-curve-left.scad index 47001e9..7fc09bb 100644 --- a/rcmodels/tracks/barrier-holder-curve-left.scad +++ b/rcmodels/tracks/barrier-holder-curve-left.scad @@ -39,9 +39,7 @@ applyMode(mode=renderMode) { curvedBarrierHolder( length = trackSectionSize, thickness = barrierBodyThickness, - base = barrierLinkBase, - strip = barrierStripHeight, - indent = barrierStripIndent, + base = barrierHolderBase, tolerance = printTolerance, ratio = 1, right = false diff --git a/rcmodels/tracks/barrier-holder-curve-right.scad b/rcmodels/tracks/barrier-holder-curve-right.scad index 1afa2d0..85aa4ae 100644 --- a/rcmodels/tracks/barrier-holder-curve-right.scad +++ b/rcmodels/tracks/barrier-holder-curve-right.scad @@ -39,9 +39,7 @@ applyMode(mode=renderMode) { curvedBarrierHolder( length = trackSectionSize, thickness = barrierBodyThickness, - base = barrierLinkBase, - strip = barrierStripHeight, - indent = barrierStripIndent, + base = barrierHolderBase, tolerance = printTolerance, ratio = 1, right = true diff --git a/rcmodels/tracks/barrier-holder-straight.scad b/rcmodels/tracks/barrier-holder-straight.scad index d062209..e75275c 100644 --- a/rcmodels/tracks/barrier-holder-straight.scad +++ b/rcmodels/tracks/barrier-holder-straight.scad @@ -39,9 +39,7 @@ applyMode(mode=renderMode) { straightBarrierHolder( length = trackSectionSize, thickness = barrierBodyThickness, - base = barrierLinkBase, - strip = barrierStripHeight, - indent = barrierStripIndent, + base = barrierHolderBase, tolerance = printTolerance ); } diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index c390bb3..98db428 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -41,9 +41,7 @@ printTolerance = 0.1; // The print tolerance when pieces need to be assembled trackSectionSize = 200; // The nominal size of a track element: the length for straight element, or the width for a curved element barrierHeight = 40; // The height of the barrier, including the holders barrierBodyThickness = 0.6; // The thickness of the barrier body -barrierStripHeight = 6; // The height of the barrier body part that will be inserted in the holder -barrierStripIndent = 1; // The indent of the barrier body strip -barrierLinkBase = 2; // The base value used to design the barrier link -archTowerWall = 1.6; // The thickness of the arch tower wall -wireClipWall = .8; // The thickness of the wire clips wall -wireClipThickness = 2; // The thickness of the wire clips +barrierHolderBase = 2; // The base unit value used to design the barrier holder +archTowerThickness = 1.6; // The thickness of the arch tower wall +wireClipThickness = .8; // The thickness of the wire clips wall +wireClipWidth = 2; // The thickness of the wire clips diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 1474fa9..e19a289 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -30,36 +30,50 @@ */ /** - * Alligns a value with respect to the target layer height + * Alligns a value with respect to the target layer height. * @param Number value * @returns Number */ function layerAligned(value) = roundBy(value, printResolution); /** - * Alligns a value with respect to the target nozzle size + * Alligns a value with respect to the target nozzle size. * @param Number value * @returns Number */ function nozzleAligned(value) = roundBy(value, nozzleWidth); /** - * Gets the thickness of N layers + * Gets the thickness of N layers. * @param Number N * @returns Number */ function layers(N) = N * printResolution; /** - * Gets the width of N times the nozzle width + * Gets the width of N times the nozzle width. * @param Number N * @returns Number */ function shells(N) = N * nozzleWidth; +/** + * Computes the height of the barrier body part that will be inserted in the holder. + * @param Number base - The base unit value used to design the barrier holder. + * @returns Number + */ +function getBarrierStripHeight(base) = base * barrierStripHeightRatio; + +/** + * Computes the indent of the barrier body strip. + * @param Number base - The base unit value used to design the barrier holder. + * @returns Number + */ +function getBarrierStripIndent(base) = base * barrierStripIndentRatio; + /** * Computes the outer length of a barrier link. - * @param Number base - The base value used to design the barrier link. + * @param Number base - The base unit value used to design the barrier holder. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Number */ @@ -67,7 +81,7 @@ function getBarrierLinkLength(base, tolerance = 0) = base * 1.5 + tolerance; /** * Computes the outer width of a barrier link. - * @param Number base - The base value used to design the barrier link. + * @param Number base - The base unit value used to design the barrier holder. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Number */ @@ -75,25 +89,23 @@ function getBarrierLinkWidth(base, tolerance = 0) = (base + tolerance) * 2; /** * Computes the outer width of a barrier holder notch. - * @param Number base - The base value used to design the barrier link. - * @param Number indent - The indent of the barrier body strip. + * @param Number base - The base unit value used to design the barrier holder. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Number */ -function getBarrierNotchWidth(base, indent, tolerance = 0) = (getBarrierLinkWidth(base, tolerance) + indent + minWidth) * 2; +function getBarrierNotchWidth(base, tolerance = 0) = (getBarrierLinkWidth(base, tolerance) + getBarrierStripIndent(base) + minWidth) * 2; /** * Computes the inner width of a barrier holder notch. - * @param Number base - The base value used to design the barrier link. - * @param Number indent - The indent of the barrier body strip. + * @param Number base - The base unit value used to design the barrier holder. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Number */ -function getBarrierNotchDistance(base, indent, tolerance = 0) = (getBarrierLinkWidth(base, tolerance) + minWidth) * 2; +function getBarrierNotchDistance(base, tolerance = 0) = (getBarrierLinkWidth(base, tolerance) + minWidth) * 2; /** * Computes the outer width of a barrier holder. - * @param Number base - The base value used to design the barrier link. + * @param Number base - The base unit value used to design the barrier holder. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Number */ @@ -101,18 +113,17 @@ function getBarrierHolderWidth(base, tolerance = 0) = getBarrierLinkWidth(base, /** * Computes the outer height of a barrier holder. - * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number base - The base unit value used to design the barrier holder. * @returns Number */ -function getBarrierHolderHeight(strip) = strip + minThickness + printResolution; +function getBarrierHolderHeight(base) = getBarrierStripHeight(base) + minThickness + printResolution; /** * Computes the inner height of the barrier body, between the barrier holders. * @param Number height - The height of the barrier. - * @param Number strip - The height of the barrier body part that will be inserted in the holder. * @returns Number */ -function getBarrierBodyInnerHeight(height, strip) = height - strip * 2; +function getBarrierBodyInnerHeight(height, base) = height - getBarrierStripHeight(base) * 2; /** * Computes the outer height of the barrier body, taking care of the barrier holders. @@ -129,7 +140,7 @@ function getBarrierBodyHeight(height) = height - (minThickness + printResolution function getCurveLength(length) = getArcLength(radius = length, angle = 90); /** - * Gets the difference between the length of a curved track element chunk and a straight track element + * Gets the difference between the length of a curved track element chunk and a straight track element. * @param Number length - The length of the track element. * @returns Number */ @@ -137,12 +148,11 @@ function getCurveRemainingLength(length) = getCurveLength(length) - length; /** * Computes the minimal length of a track element. - * @param Number base - The base value used to design the barrier link. - * @param Number indent - The indent of the barrier body strip. + * @param Number base - The base unit value used to design the barrier holder. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Number */ -function getMinLength(base, indent, tolerance = 0) = getBarrierNotchWidth(base, indent, tolerance) * 4; +function getMinLength(base, tolerance = 0) = getBarrierNotchWidth(base, tolerance) * 4; // The minimal thickness of a part @@ -151,9 +161,13 @@ minThickness = layers(2); // The minimal width of a part minWidth = shells(2); +// The ratios applied to the base unit value used to design the barrier holder +barrierStripHeightRatio = 3; +barrierStripIndentRatio = 0.5; + // The minimal size for a track element -minTrackSectionSize = getBarrierNotchWidth(barrierLinkBase, barrierStripIndent, printTolerance) * 4; -minBarrierHeight = barrierStripHeight * 3; +minTrackSectionSize = getBarrierNotchWidth(barrierHolderBase, printTolerance) * 4; +minBarrierHeight = getBarrierStripHeight(barrierHolderBase) * 3; // Validate the critical constraints assert( diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad index 63827eb..5f323fb 100644 --- a/rcmodels/tracks/shapes/curve.scad +++ b/rcmodels/tracks/shapes/curve.scad @@ -33,13 +33,13 @@ * Draws the shape of a barrier holder notch for a curved track element. * @param Number radius - The radius of the curve. * @param Number thickness - The thickness of the shape. - * @param Number base - The base value used to design the barrier link. - * @param Number strip - The height of the barrier body part that will be inserted in the holder. - * @param Number indent - The indent of the barrier body strip. + * @param Number base - The base unit value used to design the barrier holder. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module barrierNotchCurved(radius, thickness, base, strip, indent, tolerance = 0) { - width = getBarrierNotchWidth(base, indent, tolerance); +module barrierNotchCurved(radius, thickness, base, tolerance = 0) { + width = getBarrierNotchWidth(base, tolerance); + strip = getBarrierStripHeight(base); + indent = getBarrierStripIndent(base); height = strip - indent; angle = getArcAngle(radius = radius, length = width); chord = getChordLength(radius = radius, angle = getArcAngle(radius = radius, length = indent)); @@ -79,20 +79,18 @@ module barrierNotchCurved(radius, thickness, base, strip, indent, tolerance = 0) /** * Draws the barrier holder for a straight track element. * @param Number length - The length of the element. - * @param Number base - The base value used to design the barrier link. - * @param Number strip - The height of the barrier body part that will be inserted in the holder. - * @param Number indent - The indent of the barrier body strip. + * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @param Number ratio - The ratio to apply on the radius * @param Number right - Is the curve oriented to the right? */ -module curvedBarrierHolder(length, thickness, base, strip, indent, tolerance = 0, ratio = 1, right = false) { +module curvedBarrierHolder(length, thickness, base, tolerance = 0, ratio = 1, right = false) { radius = length * ratio; defaultAngle = 90; angle = defaultAngle / ratio; ratioAngle = defaultAngle - angle; - linkHeight = getBarrierHolderHeight(strip) - base; + linkHeight = getBarrierHolderHeight(base) - base; thickness = thickness + tolerance; outerLinkDirection = right ? 180 : 0; @@ -116,7 +114,6 @@ module curvedBarrierHolder(length, thickness, base, strip, indent, tolerance = 0 translateX(radius) { barrierHolderProfile( base = base, - strip = strip, thickness = thickness, tolerance = tolerance ); @@ -137,7 +134,7 @@ module curvedBarrierHolder(length, thickness, base, strip, indent, tolerance = 0 difference() { pipeSegment( r = radius + thickness / 2, - h = strip * 2, + h = linkHeight * 2, w = thickness, a = angle ); @@ -155,8 +152,6 @@ module curvedBarrierHolder(length, thickness, base, strip, indent, tolerance = 0 radius = radius, thickness = thickness * 2, base = base, - strip = strip, - indent = indent, tolerance = tolerance / 2 ); } diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index 44757ff..d732a57 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -31,7 +31,7 @@ /** * Computes the points defining the profile of a barrier link. - * @param Number base - The base value used to design the barrier link. + * @param Number base - The base unit value used to design the barrier holder. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Vector[] */ @@ -51,7 +51,7 @@ function getBarrierLinkPoints(base, tolerance = 0) = /** * Draws the profile of a barrier link. - * @param Number base - The base value used to design the barrier link. + * @param Number base - The base unit value used to design the barrier holder. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ module barrierLinkProfile(base, tolerance = 0) { @@ -63,16 +63,16 @@ module barrierLinkProfile(base, tolerance = 0) { /** * Computes the points defining the profile of a barrier holder notch. - * @param Number base - The base value used to design the barrier link. - * @param Number strip - The height of the barrier body part that will be inserted in the holder. - * @param Number indent - The indent of the barrier body strip. + * @param Number base - The base unit value used to design the barrier holder. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Vector[] */ -function getBarrierNotchPoints(base, strip, indent, tolerance = 0) = +function getBarrierNotchPoints(base, tolerance = 0) = let( - width = getBarrierNotchWidth(base, indent, tolerance), - top = getBarrierNotchDistance(base, indent, tolerance), + width = getBarrierNotchWidth(base, tolerance), + top = getBarrierNotchDistance(base, tolerance), + strip = getBarrierStripHeight(base), + indent = getBarrierStripIndent(base), height = strip - indent ) path([ @@ -87,34 +87,29 @@ function getBarrierNotchPoints(base, strip, indent, tolerance = 0) = /** * Draws the profile of a barrier holder notch. - * @param Number base - The base value used to design the barrier link. - * @param Number strip - The height of the barrier body part that will be inserted in the holder. - * @param Number indent - The indent of the barrier body strip. + * @param Number base - The base unit value used to design the barrier holder. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module barrierNotchProfile(base, strip, indent, tolerance = 0) { +module barrierNotchProfile(base, tolerance = 0) { polygon(getBarrierNotchPoints( base = base, - strip = strip, - indent = indent, tolerance = tolerance )); } /** * Computes the points defining the profile of a barrier holder. - * @param Number base - The base value used to design the barrier link. - * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Vector[] */ -function getBarrierHolderPoints(base, strip, thickness, tolerance = 0) = +function getBarrierHolderPoints(base, thickness, tolerance = 0) = let( linkWidth = getBarrierLinkWidth(base, tolerance), top = nozzleAligned((linkWidth - thickness) / 2) * 2 + thickness, width = getBarrierHolderWidth(base, tolerance), - height = getBarrierHolderHeight(strip), + height = getBarrierHolderHeight(base), lineW = (width - top) / 2, lineH = height - base, offset = printResolution * 2 @@ -135,15 +130,13 @@ function getBarrierHolderPoints(base, strip, thickness, tolerance = 0) = /** * Draws the profile of a barrier holder. - * @param Number base - The base value used to design the barrier link. - * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module barrierHolderProfile(base, strip, thickness, tolerance = 0) { +module barrierHolderProfile(base, thickness, tolerance = 0) { polygon(getBarrierHolderPoints( base = base, - strip = strip, thickness = thickness, tolerance = tolerance )); @@ -152,18 +145,16 @@ module barrierHolderProfile(base, strip, thickness, tolerance = 0) { /** * Draws the outline of a barrier holder. * @param Number wall - The thickness of the outline. - * @param Number base - The base value used to design the barrier link. - * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @param Number [distance] - An additional distance added to the outline of the profile. */ -module barrierHolderOutline(wall, base, strip, thickness, tolerance = 0, distance = 0) { +module barrierHolderOutline(wall, base, thickness, tolerance = 0, distance = 0) { translateY(wall) { difference() { profile = outline(getBarrierHolderPoints( base = base, - strip = strip, thickness = thickness, tolerance = tolerance ), -distance); @@ -177,20 +168,18 @@ module barrierHolderOutline(wall, base, strip, thickness, tolerance = 0, distanc /** * Draws the profile of a wire clip. * @param Number wall - The thickness of the outline. - * @param Number base - The base value used to design the barrier link. - * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module wireClipProfile(wall, base, strip, thickness, tolerance = 0) { +module wireClipProfile(wall, base, thickness, tolerance = 0) { holderWidth = getBarrierHolderWidth(base, tolerance) + wall * 2; - holderHeight = getBarrierHolderHeight(strip); + holderHeight = getBarrierHolderHeight(base); difference() { barrierHolderOutline( wall = wall, base = base, - strip = strip, thickness = thickness, tolerance = tolerance, distance = 0 @@ -217,14 +206,13 @@ module wireClipProfile(wall, base, strip, thickness, tolerance = 0) { * Draws the profile of an arch tower that will clamp a barrier border. * @param Number wall - The thickness of the outline. * @param Number height - The height of the barrier. - * @param Number base - The base value used to design the barrier link. - * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module archTowerProfile(wall, height, base, strip, thickness, tolerance = 0) { - holderHeight = getBarrierHolderHeight(strip) + wall + tolerance; - bodyHeight = getBarrierBodyInnerHeight(height, strip); +module archTowerProfile(wall, height, base, thickness, tolerance = 0) { + holderHeight = getBarrierHolderHeight(base) + wall + tolerance; + bodyHeight = getBarrierBodyInnerHeight(height, base); towerWidth = thickness + tolerance + wall * 2; offset = holderHeight + bodyHeight / 2; @@ -233,7 +221,6 @@ module archTowerProfile(wall, height, base, strip, thickness, tolerance = 0) { barrierHolderOutline( wall = wall, base = base, - strip = strip, thickness = thickness, tolerance = tolerance, distance = tolerance diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 8b77c2e..d617079 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -32,7 +32,7 @@ /** * Draws the shape of a barrier link. * @param Number height - The height of the link. - * @param Number base - The base value used to design the barrier link. + * @param Number base - The base unit value used to design the barrier holder. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @param Boolean [center] - The shape is centered vertically. */ @@ -48,21 +48,17 @@ module barrierLink(height, base, tolerance = 0, center = false) { /** * Draws the shape of a barrier holder notch. * @param Number thickness - The thickness of the shape. - * @param Number base - The base value used to design the barrier link. - * @param Number strip - The height of the barrier body part that will be inserted in the holder. - * @param Number indent - The indent of the barrier body strip. + * @param Number base - The base unit value used to design the barrier holder. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @param Number [interval] - The distance between two notches. * @param Number [count] - The number of notches. * @param Boolean [center] - The shape is centered vertically. */ -module barrierNotch(thickness, base, strip, indent, tolerance = 0, interval = 0, count = 1, center = false) { +module barrierNotch(thickness, base, tolerance = 0, interval = 0, count = 1, center = false) { repeat(count=count, interval=[interval, 0, 0], center=true) { negativeExtrude(height=thickness, center=center) { barrierNotchProfile( base = base, - strip = strip, - indent = indent, tolerance = tolerance ); } @@ -74,13 +70,11 @@ module barrierNotch(thickness, base, strip, indent, tolerance = 0, interval = 0, * @param Number length - The length of the track element. * @param Number height - The height of the barrier. * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base value used to design the barrier link. - * @param Number strip - The height of the barrier body part that will be inserted in the holder. - * @param Number indent - The indent of the barrier body strip. + * @param Number base - The base unit value used to design the barrier holder. * @param Number [notches] - The number of notches. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module barrierBody(length, height, thickness, base, strip, indent, notches = 1, tolerance = 0) { +module barrierBody(length, height, thickness, base, notches = 1, tolerance = 0) { count = notches + 1; interval = length / notches; @@ -94,8 +88,6 @@ module barrierBody(length, height, thickness, base, strip, indent, notches = 1, barrierNotch( thickness = thickness * 2, base = base, - strip = strip, - indent = indent, tolerance = tolerance, interval = interval, count = count, @@ -108,14 +100,12 @@ module barrierBody(length, height, thickness, base, strip, indent, notches = 1, /** * Draws the barrier holder for a straight track element. * @param Number length - The length of the element. - * @param Number base - The base value used to design the barrier link. - * @param Number strip - The height of the barrier body part that will be inserted in the holder. - * @param Number indent - The indent of the barrier body strip. + * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module straightBarrierHolder(length, thickness, base, strip, indent, tolerance = 0) { - linkHeight = getBarrierHolderHeight(strip) - base; +module straightBarrierHolder(length, thickness, base, tolerance = 0) { + linkHeight = getBarrierHolderHeight(base) - base; thickness = thickness + tolerance; translateX(-length / 2) { @@ -129,7 +119,6 @@ module straightBarrierHolder(length, thickness, base, strip, indent, tolerance = negativeExtrude(height=length, center=true) { barrierHolderProfile( base = base, - strip = strip, thickness = thickness, tolerance = tolerance ); @@ -149,8 +138,6 @@ module straightBarrierHolder(length, thickness, base, strip, indent, tolerance = height = length, thickness = thickness, base = base, - strip = strip, - indent = indent, tolerance = tolerance / 2, notches = 2 ); @@ -163,18 +150,16 @@ module straightBarrierHolder(length, thickness, base, strip, indent, tolerance = * Draws the shape of a wire clip. * @param Number wall - The thickness of the wire clip lines. * @param Number height - The thickness of the clip. - * @param Number base - The base value used to design the barrier link. - * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @param Boolean [center] - The shape is centered vertically. */ -module wireClip(wall, height, base, strip, thickness, tolerance = 0, center = false) { +module wireClip(wall, height, base, thickness, tolerance = 0, center = false) { negativeExtrude(height=height, center=center) { wireClipProfile( wall = wall, base = base, - strip = strip, thickness = thickness, tolerance = tolerance ); @@ -185,21 +170,19 @@ module wireClip(wall, height, base, strip, thickness, tolerance = 0, center = fa * Draws the shape of an arch tower that will clamp a barrier border. * @param Number wall - The thickness of the outline. * @param Number height - The height of the barrier. - * @param Number base - The base value used to design the barrier link. - * @param Number strip - The height of the barrier body part that will be inserted in the holder. + * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @param Boolean [center] - The shape is centered vertically. */ -module archTower(wall, height, base, strip, thickness, tolerance = 0, center = false) { - holderHeight = getBarrierHolderHeight(strip); +module archTower(wall, height, base, thickness, tolerance = 0, center = false) { + holderHeight = getBarrierHolderHeight(base); negativeExtrude(height=holderHeight, center=center) { archTowerProfile( wall = wall, height = height, base = base, - strip = strip, thickness = thickness, tolerance = tolerance ); @@ -211,20 +194,17 @@ module archTower(wall, height, base, strip, thickness, tolerance = 0, center = f * @param Number wall - The thickness of the outline. * @param Number height - The length of a track element. * @param Number height - The height of the barrier. - * @param Number base - The base value used to design the barrier link. - * @param Number strip - The height of the barrier body part that will be inserted in the holder. - * @param Number indent - The indent of the barrier body strip. + * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @param Number right - Is it the right or the left part of the track element that is added to the tower? */ -module archTowerWidthHolder(wall, length, height, base, strip, indent, thickness, tolerance = 0, right = false) { +module archTowerWidthHolder(wall, length, height, base, thickness, tolerance = 0, right = false) { rotateZ(-90) { archTower( wall = wall, height = height, base = base, - strip = strip, thickness = thickness, tolerance = tolerance ); @@ -235,8 +215,6 @@ module archTowerWidthHolder(wall, length, height, base, strip, indent, thickness length = length, thickness = thickness, base = base, - strip = strip, - indent = indent, tolerance = tolerance ); } @@ -244,6 +222,4 @@ module archTowerWidthHolder(wall, length, height, base, strip, indent, thickness box(length); } } - - } diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index 7233988..fe3d81e 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -40,8 +40,6 @@ applyMode(mode=renderMode) { thickness = 0.6; wall = 0.8; clip = 2; - strip = 6; - indent = 1; base = 2; tolerance = 0.1; @@ -53,8 +51,6 @@ applyMode(mode=renderMode) { length = length, thickness = thickness, base = base, - strip = strip, - indent = indent, tolerance = tolerance ); @@ -64,8 +60,6 @@ applyMode(mode=renderMode) { height = height, thickness = thickness, base = base, - strip = strip, - indent = indent, notches = 2, tolerance = tolerance ); @@ -83,7 +77,6 @@ applyMode(mode=renderMode) { wall = wall, height = clip, base = base, - strip = strip, thickness = thickness, tolerance = tolerance ); @@ -94,7 +87,6 @@ applyMode(mode=renderMode) { wall = base, height = height, base = base, - strip = strip, thickness = thickness, tolerance = tolerance ); @@ -106,8 +98,6 @@ applyMode(mode=renderMode) { length = length, height = height, base = base, - strip = strip, - indent = indent, thickness = thickness, tolerance = tolerance, right = false @@ -119,8 +109,6 @@ applyMode(mode=renderMode) { length = length, height = height, base = base, - strip = strip, - indent = indent, thickness = thickness, tolerance = tolerance, right = true @@ -132,8 +120,6 @@ applyMode(mode=renderMode) { height = height, thickness = thickness, base = base, - strip = strip, - indent = indent, notches = 1, tolerance = tolerance ); @@ -142,8 +128,6 @@ applyMode(mode=renderMode) { barrierNotch( thickness = thickness, base = base, - strip = strip, - indent = indent, tolerance = tolerance, interval = length, count = 2, @@ -157,7 +141,6 @@ applyMode(mode=renderMode) { wireClipProfile( wall = wall, base = base, - strip = strip, thickness = thickness, tolerance = tolerance ); @@ -166,7 +149,6 @@ applyMode(mode=renderMode) { barrierHolderOutline( wall = wall, base = base, - strip = strip, thickness = thickness, tolerance = tolerance, distance = 0 @@ -177,8 +159,6 @@ applyMode(mode=renderMode) { radius = length, thickness = thickness, base = base, - strip = strip, - indent = indent, tolerance = tolerance ); @@ -188,7 +168,6 @@ applyMode(mode=renderMode) { wall = wall, height = height, base = base, - strip = strip, thickness = thickness, tolerance = tolerance ); @@ -199,8 +178,6 @@ applyMode(mode=renderMode) { length = length, thickness = thickness, base = base, - strip = strip, - indent = indent, tolerance = tolerance, ratio = 1, right = true @@ -215,15 +192,12 @@ applyMode(mode=renderMode) { // test the barrier notch profile barrierNotchProfile( base = base, - strip = strip, - indent = indent, tolerance = tolerance ); // test the barrier holder profile barrierHolderProfile( base = base, - strip = strip, thickness = thickness, tolerance = tolerance ); @@ -233,8 +207,6 @@ applyMode(mode=renderMode) { length = length, thickness = thickness, base = base, - strip = strip, - indent = indent, tolerance = tolerance, ratio = 1, right = false From 1100e3738fec0bebc2205242bf9670bc880c5872 Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 4 Feb 2020 21:00:52 +0100 Subject: [PATCH 058/191] Rework the print tolerance --- rcmodels/tracks/barrier-arch-tower.scad | 4 +- rcmodels/tracks/barrier-body-curve.scad | 3 +- rcmodels/tracks/barrier-body-straight.scad | 3 +- rcmodels/tracks/barrier-holder-clip.scad | 3 +- .../tracks/barrier-holder-curve-left.scad | 1 - .../tracks/barrier-holder-curve-right.scad | 1 - rcmodels/tracks/barrier-holder-straight.scad | 3 +- rcmodels/tracks/config/values.scad | 22 +++--- rcmodels/tracks/shapes/curve.scad | 18 +++-- rcmodels/tracks/shapes/profiles.scad | 63 +++++++--------- rcmodels/tracks/shapes/straight.scad | 72 +++++++++---------- rcmodels/tracks/test/wip.scad | 39 ++++------ 12 files changed, 96 insertions(+), 136 deletions(-) diff --git a/rcmodels/tracks/barrier-arch-tower.scad b/rcmodels/tracks/barrier-arch-tower.scad index ed23b68..ed8788b 100644 --- a/rcmodels/tracks/barrier-arch-tower.scad +++ b/rcmodels/tracks/barrier-arch-tower.scad @@ -36,14 +36,13 @@ include applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - distribute([0, getBarrierHolderWidth(barrierHolderBase, printTolerance) * 2, 0], center=true) { + distribute([0, getBarrierHolderWidth(barrierHolderBase) * 2, 0], center=true) { archTowerWidthHolder( wall = archTowerThickness, length = trackSectionSize, height = barrierHeight, base = barrierHolderBase, thickness = barrierBodyThickness, - tolerance = printTolerance, right = false ); archTowerWidthHolder( @@ -52,7 +51,6 @@ applyMode(mode=renderMode) { height = barrierHeight, base = barrierHolderBase, thickness = barrierBodyThickness, - tolerance = printTolerance, right = true ); } diff --git a/rcmodels/tracks/barrier-body-curve.scad b/rcmodels/tracks/barrier-body-curve.scad index 9cdf1a5..e300326 100644 --- a/rcmodels/tracks/barrier-body-curve.scad +++ b/rcmodels/tracks/barrier-body-curve.scad @@ -41,7 +41,6 @@ applyMode(mode=renderMode) { height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase, - notches = 1, - tolerance = printTolerance + notches = 1 ); } diff --git a/rcmodels/tracks/barrier-body-straight.scad b/rcmodels/tracks/barrier-body-straight.scad index 28353be..8227958 100644 --- a/rcmodels/tracks/barrier-body-straight.scad +++ b/rcmodels/tracks/barrier-body-straight.scad @@ -41,7 +41,6 @@ applyMode(mode=renderMode) { height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase, - notches = 2, - tolerance = printTolerance + notches = 2 ); } diff --git a/rcmodels/tracks/barrier-holder-clip.scad b/rcmodels/tracks/barrier-holder-clip.scad index d81ed4e..2ec10f8 100644 --- a/rcmodels/tracks/barrier-holder-clip.scad +++ b/rcmodels/tracks/barrier-holder-clip.scad @@ -40,7 +40,6 @@ applyMode(mode=renderMode) { wall = wireClipThickness, height = wireClipWidth, base = barrierHolderBase, - thickness = barrierBodyThickness, - tolerance = printTolerance + thickness = barrierBodyThickness ); } diff --git a/rcmodels/tracks/barrier-holder-curve-left.scad b/rcmodels/tracks/barrier-holder-curve-left.scad index 7fc09bb..7904940 100644 --- a/rcmodels/tracks/barrier-holder-curve-left.scad +++ b/rcmodels/tracks/barrier-holder-curve-left.scad @@ -40,7 +40,6 @@ applyMode(mode=renderMode) { length = trackSectionSize, thickness = barrierBodyThickness, base = barrierHolderBase, - tolerance = printTolerance, ratio = 1, right = false ); diff --git a/rcmodels/tracks/barrier-holder-curve-right.scad b/rcmodels/tracks/barrier-holder-curve-right.scad index 85aa4ae..cfc5993 100644 --- a/rcmodels/tracks/barrier-holder-curve-right.scad +++ b/rcmodels/tracks/barrier-holder-curve-right.scad @@ -40,7 +40,6 @@ applyMode(mode=renderMode) { length = trackSectionSize, thickness = barrierBodyThickness, base = barrierHolderBase, - tolerance = printTolerance, ratio = 1, right = true ); diff --git a/rcmodels/tracks/barrier-holder-straight.scad b/rcmodels/tracks/barrier-holder-straight.scad index e75275c..025db40 100644 --- a/rcmodels/tracks/barrier-holder-straight.scad +++ b/rcmodels/tracks/barrier-holder-straight.scad @@ -39,7 +39,6 @@ applyMode(mode=renderMode) { straightBarrierHolder( length = trackSectionSize, thickness = barrierBodyThickness, - base = barrierHolderBase, - tolerance = printTolerance + base = barrierHolderBase ); } diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index e19a289..d176f0b 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -74,42 +74,41 @@ function getBarrierStripIndent(base) = base * barrierStripIndentRatio; /** * Computes the outer length of a barrier link. * @param Number base - The base unit value used to design the barrier holder. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. + * @param Number [distance] - An additional distance added to the outline of the barrier link. * @returns Number */ -function getBarrierLinkLength(base, tolerance = 0) = base * 1.5 + tolerance; +function getBarrierLinkLength(base, distance = 0) = base * 1.5 + distance; /** * Computes the outer width of a barrier link. * @param Number base - The base unit value used to design the barrier holder. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. + * @param Number [distance] - An additional distance added to the outline of the barrier link. * @returns Number */ -function getBarrierLinkWidth(base, tolerance = 0) = (base + tolerance) * 2; +function getBarrierLinkWidth(base, distance = 0) = (base + distance) * 2; /** * Computes the outer width of a barrier holder notch. * @param Number base - The base unit value used to design the barrier holder. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. + * @param Number [distance] - An additional distance added to the outline of the barrier link. * @returns Number */ -function getBarrierNotchWidth(base, tolerance = 0) = (getBarrierLinkWidth(base, tolerance) + getBarrierStripIndent(base) + minWidth) * 2; +function getBarrierNotchWidth(base, distance = 0) = (getBarrierLinkWidth(base, distance) + getBarrierStripIndent(base) + minWidth) * 2; /** * Computes the inner width of a barrier holder notch. * @param Number base - The base unit value used to design the barrier holder. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. + * @param Number [distance] - An additional distance added to the outline of the barrier link. * @returns Number */ -function getBarrierNotchDistance(base, tolerance = 0) = (getBarrierLinkWidth(base, tolerance) + minWidth) * 2; +function getBarrierNotchDistance(base, distance = 0) = (getBarrierLinkWidth(base, distance) + minWidth) * 2; /** * Computes the outer width of a barrier holder. * @param Number base - The base unit value used to design the barrier holder. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Number */ -function getBarrierHolderWidth(base, tolerance = 0) = getBarrierLinkWidth(base, tolerance) + minWidth * 4; +function getBarrierHolderWidth(base) = getBarrierLinkWidth(base, printTolerance) + minWidth * 4; /** * Computes the outer height of a barrier holder. @@ -149,10 +148,9 @@ function getCurveRemainingLength(length) = getCurveLength(length) - length; /** * Computes the minimal length of a track element. * @param Number base - The base unit value used to design the barrier holder. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Number */ -function getMinLength(base, tolerance = 0) = getBarrierNotchWidth(base, tolerance) * 4; +function getMinLength(base) = getBarrierNotchWidth(base, printTolerance) * 4; // The minimal thickness of a part diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad index 5f323fb..53ede51 100644 --- a/rcmodels/tracks/shapes/curve.scad +++ b/rcmodels/tracks/shapes/curve.scad @@ -34,10 +34,10 @@ * @param Number radius - The radius of the curve. * @param Number thickness - The thickness of the shape. * @param Number base - The base unit value used to design the barrier holder. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. + * @param Number [distance] - An additional distance added to the outline of the barrier link. */ -module barrierNotchCurved(radius, thickness, base, tolerance = 0) { - width = getBarrierNotchWidth(base, tolerance); +module barrierNotchCurved(radius, thickness, base, distance = 0) { + width = getBarrierNotchWidth(base, distance); strip = getBarrierStripHeight(base); indent = getBarrierStripIndent(base); height = strip - indent; @@ -81,17 +81,16 @@ module barrierNotchCurved(radius, thickness, base, tolerance = 0) { * @param Number length - The length of the element. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @param Number ratio - The ratio to apply on the radius * @param Number right - Is the curve oriented to the right? */ -module curvedBarrierHolder(length, thickness, base, tolerance = 0, ratio = 1, right = false) { +module curvedBarrierHolder(length, thickness, base, ratio = 1, right = false) { radius = length * ratio; defaultAngle = 90; angle = defaultAngle / ratio; ratioAngle = defaultAngle - angle; linkHeight = getBarrierHolderHeight(base) - base; - thickness = thickness + tolerance; + thickness = thickness + printTolerance; outerLinkDirection = right ? 180 : 0; outerLinkPosition = right ? 270 : -ratioAngle; @@ -114,8 +113,7 @@ module curvedBarrierHolder(length, thickness, base, tolerance = 0, ratio = 1, ri translateX(radius) { barrierHolderProfile( base = base, - thickness = thickness, - tolerance = tolerance + thickness = thickness ); } } @@ -125,7 +123,7 @@ module curvedBarrierHolder(length, thickness, base, tolerance = 0, ratio = 1, ri barrierLink( height = linkHeight + printResolution + 1, base = base, - tolerance = tolerance + distance = printTolerance ); } } @@ -152,7 +150,7 @@ module curvedBarrierHolder(length, thickness, base, tolerance = 0, ratio = 1, ri radius = radius, thickness = thickness * 2, base = base, - tolerance = tolerance / 2 + distance = printTolerance / 2 ); } } diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index d732a57..5029c01 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -32,10 +32,10 @@ /** * Computes the points defining the profile of a barrier link. * @param Number base - The base unit value used to design the barrier holder. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. + * @param Number [distance] - An additional distance added to the outline of the barrier link. * @returns Vector[] */ -function getBarrierLinkPoints(base, tolerance = 0) = +function getBarrierLinkPoints(base, distance = 0) = let( half = base / 2 ) @@ -46,31 +46,31 @@ function getBarrierLinkPoints(base, tolerance = 0) = ["V", -base], ["C", [half, half], 180, 360], ["H", base], - ]), tolerance) + ]), distance) ; /** * Draws the profile of a barrier link. * @param Number base - The base unit value used to design the barrier holder. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. + * @param Number [distance] - An additional distance added to the outline of the barrier link. */ -module barrierLinkProfile(base, tolerance = 0) { +module barrierLinkProfile(base, distance = 0) { polygon(getBarrierLinkPoints( base = base, - tolerance = tolerance + distance = distance )); } /** * Computes the points defining the profile of a barrier holder notch. * @param Number base - The base unit value used to design the barrier holder. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. + * @param Number [distance] - An additional distance added to the outline of the barrier link. * @returns Vector[] */ -function getBarrierNotchPoints(base, tolerance = 0) = +function getBarrierNotchPoints(base, distance = 0) = let( - width = getBarrierNotchWidth(base, tolerance), - top = getBarrierNotchDistance(base, tolerance), + width = getBarrierNotchWidth(base, distance), + top = getBarrierNotchDistance(base, distance), strip = getBarrierStripHeight(base), indent = getBarrierStripIndent(base), height = strip - indent @@ -88,12 +88,12 @@ function getBarrierNotchPoints(base, tolerance = 0) = /** * Draws the profile of a barrier holder notch. * @param Number base - The base unit value used to design the barrier holder. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. + * @param Number [distance] - An additional distance added to the outline of the barrier link. */ -module barrierNotchProfile(base, tolerance = 0) { +module barrierNotchProfile(base, distance = 0) { polygon(getBarrierNotchPoints( base = base, - tolerance = tolerance + distance = distance )); } @@ -101,14 +101,13 @@ module barrierNotchProfile(base, tolerance = 0) { * Computes the points defining the profile of a barrier holder. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @returns Vector[] */ -function getBarrierHolderPoints(base, thickness, tolerance = 0) = +function getBarrierHolderPoints(base, thickness) = let( - linkWidth = getBarrierLinkWidth(base, tolerance), + linkWidth = getBarrierLinkWidth(base, printTolerance), top = nozzleAligned((linkWidth - thickness) / 2) * 2 + thickness, - width = getBarrierHolderWidth(base, tolerance), + width = getBarrierHolderWidth(base), height = getBarrierHolderHeight(base), lineW = (width - top) / 2, lineH = height - base, @@ -132,13 +131,11 @@ function getBarrierHolderPoints(base, thickness, tolerance = 0) = * Draws the profile of a barrier holder. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module barrierHolderProfile(base, thickness, tolerance = 0) { +module barrierHolderProfile(base, thickness) { polygon(getBarrierHolderPoints( base = base, - thickness = thickness, - tolerance = tolerance + thickness = thickness )); } @@ -147,16 +144,14 @@ module barrierHolderProfile(base, thickness, tolerance = 0) { * @param Number wall - The thickness of the outline. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @param Number [distance] - An additional distance added to the outline of the profile. */ -module barrierHolderOutline(wall, base, thickness, tolerance = 0, distance = 0) { +module barrierHolderOutline(wall, base, thickness, distance = 0) { translateY(wall) { difference() { profile = outline(getBarrierHolderPoints( base = base, - thickness = thickness, - tolerance = tolerance + thickness = thickness ), -distance); polygon(outline(profile, -wall)); @@ -170,10 +165,9 @@ module barrierHolderOutline(wall, base, thickness, tolerance = 0, distance = 0) * @param Number wall - The thickness of the outline. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module wireClipProfile(wall, base, thickness, tolerance = 0) { - holderWidth = getBarrierHolderWidth(base, tolerance) + wall * 2; +module wireClipProfile(wall, base, thickness) { + holderWidth = getBarrierHolderWidth(base) + wall * 2; holderHeight = getBarrierHolderHeight(base); difference() { @@ -181,7 +175,6 @@ module wireClipProfile(wall, base, thickness, tolerance = 0) { wall = wall, base = base, thickness = thickness, - tolerance = tolerance, distance = 0 ); @@ -208,12 +201,11 @@ module wireClipProfile(wall, base, thickness, tolerance = 0) { * @param Number height - The height of the barrier. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module archTowerProfile(wall, height, base, thickness, tolerance = 0) { - holderHeight = getBarrierHolderHeight(base) + wall + tolerance; +module archTowerProfile(wall, height, base, thickness) { + holderHeight = getBarrierHolderHeight(base) + wall + printTolerance; bodyHeight = getBarrierBodyInnerHeight(height, base); - towerWidth = thickness + tolerance + wall * 2; + towerWidth = thickness + printTolerance + wall * 2; offset = holderHeight + bodyHeight / 2; difference() { @@ -222,8 +214,7 @@ module archTowerProfile(wall, height, base, thickness, tolerance = 0) { wall = wall, base = base, thickness = thickness, - tolerance = tolerance, - distance = tolerance + distance = printTolerance ); translateY(offset) { rectangle([towerWidth, bodyHeight]); @@ -231,7 +222,7 @@ module archTowerProfile(wall, height, base, thickness, tolerance = 0) { } translateY(offset) { - rectangle([thickness + tolerance, bodyHeight + wall]); + rectangle([thickness + printTolerance, bodyHeight + wall]); } } } diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index d617079..a483383 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -33,14 +33,14 @@ * Draws the shape of a barrier link. * @param Number height - The height of the link. * @param Number base - The base unit value used to design the barrier holder. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. + * @param Number [distance] - An additional distance added to the outline of the barrier link. * @param Boolean [center] - The shape is centered vertically. */ -module barrierLink(height, base, tolerance = 0, center = false) { +module barrierLink(height, base, distance = 0, center = false) { negativeExtrude(height=height, center=center) { barrierLinkProfile( base = base, - tolerance = tolerance + distance = distance ); } } @@ -49,17 +49,17 @@ module barrierLink(height, base, tolerance = 0, center = false) { * Draws the shape of a barrier holder notch. * @param Number thickness - The thickness of the shape. * @param Number base - The base unit value used to design the barrier holder. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. + * @param Number [distance] - An additional distance added to the outline of the barrier link. * @param Number [interval] - The distance between two notches. * @param Number [count] - The number of notches. * @param Boolean [center] - The shape is centered vertically. */ -module barrierNotch(thickness, base, tolerance = 0, interval = 0, count = 1, center = false) { +module barrierNotch(thickness, base, distance = 0, interval = 0, count = 1, center = false) { repeat(count=count, interval=[interval, 0, 0], center=true) { negativeExtrude(height=thickness, center=center) { barrierNotchProfile( base = base, - tolerance = tolerance + distance = distance ); } } @@ -72,9 +72,8 @@ module barrierNotch(thickness, base, tolerance = 0, interval = 0, count = 1, cen * @param Number thickness - The thickness of the barrier body. * @param Number base - The base unit value used to design the barrier holder. * @param Number [notches] - The number of notches. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module barrierBody(length, height, thickness, base, notches = 1, tolerance = 0) { +module barrierBody(length, height, thickness, base, notches = 1) { count = notches + 1; interval = length / notches; @@ -88,7 +87,7 @@ module barrierBody(length, height, thickness, base, notches = 1, tolerance = 0) barrierNotch( thickness = thickness * 2, base = base, - tolerance = tolerance, + distance = printTolerance, interval = interval, count = count, center = true @@ -102,11 +101,10 @@ module barrierBody(length, height, thickness, base, notches = 1, tolerance = 0) * @param Number length - The length of the element. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. */ -module straightBarrierHolder(length, thickness, base, tolerance = 0) { +module straightBarrierHolder(length, thickness, base) { linkHeight = getBarrierHolderHeight(base) - base; - thickness = thickness + tolerance; + thickness = thickness + printTolerance; translateX(-length / 2) { barrierLink( @@ -119,8 +117,7 @@ module straightBarrierHolder(length, thickness, base, tolerance = 0) { negativeExtrude(height=length, center=true) { barrierHolderProfile( base = base, - thickness = thickness, - tolerance = tolerance + thickness = thickness ); } } @@ -128,19 +125,23 @@ module straightBarrierHolder(length, thickness, base, tolerance = 0) { barrierLink( height = linkHeight + printResolution + 1, base = base, - tolerance = tolerance + distance = printTolerance ); } - translateZ(length / 2 + minThickness) { - rotateX(90) { - barrierBody( - length = length, - height = length, - thickness = thickness, - base = base, - tolerance = tolerance / 2, - notches = 2 - ); + translateZ(minThickness) { + difference() { + box([length + 2, thickness, linkHeight * 2]); + + rotateX(90) { + barrierNotch( + thickness = thickness * 2, + base = base, + distance = printTolerance / 2, + interval = length / 2, + count = 3, + center = true + ); + } } } } @@ -152,16 +153,14 @@ module straightBarrierHolder(length, thickness, base, tolerance = 0) { * @param Number height - The thickness of the clip. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @param Boolean [center] - The shape is centered vertically. */ -module wireClip(wall, height, base, thickness, tolerance = 0, center = false) { +module wireClip(wall, height, base, thickness, center = false) { negativeExtrude(height=height, center=center) { wireClipProfile( wall = wall, base = base, - thickness = thickness, - tolerance = tolerance + thickness = thickness ); } } @@ -172,10 +171,9 @@ module wireClip(wall, height, base, thickness, tolerance = 0, center = false) { * @param Number height - The height of the barrier. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @param Boolean [center] - The shape is centered vertically. */ -module archTower(wall, height, base, thickness, tolerance = 0, center = false) { +module archTower(wall, height, base, thickness, center = false) { holderHeight = getBarrierHolderHeight(base); negativeExtrude(height=holderHeight, center=center) { @@ -183,8 +181,7 @@ module archTower(wall, height, base, thickness, tolerance = 0, center = false) { wall = wall, height = height, base = base, - thickness = thickness, - tolerance = tolerance + thickness = thickness ); } } @@ -196,17 +193,15 @@ module archTower(wall, height, base, thickness, tolerance = 0, center = false) { * @param Number height - The height of the barrier. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. - * @param Number [tolerance] - An additional distance added to the outline of the barrier link. * @param Number right - Is it the right or the left part of the track element that is added to the tower? */ -module archTowerWidthHolder(wall, length, height, base, thickness, tolerance = 0, right = false) { +module archTowerWidthHolder(wall, length, height, base, thickness, right = false) { rotateZ(-90) { archTower( wall = wall, height = height, base = base, - thickness = thickness, - tolerance = tolerance + thickness = thickness ); } difference() { @@ -214,8 +209,7 @@ module archTowerWidthHolder(wall, length, height, base, thickness, tolerance = 0 straightBarrierHolder( length = length, thickness = thickness, - base = base, - tolerance = tolerance + base = base ); } translate([length, 0, -length] / 2) { diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad index fe3d81e..46245af 100644 --- a/rcmodels/tracks/test/wip.scad +++ b/rcmodels/tracks/test/wip.scad @@ -50,8 +50,7 @@ applyMode(mode=renderMode) { straightBarrierHolder( length = length, thickness = thickness, - base = base, - tolerance = tolerance + base = base ); // test the barrier body shape @@ -60,15 +59,14 @@ applyMode(mode=renderMode) { height = height, thickness = thickness, base = base, - notches = 2, - tolerance = tolerance + notches = 2 ); // test the barrier link shape barrierLink( height = 5, base = base, - tolerance = tolerance, + distance = tolerance, center = false ); @@ -77,8 +75,7 @@ applyMode(mode=renderMode) { wall = wall, height = clip, base = base, - thickness = thickness, - tolerance = tolerance + thickness = thickness ); // test the arch tower shape @@ -87,8 +84,7 @@ applyMode(mode=renderMode) { wall = base, height = height, base = base, - thickness = thickness, - tolerance = tolerance + thickness = thickness ); } @@ -99,7 +95,6 @@ applyMode(mode=renderMode) { height = height, base = base, thickness = thickness, - tolerance = tolerance, right = false ); @@ -110,7 +105,6 @@ applyMode(mode=renderMode) { height = height, base = base, thickness = thickness, - tolerance = tolerance, right = true ); @@ -120,15 +114,14 @@ applyMode(mode=renderMode) { height = height, thickness = thickness, base = base, - notches = 1, - tolerance = tolerance + notches = 1 ); // test the barrier notch shape for a straight track element barrierNotch( thickness = thickness, base = base, - tolerance = tolerance, + distance = tolerance, interval = length, count = 2, center = true @@ -141,8 +134,7 @@ applyMode(mode=renderMode) { wireClipProfile( wall = wall, base = base, - thickness = thickness, - tolerance = tolerance + thickness = thickness ); // test the barrier holder outline @@ -150,7 +142,6 @@ applyMode(mode=renderMode) { wall = wall, base = base, thickness = thickness, - tolerance = tolerance, distance = 0 ); @@ -159,7 +150,7 @@ applyMode(mode=renderMode) { radius = length, thickness = thickness, base = base, - tolerance = tolerance + distance = tolerance ); // test the arch tower profile @@ -168,8 +159,7 @@ applyMode(mode=renderMode) { wall = wall, height = height, base = base, - thickness = thickness, - tolerance = tolerance + thickness = thickness ); } @@ -178,7 +168,6 @@ applyMode(mode=renderMode) { length = length, thickness = thickness, base = base, - tolerance = tolerance, ratio = 1, right = true ); @@ -186,20 +175,19 @@ applyMode(mode=renderMode) { // test the barrier link profile barrierLinkProfile( base = base, - tolerance = tolerance + distance = tolerance ); // test the barrier notch profile barrierNotchProfile( base = base, - tolerance = tolerance + distance = tolerance ); // test the barrier holder profile barrierHolderProfile( base = base, - thickness = thickness, - tolerance = tolerance + thickness = thickness ); // test the barrier holder shape for a curved track element, left turned @@ -207,7 +195,6 @@ applyMode(mode=renderMode) { length = length, thickness = thickness, base = base, - tolerance = tolerance, ratio = 1, right = false ); From fc80112381a7a17cd5dd2efe9ab830a91d6247b0 Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 4 Feb 2020 21:33:50 +0100 Subject: [PATCH 059/191] Rework the tests --- rcmodels/tracks/test/curve.scad | 85 ++++++++++++ rcmodels/tracks/test/profiles.scad | 102 +++++++++++++++ rcmodels/tracks/test/setup.scad | 43 ++++++ rcmodels/tracks/test/straight.scad | 122 +++++++++++++++++ rcmodels/tracks/test/wip.scad | 204 ----------------------------- 5 files changed, 352 insertions(+), 204 deletions(-) create mode 100644 rcmodels/tracks/test/curve.scad create mode 100644 rcmodels/tracks/test/profiles.scad create mode 100644 rcmodels/tracks/test/setup.scad create mode 100644 rcmodels/tracks/test/straight.scad delete mode 100644 rcmodels/tracks/test/wip.scad diff --git a/rcmodels/tracks/test/curve.scad b/rcmodels/tracks/test/curve.scad new file mode 100644 index 0000000..6a6eab0 --- /dev/null +++ b/rcmodels/tracks/test/curve.scad @@ -0,0 +1,85 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * Test the curved barrier shapes. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=mode) { + + distributeRotate(center=true) { + + // test the barrier notch shape for a curved track element + barrierNotchCurved( + radius = length, + thickness = thickness, + base = base, + distance = tolerance + ); + + // test the barrier holder shape for a curved track element, right turned + curvedBarrierHolder( + length = length, + thickness = thickness, + base = base, + ratio = 1, + right = true + ); + + // test the barrier holder shape for a curved track element with a ratio of 2, right turned + curvedBarrierHolder( + length = length, + thickness = thickness, + base = base, + ratio = 2, + right = true + ); + + // test the barrier holder shape for a curved track element, left turned + curvedBarrierHolder( + length = length, + thickness = thickness, + base = base, + ratio = 1, + right = false + ); + + // test the barrier holder shape for a curved track element with a ratio of 2, left turned + curvedBarrierHolder( + length = length, + thickness = thickness, + base = base, + ratio = 2, + right = false + ); + + } +} diff --git a/rcmodels/tracks/test/profiles.scad b/rcmodels/tracks/test/profiles.scad new file mode 100644 index 0000000..4279578 --- /dev/null +++ b/rcmodels/tracks/test/profiles.scad @@ -0,0 +1,102 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * Test the profile shapes. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=mode) { + + distributeGrid(intervalX=[length, 0, 0], intervalY=[0, height, 0], center=true) { + + // test the barrier link profile + barrierLinkProfile( + base = base, + distance = tolerance + ); + + // test the barrier notch profile + barrierNotchProfile( + base = base, + distance = tolerance + ); + + // test the barrier holder profile + barrierHolderProfile( + base = base, + thickness = thickness + ); + + // test the barrier holder outline + barrierHolderOutline( + wall = wall, + base = base, + thickness = thickness, + distance = 0 + ); + + // test the wire clip profile + wireClipProfile( + wall = wall, + base = base, + thickness = thickness + ); + + // test the arch tower profile + rotateZ(-90) { + archTowerProfile( + wall = wall, + height = height, + base = base, + thickness = thickness + ); + } + + // test the barrier notch shape for a straight track element + barrierNotch( + thickness = thickness, + base = base, + distance = tolerance, + interval = length, + count = 2, + center = true + ); + + // test the barrier notch shape for a curved track element + barrierNotchCurved( + radius = length, + thickness = thickness, + base = base, + distance = tolerance + ); + + } +} diff --git a/rcmodels/tracks/test/setup.scad b/rcmodels/tracks/test/setup.scad new file mode 100644 index 0000000..45a253f --- /dev/null +++ b/rcmodels/tracks/test/setup.scad @@ -0,0 +1,43 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * * Setup the context and define the config for the tests. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include <../config/setup.scad> + +// Defines the test config +mode = MODE_DEV; +length = 50; +height = 30; +thickness = 0.6; +wall = 0.8; +clip = 2; +base = 2; +tolerance = 0.1; diff --git a/rcmodels/tracks/test/straight.scad b/rcmodels/tracks/test/straight.scad new file mode 100644 index 0000000..9c90ea2 --- /dev/null +++ b/rcmodels/tracks/test/straight.scad @@ -0,0 +1,122 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * Test the straight barrier shapes. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=mode) { + + distributeGrid(intervalX=[length, 0, 0], intervalY=[0, height, 0], center=true) { + + // test the barrier link shape + barrierLink( + height = 5, + base = base, + distance = tolerance, + center = false + ); + + // test the barrier notch shape for a straight track element + barrierNotch( + thickness = thickness, + base = base, + distance = tolerance, + interval = length, + count = 2, + center = true + ); + + // test the barrier body shape + barrierBody( + length = length, + height = height, + thickness = thickness, + base = base, + notches = 2 + ); + + // test the barrier body shape for the remaing of a curve + barrierBody( + length = getCurveRemainingLength(length), + height = height, + thickness = thickness, + base = base, + notches = 1 + ); + + // test the barrier holder shape for a straight track element + straightBarrierHolder( + length = length, + thickness = thickness, + base = base + ); + + // test the arch tower shape + rotateZ(-90) { + archTower( + wall = base, + height = height, + base = base, + thickness = thickness + ); + } + + // test the wire clip profile + wireClip( + wall = wall, + height = clip, + base = base, + thickness = thickness + ); + + // test the arch tower shape with holders, left side + archTowerWidthHolder( + wall = wall * 2, + length = length, + height = height, + base = base, + thickness = thickness, + right = false + ); + + // test the arch tower shape with holders, right side + archTowerWidthHolder( + wall = wall * 2, + length = length, + height = height, + base = base, + thickness = thickness, + right = true + ); + + } +} diff --git a/rcmodels/tracks/test/wip.scad b/rcmodels/tracks/test/wip.scad deleted file mode 100644 index 46245af..0000000 --- a/rcmodels/tracks/test/wip.scad +++ /dev/null @@ -1,204 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Work in progress. - * - * @author jsconan - * @version 0.2.0 - */ - -// Import the project's setup. -include <../config/setup.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - - length = 50; - height = 30; - thickness = 0.6; - wall = 0.8; - clip = 2; - base = 2; - tolerance = 0.1; - - distribute([length, 0, 0], center=true) { - distribute([0, height, 0], center=true) { - - // test the barrier holder shape for a straight track element - straightBarrierHolder( - length = length, - thickness = thickness, - base = base - ); - - // test the barrier body shape - barrierBody( - length = length, - height = height, - thickness = thickness, - base = base, - notches = 2 - ); - - // test the barrier link shape - barrierLink( - height = 5, - base = base, - distance = tolerance, - center = false - ); - - // test the wire clip profile - wireClip( - wall = wall, - height = clip, - base = base, - thickness = thickness - ); - - // test the arch tower shape - rotateZ(-90) { - archTower( - wall = base, - height = height, - base = base, - thickness = thickness - ); - } - - // test the arch tower shape with holders, left side - archTowerWidthHolder( - wall = wall * 2, - length = length, - height = height, - base = base, - thickness = thickness, - right = false - ); - - // test the arch tower shape with holders, right side - archTowerWidthHolder( - wall = wall * 2, - length = length, - height = height, - base = base, - thickness = thickness, - right = true - ); - - // test the barrier body shape for the remaing of a curve - barrierBody( - length = getCurveRemainingLength(length), - height = height, - thickness = thickness, - base = base, - notches = 1 - ); - - // test the barrier notch shape for a straight track element - barrierNotch( - thickness = thickness, - base = base, - distance = tolerance, - interval = length, - count = 2, - center = true - ); - - } - distribute([0, 10, 0], center=true) { - - // test the wire clip profile - wireClipProfile( - wall = wall, - base = base, - thickness = thickness - ); - - // test the barrier holder outline - barrierHolderOutline( - wall = wall, - base = base, - thickness = thickness, - distance = 0 - ); - - // test the barrier notch shape for a curved track element - barrierNotchCurved( - radius = length, - thickness = thickness, - base = base, - distance = tolerance - ); - - // test the arch tower profile - rotateZ(-90) { - archTowerProfile( - wall = wall, - height = height, - base = base, - thickness = thickness - ); - } - - // test the barrier holder shape for a curved track element, right turned - curvedBarrierHolder( - length = length, - thickness = thickness, - base = base, - ratio = 1, - right = true - ); - - // test the barrier link profile - barrierLinkProfile( - base = base, - distance = tolerance - ); - - // test the barrier notch profile - barrierNotchProfile( - base = base, - distance = tolerance - ); - - // test the barrier holder profile - barrierHolderProfile( - base = base, - thickness = thickness - ); - - // test the barrier holder shape for a curved track element, left turned - curvedBarrierHolder( - length = length, - thickness = thickness, - base = base, - ratio = 1, - right = false - ); - - } - } -} From 1adc4cc768b1414e2a74534baeba4851c8f97112 Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 4 Feb 2020 22:08:20 +0100 Subject: [PATCH 060/191] Split barrier holder shapes between main shape and final shape --- rcmodels/tracks/shapes/curve.scad | 77 ++++++++++++------- rcmodels/tracks/shapes/straight.scad | 24 +++++- rcmodels/tracks/test/curve.scad | 110 +++++++++++++++++++-------- rcmodels/tracks/test/straight.scad | 9 ++- 4 files changed, 157 insertions(+), 63 deletions(-) diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad index 53ede51..e9750e5 100644 --- a/rcmodels/tracks/shapes/curve.scad +++ b/rcmodels/tracks/shapes/curve.scad @@ -77,20 +77,19 @@ module barrierNotchCurved(radius, thickness, base, distance = 0) { } /** - * Draws the barrier holder for a straight track element. + * Draws the main shape of a barrier holder for a curved track element. * @param Number length - The length of the element. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. * @param Number ratio - The ratio to apply on the radius * @param Number right - Is the curve oriented to the right? */ -module curvedBarrierHolder(length, thickness, base, ratio = 1, right = false) { +module curvedBarrierMain(length, thickness, base, ratio = 1, right = false) { radius = length * ratio; defaultAngle = 90; angle = defaultAngle / ratio; ratioAngle = defaultAngle - angle; linkHeight = getBarrierHolderHeight(base) - base; - thickness = thickness + printTolerance; outerLinkDirection = right ? 180 : 0; outerLinkPosition = right ? 270 : -ratioAngle; @@ -128,31 +127,57 @@ module curvedBarrierHolder(length, thickness, base, ratio = 1, right = false) { } } } - translateZ(minThickness) { - difference() { - pipeSegment( - r = radius + thickness / 2, - h = linkHeight * 2, - w = thickness, - a = angle - ); + } + } +} - arcAngle = getArcAngle(radius = radius, length = length / 2); - angles = [ - [0, 0, 0], - [0, 0, arcAngle], - [0, 0, angle - arcAngle], - [0, 0, angle] - ]; +/** + * Draws the barrier holder for a curved track element. + * @param Number length - The length of the element. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number thickness - The thickness of the barrier body. + * @param Number ratio - The ratio to apply on the radius + * @param Number right - Is the curve oriented to the right? + */ +module curvedBarrierHolder(length, thickness, base, ratio = 1, right = false) { + radius = length * ratio; + defaultAngle = 90; + angle = defaultAngle / ratio; + linkHeight = getBarrierHolderHeight(base) - base; + thickness = thickness + printTolerance; - repeatRotateMap(angles) { - barrierNotchCurved( - radius = radius, - thickness = thickness * 2, - base = base, - distance = printTolerance / 2 - ); - } + difference() { + curvedBarrierMain( + length = length, + thickness = thickness, + base = base, + ratio = ratio, + right = right + ); + translateZ(minThickness) { + difference() { + pipeSegment( + r = radius + thickness / 2, + h = linkHeight * 2, + w = thickness, + a = angle + ); + + arcAngle = getArcAngle(radius = radius, length = length / 2); + angles = [ + [0, 0, 0], + [0, 0, arcAngle], + [0, 0, angle - arcAngle], + [0, 0, angle] + ]; + + repeatRotateMap(angles) { + barrierNotchCurved( + radius = radius, + thickness = thickness * 2, + base = base, + distance = printTolerance / 2 + ); } } } diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index a483383..bd700e0 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -97,14 +97,13 @@ module barrierBody(length, height, thickness, base, notches = 1) { } /** - * Draws the barrier holder for a straight track element. + * Draws the main shape of a barrier holder for a straight track element. * @param Number length - The length of the element. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. */ -module straightBarrierHolder(length, thickness, base) { +module straightBarrierMain(length, thickness, base) { linkHeight = getBarrierHolderHeight(base) - base; - thickness = thickness + printTolerance; translateX(-length / 2) { barrierLink( @@ -128,6 +127,25 @@ module straightBarrierHolder(length, thickness, base) { distance = printTolerance ); } + } +} + +/** + * Draws the barrier holder for a straight track element. + * @param Number length - The length of the element. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number thickness - The thickness of the barrier body. + */ +module straightBarrierHolder(length, thickness, base) { + linkHeight = getBarrierHolderHeight(base) - base; + thickness = thickness + printTolerance; + + difference() { + straightBarrierMain( + length = length, + thickness = thickness, + base = base + ); translateZ(minThickness) { difference() { box([length + 2, thickness, linkHeight * 2]); diff --git a/rcmodels/tracks/test/curve.scad b/rcmodels/tracks/test/curve.scad index 6a6eab0..b5049c2 100644 --- a/rcmodels/tracks/test/curve.scad +++ b/rcmodels/tracks/test/curve.scad @@ -35,7 +35,47 @@ include // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=mode) { - distributeRotate(center=true) { + distribute(intervalY=length * 3, center=true) { + + distributeRotate(center=true) { + + // test the main shape of a barrier holder for a curved track element, right turned + curvedBarrierMain( + length = length, + thickness = thickness, + base = base, + ratio = 1, + right = true + ); + + // test the main shape of a barrier holder for a curved track element with a ratio of 2, right turned + curvedBarrierMain( + length = length, + thickness = thickness, + base = base, + ratio = 2, + right = true + ); + + // test the main shape of a barrier holder for a curved track element, left turned + curvedBarrierMain( + length = length, + thickness = thickness, + base = base, + ratio = 1, + right = false + ); + + // test the main shape of a barrier holder for a curved track element with a ratio of 2, left turned + curvedBarrierMain( + length = length, + thickness = thickness, + base = base, + ratio = 2, + right = false + ); + + } // test the barrier notch shape for a curved track element barrierNotchCurved( @@ -45,41 +85,45 @@ applyMode(mode=mode) { distance = tolerance ); - // test the barrier holder shape for a curved track element, right turned - curvedBarrierHolder( - length = length, - thickness = thickness, - base = base, - ratio = 1, - right = true - ); + distributeRotate(center=true) { - // test the barrier holder shape for a curved track element with a ratio of 2, right turned - curvedBarrierHolder( - length = length, - thickness = thickness, - base = base, - ratio = 2, - right = true - ); + // test the barrier holder shape for a curved track element, right turned + curvedBarrierHolder( + length = length, + thickness = thickness, + base = base, + ratio = 1, + right = true + ); - // test the barrier holder shape for a curved track element, left turned - curvedBarrierHolder( - length = length, - thickness = thickness, - base = base, - ratio = 1, - right = false - ); + // test the barrier holder shape for a curved track element with a ratio of 2, right turned + curvedBarrierHolder( + length = length, + thickness = thickness, + base = base, + ratio = 2, + right = true + ); - // test the barrier holder shape for a curved track element with a ratio of 2, left turned - curvedBarrierHolder( - length = length, - thickness = thickness, - base = base, - ratio = 2, - right = false - ); + // test the barrier holder shape for a curved track element, left turned + curvedBarrierHolder( + length = length, + thickness = thickness, + base = base, + ratio = 1, + right = false + ); + + // test the barrier holder shape for a curved track element with a ratio of 2, left turned + curvedBarrierHolder( + length = length, + thickness = thickness, + base = base, + ratio = 2, + right = false + ); + + } } } diff --git a/rcmodels/tracks/test/straight.scad b/rcmodels/tracks/test/straight.scad index 9c90ea2..fc5f1fc 100644 --- a/rcmodels/tracks/test/straight.scad +++ b/rcmodels/tracks/test/straight.scad @@ -35,7 +35,7 @@ include // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=mode) { - distributeGrid(intervalX=[length, 0, 0], intervalY=[0, height, 0], center=true) { + distributeGrid(intervalX=[length, 0, 0], intervalY=[0, height, 0], line=3, center=true) { // test the barrier link shape barrierLink( @@ -64,6 +64,13 @@ applyMode(mode=mode) { notches = 2 ); + // test the main shape of the barrier holder for a straight track element + straightBarrierMain( + length = length, + thickness = thickness, + base = base + ); + // test the barrier body shape for the remaing of a curve barrierBody( length = getCurveRemainingLength(length), From 1a5f1af8a63f9a38665fec462e90ec58a6fd21bc Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 4 Feb 2020 22:17:43 +0100 Subject: [PATCH 061/191] Refine the curved elements --- ....scad => barrier-holder-curve-left-1.scad} | 2 + .../tracks/barrier-holder-curve-left-2.scad | 48 +++++++++++++++++++ .../tracks/barrier-holder-curve-left-3.scad | 48 +++++++++++++++++++ .../tracks/barrier-holder-curve-left-4.scad | 48 +++++++++++++++++++ ...scad => barrier-holder-curve-right-1.scad} | 4 +- .../tracks/barrier-holder-curve-right-2.scad | 48 +++++++++++++++++++ .../tracks/barrier-holder-curve-right-3.scad | 48 +++++++++++++++++++ .../tracks/barrier-holder-curve-right-4.scad | 48 +++++++++++++++++++ 8 files changed, 293 insertions(+), 1 deletion(-) rename rcmodels/tracks/{barrier-holder-curve-left.scad => barrier-holder-curve-left-1.scad} (93%) create mode 100644 rcmodels/tracks/barrier-holder-curve-left-2.scad create mode 100644 rcmodels/tracks/barrier-holder-curve-left-3.scad create mode 100644 rcmodels/tracks/barrier-holder-curve-left-4.scad rename rcmodels/tracks/{barrier-holder-curve-right.scad => barrier-holder-curve-right-1.scad} (89%) create mode 100644 rcmodels/tracks/barrier-holder-curve-right-2.scad create mode 100644 rcmodels/tracks/barrier-holder-curve-right-3.scad create mode 100644 rcmodels/tracks/barrier-holder-curve-right-4.scad diff --git a/rcmodels/tracks/barrier-holder-curve-left.scad b/rcmodels/tracks/barrier-holder-curve-left-1.scad similarity index 93% rename from rcmodels/tracks/barrier-holder-curve-left.scad rename to rcmodels/tracks/barrier-holder-curve-left-1.scad index 7904940..5eb30a7 100644 --- a/rcmodels/tracks/barrier-holder-curve-left.scad +++ b/rcmodels/tracks/barrier-holder-curve-left-1.scad @@ -24,6 +24,8 @@ * A race track system for 1/24 to 1/32 scale RC cars. * * A barrier holder for a curved track part, left turned. + * Ratio of 1: you need 4 elements to draw a full circle, + * the radius being 1x the size of an element. * * @author jsconan * @version 0.2.0 diff --git a/rcmodels/tracks/barrier-holder-curve-left-2.scad b/rcmodels/tracks/barrier-holder-curve-left-2.scad new file mode 100644 index 0000000..72afd6d --- /dev/null +++ b/rcmodels/tracks/barrier-holder-curve-left-2.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier holder for a curved track part, left turned. + * Ratio of 2: you need 8 elements to draw a full circle, + * the radius being 2x the size of an element. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierHolder( + length = trackSectionSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 2, + right = false + ); +} diff --git a/rcmodels/tracks/barrier-holder-curve-left-3.scad b/rcmodels/tracks/barrier-holder-curve-left-3.scad new file mode 100644 index 0000000..e932a5c --- /dev/null +++ b/rcmodels/tracks/barrier-holder-curve-left-3.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier holder for a curved track part, left turned. + * Ratio of 3: you need 12 elements to draw a full circle, + * the radius being 3x the size of an element. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierHolder( + length = trackSectionSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 3, + right = false + ); +} diff --git a/rcmodels/tracks/barrier-holder-curve-left-4.scad b/rcmodels/tracks/barrier-holder-curve-left-4.scad new file mode 100644 index 0000000..8224454 --- /dev/null +++ b/rcmodels/tracks/barrier-holder-curve-left-4.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier holder for a curved track part, left turned. + * Ratio of 4: you need 16 elements to draw a full circle, + * the radius being 4x the size of an element. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierHolder( + length = trackSectionSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 4, + right = false + ); +} diff --git a/rcmodels/tracks/barrier-holder-curve-right.scad b/rcmodels/tracks/barrier-holder-curve-right-1.scad similarity index 89% rename from rcmodels/tracks/barrier-holder-curve-right.scad rename to rcmodels/tracks/barrier-holder-curve-right-1.scad index cfc5993..21edd87 100644 --- a/rcmodels/tracks/barrier-holder-curve-right.scad +++ b/rcmodels/tracks/barrier-holder-curve-right-1.scad @@ -23,7 +23,9 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier holder for a curved track part, right turned. + * A barrier holder for a curved track part, left turned. + * Ratio of 1: you need 4 elements to draw a full circle, + * the radius being 1x the size of an element. * * @author jsconan * @version 0.2.0 diff --git a/rcmodels/tracks/barrier-holder-curve-right-2.scad b/rcmodels/tracks/barrier-holder-curve-right-2.scad new file mode 100644 index 0000000..6e27265 --- /dev/null +++ b/rcmodels/tracks/barrier-holder-curve-right-2.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier holder for a curved track part, left turned. + * Ratio of 2: you need 8 elements to draw a full circle, + * the radius being 2x the size of an element. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierHolder( + length = trackSectionSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 2, + right = true + ); +} diff --git a/rcmodels/tracks/barrier-holder-curve-right-3.scad b/rcmodels/tracks/barrier-holder-curve-right-3.scad new file mode 100644 index 0000000..3e1a5ca --- /dev/null +++ b/rcmodels/tracks/barrier-holder-curve-right-3.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier holder for a curved track part, left turned. + * Ratio of 3: you need 12 elements to draw a full circle, + * the radius being 3x the size of an element. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierHolder( + length = trackSectionSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 3, + right = true + ); +} diff --git a/rcmodels/tracks/barrier-holder-curve-right-4.scad b/rcmodels/tracks/barrier-holder-curve-right-4.scad new file mode 100644 index 0000000..9cdc2a2 --- /dev/null +++ b/rcmodels/tracks/barrier-holder-curve-right-4.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier holder for a curved track part, left turned. + * Ratio of 4: you need 16 elements to draw a full circle, + * the radius being 4x the size of an element. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierHolder( + length = trackSectionSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 4, + right = true + ); +} From b27009f44d64908ecc440682021bf683ff0362da Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 4 Feb 2020 22:27:13 +0100 Subject: [PATCH 062/191] Add sample track elements --- rcmodels/tracks/config/config.scad | 3 +- rcmodels/tracks/render.sh | 9 ++++- rcmodels/tracks/sample-curve-left-1.scad | 48 +++++++++++++++++++++++ rcmodels/tracks/sample-curve-left-2.scad | 48 +++++++++++++++++++++++ rcmodels/tracks/sample-curve-left-3.scad | 48 +++++++++++++++++++++++ rcmodels/tracks/sample-curve-left-4.scad | 48 +++++++++++++++++++++++ rcmodels/tracks/sample-curve-right-1.scad | 48 +++++++++++++++++++++++ rcmodels/tracks/sample-curve-right-2.scad | 48 +++++++++++++++++++++++ rcmodels/tracks/sample-curve-right-3.scad | 48 +++++++++++++++++++++++ rcmodels/tracks/sample-curve-right-4.scad | 48 +++++++++++++++++++++++ rcmodels/tracks/sample-straight.scad | 44 +++++++++++++++++++++ 11 files changed, 438 insertions(+), 2 deletions(-) create mode 100644 rcmodels/tracks/sample-curve-left-1.scad create mode 100644 rcmodels/tracks/sample-curve-left-2.scad create mode 100644 rcmodels/tracks/sample-curve-left-3.scad create mode 100644 rcmodels/tracks/sample-curve-left-4.scad create mode 100644 rcmodels/tracks/sample-curve-right-1.scad create mode 100644 rcmodels/tracks/sample-curve-right-2.scad create mode 100644 rcmodels/tracks/sample-curve-right-3.scad create mode 100644 rcmodels/tracks/sample-curve-right-4.scad create mode 100644 rcmodels/tracks/sample-straight.scad diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 98db428..af17169 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -38,10 +38,11 @@ nozzleWidth = 0.4; // The size of the print nozzle printTolerance = 0.1; // The print tolerance when pieces need to be assembled // The dimensions and constraints of a track element -trackSectionSize = 200; // The nominal size of a track element: the length for straight element, or the width for a curved element +trackSectionSize = 200; // The nominal size of a track element: the length for straight element, or the radius for a curved element barrierHeight = 40; // The height of the barrier, including the holders barrierBodyThickness = 0.6; // The thickness of the barrier body barrierHolderBase = 2; // The base unit value used to design the barrier holder archTowerThickness = 1.6; // The thickness of the arch tower wall wireClipThickness = .8; // The thickness of the wire clips wall wireClipWidth = 2; // The thickness of the wire clips +sampleSize = 20; // The size for the sample track elements diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index 8cc271e..303ea06 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -31,6 +31,7 @@ # application params trackSectionSize= barrierHeight= +sampleSize= # script config scriptpath=$(dirname $0) @@ -51,6 +52,10 @@ while (( "$#" )); do barrierHeight=$2 shift ;; + "-s"|"--sample") + sampleSize=$2 + shift + ;; "-h"|"--help") echo -e "${C_INF}Renders OpenSCAD files${C_RST}" echo -e " ${C_INF}Usage:${C_RST}" @@ -59,6 +64,7 @@ while (( "$#" )); do echo -e "${C_MSG} -h, --help ${C_RST}Show this help" echo -e "${C_MSG} -l, --length ${C_RST}Set the size of a track section" echo -e "${C_MSG} -w --height ${C_RST}Set the height of the track barrier" + echo -e "${C_MSG} -s --sample ${C_RST}Set the size of sample element" echo exit 0 ;; @@ -80,4 +86,5 @@ scadcheck # render the files, if exist scadtostlall "${srcpath}" "${dstpath}" "" \ "$(varif "trackSectionSize" ${trackSectionSize})" \ - "$(varif "barrierHeight" ${barrierHeight})" + "$(varif "barrierHeight" ${barrierHeight})" \ + "$(varif "sampleSize" ${sampleSize})" diff --git a/rcmodels/tracks/sample-curve-left-1.scad b/rcmodels/tracks/sample-curve-left-1.scad new file mode 100644 index 0000000..ce13d28 --- /dev/null +++ b/rcmodels/tracks/sample-curve-left-1.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for a curved track part, left turned. + * Ratio of 1: you need 4 elements to draw a full circle, + * the radius being 1x the size of an element. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierMain( + length = sampleSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 1, + right = false + ); +} diff --git a/rcmodels/tracks/sample-curve-left-2.scad b/rcmodels/tracks/sample-curve-left-2.scad new file mode 100644 index 0000000..373fc2f --- /dev/null +++ b/rcmodels/tracks/sample-curve-left-2.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for a curved track part, left turned. + * Ratio of 2: you need 8 elements to draw a full circle, + * the radius being 2x the size of an element. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierMain( + length = sampleSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 2, + right = false + ); +} diff --git a/rcmodels/tracks/sample-curve-left-3.scad b/rcmodels/tracks/sample-curve-left-3.scad new file mode 100644 index 0000000..de10cb8 --- /dev/null +++ b/rcmodels/tracks/sample-curve-left-3.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for a curved track part, left turned. + * Ratio of 3: you need 12 elements to draw a full circle, + * the radius being 3x the size of an element. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierMain( + length = sampleSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 3, + right = false + ); +} diff --git a/rcmodels/tracks/sample-curve-left-4.scad b/rcmodels/tracks/sample-curve-left-4.scad new file mode 100644 index 0000000..29acd70 --- /dev/null +++ b/rcmodels/tracks/sample-curve-left-4.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for a curved track part, left turned. + * Ratio of 4: you need 16 elements to draw a full circle, + * the radius being 4x the size of an element. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierMain( + length = sampleSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 4, + right = false + ); +} diff --git a/rcmodels/tracks/sample-curve-right-1.scad b/rcmodels/tracks/sample-curve-right-1.scad new file mode 100644 index 0000000..605f6f2 --- /dev/null +++ b/rcmodels/tracks/sample-curve-right-1.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for a curved track part, right turned. + * Ratio of 1: you need 4 elements to draw a full circle, + * the radius being 1x the size of an element. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierMain( + length = sampleSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 1, + right = true + ); +} diff --git a/rcmodels/tracks/sample-curve-right-2.scad b/rcmodels/tracks/sample-curve-right-2.scad new file mode 100644 index 0000000..b2e0277 --- /dev/null +++ b/rcmodels/tracks/sample-curve-right-2.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for a curved track part, right turned. + * Ratio of 2: you need 8 elements to draw a full circle, + * the radius being 2x the size of an element. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierMain( + length = sampleSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 2, + right = true + ); +} diff --git a/rcmodels/tracks/sample-curve-right-3.scad b/rcmodels/tracks/sample-curve-right-3.scad new file mode 100644 index 0000000..106d157 --- /dev/null +++ b/rcmodels/tracks/sample-curve-right-3.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for a curved track part, right turned. + * Ratio of 3: you need 12 elements to draw a full circle, + * the radius being 3x the size of an element. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierMain( + length = sampleSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 3, + right = true + ); +} diff --git a/rcmodels/tracks/sample-curve-right-4.scad b/rcmodels/tracks/sample-curve-right-4.scad new file mode 100644 index 0000000..0321ed3 --- /dev/null +++ b/rcmodels/tracks/sample-curve-right-4.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for a curved track part, right turned. + * Ratio of 4: you need 16 elements to draw a full circle, + * the radius being 4x the size of an element. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierMain( + length = sampleSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 4, + right = true + ); +} diff --git a/rcmodels/tracks/sample-straight.scad b/rcmodels/tracks/sample-straight.scad new file mode 100644 index 0000000..0dc6826 --- /dev/null +++ b/rcmodels/tracks/sample-straight.scad @@ -0,0 +1,44 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for a straight track part. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + straightBarrierMain( + length = sampleSize, + thickness = barrierBodyThickness, + base = barrierHolderBase + ); +} From e930b91aef200b9f5e47531a0d4b5a77f4cf8590 Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 4 Feb 2020 23:06:10 +0100 Subject: [PATCH 063/191] Add config for the track width --- .../tracks/barrier-holder-curve-left-3.scad | 48 ------------------- .../tracks/barrier-holder-curve-left-4.scad | 48 ------------------- ...d => barrier-holder-curve-left-inner.scad} | 4 +- ...d => barrier-holder-curve-left-outer.scad} | 6 +-- .../tracks/barrier-holder-curve-right-3.scad | 48 ------------------- .../tracks/barrier-holder-curve-right-4.scad | 48 ------------------- ... => barrier-holder-curve-right-inner.scad} | 4 +- ... => barrier-holder-curve-right-outer.scad} | 6 +-- rcmodels/tracks/config/config.scad | 1 + rcmodels/tracks/config/values.scad | 11 +++++ rcmodels/tracks/render.sh | 12 +++++ rcmodels/tracks/sample-curve-left-3.scad | 48 ------------------- rcmodels/tracks/sample-curve-left-4.scad | 48 ------------------- ...ft-1.scad => sample-curve-left-inner.scad} | 4 +- ...ft-2.scad => sample-curve-left-outer.scad} | 6 +-- rcmodels/tracks/sample-curve-right-3.scad | 48 ------------------- rcmodels/tracks/sample-curve-right-4.scad | 48 ------------------- ...t-1.scad => sample-curve-right-inner.scad} | 4 +- ...t-2.scad => sample-curve-right-outer.scad} | 6 +-- 19 files changed, 36 insertions(+), 412 deletions(-) delete mode 100644 rcmodels/tracks/barrier-holder-curve-left-3.scad delete mode 100644 rcmodels/tracks/barrier-holder-curve-left-4.scad rename rcmodels/tracks/{barrier-holder-curve-left-1.scad => barrier-holder-curve-left-inner.scad} (89%) rename rcmodels/tracks/{barrier-holder-curve-left-2.scad => barrier-holder-curve-left-outer.scad} (88%) delete mode 100644 rcmodels/tracks/barrier-holder-curve-right-3.scad delete mode 100644 rcmodels/tracks/barrier-holder-curve-right-4.scad rename rcmodels/tracks/{barrier-holder-curve-right-1.scad => barrier-holder-curve-right-inner.scad} (89%) rename rcmodels/tracks/{barrier-holder-curve-right-2.scad => barrier-holder-curve-right-outer.scad} (88%) delete mode 100644 rcmodels/tracks/sample-curve-left-3.scad delete mode 100644 rcmodels/tracks/sample-curve-left-4.scad rename rcmodels/tracks/{sample-curve-left-1.scad => sample-curve-left-inner.scad} (89%) rename rcmodels/tracks/{sample-curve-left-2.scad => sample-curve-left-outer.scad} (88%) delete mode 100644 rcmodels/tracks/sample-curve-right-3.scad delete mode 100644 rcmodels/tracks/sample-curve-right-4.scad rename rcmodels/tracks/{sample-curve-right-1.scad => sample-curve-right-inner.scad} (89%) rename rcmodels/tracks/{sample-curve-right-2.scad => sample-curve-right-outer.scad} (88%) diff --git a/rcmodels/tracks/barrier-holder-curve-left-3.scad b/rcmodels/tracks/barrier-holder-curve-left-3.scad deleted file mode 100644 index e932a5c..0000000 --- a/rcmodels/tracks/barrier-holder-curve-left-3.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A barrier holder for a curved track part, left turned. - * Ratio of 3: you need 12 elements to draw a full circle, - * the radius being 3x the size of an element. - * - * @author jsconan - * @version 0.2.0 - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - curvedBarrierHolder( - length = trackSectionSize, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = 3, - right = false - ); -} diff --git a/rcmodels/tracks/barrier-holder-curve-left-4.scad b/rcmodels/tracks/barrier-holder-curve-left-4.scad deleted file mode 100644 index 8224454..0000000 --- a/rcmodels/tracks/barrier-holder-curve-left-4.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A barrier holder for a curved track part, left turned. - * Ratio of 4: you need 16 elements to draw a full circle, - * the radius being 4x the size of an element. - * - * @author jsconan - * @version 0.2.0 - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - curvedBarrierHolder( - length = trackSectionSize, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = 4, - right = false - ); -} diff --git a/rcmodels/tracks/barrier-holder-curve-left-1.scad b/rcmodels/tracks/barrier-holder-curve-left-inner.scad similarity index 89% rename from rcmodels/tracks/barrier-holder-curve-left-1.scad rename to rcmodels/tracks/barrier-holder-curve-left-inner.scad index 5eb30a7..659101b 100644 --- a/rcmodels/tracks/barrier-holder-curve-left-1.scad +++ b/rcmodels/tracks/barrier-holder-curve-left-inner.scad @@ -23,9 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier holder for a curved track part, left turned. - * Ratio of 1: you need 4 elements to draw a full circle, - * the radius being 1x the size of an element. + * A barrier holder for a curved track part, inner curve, left turned. * * @author jsconan * @version 0.2.0 diff --git a/rcmodels/tracks/barrier-holder-curve-left-2.scad b/rcmodels/tracks/barrier-holder-curve-left-outer.scad similarity index 88% rename from rcmodels/tracks/barrier-holder-curve-left-2.scad rename to rcmodels/tracks/barrier-holder-curve-left-outer.scad index 72afd6d..d81ceb8 100644 --- a/rcmodels/tracks/barrier-holder-curve-left-2.scad +++ b/rcmodels/tracks/barrier-holder-curve-left-outer.scad @@ -23,9 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier holder for a curved track part, left turned. - * Ratio of 2: you need 8 elements to draw a full circle, - * the radius being 2x the size of an element. + * A barrier holder for a curved track part, outer curve, left turned. * * @author jsconan * @version 0.2.0 @@ -42,7 +40,7 @@ applyMode(mode=renderMode) { length = trackSectionSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = 2, + ratio = trackCurveRatio, right = false ); } diff --git a/rcmodels/tracks/barrier-holder-curve-right-3.scad b/rcmodels/tracks/barrier-holder-curve-right-3.scad deleted file mode 100644 index 3e1a5ca..0000000 --- a/rcmodels/tracks/barrier-holder-curve-right-3.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A barrier holder for a curved track part, left turned. - * Ratio of 3: you need 12 elements to draw a full circle, - * the radius being 3x the size of an element. - * - * @author jsconan - * @version 0.2.0 - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - curvedBarrierHolder( - length = trackSectionSize, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = 3, - right = true - ); -} diff --git a/rcmodels/tracks/barrier-holder-curve-right-4.scad b/rcmodels/tracks/barrier-holder-curve-right-4.scad deleted file mode 100644 index 9cdc2a2..0000000 --- a/rcmodels/tracks/barrier-holder-curve-right-4.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A barrier holder for a curved track part, left turned. - * Ratio of 4: you need 16 elements to draw a full circle, - * the radius being 4x the size of an element. - * - * @author jsconan - * @version 0.2.0 - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - curvedBarrierHolder( - length = trackSectionSize, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = 4, - right = true - ); -} diff --git a/rcmodels/tracks/barrier-holder-curve-right-1.scad b/rcmodels/tracks/barrier-holder-curve-right-inner.scad similarity index 89% rename from rcmodels/tracks/barrier-holder-curve-right-1.scad rename to rcmodels/tracks/barrier-holder-curve-right-inner.scad index 21edd87..dd8f10b 100644 --- a/rcmodels/tracks/barrier-holder-curve-right-1.scad +++ b/rcmodels/tracks/barrier-holder-curve-right-inner.scad @@ -23,9 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier holder for a curved track part, left turned. - * Ratio of 1: you need 4 elements to draw a full circle, - * the radius being 1x the size of an element. + * A barrier holder for a curved track part, inner curve, right turned. * * @author jsconan * @version 0.2.0 diff --git a/rcmodels/tracks/barrier-holder-curve-right-2.scad b/rcmodels/tracks/barrier-holder-curve-right-outer.scad similarity index 88% rename from rcmodels/tracks/barrier-holder-curve-right-2.scad rename to rcmodels/tracks/barrier-holder-curve-right-outer.scad index 6e27265..4555afb 100644 --- a/rcmodels/tracks/barrier-holder-curve-right-2.scad +++ b/rcmodels/tracks/barrier-holder-curve-right-outer.scad @@ -23,9 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier holder for a curved track part, left turned. - * Ratio of 2: you need 8 elements to draw a full circle, - * the radius being 2x the size of an element. + * A barrier holder for a curved track part, outer curve, right turned. * * @author jsconan * @version 0.2.0 @@ -42,7 +40,7 @@ applyMode(mode=renderMode) { length = trackSectionSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = 2, + ratio = trackCurveRatio, right = true ); } diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index af17169..a333e43 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -39,6 +39,7 @@ printTolerance = 0.1; // The print tolerance when pieces need to be assembled // The dimensions and constraints of a track element trackSectionSize = 200; // The nominal size of a track element: the length for straight element, or the radius for a curved element +trackWidth = 400; // The width of track, i.e. the distance between the barriers barrierHeight = 40; // The height of the barrier, including the holders barrierBodyThickness = 0.6; // The thickness of the barrier body barrierHolderBase = 2; // The base unit value used to design the barrier holder diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index d176f0b..cb32fb1 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -163,6 +163,9 @@ minWidth = shells(2); barrierStripHeightRatio = 3; barrierStripIndentRatio = 0.5; +// The ratio of the outer curve with respect to the track width +trackCurveRatio = (trackWidth + trackSectionSize) / trackSectionSize; + // The minimal size for a track element minTrackSectionSize = getBarrierNotchWidth(barrierHolderBase, printTolerance) * 4; minBarrierHeight = getBarrierStripHeight(barrierHolderBase) * 3; @@ -186,3 +189,11 @@ assert( barrierHeight ) ); +assert( + trackWidth > trackSectionSize, + "The width of the track must greater than the length of one element!" +); +assert( + trackWidth % trackSectionSize == 0, + "The width of the track must be a multiple of the length of one element!" +); diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index 303ea06..5d22975 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -31,6 +31,7 @@ # application params trackSectionSize= barrierHeight= +trackWidth= sampleSize= # script config @@ -52,6 +53,10 @@ while (( "$#" )); do barrierHeight=$2 shift ;; + "-t"|"--track") + trackWidth=$2 + shift + ;; "-s"|"--sample") sampleSize=$2 shift @@ -64,6 +69,7 @@ while (( "$#" )); do echo -e "${C_MSG} -h, --help ${C_RST}Show this help" echo -e "${C_MSG} -l, --length ${C_RST}Set the size of a track section" echo -e "${C_MSG} -w --height ${C_RST}Set the height of the track barrier" + echo -e "${C_MSG} -t --track ${C_RST}Set the width of the track" echo -e "${C_MSG} -s --sample ${C_RST}Set the size of sample element" echo exit 0 @@ -80,6 +86,11 @@ while (( "$#" )); do shift done +# allign values +if [ "${trackSectionSize}" != "" ] && [ "${trackWidth}" == "" ]; then + trackWidth=$((${trackSectionSize} * 2)) +fi + # check OpenSCAD scadcheck @@ -87,4 +98,5 @@ scadcheck scadtostlall "${srcpath}" "${dstpath}" "" \ "$(varif "trackSectionSize" ${trackSectionSize})" \ "$(varif "barrierHeight" ${barrierHeight})" \ + "$(varif "trackWidth" ${trackWidth})" \ "$(varif "sampleSize" ${sampleSize})" diff --git a/rcmodels/tracks/sample-curve-left-3.scad b/rcmodels/tracks/sample-curve-left-3.scad deleted file mode 100644 index de10cb8..0000000 --- a/rcmodels/tracks/sample-curve-left-3.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for a curved track part, left turned. - * Ratio of 3: you need 12 elements to draw a full circle, - * the radius being 3x the size of an element. - * - * @author jsconan - * @version 0.2.0 - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - curvedBarrierMain( - length = sampleSize, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = 3, - right = false - ); -} diff --git a/rcmodels/tracks/sample-curve-left-4.scad b/rcmodels/tracks/sample-curve-left-4.scad deleted file mode 100644 index 29acd70..0000000 --- a/rcmodels/tracks/sample-curve-left-4.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for a curved track part, left turned. - * Ratio of 4: you need 16 elements to draw a full circle, - * the radius being 4x the size of an element. - * - * @author jsconan - * @version 0.2.0 - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - curvedBarrierMain( - length = sampleSize, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = 4, - right = false - ); -} diff --git a/rcmodels/tracks/sample-curve-left-1.scad b/rcmodels/tracks/sample-curve-left-inner.scad similarity index 89% rename from rcmodels/tracks/sample-curve-left-1.scad rename to rcmodels/tracks/sample-curve-left-inner.scad index ce13d28..18c9c26 100644 --- a/rcmodels/tracks/sample-curve-left-1.scad +++ b/rcmodels/tracks/sample-curve-left-inner.scad @@ -23,9 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A sample for a curved track part, left turned. - * Ratio of 1: you need 4 elements to draw a full circle, - * the radius being 1x the size of an element. + * A sample for a curved track part, inner curve, left turned. * * @author jsconan * @version 0.2.0 diff --git a/rcmodels/tracks/sample-curve-left-2.scad b/rcmodels/tracks/sample-curve-left-outer.scad similarity index 88% rename from rcmodels/tracks/sample-curve-left-2.scad rename to rcmodels/tracks/sample-curve-left-outer.scad index 373fc2f..b065a39 100644 --- a/rcmodels/tracks/sample-curve-left-2.scad +++ b/rcmodels/tracks/sample-curve-left-outer.scad @@ -23,9 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A sample for a curved track part, left turned. - * Ratio of 2: you need 8 elements to draw a full circle, - * the radius being 2x the size of an element. + * A sample for a curved track part, outer curve, left turned. * * @author jsconan * @version 0.2.0 @@ -42,7 +40,7 @@ applyMode(mode=renderMode) { length = sampleSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = 2, + ratio = trackCurveRatio, right = false ); } diff --git a/rcmodels/tracks/sample-curve-right-3.scad b/rcmodels/tracks/sample-curve-right-3.scad deleted file mode 100644 index 106d157..0000000 --- a/rcmodels/tracks/sample-curve-right-3.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for a curved track part, right turned. - * Ratio of 3: you need 12 elements to draw a full circle, - * the radius being 3x the size of an element. - * - * @author jsconan - * @version 0.2.0 - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - curvedBarrierMain( - length = sampleSize, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = 3, - right = true - ); -} diff --git a/rcmodels/tracks/sample-curve-right-4.scad b/rcmodels/tracks/sample-curve-right-4.scad deleted file mode 100644 index 0321ed3..0000000 --- a/rcmodels/tracks/sample-curve-right-4.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for a curved track part, right turned. - * Ratio of 4: you need 16 elements to draw a full circle, - * the radius being 4x the size of an element. - * - * @author jsconan - * @version 0.2.0 - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - curvedBarrierMain( - length = sampleSize, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = 4, - right = true - ); -} diff --git a/rcmodels/tracks/sample-curve-right-1.scad b/rcmodels/tracks/sample-curve-right-inner.scad similarity index 89% rename from rcmodels/tracks/sample-curve-right-1.scad rename to rcmodels/tracks/sample-curve-right-inner.scad index 605f6f2..571b741 100644 --- a/rcmodels/tracks/sample-curve-right-1.scad +++ b/rcmodels/tracks/sample-curve-right-inner.scad @@ -23,9 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A sample for a curved track part, right turned. - * Ratio of 1: you need 4 elements to draw a full circle, - * the radius being 1x the size of an element. + * A sample for a curved track part, inner curve, right turned. * * @author jsconan * @version 0.2.0 diff --git a/rcmodels/tracks/sample-curve-right-2.scad b/rcmodels/tracks/sample-curve-right-outer.scad similarity index 88% rename from rcmodels/tracks/sample-curve-right-2.scad rename to rcmodels/tracks/sample-curve-right-outer.scad index b2e0277..81e49cb 100644 --- a/rcmodels/tracks/sample-curve-right-2.scad +++ b/rcmodels/tracks/sample-curve-right-outer.scad @@ -23,9 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A sample for a curved track part, right turned. - * Ratio of 2: you need 8 elements to draw a full circle, - * the radius being 2x the size of an element. + * A sample for a curved track part, outer curve, right turned. * * @author jsconan * @version 0.2.0 @@ -42,7 +40,7 @@ applyMode(mode=renderMode) { length = sampleSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = 2, + ratio = trackCurveRatio, right = true ); } From c62e652f5e09133217ef251c210cce35290656d7 Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 4 Feb 2020 23:06:24 +0100 Subject: [PATCH 064/191] Fix regresion on the curved barrier shape --- rcmodels/tracks/shapes/curve.scad | 39 +++++++++++++++++-------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad index e9750e5..047caba 100644 --- a/rcmodels/tracks/shapes/curve.scad +++ b/rcmodels/tracks/shapes/curve.scad @@ -143,6 +143,7 @@ module curvedBarrierHolder(length, thickness, base, ratio = 1, right = false) { radius = length * ratio; defaultAngle = 90; angle = defaultAngle / ratio; + ratioAngle = defaultAngle - angle; linkHeight = getBarrierHolderHeight(base) - base; thickness = thickness + printTolerance; @@ -154,30 +155,32 @@ module curvedBarrierHolder(length, thickness, base, ratio = 1, right = false) { ratio = ratio, right = right ); - translateZ(minThickness) { - difference() { - pipeSegment( - r = radius + thickness / 2, - h = linkHeight * 2, - w = thickness, - a = angle - ); + rotateZ(ratioAngle / 2) { + translateZ(minThickness) { + difference() { + pipeSegment( + r = radius + thickness / 2, + h = linkHeight * 2, + w = thickness, + a = angle + ); - arcAngle = getArcAngle(radius = radius, length = length / 2); - angles = [ + arcAngle = getArcAngle(radius = radius, length = length / 2); + angles = [ [0, 0, 0], [0, 0, arcAngle], [0, 0, angle - arcAngle], [0, 0, angle] - ]; + ]; - repeatRotateMap(angles) { - barrierNotchCurved( - radius = radius, - thickness = thickness * 2, - base = base, - distance = printTolerance / 2 - ); + repeatRotateMap(angles) { + barrierNotchCurved( + radius = radius, + thickness = thickness * 2, + base = base, + distance = printTolerance / 2 + ); + } } } } From a5d32cde9ebe4fb636ed46ebbe21e062fd775a15 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 5 Feb 2020 18:37:59 +0100 Subject: [PATCH 065/191] Refine the config and the functions, add a config checker --- rcmodels/tracks/barrier-body-curve.scad | 2 +- rcmodels/tracks/barrier-body-straight.scad | 2 +- .../barrier-holder-curve-left-outer.scad | 2 +- .../barrier-holder-curve-right-outer.scad | 2 +- rcmodels/tracks/config/config.scad | 6 +- rcmodels/tracks/config/setup.scad | 3 + rcmodels/tracks/config/values.scad | 93 +++++++++++-------- rcmodels/tracks/render.sh | 2 +- rcmodels/tracks/sample-curve-left-outer.scad | 2 +- rcmodels/tracks/sample-curve-right-outer.scad | 2 +- rcmodels/tracks/test/curve.scad | 26 +++--- rcmodels/tracks/test/profiles.scad | 8 +- rcmodels/tracks/test/setup.scad | 19 ++-- rcmodels/tracks/test/straight.scad | 4 +- 14 files changed, 97 insertions(+), 76 deletions(-) diff --git a/rcmodels/tracks/barrier-body-curve.scad b/rcmodels/tracks/barrier-body-curve.scad index e300326..0b65721 100644 --- a/rcmodels/tracks/barrier-body-curve.scad +++ b/rcmodels/tracks/barrier-body-curve.scad @@ -38,7 +38,7 @@ applyMode(mode=renderMode) { //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) barrierBody( length = getCurveRemainingLength(trackSectionSize), - height = barrierHeight, + height = getBarrierBodyHeight(barrierHeight), thickness = barrierBodyThickness, base = barrierHolderBase, notches = 1 diff --git a/rcmodels/tracks/barrier-body-straight.scad b/rcmodels/tracks/barrier-body-straight.scad index 8227958..63ea2be 100644 --- a/rcmodels/tracks/barrier-body-straight.scad +++ b/rcmodels/tracks/barrier-body-straight.scad @@ -38,7 +38,7 @@ applyMode(mode=renderMode) { //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) barrierBody( length = trackSectionSize, - height = barrierHeight, + height = getBarrierBodyHeight(barrierHeight), thickness = barrierBodyThickness, base = barrierHolderBase, notches = 2 diff --git a/rcmodels/tracks/barrier-holder-curve-left-outer.scad b/rcmodels/tracks/barrier-holder-curve-left-outer.scad index d81ceb8..4abfd52 100644 --- a/rcmodels/tracks/barrier-holder-curve-left-outer.scad +++ b/rcmodels/tracks/barrier-holder-curve-left-outer.scad @@ -40,7 +40,7 @@ applyMode(mode=renderMode) { length = trackSectionSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = trackCurveRatio, + ratio = getOuterCurveRatio(trackSectionSize, trackWidth), right = false ); } diff --git a/rcmodels/tracks/barrier-holder-curve-right-outer.scad b/rcmodels/tracks/barrier-holder-curve-right-outer.scad index 4555afb..545bc85 100644 --- a/rcmodels/tracks/barrier-holder-curve-right-outer.scad +++ b/rcmodels/tracks/barrier-holder-curve-right-outer.scad @@ -40,7 +40,7 @@ applyMode(mode=renderMode) { length = trackSectionSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = trackCurveRatio, + ratio = getOuterCurveRatio(trackSectionSize, trackWidth), right = true ); } diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index a333e43..5fd972f 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -39,10 +39,10 @@ printTolerance = 0.1; // The print tolerance when pieces need to be assembled // The dimensions and constraints of a track element trackSectionSize = 200; // The nominal size of a track element: the length for straight element, or the radius for a curved element -trackWidth = 400; // The width of track, i.e. the distance between the barriers -barrierHeight = 40; // The height of the barrier, including the holders -barrierBodyThickness = 0.6; // The thickness of the barrier body +trackWidth = 400; // The width of track lane, i.e. the distance between the barriers +barrierHeight = 30; // The height of the barrier, including the holders barrierHolderBase = 2; // The base unit value used to design the barrier holder +barrierBodyThickness = 0.6; // The thickness of the barrier body archTowerThickness = 1.6; // The thickness of the arch tower wall wireClipThickness = .8; // The thickness of the wire clips wall wireClipWidth = 2; // The thickness of the wire clips diff --git a/rcmodels/tracks/config/setup.scad b/rcmodels/tracks/config/setup.scad index b76b77b..c1d9dfa 100644 --- a/rcmodels/tracks/config/setup.scad +++ b/rcmodels/tracks/config/setup.scad @@ -40,3 +40,6 @@ include include <../shapes/profiles.scad> include <../shapes/straight.scad> include <../shapes/curve.scad> + +// Validate the config against the constraints +validateConfig(trackSectionSize, trackWidth, barrierHeight, barrierHolderBase); diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index cb32fb1..b8f1ef5 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -62,14 +62,14 @@ function shells(N) = N * nozzleWidth; * @param Number base - The base unit value used to design the barrier holder. * @returns Number */ -function getBarrierStripHeight(base) = base * barrierStripHeightRatio; +function getBarrierStripHeight(base) = base * stripHeightRatio; /** * Computes the indent of the barrier body strip. * @param Number base - The base unit value used to design the barrier holder. * @returns Number */ -function getBarrierStripIndent(base) = base * barrierStripIndentRatio; +function getBarrierStripIndent(base) = base * stripIndentRatio; /** * Computes the outer length of a barrier link. @@ -152,6 +152,56 @@ function getCurveRemainingLength(length) = getCurveLength(length) - length; */ function getMinLength(base) = getBarrierNotchWidth(base, printTolerance) * 4; +/** + * Computes the minimal height of a track barrier. + * @param Number base - The base unit value used to design the barrier holder. + * @returns Number + */ +function getMinHeight(base) = getBarrierStripHeight(base) * 3; + +/** + * Computes the ratio of the outer curve with respect to the track width. + * @param Number length - The nominal size of a track element. + * @param Number width - The width of track lane. + * @returns Number + */ +function getOuterCurveRatio(length, width) = (width + length) / length; + +/** + * Validates the config values, checking if it match the critical constraints. + * @param Number length - The nominal size of a track element. + * @param Number width - The width of track lane. + * @param Number height - The height of the barrier. + * @param Number base - The base unit value used to design the barrier holder. + */ +module validateConfig(length, width, height, base) { + assert( + length >= getMinLength(base), + str( + "The size for a track element is too small! The minimum length is ", + getMinLength(base), + ". The current value is ", + length + ) + ); + assert( + barrierHeight >= getMinHeight(base), + str( + "The height for a track barrier is too small! The minimum height is ", + getMinHeight(base), + ". The current value is ", + barrierHeight + ) + ); + assert( + width > length, + "The width of the track must be greater than the length of one element!" + ); + assert( + width % length == 0, + "The width of the track must be a multiple of the length of one element!" + ); +} // The minimal thickness of a part minThickness = layers(2); @@ -160,40 +210,5 @@ minThickness = layers(2); minWidth = shells(2); // The ratios applied to the base unit value used to design the barrier holder -barrierStripHeightRatio = 3; -barrierStripIndentRatio = 0.5; - -// The ratio of the outer curve with respect to the track width -trackCurveRatio = (trackWidth + trackSectionSize) / trackSectionSize; - -// The minimal size for a track element -minTrackSectionSize = getBarrierNotchWidth(barrierHolderBase, printTolerance) * 4; -minBarrierHeight = getBarrierStripHeight(barrierHolderBase) * 3; - -// Validate the critical constraints -assert( - trackSectionSize >= minTrackSectionSize, - str( - "The size for a track element is too small! The minimum length is ", - minTrackSectionSize, - ". The current value is ", - trackSectionSize - ) -); -assert( - barrierHeight >= minBarrierHeight, - str( - "The height for a track barrier is too small! The minimum height is ", - minBarrierHeight, - ". The current value is ", - barrierHeight - ) -); -assert( - trackWidth > trackSectionSize, - "The width of the track must greater than the length of one element!" -); -assert( - trackWidth % trackSectionSize == 0, - "The width of the track must be a multiple of the length of one element!" -); +stripHeightRatio = 3; +stripIndentRatio = 0.5; diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index 5d22975..c8ae57d 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -69,7 +69,7 @@ while (( "$#" )); do echo -e "${C_MSG} -h, --help ${C_RST}Show this help" echo -e "${C_MSG} -l, --length ${C_RST}Set the size of a track section" echo -e "${C_MSG} -w --height ${C_RST}Set the height of the track barrier" - echo -e "${C_MSG} -t --track ${C_RST}Set the width of the track" + echo -e "${C_MSG} -t --track ${C_RST}Set the width of a track lane" echo -e "${C_MSG} -s --sample ${C_RST}Set the size of sample element" echo exit 0 diff --git a/rcmodels/tracks/sample-curve-left-outer.scad b/rcmodels/tracks/sample-curve-left-outer.scad index b065a39..89b6c79 100644 --- a/rcmodels/tracks/sample-curve-left-outer.scad +++ b/rcmodels/tracks/sample-curve-left-outer.scad @@ -40,7 +40,7 @@ applyMode(mode=renderMode) { length = sampleSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = trackCurveRatio, + ratio = getOuterCurveRatio(trackSectionSize, trackWidth), right = false ); } diff --git a/rcmodels/tracks/sample-curve-right-outer.scad b/rcmodels/tracks/sample-curve-right-outer.scad index 81e49cb..599820a 100644 --- a/rcmodels/tracks/sample-curve-right-outer.scad +++ b/rcmodels/tracks/sample-curve-right-outer.scad @@ -40,7 +40,7 @@ applyMode(mode=renderMode) { length = sampleSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = trackCurveRatio, + ratio = getOuterCurveRatio(trackSectionSize, trackWidth), right = true ); } diff --git a/rcmodels/tracks/test/curve.scad b/rcmodels/tracks/test/curve.scad index b5049c2..854aa15 100644 --- a/rcmodels/tracks/test/curve.scad +++ b/rcmodels/tracks/test/curve.scad @@ -39,7 +39,7 @@ applyMode(mode=mode) { distributeRotate(center=true) { - // test the main shape of a barrier holder for a curved track element, right turned + // test the main shape of a barrier holder for a curved track element, inner curve, right turned curvedBarrierMain( length = length, thickness = thickness, @@ -48,16 +48,16 @@ applyMode(mode=mode) { right = true ); - // test the main shape of a barrier holder for a curved track element with a ratio of 2, right turned + // test the main shape of a barrier holder for a curved track element, outer curve, right turned curvedBarrierMain( length = length, thickness = thickness, base = base, - ratio = 2, + ratio = getOuterCurveRatio(length, width), right = true ); - // test the main shape of a barrier holder for a curved track element, left turned + // test the main shape of a barrier holder for a curved track element, inner curve, left turned curvedBarrierMain( length = length, thickness = thickness, @@ -66,12 +66,12 @@ applyMode(mode=mode) { right = false ); - // test the main shape of a barrier holder for a curved track element with a ratio of 2, left turned + // test the main shape of a barrier holder for a curved track element, outer curve, left turned curvedBarrierMain( length = length, thickness = thickness, base = base, - ratio = 2, + ratio = getOuterCurveRatio(length, width), right = false ); @@ -82,12 +82,12 @@ applyMode(mode=mode) { radius = length, thickness = thickness, base = base, - distance = tolerance + distance = printTolerance ); distributeRotate(center=true) { - // test the barrier holder shape for a curved track element, right turned + // test the barrier holder shape for a curved track element, inner curve, right turned curvedBarrierHolder( length = length, thickness = thickness, @@ -96,16 +96,16 @@ applyMode(mode=mode) { right = true ); - // test the barrier holder shape for a curved track element with a ratio of 2, right turned + // test the barrier holder shape for a curved track element, outer curve, right turned curvedBarrierHolder( length = length, thickness = thickness, base = base, - ratio = 2, + ratio = getOuterCurveRatio(length, width), right = true ); - // test the barrier holder shape for a curved track element, left turned + // test the barrier holder shape for a curved track element, inner curve, left turned curvedBarrierHolder( length = length, thickness = thickness, @@ -114,12 +114,12 @@ applyMode(mode=mode) { right = false ); - // test the barrier holder shape for a curved track element with a ratio of 2, left turned + // test the barrier holder shape for a curved track element, outer curve, left turned curvedBarrierHolder( length = length, thickness = thickness, base = base, - ratio = 2, + ratio = getOuterCurveRatio(length, width), right = false ); diff --git a/rcmodels/tracks/test/profiles.scad b/rcmodels/tracks/test/profiles.scad index 4279578..b5bf5b0 100644 --- a/rcmodels/tracks/test/profiles.scad +++ b/rcmodels/tracks/test/profiles.scad @@ -40,13 +40,13 @@ applyMode(mode=mode) { // test the barrier link profile barrierLinkProfile( base = base, - distance = tolerance + distance = printTolerance ); // test the barrier notch profile barrierNotchProfile( base = base, - distance = tolerance + distance = printTolerance ); // test the barrier holder profile @@ -84,7 +84,7 @@ applyMode(mode=mode) { barrierNotch( thickness = thickness, base = base, - distance = tolerance, + distance = printTolerance, interval = length, count = 2, center = true @@ -95,7 +95,7 @@ applyMode(mode=mode) { radius = length, thickness = thickness, base = base, - distance = tolerance + distance = printTolerance ); } diff --git a/rcmodels/tracks/test/setup.scad b/rcmodels/tracks/test/setup.scad index 45a253f..3f283c5 100644 --- a/rcmodels/tracks/test/setup.scad +++ b/rcmodels/tracks/test/setup.scad @@ -33,11 +33,14 @@ include <../config/setup.scad> // Defines the test config -mode = MODE_DEV; -length = 50; -height = 30; -thickness = 0.6; -wall = 0.8; -clip = 2; -base = 2; -tolerance = 0.1; +mode = MODE_DEV; // The render quality to apply +length = 50; // The nominal size of a track element +width = 100; // The width of track lane +height = 30; // The height of the barrier, including the holders +base = 2; // The base unit value used to design the barrier holder +thickness = 0.6; // The thickness of the barrier body +wall = 0.8; // The thickness of the walls +clip = 2; // The thickness of the wire clips + +// Validate the config against the constraints +validateConfig(length, width, height, base); diff --git a/rcmodels/tracks/test/straight.scad b/rcmodels/tracks/test/straight.scad index fc5f1fc..f572666 100644 --- a/rcmodels/tracks/test/straight.scad +++ b/rcmodels/tracks/test/straight.scad @@ -41,7 +41,7 @@ applyMode(mode=mode) { barrierLink( height = 5, base = base, - distance = tolerance, + distance = printTolerance, center = false ); @@ -49,7 +49,7 @@ applyMode(mode=mode) { barrierNotch( thickness = thickness, base = base, - distance = tolerance, + distance = printTolerance, interval = length, count = 2, center = true From cc364fd10bca01e5b75544b849bd7170e39b1394 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 5 Feb 2020 19:07:16 +0100 Subject: [PATCH 066/191] Use a proportianale value for the offset of the barrier holder profile --- rcmodels/tracks/config/values.scad | 15 +++++++++++++++ rcmodels/tracks/shapes/profiles.scad | 6 +++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index b8f1ef5..bd14580 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -110,6 +110,14 @@ function getBarrierNotchDistance(base, distance = 0) = (getBarrierLinkWidth(base */ function getBarrierHolderWidth(base) = getBarrierLinkWidth(base, printTolerance) + minWidth * 4; +/** + * Computes the top width of a barrier holder. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number thickness - The thickness of the barrier body. + * @returns Number + */ +function getBarrierHolderTopWidth(base, thickness) = nozzleAligned((getBarrierLinkWidth(base, printTolerance) - thickness) / 2) * 2 + thickness; + /** * Computes the outer height of a barrier holder. * @param Number base - The base unit value used to design the barrier holder. @@ -117,6 +125,13 @@ function getBarrierHolderWidth(base) = getBarrierLinkWidth(base, printTolerance) */ function getBarrierHolderHeight(base) = getBarrierStripHeight(base) + minThickness + printResolution; +/** + * Computes the offset applied to the outline of the barrier holder. + * @param Number base - The base unit value used to design the barrier holder. + * @returns Number + */ +function getBarrierHolderOffset(base) = base / 4; + /** * Computes the inner height of the barrier body, between the barrier holders. * @param Number height - The height of the barrier. diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index 5029c01..2dffcaa 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -106,12 +106,12 @@ module barrierNotchProfile(base, distance = 0) { function getBarrierHolderPoints(base, thickness) = let( linkWidth = getBarrierLinkWidth(base, printTolerance), - top = nozzleAligned((linkWidth - thickness) / 2) * 2 + thickness, + top = getBarrierHolderTopWidth(base, thickness), width = getBarrierHolderWidth(base), height = getBarrierHolderHeight(base), + offset = getBarrierHolderOffset(base), lineW = (width - top) / 2, - lineH = height - base, - offset = printResolution * 2 + lineH = height - base ) path([ ["P", -width / 2 + offset, 0], From e5f367e9cc3c4c6a3a9d65e17342f09340808635 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 5 Feb 2020 21:11:21 +0100 Subject: [PATCH 067/191] Rework the arch tower and the wire clip --- rcmodels/tracks/barrier-arch-tower.scad | 6 +-- rcmodels/tracks/shapes/profiles.scad | 57 ++++++++--------------- rcmodels/tracks/shapes/straight.scad | 51 +++++++++++--------- rcmodels/tracks/test/profiles.scad | 33 ++++++------- rcmodels/tracks/test/straight.scad | 62 ++++++++++--------------- 5 files changed, 89 insertions(+), 120 deletions(-) diff --git a/rcmodels/tracks/barrier-arch-tower.scad b/rcmodels/tracks/barrier-arch-tower.scad index ed8788b..d2ad63b 100644 --- a/rcmodels/tracks/barrier-arch-tower.scad +++ b/rcmodels/tracks/barrier-arch-tower.scad @@ -37,18 +37,16 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) distribute([0, getBarrierHolderWidth(barrierHolderBase) * 2, 0], center=true) { - archTowerWidthHolder( + archTower( wall = archTowerThickness, length = trackSectionSize, - height = barrierHeight, base = barrierHolderBase, thickness = barrierBodyThickness, right = false ); - archTowerWidthHolder( + archTower( wall = archTowerThickness, length = trackSectionSize, - height = barrierHeight, base = barrierHolderBase, thickness = barrierBodyThickness, right = true diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index 2dffcaa..fb3b2c9 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -161,13 +161,12 @@ module barrierHolderOutline(wall, base, thickness, distance = 0) { } /** - * Draws the profile of a wire clip. + * Draws the profile of a clip for a barrier holder. * @param Number wall - The thickness of the outline. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. */ -module wireClipProfile(wall, base, thickness) { - holderWidth = getBarrierHolderWidth(base) + wall * 2; +module clipProfile(wall, base, thickness) { holderHeight = getBarrierHolderHeight(base); difference() { @@ -178,10 +177,26 @@ module wireClipProfile(wall, base, thickness) { distance = 0 ); - translateY(holderHeight) { - rectangle([thickness, wall * 2]); + translateY(holderHeight + wall * 1.5) { + rectangle([getBarrierHolderTopWidth(base, thickness), wall * 2]); } } +} + +/** + * Draws the profile of a wire clip. + * @param Number wall - The thickness of the outline. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number thickness - The thickness of the barrier body. + */ +module wireClipProfile(wall, base, thickness) { + holderWidth = getBarrierHolderWidth(base) + wall * 2; + + clipProfile( + wall = wall, + base = base, + thickness = thickness + ); repeat(intervalX = holderWidth - wall, center = true) { translateY(base / 2) { rectangle([wall, base]); @@ -194,35 +209,3 @@ module wireClipProfile(wall, base, thickness) { $fn = 10 ); } - -/** - * Draws the profile of an arch tower that will clamp a barrier border. - * @param Number wall - The thickness of the outline. - * @param Number height - The height of the barrier. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number thickness - The thickness of the barrier body. - */ -module archTowerProfile(wall, height, base, thickness) { - holderHeight = getBarrierHolderHeight(base) + wall + printTolerance; - bodyHeight = getBarrierBodyInnerHeight(height, base); - towerWidth = thickness + printTolerance + wall * 2; - offset = holderHeight + bodyHeight / 2; - - difference() { - union() { - barrierHolderOutline( - wall = wall, - base = base, - thickness = thickness, - distance = printTolerance - ); - translateY(offset) { - rectangle([towerWidth, bodyHeight]); - } - } - - translateY(offset) { - rectangle([thickness + printTolerance, bodyHeight + wall]); - } - } -} diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index bd700e0..a430663 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -166,16 +166,16 @@ module straightBarrierHolder(length, thickness, base) { } /** - * Draws the shape of a wire clip. - * @param Number wall - The thickness of the wire clip lines. + * Draws the shape of a clip. + * @param Number wall - The thickness of the clip lines. * @param Number height - The thickness of the clip. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. * @param Boolean [center] - The shape is centered vertically. */ -module wireClip(wall, height, base, thickness, center = false) { +module clip(wall, height, base, thickness, center = false) { negativeExtrude(height=height, center=center) { - wireClipProfile( + clipProfile( wall = wall, base = base, thickness = thickness @@ -184,20 +184,17 @@ module wireClip(wall, height, base, thickness, center = false) { } /** - * Draws the shape of an arch tower that will clamp a barrier border. - * @param Number wall - The thickness of the outline. - * @param Number height - The height of the barrier. + * Draws the shape of a wire clip. + * @param Number wall - The thickness of the wire clip lines. + * @param Number height - The thickness of the clip. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. * @param Boolean [center] - The shape is centered vertically. */ -module archTower(wall, height, base, thickness, center = false) { - holderHeight = getBarrierHolderHeight(base); - - negativeExtrude(height=holderHeight, center=center) { - archTowerProfile( +module wireClip(wall, height, base, thickness, center = false) { + negativeExtrude(height=height, center=center) { + wireClipProfile( wall = wall, - height = height, base = base, thickness = thickness ); @@ -205,22 +202,30 @@ module archTower(wall, height, base, thickness, center = false) { } /** - * Draws the shape of an arch tower with the barrier holders. + * Draws the shape of an arch tower that will clamp a barrier border. * @param Number wall - The thickness of the outline. - * @param Number height - The length of a track element. - * @param Number height - The height of the barrier. + * @param Number length - The length of a track element. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. * @param Number right - Is it the right or the left part of the track element that is added to the tower? */ -module archTowerWidthHolder(wall, length, height, base, thickness, right = false) { +module archTower(wall, length, base, thickness, right = false) { + holderHeight = getBarrierHolderHeight(base); + indent = getBarrierStripIndent(base); + rotateZ(-90) { - archTower( - wall = wall, - height = height, - base = base, - thickness = thickness - ); + difference() { + clip( + wall = wall, + height = holderHeight, + base = base, + thickness = thickness + ); + + translate([0, wall / 2, holderHeight - indent]) { + box([thickness, wall * 2, indent * 2]); + } + } } difference() { rotateZ(right ? 180 : 0) { diff --git a/rcmodels/tracks/test/profiles.scad b/rcmodels/tracks/test/profiles.scad index b5bf5b0..265fe6a 100644 --- a/rcmodels/tracks/test/profiles.scad +++ b/rcmodels/tracks/test/profiles.scad @@ -35,7 +35,7 @@ include // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=mode) { - distributeGrid(intervalX=[length, 0, 0], intervalY=[0, height, 0], center=true) { + distributeGrid(intervalX=[length, 0, 0], intervalY=[0, height, 0], line=3, center=true) { // test the barrier link profile barrierLinkProfile( @@ -63,6 +63,13 @@ applyMode(mode=mode) { distance = 0 ); + // test the barrier clip profile + clipProfile( + wall = wall, + base = base, + thickness = thickness + ); + // test the wire clip profile wireClipProfile( wall = wall, @@ -70,15 +77,13 @@ applyMode(mode=mode) { thickness = thickness ); - // test the arch tower profile - rotateZ(-90) { - archTowerProfile( - wall = wall, - height = height, - base = base, - thickness = thickness - ); - } + // test the barrier notch shape for a curved track element + barrierNotchCurved( + radius = length, + thickness = thickness, + base = base, + distance = printTolerance + ); // test the barrier notch shape for a straight track element barrierNotch( @@ -90,13 +95,5 @@ applyMode(mode=mode) { center = true ); - // test the barrier notch shape for a curved track element - barrierNotchCurved( - radius = length, - thickness = thickness, - base = base, - distance = printTolerance - ); - } } diff --git a/rcmodels/tracks/test/straight.scad b/rcmodels/tracks/test/straight.scad index f572666..9672a61 100644 --- a/rcmodels/tracks/test/straight.scad +++ b/rcmodels/tracks/test/straight.scad @@ -35,25 +35,7 @@ include // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=mode) { - distributeGrid(intervalX=[length, 0, 0], intervalY=[0, height, 0], line=3, center=true) { - - // test the barrier link shape - barrierLink( - height = 5, - base = base, - distance = printTolerance, - center = false - ); - - // test the barrier notch shape for a straight track element - barrierNotch( - thickness = thickness, - base = base, - distance = printTolerance, - interval = length, - count = 2, - center = true - ); + distributeGrid(intervalX=[length, 0, 0], intervalY=[0, length, 0], line=3, center=true) { // test the barrier body shape barrierBody( @@ -64,6 +46,22 @@ applyMode(mode=mode) { notches = 2 ); + // test the clip profile + clip( + wall = wall, + height = clip, + base = base, + thickness = thickness + ); + + // test the wire clip profile + wireClip( + wall = wall, + height = clip, + base = base, + thickness = thickness + ); + // test the main shape of the barrier holder for a straight track element straightBarrierMain( length = length, @@ -87,39 +85,27 @@ applyMode(mode=mode) { base = base ); - // test the arch tower shape - rotateZ(-90) { - archTower( - wall = base, - height = height, - base = base, - thickness = thickness - ); - } - - // test the wire clip profile - wireClip( - wall = wall, - height = clip, + // test the barrier link shape + barrierLink( + height = 5, base = base, - thickness = thickness + distance = printTolerance, + center = false ); // test the arch tower shape with holders, left side - archTowerWidthHolder( + archTower( wall = wall * 2, length = length, - height = height, base = base, thickness = thickness, right = false ); // test the arch tower shape with holders, right side - archTowerWidthHolder( + archTower( wall = wall * 2, length = length, - height = height, base = base, thickness = thickness, right = true From 3933941ff00dc600203c3b4c37c9f5f9733cef5a Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 5 Feb 2020 22:55:19 +0100 Subject: [PATCH 068/191] Add config print --- .../barrier-holder-curve-left-outer.scad | 2 +- .../barrier-holder-curve-right-outer.scad | 2 +- rcmodels/tracks/config/config.scad | 8 +++---- rcmodels/tracks/config/setup.scad | 2 +- rcmodels/tracks/config/values.scad | 24 +++++++++++++++++++ rcmodels/tracks/render.sh | 10 ++++---- rcmodels/tracks/sample-curve-left-outer.scad | 2 +- rcmodels/tracks/sample-curve-right-outer.scad | 2 +- 8 files changed, 38 insertions(+), 14 deletions(-) diff --git a/rcmodels/tracks/barrier-holder-curve-left-outer.scad b/rcmodels/tracks/barrier-holder-curve-left-outer.scad index 4abfd52..a319ce3 100644 --- a/rcmodels/tracks/barrier-holder-curve-left-outer.scad +++ b/rcmodels/tracks/barrier-holder-curve-left-outer.scad @@ -40,7 +40,7 @@ applyMode(mode=renderMode) { length = trackSectionSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = getOuterCurveRatio(trackSectionSize, trackWidth), + ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth), right = false ); } diff --git a/rcmodels/tracks/barrier-holder-curve-right-outer.scad b/rcmodels/tracks/barrier-holder-curve-right-outer.scad index 545bc85..d7773b0 100644 --- a/rcmodels/tracks/barrier-holder-curve-right-outer.scad +++ b/rcmodels/tracks/barrier-holder-curve-right-outer.scad @@ -40,7 +40,7 @@ applyMode(mode=renderMode) { length = trackSectionSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = getOuterCurveRatio(trackSectionSize, trackWidth), + ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth), right = true ); } diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 5fd972f..f642d71 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -39,11 +39,11 @@ printTolerance = 0.1; // The print tolerance when pieces need to be assembled // The dimensions and constraints of a track element trackSectionSize = 200; // The nominal size of a track element: the length for straight element, or the radius for a curved element -trackWidth = 400; // The width of track lane, i.e. the distance between the barriers +trackLaneWidth = 400; // The width of track lane, i.e. the distance between the barriers barrierHeight = 30; // The height of the barrier, including the holders barrierHolderBase = 2; // The base unit value used to design the barrier holder barrierBodyThickness = 0.6; // The thickness of the barrier body -archTowerThickness = 1.6; // The thickness of the arch tower wall -wireClipThickness = .8; // The thickness of the wire clips wall -wireClipWidth = 2; // The thickness of the wire clips +archTowerThickness = 1.6; // The thickness of the arch tower clip +wireClipThickness = .8; // The thickness of the wire clip +wireClipWidth = 2; // The width of the wire clip sampleSize = 20; // The size for the sample track elements diff --git a/rcmodels/tracks/config/setup.scad b/rcmodels/tracks/config/setup.scad index c1d9dfa..2206b3c 100644 --- a/rcmodels/tracks/config/setup.scad +++ b/rcmodels/tracks/config/setup.scad @@ -42,4 +42,4 @@ include <../shapes/straight.scad> include <../shapes/curve.scad> // Validate the config against the constraints -validateConfig(trackSectionSize, trackWidth, barrierHeight, barrierHolderBase); +validateConfig(trackSectionSize, trackLaneWidth, barrierHeight, barrierHolderBase); diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index bd14580..2c5d0af 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -218,6 +218,30 @@ module validateConfig(length, width, height, base) { ); } +/** + * Prinnt the config values. + * @param Number length - The nominal size of a track element. + * @param Number width - The width of track lane. + * @param Number height - The height of the barrier. + * @param Number base - The base unit value used to design the barrier holder. + */ +module printConfig(length, width, height, base) { + echo(str("----------")); + echo(str("Track section size: ", length / 10, "cm")); + echo(str("Track lane width: ", width / 10, "cm")); + echo(str("Curve length: ", getCurveLength(length) / 10, "cm")); + echo(str("Outer curve ratio: ", getOuterCurveRatio(length, width))); + echo(str("Barrier height: ", height / 10, "cm")); + echo(str("Barrier base value: ", base, "mm")); + echo(str("Barrier thickness: ", barrierBodyThickness, "mm")); + echo(str("Size of samples: ", sampleSize / 10, "cm")); + echo(str("----------")); + echo(str("Nozzle diameter: ", nozzleWidth, "mm")); + echo(str("Print layer: ", printResolution, "mm")); + echo(str("Print tolerance: ", printTolerance, "mm")); + echo(str("----------")); +} + // The minimal thickness of a part minThickness = layers(2); diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index c8ae57d..50583d7 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -31,7 +31,7 @@ # application params trackSectionSize= barrierHeight= -trackWidth= +trackLaneWidth= sampleSize= # script config @@ -54,7 +54,7 @@ while (( "$#" )); do shift ;; "-t"|"--track") - trackWidth=$2 + trackLaneWidth=$2 shift ;; "-s"|"--sample") @@ -87,8 +87,8 @@ while (( "$#" )); do done # allign values -if [ "${trackSectionSize}" != "" ] && [ "${trackWidth}" == "" ]; then - trackWidth=$((${trackSectionSize} * 2)) +if [ "${trackSectionSize}" != "" ] && [ "${trackLaneWidth}" == "" ]; then + trackLaneWidth=$((${trackSectionSize} * 2)) fi # check OpenSCAD @@ -98,5 +98,5 @@ scadcheck scadtostlall "${srcpath}" "${dstpath}" "" \ "$(varif "trackSectionSize" ${trackSectionSize})" \ "$(varif "barrierHeight" ${barrierHeight})" \ - "$(varif "trackWidth" ${trackWidth})" \ + "$(varif "trackLaneWidth" ${trackLaneWidth})" \ "$(varif "sampleSize" ${sampleSize})" diff --git a/rcmodels/tracks/sample-curve-left-outer.scad b/rcmodels/tracks/sample-curve-left-outer.scad index 89b6c79..12abddb 100644 --- a/rcmodels/tracks/sample-curve-left-outer.scad +++ b/rcmodels/tracks/sample-curve-left-outer.scad @@ -40,7 +40,7 @@ applyMode(mode=renderMode) { length = sampleSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = getOuterCurveRatio(trackSectionSize, trackWidth), + ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth), right = false ); } diff --git a/rcmodels/tracks/sample-curve-right-outer.scad b/rcmodels/tracks/sample-curve-right-outer.scad index 599820a..8e01118 100644 --- a/rcmodels/tracks/sample-curve-right-outer.scad +++ b/rcmodels/tracks/sample-curve-right-outer.scad @@ -40,7 +40,7 @@ applyMode(mode=renderMode) { length = sampleSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = getOuterCurveRatio(trackSectionSize, trackWidth), + ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth), right = true ); } From 5dae9a90df7d2065ab85f95cadcc338500419b28 Mon Sep 17 00:00:00 2001 From: jsconan Date: Thu, 6 Feb 2020 21:58:50 +0100 Subject: [PATCH 069/191] Add inner curve radius --- .../barrier-holder-curve-left-inner.scad | 2 +- .../barrier-holder-curve-left-outer.scad | 2 +- .../tracks/barrier-holder-curve-left.scad | 46 ++++++++++++++ .../barrier-holder-curve-right-inner.scad | 2 +- .../barrier-holder-curve-right-outer.scad | 2 +- .../tracks/barrier-holder-curve-right.scad | 46 ++++++++++++++ rcmodels/tracks/config/config.scad | 3 +- rcmodels/tracks/config/setup.scad | 8 ++- rcmodels/tracks/config/values.scad | 61 +++++++++++++------ rcmodels/tracks/render.sh | 20 ++++-- rcmodels/tracks/sample-curve-left-inner.scad | 2 +- rcmodels/tracks/sample-curve-left-outer.scad | 2 +- rcmodels/tracks/sample-curve-left.scad | 46 ++++++++++++++ rcmodels/tracks/sample-curve-right-inner.scad | 2 +- rcmodels/tracks/sample-curve-right-outer.scad | 2 +- rcmodels/tracks/sample-curve-right.scad | 46 ++++++++++++++ rcmodels/tracks/test/curve.scad | 16 ++--- rcmodels/tracks/test/setup.scad | 22 ++++++- 18 files changed, 285 insertions(+), 45 deletions(-) create mode 100644 rcmodels/tracks/barrier-holder-curve-left.scad create mode 100644 rcmodels/tracks/barrier-holder-curve-right.scad create mode 100644 rcmodels/tracks/sample-curve-left.scad create mode 100644 rcmodels/tracks/sample-curve-right.scad diff --git a/rcmodels/tracks/barrier-holder-curve-left-inner.scad b/rcmodels/tracks/barrier-holder-curve-left-inner.scad index 659101b..60f3102 100644 --- a/rcmodels/tracks/barrier-holder-curve-left-inner.scad +++ b/rcmodels/tracks/barrier-holder-curve-left-inner.scad @@ -40,7 +40,7 @@ applyMode(mode=renderMode) { length = trackSectionSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = 1, + ratio = getInnerCurveRatio(trackSectionSize, trackRadius), right = false ); } diff --git a/rcmodels/tracks/barrier-holder-curve-left-outer.scad b/rcmodels/tracks/barrier-holder-curve-left-outer.scad index a319ce3..eb09c9c 100644 --- a/rcmodels/tracks/barrier-holder-curve-left-outer.scad +++ b/rcmodels/tracks/barrier-holder-curve-left-outer.scad @@ -40,7 +40,7 @@ applyMode(mode=renderMode) { length = trackSectionSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth), + ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth, trackRadius), right = false ); } diff --git a/rcmodels/tracks/barrier-holder-curve-left.scad b/rcmodels/tracks/barrier-holder-curve-left.scad new file mode 100644 index 0000000..5aca865 --- /dev/null +++ b/rcmodels/tracks/barrier-holder-curve-left.scad @@ -0,0 +1,46 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier holder for a curved track part, minimal curve, left turned. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierHolder( + length = trackSectionSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 1, + right = false + ); +} diff --git a/rcmodels/tracks/barrier-holder-curve-right-inner.scad b/rcmodels/tracks/barrier-holder-curve-right-inner.scad index dd8f10b..cf19c2b 100644 --- a/rcmodels/tracks/barrier-holder-curve-right-inner.scad +++ b/rcmodels/tracks/barrier-holder-curve-right-inner.scad @@ -40,7 +40,7 @@ applyMode(mode=renderMode) { length = trackSectionSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = 1, + ratio = getInnerCurveRatio(trackSectionSize, trackRadius), right = true ); } diff --git a/rcmodels/tracks/barrier-holder-curve-right-outer.scad b/rcmodels/tracks/barrier-holder-curve-right-outer.scad index d7773b0..a5d3ce4 100644 --- a/rcmodels/tracks/barrier-holder-curve-right-outer.scad +++ b/rcmodels/tracks/barrier-holder-curve-right-outer.scad @@ -40,7 +40,7 @@ applyMode(mode=renderMode) { length = trackSectionSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth), + ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth, trackRadius), right = true ); } diff --git a/rcmodels/tracks/barrier-holder-curve-right.scad b/rcmodels/tracks/barrier-holder-curve-right.scad new file mode 100644 index 0000000..ee027df --- /dev/null +++ b/rcmodels/tracks/barrier-holder-curve-right.scad @@ -0,0 +1,46 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier holder for a curved track part, minimal curve, right turned. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierHolder( + length = trackSectionSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 1, + right = true + ); +} diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index f642d71..86c279d 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -38,8 +38,9 @@ nozzleWidth = 0.4; // The size of the print nozzle printTolerance = 0.1; // The print tolerance when pieces need to be assembled // The dimensions and constraints of a track element -trackSectionSize = 200; // The nominal size of a track element: the length for straight element, or the radius for a curved element +trackSectionSize = 100; // The nominal size of a track element: the length for straight element, or the radius for a curved element trackLaneWidth = 400; // The width of track lane, i.e. the distance between the barriers +trackRadius = 200; // The radius of the track inner curve barrierHeight = 30; // The height of the barrier, including the holders barrierHolderBase = 2; // The base unit value used to design the barrier holder barrierBodyThickness = 0.6; // The thickness of the barrier body diff --git a/rcmodels/tracks/config/setup.scad b/rcmodels/tracks/config/setup.scad index 2206b3c..88a8d8d 100644 --- a/rcmodels/tracks/config/setup.scad +++ b/rcmodels/tracks/config/setup.scad @@ -42,4 +42,10 @@ include <../shapes/straight.scad> include <../shapes/curve.scad> // Validate the config against the constraints -validateConfig(trackSectionSize, trackLaneWidth, barrierHeight, barrierHolderBase); +validateConfig( + length = trackSectionSize, + width = trackLaneWidth, + height = barrierHeight, + radius = trackRadius, + base = barrierHolderBase +); diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 2c5d0af..8ccd71b 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -174,22 +174,32 @@ function getMinLength(base) = getBarrierNotchWidth(base, printTolerance) * 4; */ function getMinHeight(base) = getBarrierStripHeight(base) * 3; +/** + * Computes the ratio of the inner curve with respect to the track section size. + * @param Number length - The nominal size of a track element. + * @param Number radius - The radius of the track inner curve. + * @returns Number + */ +function getInnerCurveRatio(length, radius) = radius / length; + /** * Computes the ratio of the outer curve with respect to the track width. * @param Number length - The nominal size of a track element. * @param Number width - The width of track lane. + * @param Number radius - The radius of the track inner curve. * @returns Number */ -function getOuterCurveRatio(length, width) = (width + length) / length; +function getOuterCurveRatio(length, width, radius) = (width + radius) / length; /** * Validates the config values, checking if it match the critical constraints. * @param Number length - The nominal size of a track element. * @param Number width - The width of track lane. * @param Number height - The height of the barrier. + * @param Number radius - The radius of the track inner curve. * @param Number base - The base unit value used to design the barrier holder. */ -module validateConfig(length, width, height, base) { +module validateConfig(length, width, height, radius, base) { assert( length >= getMinLength(base), str( @@ -209,37 +219,48 @@ module validateConfig(length, width, height, base) { ) ); assert( - width > length, - "The width of the track must be greater than the length of one element!" + width >= length, + "The width of the track must be greater or equal than the length of one element!" + ); + assert( + radius >= length, + "The radius of the track inner curve must be greater or equal than the length of one element!" ); assert( width % length == 0, "The width of the track must be a multiple of the length of one element!" ); + assert( + radius % length == 0, + "The radius of the track inner curve must be a multiple of the length of one element!" + ); } /** - * Prinnt the config values. + * Prints the config values. * @param Number length - The nominal size of a track element. * @param Number width - The width of track lane. * @param Number height - The height of the barrier. + * @param Number radius - The radius of the track inner curve. * @param Number base - The base unit value used to design the barrier holder. */ -module printConfig(length, width, height, base) { - echo(str("----------")); - echo(str("Track section size: ", length / 10, "cm")); - echo(str("Track lane width: ", width / 10, "cm")); - echo(str("Curve length: ", getCurveLength(length) / 10, "cm")); - echo(str("Outer curve ratio: ", getOuterCurveRatio(length, width))); - echo(str("Barrier height: ", height / 10, "cm")); - echo(str("Barrier base value: ", base, "mm")); - echo(str("Barrier thickness: ", barrierBodyThickness, "mm")); - echo(str("Size of samples: ", sampleSize / 10, "cm")); - echo(str("----------")); - echo(str("Nozzle diameter: ", nozzleWidth, "mm")); - echo(str("Print layer: ", printResolution, "mm")); - echo(str("Print tolerance: ", printTolerance, "mm")); - echo(str("----------")); +module printConfig(length, width, height, radius, base) { + echo(str("------------------------------")); + echo(str("Track section length: ", length / 10, "cm")); + echo(str("Track lane width: ", width / 10, "cm")); + echo(str("Track inner radius: ", radius / 10, "cm")); + echo(str("Curve section length: ", getCurveLength(length) / 10, "cm")); + echo(str("Inner curve ratio: ", getInnerCurveRatio(length, radius))); + echo(str("Outer curve ratio: ", getOuterCurveRatio(length, width, radius))); + echo(str("Barrier height: ", height / 10, "cm")); + echo(str("Barrier base value: ", base, "mm")); + echo(str("Barrier thickness: ", barrierBodyThickness, "mm")); + echo(str("Size of samples: ", sampleSize / 10, "cm")); + echo(str("------------------------------")); + echo(str("Nozzle diameter: ", nozzleWidth, "mm")); + echo(str("Print layer: ", printResolution, "mm")); + echo(str("Print tolerance: ", printTolerance, "mm")); + echo(str("------------------------------")); } // The minimal thickness of a part diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index 50583d7..aa8232c 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -30,8 +30,9 @@ # application params trackSectionSize= -barrierHeight= trackLaneWidth= +trackRadius= +barrierHeight= sampleSize= # script config @@ -53,6 +54,10 @@ while (( "$#" )); do barrierHeight=$2 shift ;; + "-r"|"--radius") + trackRadius=$2 + shift + ;; "-t"|"--track") trackLaneWidth=$2 shift @@ -69,6 +74,7 @@ while (( "$#" )); do echo -e "${C_MSG} -h, --help ${C_RST}Show this help" echo -e "${C_MSG} -l, --length ${C_RST}Set the size of a track section" echo -e "${C_MSG} -w --height ${C_RST}Set the height of the track barrier" + echo -e "${C_MSG} -r --radius ${C_RST}Set the radius of the track inner curve" echo -e "${C_MSG} -t --track ${C_RST}Set the width of a track lane" echo -e "${C_MSG} -s --sample ${C_RST}Set the size of sample element" echo @@ -87,8 +93,13 @@ while (( "$#" )); do done # allign values -if [ "${trackSectionSize}" != "" ] && [ "${trackLaneWidth}" == "" ]; then - trackLaneWidth=$((${trackSectionSize} * 2)) +if [ "${trackSectionSize}" != "" ]; then + if [ "${trackLaneWidth}" == "" ]; then + trackLaneWidth=$((${trackSectionSize} * 2)) + fi + if [ "${trackRadius}" == "" ]; then + trackRadius=${trackSectionSize} + fi fi # check OpenSCAD @@ -97,6 +108,7 @@ scadcheck # render the files, if exist scadtostlall "${srcpath}" "${dstpath}" "" \ "$(varif "trackSectionSize" ${trackSectionSize})" \ - "$(varif "barrierHeight" ${barrierHeight})" \ "$(varif "trackLaneWidth" ${trackLaneWidth})" \ + "$(varif "trackRadius" ${trackRadius})" \ + "$(varif "barrierHeight" ${barrierHeight})" \ "$(varif "sampleSize" ${sampleSize})" diff --git a/rcmodels/tracks/sample-curve-left-inner.scad b/rcmodels/tracks/sample-curve-left-inner.scad index 18c9c26..d9ee0df 100644 --- a/rcmodels/tracks/sample-curve-left-inner.scad +++ b/rcmodels/tracks/sample-curve-left-inner.scad @@ -40,7 +40,7 @@ applyMode(mode=renderMode) { length = sampleSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = 1, + ratio = getInnerCurveRatio(trackSectionSize, trackRadius), right = false ); } diff --git a/rcmodels/tracks/sample-curve-left-outer.scad b/rcmodels/tracks/sample-curve-left-outer.scad index 12abddb..e6e4c68 100644 --- a/rcmodels/tracks/sample-curve-left-outer.scad +++ b/rcmodels/tracks/sample-curve-left-outer.scad @@ -40,7 +40,7 @@ applyMode(mode=renderMode) { length = sampleSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth), + ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth, trackRadius), right = false ); } diff --git a/rcmodels/tracks/sample-curve-left.scad b/rcmodels/tracks/sample-curve-left.scad new file mode 100644 index 0000000..5bd4dad --- /dev/null +++ b/rcmodels/tracks/sample-curve-left.scad @@ -0,0 +1,46 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for a curved track part, minimal curve, left turned. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierMain( + length = sampleSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 1, + right = false + ); +} diff --git a/rcmodels/tracks/sample-curve-right-inner.scad b/rcmodels/tracks/sample-curve-right-inner.scad index 571b741..a2cad72 100644 --- a/rcmodels/tracks/sample-curve-right-inner.scad +++ b/rcmodels/tracks/sample-curve-right-inner.scad @@ -40,7 +40,7 @@ applyMode(mode=renderMode) { length = sampleSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = 1, + ratio = getInnerCurveRatio(trackSectionSize, trackRadius), right = true ); } diff --git a/rcmodels/tracks/sample-curve-right-outer.scad b/rcmodels/tracks/sample-curve-right-outer.scad index 8e01118..f5d10a8 100644 --- a/rcmodels/tracks/sample-curve-right-outer.scad +++ b/rcmodels/tracks/sample-curve-right-outer.scad @@ -40,7 +40,7 @@ applyMode(mode=renderMode) { length = sampleSize, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth), + ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth, trackRadius), right = true ); } diff --git a/rcmodels/tracks/sample-curve-right.scad b/rcmodels/tracks/sample-curve-right.scad new file mode 100644 index 0000000..9d8fc71 --- /dev/null +++ b/rcmodels/tracks/sample-curve-right.scad @@ -0,0 +1,46 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for a curved track part, minimal curve, right turned. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierMain( + length = sampleSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 1, + right = true + ); +} diff --git a/rcmodels/tracks/test/curve.scad b/rcmodels/tracks/test/curve.scad index 854aa15..df67d8a 100644 --- a/rcmodels/tracks/test/curve.scad +++ b/rcmodels/tracks/test/curve.scad @@ -44,7 +44,7 @@ applyMode(mode=mode) { length = length, thickness = thickness, base = base, - ratio = 1, + ratio = getInnerCurveRatio(length, radius), right = true ); @@ -53,7 +53,7 @@ applyMode(mode=mode) { length = length, thickness = thickness, base = base, - ratio = getOuterCurveRatio(length, width), + ratio = getOuterCurveRatio(length, width, radius), right = true ); @@ -62,7 +62,7 @@ applyMode(mode=mode) { length = length, thickness = thickness, base = base, - ratio = 1, + ratio = getInnerCurveRatio(length, radius), right = false ); @@ -71,7 +71,7 @@ applyMode(mode=mode) { length = length, thickness = thickness, base = base, - ratio = getOuterCurveRatio(length, width), + ratio = getOuterCurveRatio(length, width, radius), right = false ); @@ -92,7 +92,7 @@ applyMode(mode=mode) { length = length, thickness = thickness, base = base, - ratio = 1, + ratio = getInnerCurveRatio(length, radius), right = true ); @@ -101,7 +101,7 @@ applyMode(mode=mode) { length = length, thickness = thickness, base = base, - ratio = getOuterCurveRatio(length, width), + ratio = getOuterCurveRatio(length, width, radius), right = true ); @@ -110,7 +110,7 @@ applyMode(mode=mode) { length = length, thickness = thickness, base = base, - ratio = 1, + ratio = getInnerCurveRatio(length, radius), right = false ); @@ -119,7 +119,7 @@ applyMode(mode=mode) { length = length, thickness = thickness, base = base, - ratio = getOuterCurveRatio(length, width), + ratio = getOuterCurveRatio(length, width, radius), right = false ); diff --git a/rcmodels/tracks/test/setup.scad b/rcmodels/tracks/test/setup.scad index 3f283c5..16eeac2 100644 --- a/rcmodels/tracks/test/setup.scad +++ b/rcmodels/tracks/test/setup.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * * Setup the context and define the config for the tests. + * Setup the context and define the config for the tests. * * @author jsconan * @version 0.2.0 @@ -35,7 +35,8 @@ include <../config/setup.scad> // Defines the test config mode = MODE_DEV; // The render quality to apply length = 50; // The nominal size of a track element -width = 100; // The width of track lane +width = 50; // The width of track lane +radius = 50; // The radius of the track inner curve height = 30; // The height of the barrier, including the holders base = 2; // The base unit value used to design the barrier holder thickness = 0.6; // The thickness of the barrier body @@ -43,4 +44,19 @@ wall = 0.8; // The thickness of the walls clip = 2; // The thickness of the wire clips // Validate the config against the constraints -validateConfig(length, width, height, base); +validateConfig( + length = length, + width = width, + height = height, + radius = radius, + base = base +); + +// Show the values +printConfig( + length = length, + width = width, + height = height, + radius = radius, + base = base +); From 3254bbd5568c689034ee712759508db1528c1af9 Mon Sep 17 00:00:00 2001 From: jsconan Date: Thu, 6 Feb 2020 21:59:58 +0100 Subject: [PATCH 070/191] Improve the config display --- rcmodels/tracks/config/print.scad | 42 ++++++++++++++++++++++++++++++ rcmodels/tracks/config/values.scad | 36 +++++++++++++------------ 2 files changed, 62 insertions(+), 16 deletions(-) create mode 100644 rcmodels/tracks/config/print.scad diff --git a/rcmodels/tracks/config/print.scad b/rcmodels/tracks/config/print.scad new file mode 100644 index 0000000..c15b7c5 --- /dev/null +++ b/rcmodels/tracks/config/print.scad @@ -0,0 +1,42 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * Show the config values. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Show the values +printConfig( + length = trackSectionSize, + width = trackLaneWidth, + height = barrierHeight, + radius = trackRadius, + base = barrierHolderBase +); diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 8ccd71b..ce54e49 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -245,22 +245,26 @@ module validateConfig(length, width, height, radius, base) { * @param Number base - The base unit value used to design the barrier holder. */ module printConfig(length, width, height, radius, base) { - echo(str("------------------------------")); - echo(str("Track section length: ", length / 10, "cm")); - echo(str("Track lane width: ", width / 10, "cm")); - echo(str("Track inner radius: ", radius / 10, "cm")); - echo(str("Curve section length: ", getCurveLength(length) / 10, "cm")); - echo(str("Inner curve ratio: ", getInnerCurveRatio(length, radius))); - echo(str("Outer curve ratio: ", getOuterCurveRatio(length, width, radius))); - echo(str("Barrier height: ", height / 10, "cm")); - echo(str("Barrier base value: ", base, "mm")); - echo(str("Barrier thickness: ", barrierBodyThickness, "mm")); - echo(str("Size of samples: ", sampleSize / 10, "cm")); - echo(str("------------------------------")); - echo(str("Nozzle diameter: ", nozzleWidth, "mm")); - echo(str("Print layer: ", printResolution, "mm")); - echo(str("Print tolerance: ", printTolerance, "mm")); - echo(str("------------------------------")); + echo(join([ + "", + str("------------------------------"), + str("Track section length: ", length / 10, "cm"), + str("Track lane width: ", width / 10, "cm"), + str("Track inner radius: ", radius / 10, "cm"), + str("Curve section length: ", getCurveLength(length) / 10, "cm"), + str("Inner curve ratio: ", getInnerCurveRatio(length, radius)), + str("Outer curve ratio: ", getOuterCurveRatio(length, width, radius)), + str("Size of samples: ", sampleSize / 10, "cm"), + str("Barrier height: ", height / 10, "cm"), + str("Barrier base value: ", base, "mm"), + str("Barrier thickness: ", barrierBodyThickness, "mm"), + str("------------------------------"), + str("Nozzle diameter: ", nozzleWidth, "mm"), + str("Print layer: ", printResolution, "mm"), + str("Print tolerance: ", printTolerance, "mm"), + str("------------------------------"), + "" + ], str(chr(13), chr(10)))); } // The minimal thickness of a part From 26a9fcee25e3f5f45f713006ee893024d2c802f2 Mon Sep 17 00:00:00 2001 From: jsconan Date: Thu, 6 Feb 2020 23:08:48 +0100 Subject: [PATCH 071/191] Improve the render script and the files structure --- .../barrier-holder-curve-left-outer.scad | 46 ------------------ .../tracks/barrier-holder-curve-left.scad | 46 ------------------ .../barrier-holder-curve-right-inner.scad | 46 ------------------ rcmodels/tracks/config/config.scad | 3 +- .../barrier-holders}/barrier-arch-tower.scad | 2 +- .../barrier-holders}/barrier-body-curve.scad | 2 +- .../barrier-body-straight.scad | 2 +- .../barrier-holders}/barrier-holder-clip.scad | 2 +- .../barrier-holder-straight.scad | 2 +- .../curves/barrier-holder-curve-inner.scad} | 6 +-- .../curves/barrier-holder-curve-outer.scad} | 6 +-- .../curves/barrier-holder-curve.scad} | 6 +-- .../samples/curves/sample-curve-inner.scad} | 6 +-- .../samples/curves/sample-curve-outer.scad} | 6 +-- .../samples/curves/sample-curve.scad} | 6 +-- .../samples}/sample-straight.scad | 2 +- rcmodels/tracks/render.sh | 47 ++++++++++++++++--- rcmodels/tracks/sample-curve-left-inner.scad | 46 ------------------ rcmodels/tracks/sample-curve-left-outer.scad | 46 ------------------ rcmodels/tracks/sample-curve-left.scad | 46 ------------------ 20 files changed, 66 insertions(+), 308 deletions(-) delete mode 100644 rcmodels/tracks/barrier-holder-curve-left-outer.scad delete mode 100644 rcmodels/tracks/barrier-holder-curve-left.scad delete mode 100644 rcmodels/tracks/barrier-holder-curve-right-inner.scad rename rcmodels/tracks/{ => elements/barrier-holders}/barrier-arch-tower.scad (98%) rename rcmodels/tracks/{ => elements/barrier-holders}/barrier-body-curve.scad (97%) rename rcmodels/tracks/{ => elements/barrier-holders}/barrier-body-straight.scad (97%) rename rcmodels/tracks/{ => elements/barrier-holders}/barrier-holder-clip.scad (97%) rename rcmodels/tracks/{ => elements/barrier-holders}/barrier-holder-straight.scad (97%) rename rcmodels/tracks/{barrier-holder-curve-left-inner.scad => elements/barrier-holders/curves/barrier-holder-curve-inner.scad} (91%) rename rcmodels/tracks/{barrier-holder-curve-right-outer.scad => elements/barrier-holders/curves/barrier-holder-curve-outer.scad} (92%) rename rcmodels/tracks/{barrier-holder-curve-right.scad => elements/barrier-holders/curves/barrier-holder-curve.scad} (91%) rename rcmodels/tracks/{sample-curve-right-inner.scad => elements/samples/curves/sample-curve-inner.scad} (92%) rename rcmodels/tracks/{sample-curve-right-outer.scad => elements/samples/curves/sample-curve-outer.scad} (92%) rename rcmodels/tracks/{sample-curve-right.scad => elements/samples/curves/sample-curve.scad} (92%) rename rcmodels/tracks/{ => elements/samples}/sample-straight.scad (97%) delete mode 100644 rcmodels/tracks/sample-curve-left-inner.scad delete mode 100644 rcmodels/tracks/sample-curve-left-outer.scad delete mode 100644 rcmodels/tracks/sample-curve-left.scad diff --git a/rcmodels/tracks/barrier-holder-curve-left-outer.scad b/rcmodels/tracks/barrier-holder-curve-left-outer.scad deleted file mode 100644 index eb09c9c..0000000 --- a/rcmodels/tracks/barrier-holder-curve-left-outer.scad +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A barrier holder for a curved track part, outer curve, left turned. - * - * @author jsconan - * @version 0.2.0 - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - curvedBarrierHolder( - length = trackSectionSize, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth, trackRadius), - right = false - ); -} diff --git a/rcmodels/tracks/barrier-holder-curve-left.scad b/rcmodels/tracks/barrier-holder-curve-left.scad deleted file mode 100644 index 5aca865..0000000 --- a/rcmodels/tracks/barrier-holder-curve-left.scad +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A barrier holder for a curved track part, minimal curve, left turned. - * - * @author jsconan - * @version 0.2.0 - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - curvedBarrierHolder( - length = trackSectionSize, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = 1, - right = false - ); -} diff --git a/rcmodels/tracks/barrier-holder-curve-right-inner.scad b/rcmodels/tracks/barrier-holder-curve-right-inner.scad deleted file mode 100644 index cf19c2b..0000000 --- a/rcmodels/tracks/barrier-holder-curve-right-inner.scad +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A barrier holder for a curved track part, inner curve, right turned. - * - * @author jsconan - * @version 0.2.0 - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - curvedBarrierHolder( - length = trackSectionSize, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = getInnerCurveRatio(trackSectionSize, trackRadius), - right = true - ); -} diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 86c279d..bc27c07 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -41,10 +41,11 @@ printTolerance = 0.1; // The print tolerance when pieces need to be assembled trackSectionSize = 100; // The nominal size of a track element: the length for straight element, or the radius for a curved element trackLaneWidth = 400; // The width of track lane, i.e. the distance between the barriers trackRadius = 200; // The radius of the track inner curve +sampleSize = 20; // The size for the sample track elements barrierHeight = 30; // The height of the barrier, including the holders barrierHolderBase = 2; // The base unit value used to design the barrier holder barrierBodyThickness = 0.6; // The thickness of the barrier body archTowerThickness = 1.6; // The thickness of the arch tower clip wireClipThickness = .8; // The thickness of the wire clip wireClipWidth = 2; // The width of the wire clip -sampleSize = 20; // The size for the sample track elements +rightOriented = false; // The orientation of the curved elements diff --git a/rcmodels/tracks/barrier-arch-tower.scad b/rcmodels/tracks/elements/barrier-holders/barrier-arch-tower.scad similarity index 98% rename from rcmodels/tracks/barrier-arch-tower.scad rename to rcmodels/tracks/elements/barrier-holders/barrier-arch-tower.scad index d2ad63b..8f5dfca 100644 --- a/rcmodels/tracks/barrier-arch-tower.scad +++ b/rcmodels/tracks/elements/barrier-holders/barrier-arch-tower.scad @@ -30,7 +30,7 @@ */ // Import the project's setup. -include +include <../../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { diff --git a/rcmodels/tracks/barrier-body-curve.scad b/rcmodels/tracks/elements/barrier-holders/barrier-body-curve.scad similarity index 97% rename from rcmodels/tracks/barrier-body-curve.scad rename to rcmodels/tracks/elements/barrier-holders/barrier-body-curve.scad index 0b65721..465316c 100644 --- a/rcmodels/tracks/barrier-body-curve.scad +++ b/rcmodels/tracks/elements/barrier-holders/barrier-body-curve.scad @@ -30,7 +30,7 @@ */ // Import the project's setup. -include +include <../../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { diff --git a/rcmodels/tracks/barrier-body-straight.scad b/rcmodels/tracks/elements/barrier-holders/barrier-body-straight.scad similarity index 97% rename from rcmodels/tracks/barrier-body-straight.scad rename to rcmodels/tracks/elements/barrier-holders/barrier-body-straight.scad index 63ea2be..abfc2af 100644 --- a/rcmodels/tracks/barrier-body-straight.scad +++ b/rcmodels/tracks/elements/barrier-holders/barrier-body-straight.scad @@ -30,7 +30,7 @@ */ // Import the project's setup. -include +include <../../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { diff --git a/rcmodels/tracks/barrier-holder-clip.scad b/rcmodels/tracks/elements/barrier-holders/barrier-holder-clip.scad similarity index 97% rename from rcmodels/tracks/barrier-holder-clip.scad rename to rcmodels/tracks/elements/barrier-holders/barrier-holder-clip.scad index 2ec10f8..054e664 100644 --- a/rcmodels/tracks/barrier-holder-clip.scad +++ b/rcmodels/tracks/elements/barrier-holders/barrier-holder-clip.scad @@ -30,7 +30,7 @@ */ // Import the project's setup. -include +include <../../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { diff --git a/rcmodels/tracks/barrier-holder-straight.scad b/rcmodels/tracks/elements/barrier-holders/barrier-holder-straight.scad similarity index 97% rename from rcmodels/tracks/barrier-holder-straight.scad rename to rcmodels/tracks/elements/barrier-holders/barrier-holder-straight.scad index 025db40..32b904f 100644 --- a/rcmodels/tracks/barrier-holder-straight.scad +++ b/rcmodels/tracks/elements/barrier-holders/barrier-holder-straight.scad @@ -30,7 +30,7 @@ */ // Import the project's setup. -include +include <../../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { diff --git a/rcmodels/tracks/barrier-holder-curve-left-inner.scad b/rcmodels/tracks/elements/barrier-holders/curves/barrier-holder-curve-inner.scad similarity index 91% rename from rcmodels/tracks/barrier-holder-curve-left-inner.scad rename to rcmodels/tracks/elements/barrier-holders/curves/barrier-holder-curve-inner.scad index 60f3102..15cc6ac 100644 --- a/rcmodels/tracks/barrier-holder-curve-left-inner.scad +++ b/rcmodels/tracks/elements/barrier-holders/curves/barrier-holder-curve-inner.scad @@ -23,14 +23,14 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier holder for a curved track part, inner curve, left turned. + * A barrier holder for a curved track part. * * @author jsconan * @version 0.2.0 */ // Import the project's setup. -include +include <../../../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { @@ -41,6 +41,6 @@ applyMode(mode=renderMode) { thickness = barrierBodyThickness, base = barrierHolderBase, ratio = getInnerCurveRatio(trackSectionSize, trackRadius), - right = false + right = rightOriented ); } diff --git a/rcmodels/tracks/barrier-holder-curve-right-outer.scad b/rcmodels/tracks/elements/barrier-holders/curves/barrier-holder-curve-outer.scad similarity index 92% rename from rcmodels/tracks/barrier-holder-curve-right-outer.scad rename to rcmodels/tracks/elements/barrier-holders/curves/barrier-holder-curve-outer.scad index a5d3ce4..91bb969 100644 --- a/rcmodels/tracks/barrier-holder-curve-right-outer.scad +++ b/rcmodels/tracks/elements/barrier-holders/curves/barrier-holder-curve-outer.scad @@ -23,14 +23,14 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier holder for a curved track part, outer curve, right turned. + * A sample for an outer curve track part. * * @author jsconan * @version 0.2.0 */ // Import the project's setup. -include +include <../../../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { @@ -41,6 +41,6 @@ applyMode(mode=renderMode) { thickness = barrierBodyThickness, base = barrierHolderBase, ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth, trackRadius), - right = true + right = rightOriented ); } diff --git a/rcmodels/tracks/barrier-holder-curve-right.scad b/rcmodels/tracks/elements/barrier-holders/curves/barrier-holder-curve.scad similarity index 91% rename from rcmodels/tracks/barrier-holder-curve-right.scad rename to rcmodels/tracks/elements/barrier-holders/curves/barrier-holder-curve.scad index ee027df..2d70f55 100644 --- a/rcmodels/tracks/barrier-holder-curve-right.scad +++ b/rcmodels/tracks/elements/barrier-holders/curves/barrier-holder-curve.scad @@ -23,14 +23,14 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier holder for a curved track part, minimal curve, right turned. + * A sample for an inner curve track part. * * @author jsconan * @version 0.2.0 */ // Import the project's setup. -include +include <../../../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { @@ -41,6 +41,6 @@ applyMode(mode=renderMode) { thickness = barrierBodyThickness, base = barrierHolderBase, ratio = 1, - right = true + right = rightOriented ); } diff --git a/rcmodels/tracks/sample-curve-right-inner.scad b/rcmodels/tracks/elements/samples/curves/sample-curve-inner.scad similarity index 92% rename from rcmodels/tracks/sample-curve-right-inner.scad rename to rcmodels/tracks/elements/samples/curves/sample-curve-inner.scad index a2cad72..72fe477 100644 --- a/rcmodels/tracks/sample-curve-right-inner.scad +++ b/rcmodels/tracks/elements/samples/curves/sample-curve-inner.scad @@ -23,14 +23,14 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A sample for a curved track part, inner curve, right turned. + * A sample for an inner curve track part. * * @author jsconan * @version 0.2.0 */ // Import the project's setup. -include +include <../../../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { @@ -41,6 +41,6 @@ applyMode(mode=renderMode) { thickness = barrierBodyThickness, base = barrierHolderBase, ratio = getInnerCurveRatio(trackSectionSize, trackRadius), - right = true + right = rightOriented ); } diff --git a/rcmodels/tracks/sample-curve-right-outer.scad b/rcmodels/tracks/elements/samples/curves/sample-curve-outer.scad similarity index 92% rename from rcmodels/tracks/sample-curve-right-outer.scad rename to rcmodels/tracks/elements/samples/curves/sample-curve-outer.scad index f5d10a8..796351d 100644 --- a/rcmodels/tracks/sample-curve-right-outer.scad +++ b/rcmodels/tracks/elements/samples/curves/sample-curve-outer.scad @@ -23,14 +23,14 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A sample for a curved track part, outer curve, right turned. + * A sample for an outer curve track part. * * @author jsconan * @version 0.2.0 */ // Import the project's setup. -include +include <../../../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { @@ -41,6 +41,6 @@ applyMode(mode=renderMode) { thickness = barrierBodyThickness, base = barrierHolderBase, ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth, trackRadius), - right = true + right = rightOriented ); } diff --git a/rcmodels/tracks/sample-curve-right.scad b/rcmodels/tracks/elements/samples/curves/sample-curve.scad similarity index 92% rename from rcmodels/tracks/sample-curve-right.scad rename to rcmodels/tracks/elements/samples/curves/sample-curve.scad index 9d8fc71..c78d4ec 100644 --- a/rcmodels/tracks/sample-curve-right.scad +++ b/rcmodels/tracks/elements/samples/curves/sample-curve.scad @@ -23,14 +23,14 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A sample for a curved track part, minimal curve, right turned. + * A sample for a curved track part. * * @author jsconan * @version 0.2.0 */ // Import the project's setup. -include +include <../../../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { @@ -41,6 +41,6 @@ applyMode(mode=renderMode) { thickness = barrierBodyThickness, base = barrierHolderBase, ratio = 1, - right = true + right = rightOriented ); } diff --git a/rcmodels/tracks/sample-straight.scad b/rcmodels/tracks/elements/samples/sample-straight.scad similarity index 97% rename from rcmodels/tracks/sample-straight.scad rename to rcmodels/tracks/elements/samples/sample-straight.scad index 0dc6826..44dee9b 100644 --- a/rcmodels/tracks/sample-straight.scad +++ b/rcmodels/tracks/elements/samples/sample-straight.scad @@ -30,7 +30,7 @@ */ // Import the project's setup. -include +include <../../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index aa8232c..1a986f5 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -41,8 +41,42 @@ project=$(pwd) srcpath=${project} dstpath=${project}/output +# include libs source "${scriptpath}/../../lib/camelSCAD/scripts/utils.sh" +# Renders the files from a path. +# +# @param sourcepath - The path of the folder containing the SCAD files to render. +# @param destpath - The path to the output folder. +# @param prefix - A prefix to add to each output file. +# @param right - Right oriented or left oriented +renderpath() { + rightOriented=$3 + scadtostlall "$1" "$2" "" \ + "$(varif "trackSectionSize" ${trackSectionSize})" \ + "$(varif "trackLaneWidth" ${trackLaneWidth})" \ + "$(varif "trackRadius" ${trackRadius})" \ + "$(varif "barrierHeight" ${barrierHeight})" \ + "$(varif "sampleSize" ${sampleSize})" \ + "$(varif "rightOriented" ${rightOriented})" +} + +# Renders the files from a path, taking care of the curves. +# +# @param sourcepath - The path of the folder containing the SCAD files to render. +# @param destpath - The path to the output folder. +renderpathall() { + renderpath "$1" "$2" + renderpath "$1/curves" "$2/left" "0" + renderpath "$1/curves" "$2/right" "1" +} + +# Display the render config +showconfig() { + printmessage "${C_MSG}Will generates the track elements with respect to the following config:" + renderpath "${srcpath}/config/print.scad" "${dstpath}" +} + # load parameters while (( "$#" )); do case $1 in @@ -105,10 +139,9 @@ fi # check OpenSCAD scadcheck -# render the files, if exist -scadtostlall "${srcpath}" "${dstpath}" "" \ - "$(varif "trackSectionSize" ${trackSectionSize})" \ - "$(varif "trackLaneWidth" ${trackLaneWidth})" \ - "$(varif "trackRadius" ${trackRadius})" \ - "$(varif "barrierHeight" ${barrierHeight})" \ - "$(varif "sampleSize" ${sampleSize})" +# show the config +showconfig + +# render the files +renderpathall "${srcpath}/elements/barrier-holders" "${dstpath}/elements" +renderpathall "${srcpath}/elements/samples" "${dstpath}/samples" diff --git a/rcmodels/tracks/sample-curve-left-inner.scad b/rcmodels/tracks/sample-curve-left-inner.scad deleted file mode 100644 index d9ee0df..0000000 --- a/rcmodels/tracks/sample-curve-left-inner.scad +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for a curved track part, inner curve, left turned. - * - * @author jsconan - * @version 0.2.0 - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - curvedBarrierMain( - length = sampleSize, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = getInnerCurveRatio(trackSectionSize, trackRadius), - right = false - ); -} diff --git a/rcmodels/tracks/sample-curve-left-outer.scad b/rcmodels/tracks/sample-curve-left-outer.scad deleted file mode 100644 index e6e4c68..0000000 --- a/rcmodels/tracks/sample-curve-left-outer.scad +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for a curved track part, outer curve, left turned. - * - * @author jsconan - * @version 0.2.0 - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - curvedBarrierMain( - length = sampleSize, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth, trackRadius), - right = false - ); -} diff --git a/rcmodels/tracks/sample-curve-left.scad b/rcmodels/tracks/sample-curve-left.scad deleted file mode 100644 index 5bd4dad..0000000 --- a/rcmodels/tracks/sample-curve-left.scad +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for a curved track part, minimal curve, left turned. - * - * @author jsconan - * @version 0.2.0 - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - curvedBarrierMain( - length = sampleSize, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = 1, - right = false - ); -} From 34737ac410752510f1f0dcbf34b7efad355fea23 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 7 Feb 2020 07:40:03 +0100 Subject: [PATCH 072/191] Improve the render script, adding commands --- rcmodels/tracks/render.sh | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index 1a986f5..a6e2685 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -40,6 +40,8 @@ scriptpath=$(dirname $0) project=$(pwd) srcpath=${project} dstpath=${project}/output +renderElements= +renderSamples= # include libs source "${scriptpath}/../../lib/camelSCAD/scripts/utils.sh" @@ -66,8 +68,11 @@ renderpath() { # @param sourcepath - The path of the folder containing the SCAD files to render. # @param destpath - The path to the output folder. renderpathall() { + printmessage "${C_MSG}- straight elements" renderpath "$1" "$2" + printmessage "${C_MSG}- left curved elements" renderpath "$1/curves" "$2/left" "0" + printmessage "${C_MSG}- right curved elements" renderpath "$1/curves" "$2/right" "1" } @@ -80,6 +85,12 @@ showconfig() { # load parameters while (( "$#" )); do case $1 in + "e"|"elements") + renderElements=1 + ;; + "s"|"samples") + renderSamples=1 + ;; "-l"|"--length") trackSectionSize=$2 shift @@ -103,8 +114,10 @@ while (( "$#" )); do "-h"|"--help") echo -e "${C_INF}Renders OpenSCAD files${C_RST}" echo -e " ${C_INF}Usage:${C_RST}" - echo -e "${C_CTX}\t$0 [-h|--help] [-o|--option value] files${C_RST}" + echo -e "${C_CTX}\t$0 [command] [-h|--help] [-o|--option value] files${C_RST}" echo + echo -e "${C_MSG} e, elements ${C_RST}Render the track elements" + echo -e "${C_MSG} s, samples ${C_RST}Render the samples" echo -e "${C_MSG} -h, --help ${C_RST}Show this help" echo -e "${C_MSG} -l, --length ${C_RST}Set the size of a track section" echo -e "${C_MSG} -w --height ${C_RST}Set the height of the track barrier" @@ -136,6 +149,12 @@ if [ "${trackSectionSize}" != "" ]; then fi fi +# default script config +if [ "${renderElements}" == "" ] && [ "${renderSamples}" == "" ]; then + renderElements=1 + renderSamples=1 +fi + # check OpenSCAD scadcheck @@ -143,5 +162,11 @@ scadcheck showconfig # render the files -renderpathall "${srcpath}/elements/barrier-holders" "${dstpath}/elements" -renderpathall "${srcpath}/elements/samples" "${dstpath}/samples" +if [ "${renderElements}" != "" ]; then + printmessage "${C_MSG}Rendering track elements" + renderpathall "${srcpath}/elements/barrier-holders" "${dstpath}/elements" +fi +if [ "${renderSamples}" != "" ]; then + printmessage "${C_MSG}Rendering track samples" + renderpathall "${srcpath}/elements/samples" "${dstpath}/samples" +fi From 5908a8d9b52159cf511c5b7685268594fb1d0d9b Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 7 Feb 2020 07:40:28 +0100 Subject: [PATCH 073/191] Reduce size of samples --- rcmodels/tracks/config/config.scad | 3 ++- rcmodels/tracks/config/values.scad | 1 + .../tracks/elements/samples/curves/sample-curve-inner.scad | 2 +- .../tracks/elements/samples/curves/sample-curve-outer.scad | 2 +- rcmodels/tracks/elements/samples/curves/sample-curve.scad | 2 +- rcmodels/tracks/elements/samples/sample-straight.scad | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index bc27c07..8534f83 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -41,10 +41,11 @@ printTolerance = 0.1; // The print tolerance when pieces need to be assembled trackSectionSize = 100; // The nominal size of a track element: the length for straight element, or the radius for a curved element trackLaneWidth = 400; // The width of track lane, i.e. the distance between the barriers trackRadius = 200; // The radius of the track inner curve -sampleSize = 20; // The size for the sample track elements barrierHeight = 30; // The height of the barrier, including the holders barrierHolderBase = 2; // The base unit value used to design the barrier holder barrierBodyThickness = 0.6; // The thickness of the barrier body +sampleSize = 10; // The size for the sample track elements +sampleBase = 1; // The base unit value used to design the samples archTowerThickness = 1.6; // The thickness of the arch tower clip wireClipThickness = .8; // The thickness of the wire clip wireClipWidth = 2; // The width of the wire clip diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index ce54e49..2a33ffa 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -255,6 +255,7 @@ module printConfig(length, width, height, radius, base) { str("Inner curve ratio: ", getInnerCurveRatio(length, radius)), str("Outer curve ratio: ", getOuterCurveRatio(length, width, radius)), str("Size of samples: ", sampleSize / 10, "cm"), + str("Base of samples: ", sampleBase, "mm"), str("Barrier height: ", height / 10, "cm"), str("Barrier base value: ", base, "mm"), str("Barrier thickness: ", barrierBodyThickness, "mm"), diff --git a/rcmodels/tracks/elements/samples/curves/sample-curve-inner.scad b/rcmodels/tracks/elements/samples/curves/sample-curve-inner.scad index 72fe477..4f03c50 100644 --- a/rcmodels/tracks/elements/samples/curves/sample-curve-inner.scad +++ b/rcmodels/tracks/elements/samples/curves/sample-curve-inner.scad @@ -39,7 +39,7 @@ applyMode(mode=renderMode) { curvedBarrierMain( length = sampleSize, thickness = barrierBodyThickness, - base = barrierHolderBase, + base = sampleBase, ratio = getInnerCurveRatio(trackSectionSize, trackRadius), right = rightOriented ); diff --git a/rcmodels/tracks/elements/samples/curves/sample-curve-outer.scad b/rcmodels/tracks/elements/samples/curves/sample-curve-outer.scad index 796351d..bd1a278 100644 --- a/rcmodels/tracks/elements/samples/curves/sample-curve-outer.scad +++ b/rcmodels/tracks/elements/samples/curves/sample-curve-outer.scad @@ -39,7 +39,7 @@ applyMode(mode=renderMode) { curvedBarrierMain( length = sampleSize, thickness = barrierBodyThickness, - base = barrierHolderBase, + base = sampleBase, ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth, trackRadius), right = rightOriented ); diff --git a/rcmodels/tracks/elements/samples/curves/sample-curve.scad b/rcmodels/tracks/elements/samples/curves/sample-curve.scad index c78d4ec..bf4a2ef 100644 --- a/rcmodels/tracks/elements/samples/curves/sample-curve.scad +++ b/rcmodels/tracks/elements/samples/curves/sample-curve.scad @@ -39,7 +39,7 @@ applyMode(mode=renderMode) { curvedBarrierMain( length = sampleSize, thickness = barrierBodyThickness, - base = barrierHolderBase, + base = sampleBase, ratio = 1, right = rightOriented ); diff --git a/rcmodels/tracks/elements/samples/sample-straight.scad b/rcmodels/tracks/elements/samples/sample-straight.scad index 44dee9b..5e8e2cf 100644 --- a/rcmodels/tracks/elements/samples/sample-straight.scad +++ b/rcmodels/tracks/elements/samples/sample-straight.scad @@ -39,6 +39,6 @@ applyMode(mode=renderMode) { straightBarrierMain( length = sampleSize, thickness = barrierBodyThickness, - base = barrierHolderBase + base = sampleBase ); } From b9689347e2b47871836afa1c9ec8e70d003eb56f Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 7 Feb 2020 18:11:08 +0100 Subject: [PATCH 074/191] Reformat the display of config, improve the render script, allowing to only show the config --- rcmodels/tracks/config/values.scad | 4 ++-- rcmodels/tracks/render.sh | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 2a33ffa..10502c7 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -254,11 +254,11 @@ module printConfig(length, width, height, radius, base) { str("Curve section length: ", getCurveLength(length) / 10, "cm"), str("Inner curve ratio: ", getInnerCurveRatio(length, radius)), str("Outer curve ratio: ", getOuterCurveRatio(length, width, radius)), - str("Size of samples: ", sampleSize / 10, "cm"), - str("Base of samples: ", sampleBase, "mm"), str("Barrier height: ", height / 10, "cm"), str("Barrier base value: ", base, "mm"), str("Barrier thickness: ", barrierBodyThickness, "mm"), + str("Size of samples: ", sampleSize / 10, "cm"), + str("Base of samples: ", sampleBase, "mm"), str("------------------------------"), str("Nozzle diameter: ", nozzleWidth, "mm"), str("Print layer: ", printResolution, "mm"), diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index a6e2685..6e7611a 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -40,6 +40,7 @@ scriptpath=$(dirname $0) project=$(pwd) srcpath=${project} dstpath=${project}/output +showConfig= renderElements= renderSamples= @@ -53,7 +54,7 @@ source "${scriptpath}/../../lib/camelSCAD/scripts/utils.sh" # @param prefix - A prefix to add to each output file. # @param right - Right oriented or left oriented renderpath() { - rightOriented=$3 + local rightOriented=$3 scadtostlall "$1" "$2" "" \ "$(varif "trackSectionSize" ${trackSectionSize})" \ "$(varif "trackLaneWidth" ${trackLaneWidth})" \ @@ -79,7 +80,7 @@ renderpathall() { # Display the render config showconfig() { printmessage "${C_MSG}Will generates the track elements with respect to the following config:" - renderpath "${srcpath}/config/print.scad" "${dstpath}" + renderpath "${srcpath}/config/print.scad" "${dstpath}" 2>&1 | sed -e '1,4d' | sed -e :a -e '$d;N;2,3ba' -e 'P;D' } # load parameters @@ -87,9 +88,14 @@ while (( "$#" )); do case $1 in "e"|"elements") renderElements=1 + showConfig=1 ;; "s"|"samples") renderSamples=1 + showConfig=1 + ;; + "c"|"config") + showConfig=1 ;; "-l"|"--length") trackSectionSize=$2 @@ -118,6 +124,7 @@ while (( "$#" )); do echo echo -e "${C_MSG} e, elements ${C_RST}Render the track elements" echo -e "${C_MSG} s, samples ${C_RST}Render the samples" + echo -e "${C_MSG} c, config ${C_RST}Show the config values" echo -e "${C_MSG} -h, --help ${C_RST}Show this help" echo -e "${C_MSG} -l, --length ${C_RST}Set the size of a track section" echo -e "${C_MSG} -w --height ${C_RST}Set the height of the track barrier" @@ -150,16 +157,19 @@ if [ "${trackSectionSize}" != "" ]; then fi # default script config -if [ "${renderElements}" == "" ] && [ "${renderSamples}" == "" ]; then +if [ "${renderElements}" == "" ] && [ "${renderSamples}" == "" ] && [ "${showConfig}" == "" ]; then renderElements=1 renderSamples=1 + showConfig=1 fi # check OpenSCAD scadcheck # show the config -showconfig +if [ "${showConfig}" != "" ]; then + showconfig +fi # render the files if [ "${renderElements}" != "" ]; then From 426a090c7fd64def2b10307cf878f9f37adfc1f2 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 8 Feb 2020 21:02:09 +0100 Subject: [PATCH 075/191] More consistent placement of curved elements --- rcmodels/tracks/config/values.scad | 26 ++++++++++- rcmodels/tracks/shapes/curve.scad | 72 ++++++++++++++++++------------ 2 files changed, 67 insertions(+), 31 deletions(-) diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 10502c7..ea6af8c 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -191,6 +191,21 @@ function getInnerCurveRatio(length, radius) = radius / length; */ function getOuterCurveRatio(length, width, radius) = (width + radius) / length; +/** + * Computes the radius of a curve with respect to the ratio. + * @param Number length - The nominal size of a track element. + * @param Number ratio - The ratio of the curve. + * @returns Number + */ +function getCurveRadius(length, ratio) = length * ratio; + +/** + * Computes the angle of a curve with respect to the ratio. + * @param Number ratio - The ratio of the curve. + * @returns Number + */ +function getCurveAngle(ratio) = curveAngle / ratio; + /** * Validates the config values, checking if it match the critical constraints. * @param Number length - The nominal size of a track element. @@ -245,6 +260,8 @@ module validateConfig(length, width, height, radius, base) { * @param Number base - The base unit value used to design the barrier holder. */ module printConfig(length, width, height, radius, base) { + innerCurveRatio = getInnerCurveRatio(length, radius); + outerCurveRatio = getOuterCurveRatio(length, width, radius); echo(join([ "", str("------------------------------"), @@ -252,8 +269,10 @@ module printConfig(length, width, height, radius, base) { str("Track lane width: ", width / 10, "cm"), str("Track inner radius: ", radius / 10, "cm"), str("Curve section length: ", getCurveLength(length) / 10, "cm"), - str("Inner curve ratio: ", getInnerCurveRatio(length, radius)), - str("Outer curve ratio: ", getOuterCurveRatio(length, width, radius)), + str("Inner curve ratio: ", innerCurveRatio), + str("Inner curve angle: ", getCurveAngle(innerCurveRatio), "°"), + str("Outer curve ratio: ", outerCurveRatio), + str("Outer curve angle: ", getCurveAngle(outerCurveRatio), "°"), str("Barrier height: ", height / 10, "cm"), str("Barrier base value: ", base, "mm"), str("Barrier thickness: ", barrierBodyThickness, "mm"), @@ -277,3 +296,6 @@ minWidth = shells(2); // The ratios applied to the base unit value used to design the barrier holder stripHeightRatio = 3; stripIndentRatio = 0.5; + +// The angle of a typical curve +curveAngle = 90; diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curve.scad index 047caba..fea2570 100644 --- a/rcmodels/tracks/shapes/curve.scad +++ b/rcmodels/tracks/shapes/curve.scad @@ -76,6 +76,25 @@ module barrierNotchCurved(radius, thickness, base, distance = 0) { } } +/** + * Place a curved element with respect to the length and the ratio. + * @param Number length - The length of the element. + * @param Number ratio - The ratio to apply on the radius + * @param Number z - An option Z-axis translation + */ +module placeCurvedElement(length, ratio = 1, z = 0) { + radius = getCurveRadius(length, ratio); + angle = getCurveAngle(ratio); + ratioAngle = curveAngle - angle; + offset = (length - radius) * cos(45) * [1, 1, 0] + [0, 0, z]; + + translate(offset) { + rotateZ(ratioAngle / 2) { + children(); + } + } +} + /** * Draws the main shape of a barrier holder for a curved track element. * @param Number length - The length of the element. @@ -85,10 +104,9 @@ module barrierNotchCurved(radius, thickness, base, distance = 0) { * @param Number right - Is the curve oriented to the right? */ module curvedBarrierMain(length, thickness, base, ratio = 1, right = false) { - radius = length * ratio; - defaultAngle = 90; - angle = defaultAngle / ratio; - ratioAngle = defaultAngle - angle; + radius = getCurveRadius(length, ratio); + angle = getCurveAngle(ratio); + ratioAngle = curveAngle - angle; linkHeight = getBarrierHolderHeight(base) - base; outerLinkDirection = right ? 180 : 0; @@ -96,7 +114,7 @@ module curvedBarrierMain(length, thickness, base, ratio = 1, right = false) { innerLinkDirection = right ? 90 : -90; innerLinkPosition = right ? 90 - ratioAngle : 0; - rotateZ(ratioAngle / 2) { + placeCurvedElement(length, ratio) { rotateZ(outerLinkPosition) { translateY(radius) { rotateZ(outerLinkDirection) { @@ -140,10 +158,8 @@ module curvedBarrierMain(length, thickness, base, ratio = 1, right = false) { * @param Number right - Is the curve oriented to the right? */ module curvedBarrierHolder(length, thickness, base, ratio = 1, right = false) { - radius = length * ratio; - defaultAngle = 90; - angle = defaultAngle / ratio; - ratioAngle = defaultAngle - angle; + radius = getCurveRadius(length, ratio); + angle = getCurveAngle(ratio); linkHeight = getBarrierHolderHeight(base) - base; thickness = thickness + printTolerance; @@ -155,32 +171,30 @@ module curvedBarrierHolder(length, thickness, base, ratio = 1, right = false) { ratio = ratio, right = right ); - rotateZ(ratioAngle / 2) { - translateZ(minThickness) { - difference() { - pipeSegment( - r = radius + thickness / 2, - h = linkHeight * 2, - w = thickness, - a = angle - ); + placeCurvedElement(length, ratio, minThickness) { + difference() { + pipeSegment( + r = radius + thickness / 2, + h = linkHeight * 2, + w = thickness, + a = angle + ); - arcAngle = getArcAngle(radius = radius, length = length / 2); - angles = [ + arcAngle = getArcAngle(radius = radius, length = length / 2); + angles = [ [0, 0, 0], [0, 0, arcAngle], [0, 0, angle - arcAngle], [0, 0, angle] - ]; + ]; - repeatRotateMap(angles) { - barrierNotchCurved( - radius = radius, - thickness = thickness * 2, - base = base, - distance = printTolerance / 2 - ); - } + repeatRotateMap(angles) { + barrierNotchCurved( + radius = radius, + thickness = thickness * 2, + base = base, + distance = printTolerance / 2 + ); } } } From 7525d2d83e672ca2d48f3665631070e104fc0efa Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 9 Feb 2020 11:03:42 +0100 Subject: [PATCH 076/191] Add sample element for the arch --- .../tracks/elements/samples/sample-arch.scad | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 rcmodels/tracks/elements/samples/sample-arch.scad diff --git a/rcmodels/tracks/elements/samples/sample-arch.scad b/rcmodels/tracks/elements/samples/sample-arch.scad new file mode 100644 index 0000000..903a19a --- /dev/null +++ b/rcmodels/tracks/elements/samples/sample-arch.scad @@ -0,0 +1,98 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * An arch sample scaled with respect to the size of the track samples. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include <../../config/setup.scad> + +// Refine the config for the arch sample +laneWidth = trackLaneWidth / trackSectionSize * sampleSize; +wallWidth = minWidth * 2; + +/** + * Computes the points defining the profile of the arch sample. + * @param Number length - The length of a track element. + * @param Number width - The width of track lane. + * @returns Vector[] + */ +function getArchSamplePoints(length, width) = + let( + start = width / 2, + radius = length, + tower = length / 2, + middle = width - 2 * radius + ) + path([ + ["P", -start, 0], + ["V", tower], + ["C", radius, 180, 90], + ["H", middle], + ["C", radius, 90, 0], + ["V", -tower] + ]) +; + +/** + * Draws the shape of the arch sample. + * @param Number length - The length of a track element. + * @param Number width - The width of track lane. + * @param Number wall - The thickness of the outline. + */ +module archSampleProfile(length, width, wall) { + distance = wall / 2; + difference() { + polygon(outline(getArchSamplePoints(length, width), -distance)); + polygon(outline(getArchSamplePoints(length, width), distance)); + rectangle([width - wall, wall]); + } +} + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + negativeExtrude(height=getBarrierHolderWidth(sampleBase)) { + archSampleProfile(sampleSize, laneWidth, wallWidth); + repeat(count=2, intervalX=laneWidth, center=true) { + translateY(-getBarrierHolderHeight(sampleBase) - wallWidth * 2) { + difference() { + barrierHolderOutline( + wall = wallWidth, + base = sampleBase, + thickness = barrierBodyThickness, + distance = printTolerance + ); + rectangle([getBarrierHolderWidth(sampleBase) + wallWidth * 3, wallWidth * 2]); + rectangle([getBarrierHolderWidth(sampleBase) + printTolerance * 2, wallWidth * 3]); + } + } + } + } +} From 38a453392cd41a72ebb04b99c4e081039f435697 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 9 Feb 2020 19:55:10 +0100 Subject: [PATCH 077/191] Rework the files structure --- rcmodels/tracks/config/setup.scad | 2 +- .../accessories/led-clip.scad} | 2 +- .../curved/element-curved-inner.scad} | 2 +- .../curved/element-curved-outer.scad} | 2 +- .../elements/curved/element-curved.scad} | 2 +- .../straight/element-arch-tower.scad} | 2 +- .../straight/element-curved-body.scad} | 2 +- .../straight/element-straight-body.scad} | 2 +- .../elements/straight/element-straight.scad} | 2 +- .../samples/curved/sample-curved-inner.scad} | 0 .../curved/sample-curved-minimal.scad} | 2 +- .../samples/curved/sample-curved-outer.scad} | 0 .../samples/straight}/sample-arch.scad | 2 +- .../samples/straight}/sample-straight.scad | 2 +- rcmodels/tracks/render.sh | 27 ++++++++++++++----- .../tracks/shapes/{curve.scad => curved.scad} | 0 .../tracks/test/{curve.scad => curved.scad} | 2 +- rcmodels/tracks/test/straight.scad | 2 +- 18 files changed, 34 insertions(+), 21 deletions(-) rename rcmodels/tracks/{elements/barrier-holders/barrier-holder-clip.scad => parts/accessories/led-clip.scad} (96%) rename rcmodels/tracks/{elements/barrier-holders/curves/barrier-holder-curve-inner.scad => parts/elements/curved/element-curved-inner.scad} (96%) rename rcmodels/tracks/{elements/barrier-holders/curves/barrier-holder-curve-outer.scad => parts/elements/curved/element-curved-outer.scad} (96%) rename rcmodels/tracks/{elements/barrier-holders/curves/barrier-holder-curve.scad => parts/elements/curved/element-curved.scad} (96%) rename rcmodels/tracks/{elements/barrier-holders/barrier-arch-tower.scad => parts/elements/straight/element-arch-tower.scad} (97%) rename rcmodels/tracks/{elements/barrier-holders/barrier-body-curve.scad => parts/elements/straight/element-curved-body.scad} (97%) rename rcmodels/tracks/{elements/barrier-holders/barrier-body-straight.scad => parts/elements/straight/element-straight-body.scad} (97%) rename rcmodels/tracks/{elements/barrier-holders/barrier-holder-straight.scad => parts/elements/straight/element-straight.scad} (97%) rename rcmodels/tracks/{elements/samples/curves/sample-curve-inner.scad => parts/samples/curved/sample-curved-inner.scad} (100%) rename rcmodels/tracks/{elements/samples/curves/sample-curve.scad => parts/samples/curved/sample-curved-minimal.scad} (96%) rename rcmodels/tracks/{elements/samples/curves/sample-curve-outer.scad => parts/samples/curved/sample-curved-outer.scad} (100%) rename rcmodels/tracks/{elements/samples => parts/samples/straight}/sample-arch.scad (98%) rename rcmodels/tracks/{elements/samples => parts/samples/straight}/sample-straight.scad (97%) rename rcmodels/tracks/shapes/{curve.scad => curved.scad} (100%) rename rcmodels/tracks/test/{curve.scad => curved.scad} (99%) diff --git a/rcmodels/tracks/config/setup.scad b/rcmodels/tracks/config/setup.scad index 88a8d8d..0d4049f 100644 --- a/rcmodels/tracks/config/setup.scad +++ b/rcmodels/tracks/config/setup.scad @@ -39,7 +39,7 @@ include // Finally, include the shapes include <../shapes/profiles.scad> include <../shapes/straight.scad> -include <../shapes/curve.scad> +include <../shapes/curved.scad> // Validate the config against the constraints validateConfig( diff --git a/rcmodels/tracks/elements/barrier-holders/barrier-holder-clip.scad b/rcmodels/tracks/parts/accessories/led-clip.scad similarity index 96% rename from rcmodels/tracks/elements/barrier-holders/barrier-holder-clip.scad rename to rcmodels/tracks/parts/accessories/led-clip.scad index 054e664..f80a0ae 100644 --- a/rcmodels/tracks/elements/barrier-holders/barrier-holder-clip.scad +++ b/rcmodels/tracks/parts/accessories/led-clip.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A wire clip for the barrier holders. + * A LED cable clip for the barrier holders. * * @author jsconan * @version 0.2.0 diff --git a/rcmodels/tracks/elements/barrier-holders/curves/barrier-holder-curve-inner.scad b/rcmodels/tracks/parts/elements/curved/element-curved-inner.scad similarity index 96% rename from rcmodels/tracks/elements/barrier-holders/curves/barrier-holder-curve-inner.scad rename to rcmodels/tracks/parts/elements/curved/element-curved-inner.scad index 15cc6ac..0d22e1b 100644 --- a/rcmodels/tracks/elements/barrier-holders/curves/barrier-holder-curve-inner.scad +++ b/rcmodels/tracks/parts/elements/curved/element-curved-inner.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier holder for a curved track part. + * A barrier holder for an inner curve track part. * * @author jsconan * @version 0.2.0 diff --git a/rcmodels/tracks/elements/barrier-holders/curves/barrier-holder-curve-outer.scad b/rcmodels/tracks/parts/elements/curved/element-curved-outer.scad similarity index 96% rename from rcmodels/tracks/elements/barrier-holders/curves/barrier-holder-curve-outer.scad rename to rcmodels/tracks/parts/elements/curved/element-curved-outer.scad index 91bb969..771c203 100644 --- a/rcmodels/tracks/elements/barrier-holders/curves/barrier-holder-curve-outer.scad +++ b/rcmodels/tracks/parts/elements/curved/element-curved-outer.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A sample for an outer curve track part. + * A barrier holder for an outer curve track part. * * @author jsconan * @version 0.2.0 diff --git a/rcmodels/tracks/elements/barrier-holders/curves/barrier-holder-curve.scad b/rcmodels/tracks/parts/elements/curved/element-curved.scad similarity index 96% rename from rcmodels/tracks/elements/barrier-holders/curves/barrier-holder-curve.scad rename to rcmodels/tracks/parts/elements/curved/element-curved.scad index 2d70f55..51724b7 100644 --- a/rcmodels/tracks/elements/barrier-holders/curves/barrier-holder-curve.scad +++ b/rcmodels/tracks/parts/elements/curved/element-curved.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A sample for an inner curve track part. + * A barrier holder for a minimal curved track part. * * @author jsconan * @version 0.2.0 diff --git a/rcmodels/tracks/elements/barrier-holders/barrier-arch-tower.scad b/rcmodels/tracks/parts/elements/straight/element-arch-tower.scad similarity index 97% rename from rcmodels/tracks/elements/barrier-holders/barrier-arch-tower.scad rename to rcmodels/tracks/parts/elements/straight/element-arch-tower.scad index 8f5dfca..2c86507 100644 --- a/rcmodels/tracks/elements/barrier-holders/barrier-arch-tower.scad +++ b/rcmodels/tracks/parts/elements/straight/element-arch-tower.scad @@ -30,7 +30,7 @@ */ // Import the project's setup. -include <../../config/setup.scad> +include <../../../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { diff --git a/rcmodels/tracks/elements/barrier-holders/barrier-body-curve.scad b/rcmodels/tracks/parts/elements/straight/element-curved-body.scad similarity index 97% rename from rcmodels/tracks/elements/barrier-holders/barrier-body-curve.scad rename to rcmodels/tracks/parts/elements/straight/element-curved-body.scad index 465316c..f8c9dcd 100644 --- a/rcmodels/tracks/elements/barrier-holders/barrier-body-curve.scad +++ b/rcmodels/tracks/parts/elements/straight/element-curved-body.scad @@ -30,7 +30,7 @@ */ // Import the project's setup. -include <../../config/setup.scad> +include <../../../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { diff --git a/rcmodels/tracks/elements/barrier-holders/barrier-body-straight.scad b/rcmodels/tracks/parts/elements/straight/element-straight-body.scad similarity index 97% rename from rcmodels/tracks/elements/barrier-holders/barrier-body-straight.scad rename to rcmodels/tracks/parts/elements/straight/element-straight-body.scad index abfc2af..e614007 100644 --- a/rcmodels/tracks/elements/barrier-holders/barrier-body-straight.scad +++ b/rcmodels/tracks/parts/elements/straight/element-straight-body.scad @@ -30,7 +30,7 @@ */ // Import the project's setup. -include <../../config/setup.scad> +include <../../../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { diff --git a/rcmodels/tracks/elements/barrier-holders/barrier-holder-straight.scad b/rcmodels/tracks/parts/elements/straight/element-straight.scad similarity index 97% rename from rcmodels/tracks/elements/barrier-holders/barrier-holder-straight.scad rename to rcmodels/tracks/parts/elements/straight/element-straight.scad index 32b904f..e2c055b 100644 --- a/rcmodels/tracks/elements/barrier-holders/barrier-holder-straight.scad +++ b/rcmodels/tracks/parts/elements/straight/element-straight.scad @@ -30,7 +30,7 @@ */ // Import the project's setup. -include <../../config/setup.scad> +include <../../../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { diff --git a/rcmodels/tracks/elements/samples/curves/sample-curve-inner.scad b/rcmodels/tracks/parts/samples/curved/sample-curved-inner.scad similarity index 100% rename from rcmodels/tracks/elements/samples/curves/sample-curve-inner.scad rename to rcmodels/tracks/parts/samples/curved/sample-curved-inner.scad diff --git a/rcmodels/tracks/elements/samples/curves/sample-curve.scad b/rcmodels/tracks/parts/samples/curved/sample-curved-minimal.scad similarity index 96% rename from rcmodels/tracks/elements/samples/curves/sample-curve.scad rename to rcmodels/tracks/parts/samples/curved/sample-curved-minimal.scad index bf4a2ef..58fe9c6 100644 --- a/rcmodels/tracks/elements/samples/curves/sample-curve.scad +++ b/rcmodels/tracks/parts/samples/curved/sample-curved-minimal.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A sample for a curved track part. + * A sample for a minimal curve track part. * * @author jsconan * @version 0.2.0 diff --git a/rcmodels/tracks/elements/samples/curves/sample-curve-outer.scad b/rcmodels/tracks/parts/samples/curved/sample-curved-outer.scad similarity index 100% rename from rcmodels/tracks/elements/samples/curves/sample-curve-outer.scad rename to rcmodels/tracks/parts/samples/curved/sample-curved-outer.scad diff --git a/rcmodels/tracks/elements/samples/sample-arch.scad b/rcmodels/tracks/parts/samples/straight/sample-arch.scad similarity index 98% rename from rcmodels/tracks/elements/samples/sample-arch.scad rename to rcmodels/tracks/parts/samples/straight/sample-arch.scad index 903a19a..8292126 100644 --- a/rcmodels/tracks/elements/samples/sample-arch.scad +++ b/rcmodels/tracks/parts/samples/straight/sample-arch.scad @@ -30,7 +30,7 @@ */ // Import the project's setup. -include <../../config/setup.scad> +include <../../../config/setup.scad> // Refine the config for the arch sample laneWidth = trackLaneWidth / trackSectionSize * sampleSize; diff --git a/rcmodels/tracks/elements/samples/sample-straight.scad b/rcmodels/tracks/parts/samples/straight/sample-straight.scad similarity index 97% rename from rcmodels/tracks/elements/samples/sample-straight.scad rename to rcmodels/tracks/parts/samples/straight/sample-straight.scad index 5e8e2cf..7d8fd9d 100644 --- a/rcmodels/tracks/elements/samples/sample-straight.scad +++ b/rcmodels/tracks/parts/samples/straight/sample-straight.scad @@ -30,7 +30,7 @@ */ // Import the project's setup. -include <../../config/setup.scad> +include <../../../config/setup.scad> // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index 6e7611a..a66d5a3 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -40,7 +40,10 @@ scriptpath=$(dirname $0) project=$(pwd) srcpath=${project} dstpath=${project}/output +configpath=${srcpath}/config +partpath=${srcpath}/parts showConfig= +renderAccessories= renderElements= renderSamples= @@ -70,22 +73,26 @@ renderpath() { # @param destpath - The path to the output folder. renderpathall() { printmessage "${C_MSG}- straight elements" - renderpath "$1" "$2" + renderpath "$1/straight" "$2" printmessage "${C_MSG}- left curved elements" - renderpath "$1/curves" "$2/left" "0" + renderpath "$1/curved" "$2/left" "0" printmessage "${C_MSG}- right curved elements" - renderpath "$1/curves" "$2/right" "1" + renderpath "$1/curved" "$2/right" "1" } # Display the render config showconfig() { printmessage "${C_MSG}Will generates the track elements with respect to the following config:" - renderpath "${srcpath}/config/print.scad" "${dstpath}" 2>&1 | sed -e '1,4d' | sed -e :a -e '$d;N;2,3ba' -e 'P;D' + renderpath "${configpath}/print.scad" "${dstpath}" 2>&1 | sed -e '1,4d' | sed -e :a -e '$d;N;2,3ba' -e 'P;D' } # load parameters while (( "$#" )); do case $1 in + "a"|"accessories") + renderAccessories=1 + showConfig=1 + ;; "e"|"elements") renderElements=1 showConfig=1 @@ -122,6 +129,7 @@ while (( "$#" )); do echo -e " ${C_INF}Usage:${C_RST}" echo -e "${C_CTX}\t$0 [command] [-h|--help] [-o|--option value] files${C_RST}" echo + echo -e "${C_MSG} a, accessories ${C_RST}Render the accessories" echo -e "${C_MSG} e, elements ${C_RST}Render the track elements" echo -e "${C_MSG} s, samples ${C_RST}Render the samples" echo -e "${C_MSG} c, config ${C_RST}Show the config values" @@ -157,7 +165,8 @@ if [ "${trackSectionSize}" != "" ]; then fi # default script config -if [ "${renderElements}" == "" ] && [ "${renderSamples}" == "" ] && [ "${showConfig}" == "" ]; then +if [ "${renderAccessories}" == "" ] && [ "${renderElements}" == "" ] && [ "${renderSamples}" == "" ] && [ "${showConfig}" == "" ]; then + renderAccessories=1 renderElements=1 renderSamples=1 showConfig=1 @@ -172,11 +181,15 @@ if [ "${showConfig}" != "" ]; then fi # render the files +if [ "${renderAccessories}" != "" ]; then + printmessage "${C_MSG}Rendering accessories" + renderpath "${partpath}/accessories" "${dstpath}/accessories" +fi if [ "${renderElements}" != "" ]; then printmessage "${C_MSG}Rendering track elements" - renderpathall "${srcpath}/elements/barrier-holders" "${dstpath}/elements" + renderpathall "${partpath}/elements" "${dstpath}/elements" fi if [ "${renderSamples}" != "" ]; then printmessage "${C_MSG}Rendering track samples" - renderpathall "${srcpath}/elements/samples" "${dstpath}/samples" + renderpathall "${partpath}/samples" "${dstpath}/samples" fi diff --git a/rcmodels/tracks/shapes/curve.scad b/rcmodels/tracks/shapes/curved.scad similarity index 100% rename from rcmodels/tracks/shapes/curve.scad rename to rcmodels/tracks/shapes/curved.scad diff --git a/rcmodels/tracks/test/curve.scad b/rcmodels/tracks/test/curved.scad similarity index 99% rename from rcmodels/tracks/test/curve.scad rename to rcmodels/tracks/test/curved.scad index df67d8a..ae7462c 100644 --- a/rcmodels/tracks/test/curve.scad +++ b/rcmodels/tracks/test/curved.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * Test the curved barrier shapes. + * Test the curved elements shapes. * * @author jsconan * @version 0.2.0 diff --git a/rcmodels/tracks/test/straight.scad b/rcmodels/tracks/test/straight.scad index 9672a61..e23efd6 100644 --- a/rcmodels/tracks/test/straight.scad +++ b/rcmodels/tracks/test/straight.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * Test the straight barrier shapes. + * Test the straight elements shapes. * * @author jsconan * @version 0.2.0 From 8cb0d316fcd1779f3671abc449834154d9adbe2b Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 9 Feb 2020 23:39:44 +0100 Subject: [PATCH 078/191] Refine the file distribution --- rcmodels/tracks/config/setup.scad | 2 + rcmodels/tracks/shapes/accessories.scad | 75 ++++++++++++++++++++++ rcmodels/tracks/shapes/fragments.scad | 84 +++++++++++++++++++++++++ rcmodels/tracks/shapes/profiles.scad | 27 -------- rcmodels/tracks/shapes/straight.scad | 72 --------------------- rcmodels/tracks/test/accessories.scad | 56 +++++++++++++++++ rcmodels/tracks/test/fragments.scad | 67 ++++++++++++++++++++ rcmodels/tracks/test/profiles.scad | 27 +------- rcmodels/tracks/test/straight.scad | 26 +------- 9 files changed, 286 insertions(+), 150 deletions(-) create mode 100644 rcmodels/tracks/shapes/accessories.scad create mode 100644 rcmodels/tracks/shapes/fragments.scad create mode 100644 rcmodels/tracks/test/accessories.scad create mode 100644 rcmodels/tracks/test/fragments.scad diff --git a/rcmodels/tracks/config/setup.scad b/rcmodels/tracks/config/setup.scad index 0d4049f..e29aead 100644 --- a/rcmodels/tracks/config/setup.scad +++ b/rcmodels/tracks/config/setup.scad @@ -38,8 +38,10 @@ include // Finally, include the shapes include <../shapes/profiles.scad> +include <../shapes/fragments.scad> include <../shapes/straight.scad> include <../shapes/curved.scad> +include <../shapes/accessories.scad> // Validate the config against the constraints validateConfig( diff --git a/rcmodels/tracks/shapes/accessories.scad b/rcmodels/tracks/shapes/accessories.scad new file mode 100644 index 0000000..19d5cf0 --- /dev/null +++ b/rcmodels/tracks/shapes/accessories.scad @@ -0,0 +1,75 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * Defines the shapes for the track accessories. + * + * @author jsconan + * @version 0.2.0 + */ + +/** + * Draws the profile of a wire clip. + * @param Number wall - The thickness of the outline. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number thickness - The thickness of the barrier body. + */ +module wireClipProfile(wall, base, thickness) { + holderWidth = getBarrierHolderWidth(base) + wall * 2; + + clipProfile( + wall = wall, + base = base, + thickness = thickness + ); + repeat(intervalX = holderWidth - wall, center = true) { + translateY(base / 2) { + rectangle([wall, base]); + } + } + ringSegment( + r = [1, 1] * (holderWidth / 2), + w = wall, + a = -180, + $fn = 10 + ); +} + +/** + * Draws the shape of a wire clip. + * @param Number wall - The thickness of the wire clip lines. + * @param Number height - The thickness of the clip. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number thickness - The thickness of the barrier body. + * @param Boolean [center] - The shape is centered vertically. + */ +module wireClip(wall, height, base, thickness, center = false) { + negativeExtrude(height=height, center=center) { + wireClipProfile( + wall = wall, + base = base, + thickness = thickness + ); + } +} diff --git a/rcmodels/tracks/shapes/fragments.scad b/rcmodels/tracks/shapes/fragments.scad new file mode 100644 index 0000000..f635698 --- /dev/null +++ b/rcmodels/tracks/shapes/fragments.scad @@ -0,0 +1,84 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * Defines the fragments shapes for the track elements. + * + * @author jsconan + * @version 0.2.0 + */ + +/** + * Draws the shape of a barrier link. + * @param Number height - The height of the link. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number [distance] - An additional distance added to the outline of the barrier link. + * @param Boolean [center] - The shape is centered vertically. + */ +module barrierLink(height, base, distance = 0, center = false) { + negativeExtrude(height=height, center=center) { + barrierLinkProfile( + base = base, + distance = distance + ); + } +} + +/** + * Draws the shape of a barrier holder notch. + * @param Number thickness - The thickness of the shape. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number [distance] - An additional distance added to the outline of the barrier link. + * @param Number [interval] - The distance between two notches. + * @param Number [count] - The number of notches. + * @param Boolean [center] - The shape is centered vertically. + */ +module barrierNotch(thickness, base, distance = 0, interval = 0, count = 1, center = false) { + repeat(count=count, interval=[interval, 0, 0], center=true) { + negativeExtrude(height=thickness, center=center) { + barrierNotchProfile( + base = base, + distance = distance + ); + } + } +} + +/** + * Draws the shape of a clip. + * @param Number wall - The thickness of the clip lines. + * @param Number height - The thickness of the clip. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number thickness - The thickness of the barrier body. + * @param Boolean [center] - The shape is centered vertically. + */ +module clip(wall, height, base, thickness, center = false) { + negativeExtrude(height=height, center=center) { + clipProfile( + wall = wall, + base = base, + thickness = thickness + ); + } +} diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index fb3b2c9..c9ea4d6 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -182,30 +182,3 @@ module clipProfile(wall, base, thickness) { } } } - -/** - * Draws the profile of a wire clip. - * @param Number wall - The thickness of the outline. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number thickness - The thickness of the barrier body. - */ -module wireClipProfile(wall, base, thickness) { - holderWidth = getBarrierHolderWidth(base) + wall * 2; - - clipProfile( - wall = wall, - base = base, - thickness = thickness - ); - repeat(intervalX = holderWidth - wall, center = true) { - translateY(base / 2) { - rectangle([wall, base]); - } - } - ringSegment( - r = [1, 1] * (holderWidth / 2), - w = wall, - a = -180, - $fn = 10 - ); -} diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index a430663..52f87fc 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -29,42 +29,6 @@ * @version 0.2.0 */ -/** - * Draws the shape of a barrier link. - * @param Number height - The height of the link. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [distance] - An additional distance added to the outline of the barrier link. - * @param Boolean [center] - The shape is centered vertically. - */ -module barrierLink(height, base, distance = 0, center = false) { - negativeExtrude(height=height, center=center) { - barrierLinkProfile( - base = base, - distance = distance - ); - } -} - -/** - * Draws the shape of a barrier holder notch. - * @param Number thickness - The thickness of the shape. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [distance] - An additional distance added to the outline of the barrier link. - * @param Number [interval] - The distance between two notches. - * @param Number [count] - The number of notches. - * @param Boolean [center] - The shape is centered vertically. - */ -module barrierNotch(thickness, base, distance = 0, interval = 0, count = 1, center = false) { - repeat(count=count, interval=[interval, 0, 0], center=true) { - negativeExtrude(height=thickness, center=center) { - barrierNotchProfile( - base = base, - distance = distance - ); - } - } -} - /** * Draws the shape of a barrier body. * @param Number length - The length of the track element. @@ -165,42 +129,6 @@ module straightBarrierHolder(length, thickness, base) { } } -/** - * Draws the shape of a clip. - * @param Number wall - The thickness of the clip lines. - * @param Number height - The thickness of the clip. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number thickness - The thickness of the barrier body. - * @param Boolean [center] - The shape is centered vertically. - */ -module clip(wall, height, base, thickness, center = false) { - negativeExtrude(height=height, center=center) { - clipProfile( - wall = wall, - base = base, - thickness = thickness - ); - } -} - -/** - * Draws the shape of a wire clip. - * @param Number wall - The thickness of the wire clip lines. - * @param Number height - The thickness of the clip. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number thickness - The thickness of the barrier body. - * @param Boolean [center] - The shape is centered vertically. - */ -module wireClip(wall, height, base, thickness, center = false) { - negativeExtrude(height=height, center=center) { - wireClipProfile( - wall = wall, - base = base, - thickness = thickness - ); - } -} - /** * Draws the shape of an arch tower that will clamp a barrier border. * @param Number wall - The thickness of the outline. diff --git a/rcmodels/tracks/test/accessories.scad b/rcmodels/tracks/test/accessories.scad new file mode 100644 index 0000000..9162cab --- /dev/null +++ b/rcmodels/tracks/test/accessories.scad @@ -0,0 +1,56 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * Test the accessories shapes. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=mode) { + + distributeGrid(intervalX=[length, 0, 0], intervalY=[0, height, 0], line=2, center=true) { + + // test the wire clip profile + wireClipProfile( + wall = wall, + base = base, + thickness = thickness + ); + + // test the wire clip profile + wireClip( + wall = wall, + height = clip, + base = base, + thickness = thickness + ); + + } +} diff --git a/rcmodels/tracks/test/fragments.scad b/rcmodels/tracks/test/fragments.scad new file mode 100644 index 0000000..3bc329f --- /dev/null +++ b/rcmodels/tracks/test/fragments.scad @@ -0,0 +1,67 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * Test the fragments shapes. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=mode) { + + distributeGrid(intervalX=[length, 0, 0], intervalY=[0, height, 0], line=2, center=true) { + + // test the clip profile + clip( + wall = wall, + height = clip, + base = base, + thickness = thickness + ); + + // test the barrier link shape + barrierLink( + height = 5, + base = base, + distance = printTolerance, + center = false + ); + + // test the barrier notch shape for a straight track element + barrierNotch( + thickness = thickness, + base = base, + distance = printTolerance, + interval = length, + count = 2, + center = true + ); + + } +} diff --git a/rcmodels/tracks/test/profiles.scad b/rcmodels/tracks/test/profiles.scad index 265fe6a..9ba922a 100644 --- a/rcmodels/tracks/test/profiles.scad +++ b/rcmodels/tracks/test/profiles.scad @@ -35,7 +35,7 @@ include // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=mode) { - distributeGrid(intervalX=[length, 0, 0], intervalY=[0, height, 0], line=3, center=true) { + distributeGrid(intervalX=[length, 0, 0], intervalY=[0, height, 0], line=2, center=true) { // test the barrier link profile barrierLinkProfile( @@ -70,30 +70,5 @@ applyMode(mode=mode) { thickness = thickness ); - // test the wire clip profile - wireClipProfile( - wall = wall, - base = base, - thickness = thickness - ); - - // test the barrier notch shape for a curved track element - barrierNotchCurved( - radius = length, - thickness = thickness, - base = base, - distance = printTolerance - ); - - // test the barrier notch shape for a straight track element - barrierNotch( - thickness = thickness, - base = base, - distance = printTolerance, - interval = length, - count = 2, - center = true - ); - } } diff --git a/rcmodels/tracks/test/straight.scad b/rcmodels/tracks/test/straight.scad index e23efd6..d7fabf2 100644 --- a/rcmodels/tracks/test/straight.scad +++ b/rcmodels/tracks/test/straight.scad @@ -35,7 +35,7 @@ include // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=mode) { - distributeGrid(intervalX=[length, 0, 0], intervalY=[0, length, 0], line=3, center=true) { + distributeGrid(intervalX=[length * 1.5, 0, 0], intervalY=[0, height * 1.5, 0], line=3, center=true) { // test the barrier body shape barrierBody( @@ -46,22 +46,6 @@ applyMode(mode=mode) { notches = 2 ); - // test the clip profile - clip( - wall = wall, - height = clip, - base = base, - thickness = thickness - ); - - // test the wire clip profile - wireClip( - wall = wall, - height = clip, - base = base, - thickness = thickness - ); - // test the main shape of the barrier holder for a straight track element straightBarrierMain( length = length, @@ -85,14 +69,6 @@ applyMode(mode=mode) { base = base ); - // test the barrier link shape - barrierLink( - height = 5, - base = base, - distance = printTolerance, - center = false - ); - // test the arch tower shape with holders, left side archTower( wall = wall * 2, From e7aa7b45a7b428e90a0ff1be8a49d4caf8de984d Mon Sep 17 00:00:00 2001 From: jsconan Date: Mon, 10 Feb 2020 20:35:04 +0100 Subject: [PATCH 079/191] Allow to apply a multiplier on the length of the straight elements --- .../parts/elements/straight/element-straight.scad | 3 ++- rcmodels/tracks/shapes/curved.scad | 4 ++-- rcmodels/tracks/shapes/straight.scad | 15 ++++++++++----- rcmodels/tracks/test/straight.scad | 3 ++- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/rcmodels/tracks/parts/elements/straight/element-straight.scad b/rcmodels/tracks/parts/elements/straight/element-straight.scad index e2c055b..5ab9ab1 100644 --- a/rcmodels/tracks/parts/elements/straight/element-straight.scad +++ b/rcmodels/tracks/parts/elements/straight/element-straight.scad @@ -39,6 +39,7 @@ applyMode(mode=renderMode) { straightBarrierHolder( length = trackSectionSize, thickness = barrierBodyThickness, - base = barrierHolderBase + base = barrierHolderBase, + ratio = 1 ); } diff --git a/rcmodels/tracks/shapes/curved.scad b/rcmodels/tracks/shapes/curved.scad index fea2570..172383a 100644 --- a/rcmodels/tracks/shapes/curved.scad +++ b/rcmodels/tracks/shapes/curved.scad @@ -98,8 +98,8 @@ module placeCurvedElement(length, ratio = 1, z = 0) { /** * Draws the main shape of a barrier holder for a curved track element. * @param Number length - The length of the element. - * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. * @param Number ratio - The ratio to apply on the radius * @param Number right - Is the curve oriented to the right? */ @@ -152,8 +152,8 @@ module curvedBarrierMain(length, thickness, base, ratio = 1, right = false) { /** * Draws the barrier holder for a curved track element. * @param Number length - The length of the element. - * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. * @param Number ratio - The ratio to apply on the radius * @param Number right - Is the curve oriented to the right? */ diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 52f87fc..58986a3 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -63,8 +63,8 @@ module barrierBody(length, height, thickness, base, notches = 1) { /** * Draws the main shape of a barrier holder for a straight track element. * @param Number length - The length of the element. - * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. */ module straightBarrierMain(length, thickness, base) { linkHeight = getBarrierHolderHeight(base) - base; @@ -97,12 +97,17 @@ module straightBarrierMain(length, thickness, base) { /** * Draws the barrier holder for a straight track element. * @param Number length - The length of the element. - * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number ratio - The ratio to apply on the length */ -module straightBarrierHolder(length, thickness, base) { +module straightBarrierHolder(length, thickness, base, ratio = 1) { linkHeight = getBarrierHolderHeight(base) - base; thickness = thickness + printTolerance; + length = length * ratio; + notches = ratio * 2; + interval = length / notches; + count = notches + 1; difference() { straightBarrierMain( @@ -119,8 +124,8 @@ module straightBarrierHolder(length, thickness, base) { thickness = thickness * 2, base = base, distance = printTolerance / 2, - interval = length / 2, - count = 3, + interval = interval, + count = count, center = true ); } diff --git a/rcmodels/tracks/test/straight.scad b/rcmodels/tracks/test/straight.scad index d7fabf2..b040d08 100644 --- a/rcmodels/tracks/test/straight.scad +++ b/rcmodels/tracks/test/straight.scad @@ -66,7 +66,8 @@ applyMode(mode=mode) { straightBarrierHolder( length = length, thickness = thickness, - base = base + base = base, + ratio = 1 ); // test the arch tower shape with holders, left side From 2291f86a78f2074e665021bb157e596c6232f045 Mon Sep 17 00:00:00 2001 From: jsconan Date: Mon, 10 Feb 2020 20:35:37 +0100 Subject: [PATCH 080/191] Add a double length straight element --- .../straight/element-straight-double.scad | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 rcmodels/tracks/parts/elements/straight/element-straight-double.scad diff --git a/rcmodels/tracks/parts/elements/straight/element-straight-double.scad b/rcmodels/tracks/parts/elements/straight/element-straight-double.scad new file mode 100644 index 0000000..eb64ac0 --- /dev/null +++ b/rcmodels/tracks/parts/elements/straight/element-straight-double.scad @@ -0,0 +1,45 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier holder for a straight track part, with a double length. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + straightBarrierHolder( + length = trackSectionSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 2 + ); +} From 1f857d06d2c5d68db5fd22b0dc09505680f1bdc7 Mon Sep 17 00:00:00 2001 From: jsconan Date: Mon, 10 Feb 2020 22:32:36 +0100 Subject: [PATCH 081/191] Add long samples --- .../curved/sample-curved-inner-full.scad | 46 +++++++++++++++++++ .../curved/sample-curved-outer-full.scad | 46 +++++++++++++++++++ .../samples/straight/sample-straight-10.scad | 44 ++++++++++++++++++ .../samples/straight/sample-straight-5.scad | 44 ++++++++++++++++++ 4 files changed, 180 insertions(+) create mode 100644 rcmodels/tracks/parts/samples/curved/sample-curved-inner-full.scad create mode 100644 rcmodels/tracks/parts/samples/curved/sample-curved-outer-full.scad create mode 100644 rcmodels/tracks/parts/samples/straight/sample-straight-10.scad create mode 100644 rcmodels/tracks/parts/samples/straight/sample-straight-5.scad diff --git a/rcmodels/tracks/parts/samples/curved/sample-curved-inner-full.scad b/rcmodels/tracks/parts/samples/curved/sample-curved-inner-full.scad new file mode 100644 index 0000000..c76da9e --- /dev/null +++ b/rcmodels/tracks/parts/samples/curved/sample-curved-inner-full.scad @@ -0,0 +1,46 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for an inner curve track part, full curve. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierMain( + length = sampleSize * getInnerCurveRatio(trackSectionSize, trackRadius), + thickness = barrierBodyThickness, + base = sampleBase, + ratio = 1, + right = rightOriented + ); +} diff --git a/rcmodels/tracks/parts/samples/curved/sample-curved-outer-full.scad b/rcmodels/tracks/parts/samples/curved/sample-curved-outer-full.scad new file mode 100644 index 0000000..70a35a3 --- /dev/null +++ b/rcmodels/tracks/parts/samples/curved/sample-curved-outer-full.scad @@ -0,0 +1,46 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for an outer curve track part, full curve. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierMain( + length = sampleSize * getOuterCurveRatio(trackSectionSize, trackLaneWidth, trackRadius), + thickness = barrierBodyThickness, + base = sampleBase, + ratio = 1, + right = rightOriented + ); +} diff --git a/rcmodels/tracks/parts/samples/straight/sample-straight-10.scad b/rcmodels/tracks/parts/samples/straight/sample-straight-10.scad new file mode 100644 index 0000000..eda958b --- /dev/null +++ b/rcmodels/tracks/parts/samples/straight/sample-straight-10.scad @@ -0,0 +1,44 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for a straight track part, 5x the length. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + straightBarrierMain( + length = sampleSize * 10, + thickness = barrierBodyThickness, + base = sampleBase + ); +} diff --git a/rcmodels/tracks/parts/samples/straight/sample-straight-5.scad b/rcmodels/tracks/parts/samples/straight/sample-straight-5.scad new file mode 100644 index 0000000..e381226 --- /dev/null +++ b/rcmodels/tracks/parts/samples/straight/sample-straight-5.scad @@ -0,0 +1,44 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for a straight track part, 5x the length. + * + * @author jsconan + * @version 0.2.0 + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + straightBarrierMain( + length = sampleSize * 5, + thickness = barrierBodyThickness, + base = sampleBase + ); +} From a2eeb0fa6503043606a4321a5f1ce8b8be303352 Mon Sep 17 00:00:00 2001 From: jsconan Date: Mon, 10 Feb 2020 22:41:07 +0100 Subject: [PATCH 082/191] Rework the version handling --- rcmodels/tracks/config/config.scad | 3 ++- rcmodels/tracks/config/print.scad | 1 - rcmodels/tracks/config/setup.scad | 1 - rcmodels/tracks/config/values.scad | 3 ++- rcmodels/tracks/parts/accessories/led-clip.scad | 1 - .../tracks/parts/elements/curved/element-curved-inner.scad | 1 - .../tracks/parts/elements/curved/element-curved-outer.scad | 1 - rcmodels/tracks/parts/elements/curved/element-curved.scad | 1 - .../tracks/parts/elements/straight/element-arch-tower.scad | 1 - .../tracks/parts/elements/straight/element-curved-body.scad | 1 - .../tracks/parts/elements/straight/element-straight-body.scad | 1 - .../parts/elements/straight/element-straight-double.scad | 1 - rcmodels/tracks/parts/elements/straight/element-straight.scad | 1 - .../tracks/parts/samples/curved/sample-curved-inner-full.scad | 1 - rcmodels/tracks/parts/samples/curved/sample-curved-inner.scad | 1 - .../tracks/parts/samples/curved/sample-curved-minimal.scad | 1 - .../tracks/parts/samples/curved/sample-curved-outer-full.scad | 1 - rcmodels/tracks/parts/samples/curved/sample-curved-outer.scad | 1 - rcmodels/tracks/parts/samples/straight/sample-arch.scad | 1 - rcmodels/tracks/parts/samples/straight/sample-straight-10.scad | 1 - rcmodels/tracks/parts/samples/straight/sample-straight-5.scad | 1 - rcmodels/tracks/parts/samples/straight/sample-straight.scad | 1 - rcmodels/tracks/shapes/accessories.scad | 1 - rcmodels/tracks/shapes/curved.scad | 1 - rcmodels/tracks/shapes/fragments.scad | 1 - rcmodels/tracks/shapes/profiles.scad | 1 - rcmodels/tracks/shapes/straight.scad | 1 - rcmodels/tracks/test/accessories.scad | 1 - rcmodels/tracks/test/curved.scad | 1 - rcmodels/tracks/test/fragments.scad | 1 - rcmodels/tracks/test/profiles.scad | 1 - rcmodels/tracks/test/setup.scad | 1 - rcmodels/tracks/test/straight.scad | 1 - 33 files changed, 4 insertions(+), 33 deletions(-) diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 8534f83..741f7c6 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -26,9 +26,10 @@ * Configures the project. * * @author jsconan - * @version 0.2.0 */ + projectVersion = "0.2.0"; + // We will render the object using the specifications of this mode renderMode = MODE_PROD; diff --git a/rcmodels/tracks/config/print.scad b/rcmodels/tracks/config/print.scad index c15b7c5..c7e4b4f 100644 --- a/rcmodels/tracks/config/print.scad +++ b/rcmodels/tracks/config/print.scad @@ -26,7 +26,6 @@ * Show the config values. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/config/setup.scad b/rcmodels/tracks/config/setup.scad index e29aead..9f4616a 100644 --- a/rcmodels/tracks/config/setup.scad +++ b/rcmodels/tracks/config/setup.scad @@ -26,7 +26,6 @@ * Setup the context. * * @author jsconan - * @version 0.2.0 */ // As we need to use some shapes, use the right entry point of the library. diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index ea6af8c..85871e4 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -26,7 +26,6 @@ * Refines values and defines functions. * * @author jsconan - * @version 0.2.0 */ /** @@ -265,6 +264,8 @@ module printConfig(length, width, height, radius, base) { echo(join([ "", str("------------------------------"), + str("RC Track System, Version ", projectVersion), + str("------------------------------"), str("Track section length: ", length / 10, "cm"), str("Track lane width: ", width / 10, "cm"), str("Track inner radius: ", radius / 10, "cm"), diff --git a/rcmodels/tracks/parts/accessories/led-clip.scad b/rcmodels/tracks/parts/accessories/led-clip.scad index f80a0ae..3055c0f 100644 --- a/rcmodels/tracks/parts/accessories/led-clip.scad +++ b/rcmodels/tracks/parts/accessories/led-clip.scad @@ -26,7 +26,6 @@ * A LED cable clip for the barrier holders. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/parts/elements/curved/element-curved-inner.scad b/rcmodels/tracks/parts/elements/curved/element-curved-inner.scad index 0d22e1b..ee4930e 100644 --- a/rcmodels/tracks/parts/elements/curved/element-curved-inner.scad +++ b/rcmodels/tracks/parts/elements/curved/element-curved-inner.scad @@ -26,7 +26,6 @@ * A barrier holder for an inner curve track part. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/parts/elements/curved/element-curved-outer.scad b/rcmodels/tracks/parts/elements/curved/element-curved-outer.scad index 771c203..e945dc4 100644 --- a/rcmodels/tracks/parts/elements/curved/element-curved-outer.scad +++ b/rcmodels/tracks/parts/elements/curved/element-curved-outer.scad @@ -26,7 +26,6 @@ * A barrier holder for an outer curve track part. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/parts/elements/curved/element-curved.scad b/rcmodels/tracks/parts/elements/curved/element-curved.scad index 51724b7..c89687e 100644 --- a/rcmodels/tracks/parts/elements/curved/element-curved.scad +++ b/rcmodels/tracks/parts/elements/curved/element-curved.scad @@ -26,7 +26,6 @@ * A barrier holder for a minimal curved track part. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/parts/elements/straight/element-arch-tower.scad b/rcmodels/tracks/parts/elements/straight/element-arch-tower.scad index 2c86507..0758240 100644 --- a/rcmodels/tracks/parts/elements/straight/element-arch-tower.scad +++ b/rcmodels/tracks/parts/elements/straight/element-arch-tower.scad @@ -26,7 +26,6 @@ * An arch tower that clamp the barrier holders. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/parts/elements/straight/element-curved-body.scad b/rcmodels/tracks/parts/elements/straight/element-curved-body.scad index f8c9dcd..5796664 100644 --- a/rcmodels/tracks/parts/elements/straight/element-curved-body.scad +++ b/rcmodels/tracks/parts/elements/straight/element-curved-body.scad @@ -26,7 +26,6 @@ * An additional barrier body for a curved track part. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/parts/elements/straight/element-straight-body.scad b/rcmodels/tracks/parts/elements/straight/element-straight-body.scad index e614007..074e0c7 100644 --- a/rcmodels/tracks/parts/elements/straight/element-straight-body.scad +++ b/rcmodels/tracks/parts/elements/straight/element-straight-body.scad @@ -26,7 +26,6 @@ * A barrier body for a straight track part. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/parts/elements/straight/element-straight-double.scad b/rcmodels/tracks/parts/elements/straight/element-straight-double.scad index eb64ac0..c09873f 100644 --- a/rcmodels/tracks/parts/elements/straight/element-straight-double.scad +++ b/rcmodels/tracks/parts/elements/straight/element-straight-double.scad @@ -26,7 +26,6 @@ * A barrier holder for a straight track part, with a double length. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/parts/elements/straight/element-straight.scad b/rcmodels/tracks/parts/elements/straight/element-straight.scad index 5ab9ab1..24bd534 100644 --- a/rcmodels/tracks/parts/elements/straight/element-straight.scad +++ b/rcmodels/tracks/parts/elements/straight/element-straight.scad @@ -26,7 +26,6 @@ * A barrier holder for a straight track part. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/parts/samples/curved/sample-curved-inner-full.scad b/rcmodels/tracks/parts/samples/curved/sample-curved-inner-full.scad index c76da9e..57c2586 100644 --- a/rcmodels/tracks/parts/samples/curved/sample-curved-inner-full.scad +++ b/rcmodels/tracks/parts/samples/curved/sample-curved-inner-full.scad @@ -26,7 +26,6 @@ * A sample for an inner curve track part, full curve. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/parts/samples/curved/sample-curved-inner.scad b/rcmodels/tracks/parts/samples/curved/sample-curved-inner.scad index 4f03c50..61c89b4 100644 --- a/rcmodels/tracks/parts/samples/curved/sample-curved-inner.scad +++ b/rcmodels/tracks/parts/samples/curved/sample-curved-inner.scad @@ -26,7 +26,6 @@ * A sample for an inner curve track part. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/parts/samples/curved/sample-curved-minimal.scad b/rcmodels/tracks/parts/samples/curved/sample-curved-minimal.scad index 58fe9c6..959f161 100644 --- a/rcmodels/tracks/parts/samples/curved/sample-curved-minimal.scad +++ b/rcmodels/tracks/parts/samples/curved/sample-curved-minimal.scad @@ -26,7 +26,6 @@ * A sample for a minimal curve track part. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/parts/samples/curved/sample-curved-outer-full.scad b/rcmodels/tracks/parts/samples/curved/sample-curved-outer-full.scad index 70a35a3..1272891 100644 --- a/rcmodels/tracks/parts/samples/curved/sample-curved-outer-full.scad +++ b/rcmodels/tracks/parts/samples/curved/sample-curved-outer-full.scad @@ -26,7 +26,6 @@ * A sample for an outer curve track part, full curve. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/parts/samples/curved/sample-curved-outer.scad b/rcmodels/tracks/parts/samples/curved/sample-curved-outer.scad index bd1a278..c6dca8f 100644 --- a/rcmodels/tracks/parts/samples/curved/sample-curved-outer.scad +++ b/rcmodels/tracks/parts/samples/curved/sample-curved-outer.scad @@ -26,7 +26,6 @@ * A sample for an outer curve track part. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/parts/samples/straight/sample-arch.scad b/rcmodels/tracks/parts/samples/straight/sample-arch.scad index 8292126..eb25ec7 100644 --- a/rcmodels/tracks/parts/samples/straight/sample-arch.scad +++ b/rcmodels/tracks/parts/samples/straight/sample-arch.scad @@ -26,7 +26,6 @@ * An arch sample scaled with respect to the size of the track samples. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/parts/samples/straight/sample-straight-10.scad b/rcmodels/tracks/parts/samples/straight/sample-straight-10.scad index eda958b..5a7f694 100644 --- a/rcmodels/tracks/parts/samples/straight/sample-straight-10.scad +++ b/rcmodels/tracks/parts/samples/straight/sample-straight-10.scad @@ -26,7 +26,6 @@ * A sample for a straight track part, 5x the length. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/parts/samples/straight/sample-straight-5.scad b/rcmodels/tracks/parts/samples/straight/sample-straight-5.scad index e381226..05f73e0 100644 --- a/rcmodels/tracks/parts/samples/straight/sample-straight-5.scad +++ b/rcmodels/tracks/parts/samples/straight/sample-straight-5.scad @@ -26,7 +26,6 @@ * A sample for a straight track part, 5x the length. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/parts/samples/straight/sample-straight.scad b/rcmodels/tracks/parts/samples/straight/sample-straight.scad index 7d8fd9d..e75eed7 100644 --- a/rcmodels/tracks/parts/samples/straight/sample-straight.scad +++ b/rcmodels/tracks/parts/samples/straight/sample-straight.scad @@ -26,7 +26,6 @@ * A sample for a straight track part. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/shapes/accessories.scad b/rcmodels/tracks/shapes/accessories.scad index 19d5cf0..ef031b4 100644 --- a/rcmodels/tracks/shapes/accessories.scad +++ b/rcmodels/tracks/shapes/accessories.scad @@ -26,7 +26,6 @@ * Defines the shapes for the track accessories. * * @author jsconan - * @version 0.2.0 */ /** diff --git a/rcmodels/tracks/shapes/curved.scad b/rcmodels/tracks/shapes/curved.scad index 172383a..5d0d2b1 100644 --- a/rcmodels/tracks/shapes/curved.scad +++ b/rcmodels/tracks/shapes/curved.scad @@ -26,7 +26,6 @@ * Defines the curved track parts. * * @author jsconan - * @version 0.2.0 */ /** diff --git a/rcmodels/tracks/shapes/fragments.scad b/rcmodels/tracks/shapes/fragments.scad index f635698..6c01f11 100644 --- a/rcmodels/tracks/shapes/fragments.scad +++ b/rcmodels/tracks/shapes/fragments.scad @@ -26,7 +26,6 @@ * Defines the fragments shapes for the track elements. * * @author jsconan - * @version 0.2.0 */ /** diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index c9ea4d6..e5d896e 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -26,7 +26,6 @@ * Defines the profile shapes for the track elements. * * @author jsconan - * @version 0.2.0 */ /** diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 58986a3..b0abab3 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -26,7 +26,6 @@ * Defines the straight track parts. * * @author jsconan - * @version 0.2.0 */ /** diff --git a/rcmodels/tracks/test/accessories.scad b/rcmodels/tracks/test/accessories.scad index 9162cab..77c108c 100644 --- a/rcmodels/tracks/test/accessories.scad +++ b/rcmodels/tracks/test/accessories.scad @@ -26,7 +26,6 @@ * Test the accessories shapes. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/test/curved.scad b/rcmodels/tracks/test/curved.scad index ae7462c..9a21890 100644 --- a/rcmodels/tracks/test/curved.scad +++ b/rcmodels/tracks/test/curved.scad @@ -26,7 +26,6 @@ * Test the curved elements shapes. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/test/fragments.scad b/rcmodels/tracks/test/fragments.scad index 3bc329f..cae7892 100644 --- a/rcmodels/tracks/test/fragments.scad +++ b/rcmodels/tracks/test/fragments.scad @@ -26,7 +26,6 @@ * Test the fragments shapes. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/test/profiles.scad b/rcmodels/tracks/test/profiles.scad index 9ba922a..8b46c77 100644 --- a/rcmodels/tracks/test/profiles.scad +++ b/rcmodels/tracks/test/profiles.scad @@ -26,7 +26,6 @@ * Test the profile shapes. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/test/setup.scad b/rcmodels/tracks/test/setup.scad index 16eeac2..f50f8e2 100644 --- a/rcmodels/tracks/test/setup.scad +++ b/rcmodels/tracks/test/setup.scad @@ -26,7 +26,6 @@ * Setup the context and define the config for the tests. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. diff --git a/rcmodels/tracks/test/straight.scad b/rcmodels/tracks/test/straight.scad index b040d08..fd14ef0 100644 --- a/rcmodels/tracks/test/straight.scad +++ b/rcmodels/tracks/test/straight.scad @@ -26,7 +26,6 @@ * Test the straight elements shapes. * * @author jsconan - * @version 0.2.0 */ // Import the project's setup. From 21964b96204078f2597262ef466eb0ffdf0a294f Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 11 Feb 2020 19:30:51 +0100 Subject: [PATCH 083/191] Rename some file for better consistency --- .../curved/{element-curved.scad => element-curved-minimal.scad} | 0 .../{element-straight.scad => element-straight-simple.scad} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename rcmodels/tracks/parts/elements/curved/{element-curved.scad => element-curved-minimal.scad} (100%) rename rcmodels/tracks/parts/elements/straight/{element-straight.scad => element-straight-simple.scad} (100%) diff --git a/rcmodels/tracks/parts/elements/curved/element-curved.scad b/rcmodels/tracks/parts/elements/curved/element-curved-minimal.scad similarity index 100% rename from rcmodels/tracks/parts/elements/curved/element-curved.scad rename to rcmodels/tracks/parts/elements/curved/element-curved-minimal.scad diff --git a/rcmodels/tracks/parts/elements/straight/element-straight.scad b/rcmodels/tracks/parts/elements/straight/element-straight-simple.scad similarity index 100% rename from rcmodels/tracks/parts/elements/straight/element-straight.scad rename to rcmodels/tracks/parts/elements/straight/element-straight-simple.scad From 8c07351dba739cc26e25fd802e533699361422ae Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 11 Feb 2020 19:38:17 +0100 Subject: [PATCH 084/191] Add other long samples --- .../samples/straight/sample-straight-2.scad | 43 +++++++++++++++++++ .../samples/straight/sample-straight-20.scad | 43 +++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 rcmodels/tracks/parts/samples/straight/sample-straight-2.scad create mode 100644 rcmodels/tracks/parts/samples/straight/sample-straight-20.scad diff --git a/rcmodels/tracks/parts/samples/straight/sample-straight-2.scad b/rcmodels/tracks/parts/samples/straight/sample-straight-2.scad new file mode 100644 index 0000000..9824462 --- /dev/null +++ b/rcmodels/tracks/parts/samples/straight/sample-straight-2.scad @@ -0,0 +1,43 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for a straight track part, 2x the length. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + straightBarrierMain( + length = sampleSize * 2, + thickness = barrierBodyThickness, + base = sampleBase + ); +} diff --git a/rcmodels/tracks/parts/samples/straight/sample-straight-20.scad b/rcmodels/tracks/parts/samples/straight/sample-straight-20.scad new file mode 100644 index 0000000..a2219fd --- /dev/null +++ b/rcmodels/tracks/parts/samples/straight/sample-straight-20.scad @@ -0,0 +1,43 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for a straight track part, 20x the length. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + straightBarrierMain( + length = sampleSize * 20, + thickness = barrierBodyThickness, + base = sampleBase + ); +} From a13d78d5e41fdb4bd47a65c9feabc2f31c56086c Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 11 Feb 2020 21:45:42 +0100 Subject: [PATCH 085/191] Set convexity of polygons --- .../tracks/parts/samples/straight/sample-arch.scad | 4 ++-- rcmodels/tracks/shapes/curved.scad | 2 +- rcmodels/tracks/shapes/profiles.scad | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rcmodels/tracks/parts/samples/straight/sample-arch.scad b/rcmodels/tracks/parts/samples/straight/sample-arch.scad index eb25ec7..eadba25 100644 --- a/rcmodels/tracks/parts/samples/straight/sample-arch.scad +++ b/rcmodels/tracks/parts/samples/straight/sample-arch.scad @@ -67,8 +67,8 @@ function getArchSamplePoints(length, width) = module archSampleProfile(length, width, wall) { distance = wall / 2; difference() { - polygon(outline(getArchSamplePoints(length, width), -distance)); - polygon(outline(getArchSamplePoints(length, width), distance)); + polygon(outline(getArchSamplePoints(length, width), -distance), convexity = 10); + polygon(outline(getArchSamplePoints(length, width), distance), convexity = 10); rectangle([width - wall, wall]); } } diff --git a/rcmodels/tracks/shapes/curved.scad b/rcmodels/tracks/shapes/curved.scad index 5d0d2b1..7341500 100644 --- a/rcmodels/tracks/shapes/curved.scad +++ b/rcmodels/tracks/shapes/curved.scad @@ -66,7 +66,7 @@ module barrierNotchCurved(radius, thickness, base, distance = 0) { ["V", base], ["H", -base], ["V", -height - base * 2] - ])); + ]), convexity = 10); } } } diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index e5d896e..7a69bb5 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -57,7 +57,7 @@ module barrierLinkProfile(base, distance = 0) { polygon(getBarrierLinkPoints( base = base, distance = distance - )); + ), convexity = 10); } /** @@ -93,7 +93,7 @@ module barrierNotchProfile(base, distance = 0) { polygon(getBarrierNotchPoints( base = base, distance = distance - )); + ), convexity = 10); } /** @@ -135,7 +135,7 @@ module barrierHolderProfile(base, thickness) { polygon(getBarrierHolderPoints( base = base, thickness = thickness - )); + ), convexity = 10); } /** @@ -153,8 +153,8 @@ module barrierHolderOutline(wall, base, thickness, distance = 0) { thickness = thickness ), -distance); - polygon(outline(profile, -wall)); - polygon(profile); + polygon(outline(profile, -wall), convexity = 10); + polygon(profile, convexity = 10); } } } From 2e5bc85261544abb8bbda124038ff8c82ea77116 Mon Sep 17 00:00:00 2001 From: jsconan Date: Thu, 13 Feb 2020 18:07:00 +0100 Subject: [PATCH 086/191] Rework the config display --- rcmodels/tracks/config/values.scad | 42 +++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 85871e4..a20ec90 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -263,27 +263,27 @@ module printConfig(length, width, height, radius, base) { outerCurveRatio = getOuterCurveRatio(length, width, radius); echo(join([ "", - str("------------------------------"), - str("RC Track System, Version ", projectVersion), - str("------------------------------"), - str("Track section length: ", length / 10, "cm"), - str("Track lane width: ", width / 10, "cm"), - str("Track inner radius: ", radius / 10, "cm"), - str("Curve section length: ", getCurveLength(length) / 10, "cm"), - str("Inner curve ratio: ", innerCurveRatio), - str("Inner curve angle: ", getCurveAngle(innerCurveRatio), "°"), - str("Outer curve ratio: ", outerCurveRatio), - str("Outer curve angle: ", getCurveAngle(outerCurveRatio), "°"), - str("Barrier height: ", height / 10, "cm"), - str("Barrier base value: ", base, "mm"), - str("Barrier thickness: ", barrierBodyThickness, "mm"), - str("Size of samples: ", sampleSize / 10, "cm"), - str("Base of samples: ", sampleBase, "mm"), - str("------------------------------"), - str("Nozzle diameter: ", nozzleWidth, "mm"), - str("Print layer: ", printResolution, "mm"), - str("Print tolerance: ", printTolerance, "mm"), - str("------------------------------"), + str("-- RC Track System ------------"), + str("Version: ", projectVersion), + str("-- Track elements -------------"), + str("Track section length: ", length / 10, "cm"), + str("Track lane width: ", width / 10, "cm"), + str("Track inner radius: ", radius / 10, "cm"), + str("Curve section length: ", getCurveLength(length) / 10, "cm"), + str("Inner curve ratio: ", innerCurveRatio), + str("Inner curve angle: ", getCurveAngle(innerCurveRatio), "°"), + str("Outer curve ratio: ", outerCurveRatio), + str("Outer curve angle: ", getCurveAngle(outerCurveRatio), "°"), + str("Barrier height: ", height / 10, "cm"), + str("Barrier base value: ", base, "mm"), + str("Barrier thickness: ", barrierBodyThickness, "mm"), + str("-- Track samples --------------"), + str("Size of samples: ", sampleSize / 10, "cm"), + str("Base of samples: ", sampleBase, "mm"), + str("-- Printer settings -----------"), + str("Nozzle diameter: ", nozzleWidth, "mm"), + str("Print layer: ", printResolution, "mm"), + str("Print tolerance: ", printTolerance, "mm"), "" ], str(chr(13), chr(10)))); } From e0219258d6386dfb445d30a6322aebd6a0987e3d Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 14 Feb 2020 22:01:15 +0100 Subject: [PATCH 087/191] Add mast and flag accessories --- rcmodels/tracks/config/config.scad | 29 ++-- rcmodels/tracks/config/values.scad | 17 ++ .../parts/accessories/accessory-flag.scad | 45 ++++++ .../parts/accessories/accessory-mast.scad | 45 ++++++ .../tracks/parts/accessories/led-clip.scad | 6 +- rcmodels/tracks/shapes/accessories.scad | 146 +++++++++++++++--- rcmodels/tracks/test/accessories.scad | 39 ++++- rcmodels/tracks/test/setup.scad | 2 +- 8 files changed, 283 insertions(+), 46 deletions(-) create mode 100644 rcmodels/tracks/parts/accessories/accessory-flag.scad create mode 100644 rcmodels/tracks/parts/accessories/accessory-mast.scad diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 741f7c6..8b10f26 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -39,15 +39,20 @@ nozzleWidth = 0.4; // The size of the print nozzle printTolerance = 0.1; // The print tolerance when pieces need to be assembled // The dimensions and constraints of a track element -trackSectionSize = 100; // The nominal size of a track element: the length for straight element, or the radius for a curved element -trackLaneWidth = 400; // The width of track lane, i.e. the distance between the barriers -trackRadius = 200; // The radius of the track inner curve -barrierHeight = 30; // The height of the barrier, including the holders -barrierHolderBase = 2; // The base unit value used to design the barrier holder -barrierBodyThickness = 0.6; // The thickness of the barrier body -sampleSize = 10; // The size for the sample track elements -sampleBase = 1; // The base unit value used to design the samples -archTowerThickness = 1.6; // The thickness of the arch tower clip -wireClipThickness = .8; // The thickness of the wire clip -wireClipWidth = 2; // The width of the wire clip -rightOriented = false; // The orientation of the curved elements +trackSectionSize = 100; // The nominal size of a track element: the length for straight element, or the radius for a curved element +trackLaneWidth = 400; // The width of track lane, i.e. the distance between the barriers +trackRadius = 200; // The radius of the track inner curve +barrierHeight = 30; // The height of the barrier, including the holders +barrierHolderBase = 2; // The base unit value used to design the barrier holder +barrierBodyThickness = 0.6; // The thickness of the barrier body +sampleSize = 10; // The size for the sample track elements +sampleBase = 1; // The base unit value used to design the samples +archTowerThickness = 1.6; // The thickness of the arch tower clip +accessoryClipThickness = 0.8; // The thickness of the cable clip +cableClipWidth = 2; // The width of the cable clip +mastWidth = 3; // The width of the accessory mast +mastHeight = 70; // The length of the accessory mast +flagWidth = 40; // The width of the accessory flag +flagHeight = 20; // The height of the accessory flag +flagThickness = 0.8; // The thickness of the accessory flag +rightOriented = false; // The orientation of the curved elements diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index a20ec90..4c88128 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -205,6 +205,13 @@ function getCurveRadius(length, ratio) = length * ratio; */ function getCurveAngle(ratio) = curveAngle / ratio; +/** + * Computes the radius of the accessory mast. + * @param Number width - The width of the mast. + * @returns Number + */ +function getMastRadius(width) = circumradius(n = mastFacets, a = width / 2); + /** * Validates the config values, checking if it match the critical constraints. * @param Number length - The nominal size of a track element. @@ -280,6 +287,13 @@ module printConfig(length, width, height, radius, base) { str("-- Track samples --------------"), str("Size of samples: ", sampleSize / 10, "cm"), str("Base of samples: ", sampleBase, "mm"), + str("-- Track accessories ----------"), + str("Mast height: ", mastHeight, "mm"), + str("Mast width: ", mastWidth, "mm"), + str("Mast radius: ", getMastRadius(mastWidth), "mm"), + str("Flag height: ", flagHeight, "mm"), + str("Flag width: ", flagWidth, "mm"), + str("Flag thickness: ", flagThickness, "mm"), str("-- Printer settings -----------"), str("Nozzle diameter: ", nozzleWidth, "mm"), str("Print layer: ", printResolution, "mm"), @@ -300,3 +314,6 @@ stripIndentRatio = 0.5; // The angle of a typical curve curveAngle = 90; + +// The number of facets the accessory mast have +mastFacets = 6; diff --git a/rcmodels/tracks/parts/accessories/accessory-flag.scad b/rcmodels/tracks/parts/accessories/accessory-flag.scad new file mode 100644 index 0000000..aeba1d9 --- /dev/null +++ b/rcmodels/tracks/parts/accessories/accessory-flag.scad @@ -0,0 +1,45 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A flag to clip onto the barrier holders. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + accessoryFlag( + width = flagWidth, + height = flagHeight, + thickness = flagThickness, + ring = mastWidth, + mast = mastWidth + ); +} diff --git a/rcmodels/tracks/parts/accessories/accessory-mast.scad b/rcmodels/tracks/parts/accessories/accessory-mast.scad new file mode 100644 index 0000000..9682ff4 --- /dev/null +++ b/rcmodels/tracks/parts/accessories/accessory-mast.scad @@ -0,0 +1,45 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A mast to clip accessories onto the barrier holders. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + accessoryMast( + width = mastWidth, + height = mastHeight, + wall = accessoryClipThickness, + base = barrierHolderBase, + thickness = barrierBodyThickness + ); +} diff --git a/rcmodels/tracks/parts/accessories/led-clip.scad b/rcmodels/tracks/parts/accessories/led-clip.scad index 3055c0f..128d3a7 100644 --- a/rcmodels/tracks/parts/accessories/led-clip.scad +++ b/rcmodels/tracks/parts/accessories/led-clip.scad @@ -35,9 +35,9 @@ include <../../config/setup.scad> applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - wireClip( - wall = wireClipThickness, - height = wireClipWidth, + cableClip( + height = cableClipWidth, + wall = accessoryClipThickness, base = barrierHolderBase, thickness = barrierBodyThickness ); diff --git a/rcmodels/tracks/shapes/accessories.scad b/rcmodels/tracks/shapes/accessories.scad index ef031b4..5d46c69 100644 --- a/rcmodels/tracks/shapes/accessories.scad +++ b/rcmodels/tracks/shapes/accessories.scad @@ -29,46 +29,142 @@ */ /** - * Draws the profile of a wire clip. - * @param Number wall - The thickness of the outline. + * Draws the shape of a cable clip. + * @param Number height - The thickness of the clip. + * @param Number wall - The thickness of the cable clip lines. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. + * @param Boolean [center] - The shape is centered vertically. */ -module wireClipProfile(wall, base, thickness) { +module cableClip(height, wall, base, thickness, center = false) { holderWidth = getBarrierHolderWidth(base) + wall * 2; - clipProfile( - wall = wall, - base = base, - thickness = thickness - ); - repeat(intervalX = holderWidth - wall, center = true) { - translateY(base / 2) { - rectangle([wall, base]); + negativeExtrude(height=height, center=center) { + clipProfile( + wall = wall, + base = base, + thickness = thickness + ); + repeat(intervalX = holderWidth - wall, center = true) { + translateY(base / 2) { + rectangle([wall, base]); + } } + ringSegment( + r = [1, 1] * (holderWidth / 2), + w = wall, + a = -180, + $fn = 10 + ); } - ringSegment( - r = [1, 1] * (holderWidth / 2), - w = wall, - a = -180, - $fn = 10 - ); } /** - * Draws the shape of a wire clip. - * @param Number wall - The thickness of the wire clip lines. - * @param Number height - The thickness of the clip. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number thickness - The thickness of the barrier body. + * Draws the shape of an accessory mast. + * @param Number width - The width of the mast. + * @param Number height - The height of the mast. + * @param Number [distance] - An additional distance added to the outline. * @param Boolean [center] - The shape is centered vertically. */ -module wireClip(wall, height, base, thickness, center = false) { +module mast(width, height, distance = 0, center = false) { + radius = getMastRadius(width); + negativeExtrude(height=height, center=center) { - wireClipProfile( + rotateZ(getPolygonAngle(1, mastFacets) / 2) { + polygon( + points = outline(drawEllipse(r=radius, $fn=mastFacets), distance), + convexity = 10 + ); + } + } +} + +/** + * Draws the shape of rings that will maintain an accessory onto a mast. + * @param Number width - The width of the mast. + * @param Number height - The height of the ring. + * @param Number wall - The thickness of the accessory ring. + * @param Number [interval] - The interval between 2 rings. + * @param Number [count] - The number of rings. + * @param Number [distance] - An additional distance added to the outline. + * @param Boolean [center] - The shape is centered. + */ +module mastRings(width, height, wall, interval = 0, count = 1, distance = 0, center = false) { + repeat(count=count, intervalX=interval, center=center) { + rotateY(90) { + difference() { + mast( + width = width, + height = height, + distance = wall + distance, + center = center + ); + mast( + width = width, + height = height * 2 + 1, + distance = distance, + center = true + ); + } + } + } +} + +/** + * Draws the shape of an accessory mast with a clip. + * @param Number width - The width of the mast. + * @param Number height - The height of the mast. + * @param Number wall - The thickness of the accessory clip lines. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number thickness - The thickness of the barrier body. + */ +module accessoryMast(width, height, wall, base, thickness) { + rotateY(90) { + mast( + width = width, + height = height, + distance = 0, + center = false + ); + } + rotateZ(90) { + clip( wall = wall, + height = width, base = base, - thickness = thickness + thickness = thickness, + center = true ); } } + +/** + * Draws the shape of an accessory flag. + * @param Number width - The width of the flag. + * @param Number height - The height of the flag. + * @param Number thickness - The thickness of the flag. + * @param Number ring - The width of the rings. + * @param Number mast - The width of the mast. + */ +module accessoryFlag(width, height, thickness, ring, mast) { + distance = printResolution; + ringHeight = height / 4; + ringInterval = height - ringHeight; + ringOffset = apothem(n=mastFacets, r=getMastRadius(mast)) + distance + thickness; + + + translateZ(ringOffset) { + mastRings( + width = mast, + height = ringHeight, + wall = thickness, + interval = ringInterval, + count = 2, + distance = distance, + center = true + ); + } + translateY(width / 2) { + box([height, width, thickness]); + } +} diff --git a/rcmodels/tracks/test/accessories.scad b/rcmodels/tracks/test/accessories.scad index 77c108c..e7d07f0 100644 --- a/rcmodels/tracks/test/accessories.scad +++ b/rcmodels/tracks/test/accessories.scad @@ -36,20 +36,49 @@ applyMode(mode=mode) { distributeGrid(intervalX=[length, 0, 0], intervalY=[0, height, 0], line=2, center=true) { - // test the wire clip profile - wireClipProfile( + // test the cable clip shape + cableClip( + height = clip, wall = wall, base = base, thickness = thickness ); - // test the wire clip profile - wireClip( + // test the accessory mast shape + mast( + width = base, + height = height, + distance = 0 + ); + + // test the accessory rings shape + mastRings( + width = base, + height = base, + wall = base, + interval = height / 2, + count = 2, + distance = printTolerance, + center = true + ); + + // test the accessory clip shape + accessoryMast( + width = base, + height = height, wall = wall, - height = clip, base = base, thickness = thickness ); + // test the accessory flag shape + accessoryFlag( + width = width, + height = height, + thickness = thickness, + ring = wall, + mast = base + ); + } } diff --git a/rcmodels/tracks/test/setup.scad b/rcmodels/tracks/test/setup.scad index f50f8e2..3038fb7 100644 --- a/rcmodels/tracks/test/setup.scad +++ b/rcmodels/tracks/test/setup.scad @@ -40,7 +40,7 @@ height = 30; // The height of the barrier, including the holders base = 2; // The base unit value used to design the barrier holder thickness = 0.6; // The thickness of the barrier body wall = 0.8; // The thickness of the walls -clip = 2; // The thickness of the wire clips +clip = 2; // The thickness of the cable clips // Validate the config against the constraints validateConfig( From 5909c1a3542c1fc458fadf3620502b9a6b3b298e Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 14 Feb 2020 22:06:31 +0100 Subject: [PATCH 088/191] Print the config into a file while rendering --- rcmodels/tracks/.gitignore | 2 ++ rcmodels/tracks/render.sh | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 rcmodels/tracks/.gitignore diff --git a/rcmodels/tracks/.gitignore b/rcmodels/tracks/.gitignore new file mode 100644 index 0000000..89f984e --- /dev/null +++ b/rcmodels/tracks/.gitignore @@ -0,0 +1,2 @@ +/output +/dist diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index a66d5a3..9461bd0 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -82,8 +82,10 @@ renderpathall() { # Display the render config showconfig() { + local config="${dstpath}/config.txt" printmessage "${C_MSG}Will generates the track elements with respect to the following config:" - renderpath "${configpath}/print.scad" "${dstpath}" 2>&1 | sed -e '1,4d' | sed -e :a -e '$d;N;2,3ba' -e 'P;D' + renderpath "${configpath}/print.scad" "${dstpath}" 2>&1 | sed -e '1,4d' | sed -e :a -e '$d;N;2,3ba' -e 'P;D' > "${config}" + cat "${config}" } # load parameters From 8e8488b0ce2aa768428b9a9873f61ab203f42061 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 15 Feb 2020 12:34:36 +0100 Subject: [PATCH 089/191] Add short curve track part --- .../elements/curved/element-curved-short.scad | 45 +++++++++++++++++++ ...minimal.scad => element-curved-small.scad} | 2 +- .../samples/curved/sample-curved-short.scad | 45 +++++++++++++++++++ ...-minimal.scad => sample-curved-small.scad} | 2 +- rcmodels/tracks/test/curved.scad | 36 +++++++++++++++ 5 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 rcmodels/tracks/parts/elements/curved/element-curved-short.scad rename rcmodels/tracks/parts/elements/curved/{element-curved-minimal.scad => element-curved-small.scad} (96%) create mode 100644 rcmodels/tracks/parts/samples/curved/sample-curved-short.scad rename rcmodels/tracks/parts/samples/curved/{sample-curved-minimal.scad => sample-curved-small.scad} (96%) diff --git a/rcmodels/tracks/parts/elements/curved/element-curved-short.scad b/rcmodels/tracks/parts/elements/curved/element-curved-short.scad new file mode 100644 index 0000000..b56beda --- /dev/null +++ b/rcmodels/tracks/parts/elements/curved/element-curved-short.scad @@ -0,0 +1,45 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier holder for a short curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierHolder( + length = trackSectionSize, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = .5, + right = rightOriented + ); +} diff --git a/rcmodels/tracks/parts/elements/curved/element-curved-minimal.scad b/rcmodels/tracks/parts/elements/curved/element-curved-small.scad similarity index 96% rename from rcmodels/tracks/parts/elements/curved/element-curved-minimal.scad rename to rcmodels/tracks/parts/elements/curved/element-curved-small.scad index c89687e..4952085 100644 --- a/rcmodels/tracks/parts/elements/curved/element-curved-minimal.scad +++ b/rcmodels/tracks/parts/elements/curved/element-curved-small.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier holder for a minimal curved track part. + * A barrier holder for a small curve track part. * * @author jsconan */ diff --git a/rcmodels/tracks/parts/samples/curved/sample-curved-short.scad b/rcmodels/tracks/parts/samples/curved/sample-curved-short.scad new file mode 100644 index 0000000..c2d09fb --- /dev/null +++ b/rcmodels/tracks/parts/samples/curved/sample-curved-short.scad @@ -0,0 +1,45 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for a short curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierMain( + length = sampleSize, + thickness = barrierBodyThickness, + base = sampleBase, + ratio = .5, + right = rightOriented + ); +} diff --git a/rcmodels/tracks/parts/samples/curved/sample-curved-minimal.scad b/rcmodels/tracks/parts/samples/curved/sample-curved-small.scad similarity index 96% rename from rcmodels/tracks/parts/samples/curved/sample-curved-minimal.scad rename to rcmodels/tracks/parts/samples/curved/sample-curved-small.scad index 959f161..81abdee 100644 --- a/rcmodels/tracks/parts/samples/curved/sample-curved-minimal.scad +++ b/rcmodels/tracks/parts/samples/curved/sample-curved-small.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A sample for a minimal curve track part. + * A sample for a small curve track part. * * @author jsconan */ diff --git a/rcmodels/tracks/test/curved.scad b/rcmodels/tracks/test/curved.scad index 9a21890..560e98a 100644 --- a/rcmodels/tracks/test/curved.scad +++ b/rcmodels/tracks/test/curved.scad @@ -36,6 +36,24 @@ applyMode(mode=mode) { distribute(intervalY=length * 3, center=true) { + // test the main shape of a barrier holder for a curved track element, short curve, right turned + curvedBarrierMain( + length = length, + thickness = thickness, + base = base, + ratio = 0.5, + right = true + ); + + // test the main shape of a barrier holder for a curved track element, short curve, left turned + curvedBarrierMain( + length = length, + thickness = thickness, + base = base, + ratio = 0.5, + right = false + ); + distributeRotate(center=true) { // test the main shape of a barrier holder for a curved track element, inner curve, right turned @@ -84,6 +102,24 @@ applyMode(mode=mode) { distance = printTolerance ); + // test the barrier holder shape for a curved track element, short curve, right turned + curvedBarrierHolder( + length = length, + thickness = thickness, + base = base, + ratio = 0.5, + right = true + ); + + // test the barrier holder shape for a curved track element, short curve, left turned + curvedBarrierHolder( + length = length, + thickness = thickness, + base = base, + ratio = 0.5, + right = false + ); + distributeRotate(center=true) { // test the barrier holder shape for a curved track element, inner curve, right turned From 193cf4b6a9e42706430d987cec89be3960e82eb8 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 15 Feb 2020 13:29:11 +0100 Subject: [PATCH 090/191] Simplify the profiles and add values in the printed config --- rcmodels/tracks/config/values.scad | 11 +-- rcmodels/tracks/shapes/accessories.scad | 1 - rcmodels/tracks/shapes/fragments.scad | 6 +- rcmodels/tracks/shapes/profiles.scad | 124 +++++++++--------------- rcmodels/tracks/test/fragments.scad | 3 +- rcmodels/tracks/test/profiles.scad | 6 +- 6 files changed, 57 insertions(+), 94 deletions(-) diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 4c88128..2546b6a 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -124,13 +124,6 @@ function getBarrierHolderTopWidth(base, thickness) = nozzleAligned((getBarrierLi */ function getBarrierHolderHeight(base) = getBarrierStripHeight(base) + minThickness + printResolution; -/** - * Computes the offset applied to the outline of the barrier holder. - * @param Number base - The base unit value used to design the barrier holder. - * @returns Number - */ -function getBarrierHolderOffset(base) = base / 4; - /** * Computes the inner height of the barrier body, between the barrier holders. * @param Number height - The height of the barrier. @@ -282,8 +275,10 @@ module printConfig(length, width, height, radius, base) { str("Outer curve ratio: ", outerCurveRatio), str("Outer curve angle: ", getCurveAngle(outerCurveRatio), "°"), str("Barrier height: ", height / 10, "cm"), - str("Barrier base value: ", base, "mm"), str("Barrier thickness: ", barrierBodyThickness, "mm"), + str("Barrier base value: ", base, "mm"), + str("Barrier holder width: ", getBarrierHolderWidth(base), "mm"), + str("Barrier holder height: ", getBarrierHolderHeight(base), "mm"), str("-- Track samples --------------"), str("Size of samples: ", sampleSize / 10, "cm"), str("Base of samples: ", sampleBase, "mm"), diff --git a/rcmodels/tracks/shapes/accessories.scad b/rcmodels/tracks/shapes/accessories.scad index 5d46c69..a5b8280 100644 --- a/rcmodels/tracks/shapes/accessories.scad +++ b/rcmodels/tracks/shapes/accessories.scad @@ -152,7 +152,6 @@ module accessoryFlag(width, height, thickness, ring, mast) { ringInterval = height - ringHeight; ringOffset = apothem(n=mastFacets, r=getMastRadius(mast)) + distance + thickness; - translateZ(ringOffset) { mastRings( width = mast, diff --git a/rcmodels/tracks/shapes/fragments.scad b/rcmodels/tracks/shapes/fragments.scad index 6c01f11..52208f8 100644 --- a/rcmodels/tracks/shapes/fragments.scad +++ b/rcmodels/tracks/shapes/fragments.scad @@ -70,14 +70,16 @@ module barrierNotch(thickness, base, distance = 0, interval = 0, count = 1, cent * @param Number height - The thickness of the clip. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. + * @param Number [distance] - An additional distance added to the outline of the profile. * @param Boolean [center] - The shape is centered vertically. */ -module clip(wall, height, base, thickness, center = false) { +module clip(wall, height, base, thickness, distance = 0, center = false) { negativeExtrude(height=height, center=center) { clipProfile( wall = wall, base = base, - thickness = thickness + thickness = thickness, + distance = distance ); } } diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index 7a69bb5..062e0ee 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -29,90 +29,61 @@ */ /** - * Computes the points defining the profile of a barrier link. + * Draws the profile of a barrier link. * @param Number base - The base unit value used to design the barrier holder. - * @param Number [distance] - An additional distance added to the outline of the barrier link. - * @returns Vector[] + * @param Number [distance] - An additional distance added to the outline of the profile. */ -function getBarrierLinkPoints(base, distance = 0) = - let( - half = base / 2 - ) - outline(path([ +module barrierLinkProfile(base, distance = 0) { + half = base / 2; + + polygon(outline(path([ ["P", half, half], ["H", -base], ["C", [half, half], 0, 180], ["V", -base], ["C", [half, half], 180, 360], ["H", base], - ]), distance) -; - -/** - * Draws the profile of a barrier link. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [distance] - An additional distance added to the outline of the barrier link. - */ -module barrierLinkProfile(base, distance = 0) { - polygon(getBarrierLinkPoints( - base = base, - distance = distance - ), convexity = 10); + ]), distance), convexity = 10); } /** - * Computes the points defining the profile of a barrier holder notch. + * Draws the profile of a barrier holder notch. * @param Number base - The base unit value used to design the barrier holder. * @param Number [distance] - An additional distance added to the outline of the barrier link. - * @returns Vector[] */ -function getBarrierNotchPoints(base, distance = 0) = - let( - width = getBarrierNotchWidth(base, distance), - top = getBarrierNotchDistance(base, distance), - strip = getBarrierStripHeight(base), - indent = getBarrierStripIndent(base), - height = strip - indent - ) - path([ +module barrierNotchProfile(base, distance = 0) { + width = getBarrierNotchWidth(base, distance); + top = getBarrierNotchDistance(base, distance); + strip = getBarrierStripHeight(base); + indent = getBarrierStripIndent(base); + height = strip - indent; + + polygon(path([ ["P", -width / 2, 0], ["L", indent, height], ["H", top], ["L", indent, -height], ["V", -base], ["H", -width] - ]) -; - -/** - * Draws the profile of a barrier holder notch. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [distance] - An additional distance added to the outline of the barrier link. - */ -module barrierNotchProfile(base, distance = 0) { - polygon(getBarrierNotchPoints( - base = base, - distance = distance - ), convexity = 10); + ]), convexity = 10); } /** - * Computes the points defining the profile of a barrier holder. + * Draws the profile of a barrier holder. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. - * @returns Vector[] + * @param Number [distance] - An additional distance added to the outline of the profile. */ -function getBarrierHolderPoints(base, thickness) = - let( - linkWidth = getBarrierLinkWidth(base, printTolerance), - top = getBarrierHolderTopWidth(base, thickness), - width = getBarrierHolderWidth(base), - height = getBarrierHolderHeight(base), - offset = getBarrierHolderOffset(base), - lineW = (width - top) / 2, - lineH = height - base - ) - path([ +module barrierHolderProfile(base, thickness, distance = 0) { + linkWidth = getBarrierLinkWidth(base, printTolerance); + top = getBarrierHolderTopWidth(base, thickness); + width = getBarrierHolderWidth(base); + height = getBarrierHolderHeight(base); + offset = base / 4; + lineW = (width - top) / 2; + lineH = height - base; + + polygon(outline(path([ ["P", -width / 2 + offset, 0], ["L", -offset, offset], ["V", base - offset], @@ -123,19 +94,7 @@ function getBarrierHolderPoints(base, thickness) = ["L", lineW - offset, -lineH + offset], ["V", -base + offset], ["L", -offset, -offset] - ]) -; - -/** - * Draws the profile of a barrier holder. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number thickness - The thickness of the barrier body. - */ -module barrierHolderProfile(base, thickness) { - polygon(getBarrierHolderPoints( - base = base, - thickness = thickness - ), convexity = 10); + ]), -distance), convexity = 10); } /** @@ -148,13 +107,17 @@ module barrierHolderProfile(base, thickness) { module barrierHolderOutline(wall, base, thickness, distance = 0) { translateY(wall) { difference() { - profile = outline(getBarrierHolderPoints( + barrierHolderProfile( base = base, - thickness = thickness - ), -distance); + thickness = thickness, + distance = wall + distance + ); - polygon(outline(profile, -wall), convexity = 10); - polygon(profile, convexity = 10); + barrierHolderProfile( + base = base, + thickness = thickness, + distance = distance + ); } } } @@ -164,8 +127,9 @@ module barrierHolderOutline(wall, base, thickness, distance = 0) { * @param Number wall - The thickness of the outline. * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. + * @param Number [distance] - An additional distance added to the outline of the profile. */ -module clipProfile(wall, base, thickness) { +module clipProfile(wall, base, thickness, distance = 0) { holderHeight = getBarrierHolderHeight(base); difference() { @@ -173,11 +137,11 @@ module clipProfile(wall, base, thickness) { wall = wall, base = base, thickness = thickness, - distance = 0 + distance = distance ); - translateY(holderHeight + wall * 1.5) { - rectangle([getBarrierHolderTopWidth(base, thickness), wall * 2]); + translateY(holderHeight + wall * 1.5 + distance) { + rectangle([getBarrierHolderTopWidth(base, thickness), wall * 2] + vector2D(distance)); } } } diff --git a/rcmodels/tracks/test/fragments.scad b/rcmodels/tracks/test/fragments.scad index cae7892..db1c4d7 100644 --- a/rcmodels/tracks/test/fragments.scad +++ b/rcmodels/tracks/test/fragments.scad @@ -41,7 +41,8 @@ applyMode(mode=mode) { wall = wall, height = clip, base = base, - thickness = thickness + thickness = thickness, + distance = 0 ); // test the barrier link shape diff --git a/rcmodels/tracks/test/profiles.scad b/rcmodels/tracks/test/profiles.scad index 8b46c77..643e1c2 100644 --- a/rcmodels/tracks/test/profiles.scad +++ b/rcmodels/tracks/test/profiles.scad @@ -51,7 +51,8 @@ applyMode(mode=mode) { // test the barrier holder profile barrierHolderProfile( base = base, - thickness = thickness + thickness = thickness, + distance = 0 ); // test the barrier holder outline @@ -66,7 +67,8 @@ applyMode(mode=mode) { clipProfile( wall = wall, base = base, - thickness = thickness + thickness = thickness, + distance = 0 ); } From 50814c1ffd3806941da7dd89fdee8749cbba6e6a Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 15 Feb 2020 23:07:42 +0100 Subject: [PATCH 091/191] Add u-turn parts --- rcmodels/tracks/config/setup.scad | 1 + .../elements/curved/element-curved-uturn.scad | 46 ++++++ .../elements/straight/element-arch-tower.scad | 8 +- .../elements/straight/element-uturn-body.scad | 45 +++++ .../straight/element-uturn-compensation.scad | 43 +++++ .../samples/curved/sample-curved-uturn.scad | 95 +++++++++++ .../straight/sample-uturn-compensation.scad | 43 +++++ rcmodels/tracks/shapes/straight.scad | 6 +- rcmodels/tracks/shapes/uturn.scad | 155 ++++++++++++++++++ rcmodels/tracks/test/straight.scad | 8 +- rcmodels/tracks/test/uturn.scad | 76 +++++++++ 11 files changed, 515 insertions(+), 11 deletions(-) create mode 100644 rcmodels/tracks/parts/elements/curved/element-curved-uturn.scad create mode 100644 rcmodels/tracks/parts/elements/straight/element-uturn-body.scad create mode 100644 rcmodels/tracks/parts/elements/straight/element-uturn-compensation.scad create mode 100644 rcmodels/tracks/parts/samples/curved/sample-curved-uturn.scad create mode 100644 rcmodels/tracks/parts/samples/straight/sample-uturn-compensation.scad create mode 100644 rcmodels/tracks/shapes/uturn.scad create mode 100644 rcmodels/tracks/test/uturn.scad diff --git a/rcmodels/tracks/config/setup.scad b/rcmodels/tracks/config/setup.scad index 9f4616a..c4f720d 100644 --- a/rcmodels/tracks/config/setup.scad +++ b/rcmodels/tracks/config/setup.scad @@ -40,6 +40,7 @@ include <../shapes/profiles.scad> include <../shapes/fragments.scad> include <../shapes/straight.scad> include <../shapes/curved.scad> +include <../shapes/uturn.scad> include <../shapes/accessories.scad> // Validate the config against the constraints diff --git a/rcmodels/tracks/parts/elements/curved/element-curved-uturn.scad b/rcmodels/tracks/parts/elements/curved/element-curved-uturn.scad new file mode 100644 index 0000000..d7473f7 --- /dev/null +++ b/rcmodels/tracks/parts/elements/curved/element-curved-uturn.scad @@ -0,0 +1,46 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier holder for a U-turn track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + uTurnBarrierHolder( + length = trackSectionSize, + height = barrierHeight, + thickness = barrierBodyThickness, + base = barrierHolderBase, + gap = archTowerThickness * 2, + right = rightOriented + ); +} diff --git a/rcmodels/tracks/parts/elements/straight/element-arch-tower.scad b/rcmodels/tracks/parts/elements/straight/element-arch-tower.scad index 0758240..8d3f1d1 100644 --- a/rcmodels/tracks/parts/elements/straight/element-arch-tower.scad +++ b/rcmodels/tracks/parts/elements/straight/element-arch-tower.scad @@ -37,17 +37,17 @@ applyMode(mode=renderMode) { //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) distribute([0, getBarrierHolderWidth(barrierHolderBase) * 2, 0], center=true) { archTower( - wall = archTowerThickness, length = trackSectionSize, - base = barrierHolderBase, thickness = barrierBodyThickness, + base = barrierHolderBase, + wall = archTowerThickness, right = false ); archTower( - wall = archTowerThickness, length = trackSectionSize, - base = barrierHolderBase, thickness = barrierBodyThickness, + base = barrierHolderBase, + wall = archTowerThickness, right = true ); } diff --git a/rcmodels/tracks/parts/elements/straight/element-uturn-body.scad b/rcmodels/tracks/parts/elements/straight/element-uturn-body.scad new file mode 100644 index 0000000..4a742e0 --- /dev/null +++ b/rcmodels/tracks/parts/elements/straight/element-uturn-body.scad @@ -0,0 +1,45 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * An additional barrier body for a U-turn compensation track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + uTurnCompensationBarrierBody( + length = trackSectionSize, + height = getBarrierBodyHeight(barrierHeight), + thickness = barrierBodyThickness, + base = barrierHolderBase, + gap = archTowerThickness * 2 + ); +} diff --git a/rcmodels/tracks/parts/elements/straight/element-uturn-compensation.scad b/rcmodels/tracks/parts/elements/straight/element-uturn-compensation.scad new file mode 100644 index 0000000..04d176b --- /dev/null +++ b/rcmodels/tracks/parts/elements/straight/element-uturn-compensation.scad @@ -0,0 +1,43 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier holder to compensate a U-turn track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + uTurnCompensationBarrierHolder( + thickness = barrierBodyThickness, + base = barrierHolderBase, + gap = archTowerThickness * 2 + ); +} diff --git a/rcmodels/tracks/parts/samples/curved/sample-curved-uturn.scad b/rcmodels/tracks/parts/samples/curved/sample-curved-uturn.scad new file mode 100644 index 0000000..a511e5c --- /dev/null +++ b/rcmodels/tracks/parts/samples/curved/sample-curved-uturn.scad @@ -0,0 +1,95 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for a U-turn curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +/** + * Draws the shape of a barrier border for a U-Turn. + * @param Number length - The length of a track element. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number gap - The distance between the two side of the u-turn. + * @param Number right - Is it the right or the left part of the track element that is added first? + */ +module uTurnSample(length, thickness, base, gap, right = false) { + holderWidth = getBarrierHolderWidth(base); + holderHeight = getBarrierHolderHeight(base); + interval = (gap + holderWidth) / 2; + + difference() { + union() { + translateY(interval) { + rotateZ(right ? 180 : 0) { + straightBarrierMain( + length = length, + thickness = thickness, + base = base + ); + } + } + translateY(-interval) { + rotateZ(right ? 0 : 180) { + straightBarrierMain( + length = length, + thickness = thickness, + base = base + ); + } + } + } + translate([length, 0, -length]) { + box(length * 2); + } + } + rotateZ(270) { + rotate_extrude(angle=180, convexity=10) { + translateX(interval) { + barrierHolderProfile( + base = base, + thickness = thickness + ); + } + } + } +} + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + uTurnSample( + length = sampleSize, + thickness = barrierBodyThickness, + base = sampleBase, + gap = minWidth * 2, + right = rightOriented + ); +} diff --git a/rcmodels/tracks/parts/samples/straight/sample-uturn-compensation.scad b/rcmodels/tracks/parts/samples/straight/sample-uturn-compensation.scad new file mode 100644 index 0000000..3fb57d6 --- /dev/null +++ b/rcmodels/tracks/parts/samples/straight/sample-uturn-compensation.scad @@ -0,0 +1,43 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A sample for a U-turn compensation track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + straightBarrierMain( + length = getBarrierHolderWidth(sampleBase) + minWidth * 2, + thickness = barrierBodyThickness, + base = sampleBase + ); +} diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index b0abab3..ecfc8af 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -135,13 +135,13 @@ module straightBarrierHolder(length, thickness, base, ratio = 1) { /** * Draws the shape of an arch tower that will clamp a barrier border. - * @param Number wall - The thickness of the outline. * @param Number length - The length of a track element. - * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number wall - The thickness of the outline. * @param Number right - Is it the right or the left part of the track element that is added to the tower? */ -module archTower(wall, length, base, thickness, right = false) { +module archTower(length, thickness, base, wall, right = false) { holderHeight = getBarrierHolderHeight(base); indent = getBarrierStripIndent(base); diff --git a/rcmodels/tracks/shapes/uturn.scad b/rcmodels/tracks/shapes/uturn.scad new file mode 100644 index 0000000..2d011e0 --- /dev/null +++ b/rcmodels/tracks/shapes/uturn.scad @@ -0,0 +1,155 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * Defines the U-turn track parts. + * + * @author jsconan + */ + +/** + * Draws the shape of a barrier border for a U-Turn. + * @param Number length - The length of a track element. + * @param Number height - The height of the barrier. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number gap - The distance between the two side of the u-turn. + * @param Number right - Is it the right or the left part of the track element that is added first? + */ +module uTurnBarrierHolder(length, height, thickness, base, gap, right = false) { + adjustedThickness = thickness + printTolerance; + holderWidth = getBarrierHolderWidth(base); + holderHeight = getBarrierHolderHeight(base); + towerWidth = nozzleAligned(adjustedThickness + minWidth); + towerHeight = getBarrierBodyInnerHeight(height, base) / 2; + interval = (holderWidth + gap) / 2; + + difference() { + union() { + translateY(interval) { + rotateZ(right ? 180 : 0) { + straightBarrierHolder( + length = length, + thickness = thickness, + base = base + ); + } + } + translateY(-interval) { + rotateZ(right ? 0 : 180) { + straightBarrierHolder( + length = length, + thickness = thickness, + base = base + ); + } + } + } + translate([length, 0, -length]) { + box(length * 2); + } + } + rotateZ(270) { + rotate_extrude(angle=180, convexity=10) { + translateX(interval) { + barrierHolderProfile( + base = base, + thickness = adjustedThickness + ); + translate([-adjustedThickness / 2, holderHeight + towerHeight / 2]) { + rectangle([towerWidth, towerHeight]); + } + } + } + } +} + +/** + * Draws the shape of a barrier border for a U-Turn. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number gap - The distance between the two side of the u-turn. + */ +module uTurnCompensationBarrierHolder(thickness, base, gap) { + holderWidth = getBarrierHolderWidth(base); + holderHeight = getBarrierHolderHeight(base); + length = holderWidth + gap; + indent = getBarrierStripIndent(base); + height = holderHeight - indent; + thickness = thickness + printTolerance; + + difference() { + straightBarrierMain( + length = length, + thickness = thickness, + base = base + ); + translateZ(height) { + box([length + 2, thickness, indent * 2]); + } + } +} + +/** + * Draws the shape of a barrier body. + * @param Number length - The length of the track element. + * @param Number height - The height of the barrier. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number gap - The distance between the two side of the u-turn. + */ +module uTurnCompensationBarrierBody(length, height, thickness, base, gap) { + holderWidth = getBarrierHolderWidth(base); + strip = getBarrierStripHeight(base); + indent = getBarrierStripIndent(base); + stripHeight = strip - indent; + compensation = holderWidth + gap; + compensedLength = length + compensation; + interval = length / 2; + + difference() { + box( + size = [compensedLength, height, thickness], + center = true + ); + repeatMirror(interval=[0, height, 0], axis=[0, 1, 0], center=true) { + repeatMirror() { + translateX((compensedLength - interval) / 2) { + barrierNotch( + thickness = thickness * 2, + base = base, + distance = printTolerance, + interval = interval, + count = 2, + center = true + ); + } + } + box( + size = [compensation, stripHeight * 2, thickness + 1], + center = true + ); + } + } +} diff --git a/rcmodels/tracks/test/straight.scad b/rcmodels/tracks/test/straight.scad index fd14ef0..9837ad6 100644 --- a/rcmodels/tracks/test/straight.scad +++ b/rcmodels/tracks/test/straight.scad @@ -71,19 +71,19 @@ applyMode(mode=mode) { // test the arch tower shape with holders, left side archTower( - wall = wall * 2, length = length, - base = base, thickness = thickness, + base = base, + wall = wall * 2, right = false ); // test the arch tower shape with holders, right side archTower( - wall = wall * 2, length = length, - base = base, thickness = thickness, + base = base, + wall = wall * 2, right = true ); diff --git a/rcmodels/tracks/test/uturn.scad b/rcmodels/tracks/test/uturn.scad new file mode 100644 index 0000000..a29f59c --- /dev/null +++ b/rcmodels/tracks/test/uturn.scad @@ -0,0 +1,76 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * Test the U-turn elements shapes. + * + * @author jsconan + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=mode) { + + distribute(intervalY=length, center=true) { + + // test the u-turn shape, left side + uTurnBarrierHolder( + length = length, + height = height, + thickness = thickness, + base = base, + gap = wall, + right = false + ); + + // test the u-turn shape, right side + uTurnBarrierHolder( + length = length, + height = height, + thickness = thickness, + base = base, + gap = wall, + right = true + ); + + // test the u-turn compensation shape + uTurnCompensationBarrierHolder( + thickness = thickness, + base = base, + gap = wall + ); + + // test the u-turn compensation body shape + uTurnCompensationBarrierBody( + length = length, + height = height, + thickness = thickness, + base = base, + gap = wall + ); + + } +} From 8954fbcba75a1cbfe215d8b3cac74c12986d2429 Mon Sep 17 00:00:00 2001 From: jsconan Date: Mon, 17 Feb 2020 23:36:43 +0100 Subject: [PATCH 092/191] Improve the modularity of the shapes --- rcmodels/tracks/shapes/curved.scad | 91 +++++++++++++++------------ rcmodels/tracks/shapes/fragments.scad | 29 +++++++++ rcmodels/tracks/shapes/straight.scad | 59 ++++++++--------- rcmodels/tracks/test/curved.scad | 2 +- rcmodels/tracks/test/fragments.scad | 8 +++ 5 files changed, 120 insertions(+), 69 deletions(-) diff --git a/rcmodels/tracks/shapes/curved.scad b/rcmodels/tracks/shapes/curved.scad index 7341500..3eeb8c0 100644 --- a/rcmodels/tracks/shapes/curved.scad +++ b/rcmodels/tracks/shapes/curved.scad @@ -35,7 +35,7 @@ * @param Number base - The base unit value used to design the barrier holder. * @param Number [distance] - An additional distance added to the outline of the barrier link. */ -module barrierNotchCurved(radius, thickness, base, distance = 0) { +module curvedBarrierNotch(radius, thickness, base, distance = 0) { width = getBarrierNotchWidth(base, distance); strip = getBarrierStripHeight(base); indent = getBarrierStripIndent(base); @@ -77,23 +77,63 @@ module barrierNotchCurved(radius, thickness, base, distance = 0) { /** * Place a curved element with respect to the length and the ratio. - * @param Number length - The length of the element. - * @param Number ratio - The ratio to apply on the radius + * @param Number length - The length of a track element. + * @param Number radius - The radius of the curve. + * @param Number angle - The angle of the curve. * @param Number z - An option Z-axis translation */ -module placeCurvedElement(length, ratio = 1, z = 0) { - radius = getCurveRadius(length, ratio); - angle = getCurveAngle(ratio); - ratioAngle = curveAngle - angle; +module placeCurvedElement(length, radius, angle, z = 0) { + remainingAngle = curveAngle - angle; offset = (length - radius) * cos(45) * [1, 1, 0] + [0, 0, z]; translate(offset) { - rotateZ(ratioAngle / 2) { + rotateZ(remainingAngle / 2) { children(); } } } +/** + * Adds the links to a curved element. + * @param Number radius - The radius of the curve. + * @param Number angle - The angle of the curve. + * @param Number linkHeight - The height of the link. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number right - Is the curve oriented to the right? + */ +module curvedLinks(radius, angle, linkHeight, base, right = false) { + remainingAngle = curveAngle - angle; + outerLinkDirection = right ? 180 : 0; + outerLinkPosition = right ? 270 : -remainingAngle; + innerLinkDirection = right ? 90 : -90; + innerLinkPosition = right ? 90 - remainingAngle : 0; + + rotateZ(outerLinkPosition) { + translateY(radius) { + rotateZ(outerLinkDirection) { + barrierLink( + height = linkHeight - printResolution, + base = base + ); + } + } + } + difference() { + children(); + rotateZ(innerLinkPosition) { + translate([radius, 0, -1]) { + rotateZ(innerLinkDirection) { + barrierLink( + height = linkHeight + printResolution + 1, + base = base, + distance = printTolerance + ); + } + } + } + } +} + /** * Draws the main shape of a barrier holder for a curved track element. * @param Number length - The length of the element. @@ -105,26 +145,10 @@ module placeCurvedElement(length, ratio = 1, z = 0) { module curvedBarrierMain(length, thickness, base, ratio = 1, right = false) { radius = getCurveRadius(length, ratio); angle = getCurveAngle(ratio); - ratioAngle = curveAngle - angle; linkHeight = getBarrierHolderHeight(base) - base; - outerLinkDirection = right ? 180 : 0; - outerLinkPosition = right ? 270 : -ratioAngle; - innerLinkDirection = right ? 90 : -90; - innerLinkPosition = right ? 90 - ratioAngle : 0; - - placeCurvedElement(length, ratio) { - rotateZ(outerLinkPosition) { - translateY(radius) { - rotateZ(outerLinkDirection) { - barrierLink( - height = linkHeight - printResolution, - base = base - ); - } - } - } - difference() { + placeCurvedElement(length=length, radius=radius, angle=angle) { + curvedLinks(radius=radius, angle=angle, linkHeight=linkHeight, base=base, right=right) { rotate_extrude(angle=angle, convexity=10) { translateX(radius) { barrierHolderProfile( @@ -133,17 +157,6 @@ module curvedBarrierMain(length, thickness, base, ratio = 1, right = false) { ); } } - rotateZ(innerLinkPosition) { - translate([radius, 0, -1]) { - rotateZ(innerLinkDirection) { - barrierLink( - height = linkHeight + printResolution + 1, - base = base, - distance = printTolerance - ); - } - } - } } } } @@ -170,7 +183,7 @@ module curvedBarrierHolder(length, thickness, base, ratio = 1, right = false) { ratio = ratio, right = right ); - placeCurvedElement(length, ratio, minThickness) { + placeCurvedElement(length=length, radius=radius, angle=angle, z=minThickness) { difference() { pipeSegment( r = radius + thickness / 2, @@ -188,7 +201,7 @@ module curvedBarrierHolder(length, thickness, base, ratio = 1, right = false) { ]; repeatRotateMap(angles) { - barrierNotchCurved( + curvedBarrierNotch( radius = radius, thickness = thickness * 2, base = base, diff --git a/rcmodels/tracks/shapes/fragments.scad b/rcmodels/tracks/shapes/fragments.scad index 52208f8..add116a 100644 --- a/rcmodels/tracks/shapes/fragments.scad +++ b/rcmodels/tracks/shapes/fragments.scad @@ -64,6 +64,35 @@ module barrierNotch(thickness, base, distance = 0, interval = 0, count = 1, cent } } +/** + * Draws the negative shape of a barrier holder notch. + * @param Number length - The length of the shape. + * @param Number thickness - The thickness of the shape. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number [notches] - The number of notches. + */ +module barrierNotchNegative(length, thickness, base, notches = 2) { + height = getBarrierHolderHeight(base) * 2; + notches = min(notches, 2); + interval = length / notches; + count = notches + 1; + + difference() { + box([length + 2, thickness, height]); + + rotateX(90) { + barrierNotch( + thickness = thickness * 2, + base = base, + distance = printTolerance / 2, + interval = interval, + count = count, + center = true + ); + } + } +} + /** * Draws the shape of a clip. * @param Number wall - The thickness of the clip lines. diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index ecfc8af..6da5253 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -60,14 +60,12 @@ module barrierBody(length, height, thickness, base, notches = 1) { } /** - * Draws the main shape of a barrier holder for a straight track element. + * Adds the links to a straight element. * @param Number length - The length of the element. - * @param Number thickness - The thickness of the barrier body. + * @param Number linkHeight - The height of the link. * @param Number base - The base unit value used to design the barrier holder. */ -module straightBarrierMain(length, thickness, base) { - linkHeight = getBarrierHolderHeight(base) - base; - +module straightLinks(length, linkHeight, base) { translateX(-length / 2) { barrierLink( height = linkHeight - printResolution, @@ -75,6 +73,27 @@ module straightBarrierMain(length, thickness, base) { ); } difference() { + children(); + translate([length / 2, 0, -1]) { + barrierLink( + height = linkHeight + printResolution + 1, + base = base, + distance = printTolerance + ); + } + } +} + +/** + * Draws the main shape of a barrier holder for a straight track element. + * @param Number length - The length of the element. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + */ +module straightBarrierMain(length, thickness, base) { + linkHeight = getBarrierHolderHeight(base) - base; + + straightLinks(length=length, linkHeight=linkHeight, base=base) { rotate([90, 0, 90]) { negativeExtrude(height=length, center=true) { barrierHolderProfile( @@ -83,13 +102,6 @@ module straightBarrierMain(length, thickness, base) { ); } } - translate([length / 2, 0, -1]) { - barrierLink( - height = linkHeight + printResolution + 1, - base = base, - distance = printTolerance - ); - } } } @@ -101,12 +113,9 @@ module straightBarrierMain(length, thickness, base) { * @param Number ratio - The ratio to apply on the length */ module straightBarrierHolder(length, thickness, base, ratio = 1) { - linkHeight = getBarrierHolderHeight(base) - base; thickness = thickness + printTolerance; length = length * ratio; notches = ratio * 2; - interval = length / notches; - count = notches + 1; difference() { straightBarrierMain( @@ -115,20 +124,12 @@ module straightBarrierHolder(length, thickness, base, ratio = 1) { base = base ); translateZ(minThickness) { - difference() { - box([length + 2, thickness, linkHeight * 2]); - - rotateX(90) { - barrierNotch( - thickness = thickness * 2, - base = base, - distance = printTolerance / 2, - interval = interval, - count = count, - center = true - ); - } - } + barrierNotchNegative( + length = length, + thickness = thickness, + base = base, + notches = notches + ); } } } diff --git a/rcmodels/tracks/test/curved.scad b/rcmodels/tracks/test/curved.scad index 560e98a..bd67c89 100644 --- a/rcmodels/tracks/test/curved.scad +++ b/rcmodels/tracks/test/curved.scad @@ -95,7 +95,7 @@ applyMode(mode=mode) { } // test the barrier notch shape for a curved track element - barrierNotchCurved( + curvedBarrierNotch( radius = length, thickness = thickness, base = base, diff --git a/rcmodels/tracks/test/fragments.scad b/rcmodels/tracks/test/fragments.scad index db1c4d7..5e33a10 100644 --- a/rcmodels/tracks/test/fragments.scad +++ b/rcmodels/tracks/test/fragments.scad @@ -45,6 +45,14 @@ applyMode(mode=mode) { distance = 0 ); + // test the barrier notch negative shape for a straight track element + barrierNotchNegative( + length = length, + thickness = thickness, + base = base, + notches = 2 + ); + // test the barrier link shape barrierLink( height = 5, From 6aebe77d378fea41d1814fc75efc3502a9be3d49 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 19 Feb 2020 21:16:15 +0100 Subject: [PATCH 093/191] Fix computation of the barrier inner height --- rcmodels/tracks/config/values.scad | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 2546b6a..73e0c5d 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -129,7 +129,7 @@ function getBarrierHolderHeight(base) = getBarrierStripHeight(base) + minThickne * @param Number height - The height of the barrier. * @returns Number */ -function getBarrierBodyInnerHeight(height, base) = height - getBarrierStripHeight(base) * 2; +function getBarrierBodyInnerHeight(height, base) = height - (getBarrierStripHeight(base) + minThickness) * 2; /** * Computes the outer height of the barrier body, taking care of the barrier holders. @@ -274,13 +274,13 @@ module printConfig(length, width, height, radius, base) { str("Inner curve angle: ", getCurveAngle(innerCurveRatio), "°"), str("Outer curve ratio: ", outerCurveRatio), str("Outer curve angle: ", getCurveAngle(outerCurveRatio), "°"), - str("Barrier height: ", height / 10, "cm"), + str("Barrier height: ", height, "mm"), str("Barrier thickness: ", barrierBodyThickness, "mm"), str("Barrier base value: ", base, "mm"), str("Barrier holder width: ", getBarrierHolderWidth(base), "mm"), str("Barrier holder height: ", getBarrierHolderHeight(base), "mm"), str("-- Track samples --------------"), - str("Size of samples: ", sampleSize / 10, "cm"), + str("Size of samples: ", sampleSize, "mm"), str("Base of samples: ", sampleBase, "mm"), str("-- Track accessories ----------"), str("Mast height: ", mastHeight, "mm"), From 1a0cecc233e98242cb6649174a7a3e94aaeedb31 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 19 Feb 2020 21:26:22 +0100 Subject: [PATCH 094/191] Fix the print tolerance adjustment for the barrier holder outline --- rcmodels/tracks/shapes/accessories.scad | 9 +++-- rcmodels/tracks/shapes/profiles.scad | 52 ++++++++++++------------- rcmodels/tracks/shapes/straight.scad | 5 +-- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/rcmodels/tracks/shapes/accessories.scad b/rcmodels/tracks/shapes/accessories.scad index a5b8280..db2c428 100644 --- a/rcmodels/tracks/shapes/accessories.scad +++ b/rcmodels/tracks/shapes/accessories.scad @@ -37,13 +37,13 @@ * @param Boolean [center] - The shape is centered vertically. */ module cableClip(height, wall, base, thickness, center = false) { - holderWidth = getBarrierHolderWidth(base) + wall * 2; - + holderWidth = getBarrierHolderWidth(base) + (wall + printTolerance) * 2; negativeExtrude(height=height, center=center) { clipProfile( wall = wall, base = base, - thickness = thickness + thickness = thickness + printTolerance, + distance = printTolerance ); repeat(intervalX = holderWidth - wall, center = true) { translateY(base / 2) { @@ -132,7 +132,8 @@ module accessoryMast(width, height, wall, base, thickness) { wall = wall, height = width, base = base, - thickness = thickness, + thickness = thickness + printTolerance, + distance = printTolerance, center = true ); } diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index 062e0ee..6350e20 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -75,25 +75,25 @@ module barrierNotchProfile(base, distance = 0) { * @param Number [distance] - An additional distance added to the outline of the profile. */ module barrierHolderProfile(base, thickness, distance = 0) { - linkWidth = getBarrierLinkWidth(base, printTolerance); - top = getBarrierHolderTopWidth(base, thickness); - width = getBarrierHolderWidth(base); - height = getBarrierHolderHeight(base); - offset = base / 4; - lineW = (width - top) / 2; - lineH = height - base; + holderTopWidth = getBarrierHolderTopWidth(base, thickness); + holderWidth = getBarrierHolderWidth(base); + holderHeight = getBarrierHolderHeight(base); + holderOffset = base / 4; + holderSide = base - holderOffset; + holderLineX = (holderWidth - holderTopWidth) / 2 - holderOffset; + holderLineY = holderHeight - holderSide - holderOffset * 2; polygon(outline(path([ - ["P", -width / 2 + offset, 0], - ["L", -offset, offset], - ["V", base - offset], - ["L", lineW - offset, lineH - offset], - ["L", offset, offset], - ["H", top], - ["L", offset, -offset], - ["L", lineW - offset, -lineH + offset], - ["V", -base + offset], - ["L", -offset, -offset] + ["P", holderOffset - holderWidth / 2, 0], + ["L", -holderOffset, holderOffset], + ["V", holderSide], + ["L", holderLineX, holderLineY], + ["L", holderOffset, holderOffset], + ["H", holderTopWidth], + ["L", holderOffset, -holderOffset], + ["L", holderLineX, -holderLineY], + ["V", -holderSide], + ["L", -holderOffset, -holderOffset] ]), -distance), convexity = 10); } @@ -112,7 +112,6 @@ module barrierHolderOutline(wall, base, thickness, distance = 0) { thickness = thickness, distance = wall + distance ); - barrierHolderProfile( base = base, thickness = thickness, @@ -133,14 +132,15 @@ module clipProfile(wall, base, thickness, distance = 0) { holderHeight = getBarrierHolderHeight(base); difference() { - barrierHolderOutline( - wall = wall, - base = base, - thickness = thickness, - distance = distance - ); - - translateY(holderHeight + wall * 1.5 + distance) { + translateY(distance) { + barrierHolderOutline( + wall = wall, + base = base, + thickness = thickness, + distance = distance + ); + } + translateY(holderHeight + wall * 1.5 + distance * 2) { rectangle([getBarrierHolderTopWidth(base, thickness), wall * 2] + vector2D(distance)); } } diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 6da5253..e7c230b 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -45,7 +45,6 @@ module barrierBody(length, height, thickness, base, notches = 1) { size = [length, height, thickness], center = true ); - repeatMirror(interval=[0, height, 0], axis=[0, 1, 0], center=true) { barrierNotch( thickness = thickness * 2, @@ -152,9 +151,9 @@ module archTower(length, thickness, base, wall, right = false) { wall = wall, height = holderHeight, base = base, - thickness = thickness + thickness = thickness + printTolerance, + distance = printTolerance ); - translate([0, wall / 2, holderHeight - indent]) { box([thickness, wall * 2, indent * 2]); } From 98d0fa9eddd2dc421bab61d7e86f8abd0dfa9708 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 22 Feb 2020 12:38:48 +0100 Subject: [PATCH 095/191] Update camelSCAD to v0.10.0 --- lib/camelSCAD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/camelSCAD b/lib/camelSCAD index 214f808..a748b12 160000 --- a/lib/camelSCAD +++ b/lib/camelSCAD @@ -1 +1 @@ -Subproject commit 214f808728703a36435019b5e7dfbe3939097ea1 +Subproject commit a748b124013464445893e80951b6716f2fd12b18 From 5e2c08544445db5813be10f7925e4ea8a3eb798f Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 22 Feb 2020 12:46:07 +0100 Subject: [PATCH 096/191] Fix breaking changes in render scripts --- rcmodels/tracks/render.sh | 2 +- rcmodels/whoop-box/render.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index 8640c6d..a668cb1 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -87,7 +87,7 @@ done scadcheck # render the files, if exist -scadtostlall "${srcpath}" "${dstpath}" "" \ +scadrenderall "${srcpath}" "${dstpath}" "" \ "$(varif "chunkSize" ${chunkSize})" \ "$(varif "barrierHeight" ${barrierHeight})" \ "$(varif "heightWithFasteners" ${heightWithFasteners})" diff --git a/rcmodels/whoop-box/render.sh b/rcmodels/whoop-box/render.sh index e9e2a32..43d286f 100755 --- a/rcmodels/whoop-box/render.sh +++ b/rcmodels/whoop-box/render.sh @@ -124,7 +124,7 @@ done scadcheck # render the files, if exist -scadtostlall "${srcpath}" "${dstpath}" "${whoop}" \ +scadrenderall "${srcpath}" "${dstpath}" "${whoop}" \ "whoopType=\"${whoop}\"" \ "$(vectorif "whoopCountBox" ${boxX} ${boxY})" \ "$(vectorif "whoopCountDrawer" ${drawerX} ${drawerY})" \ From df45d513d8fb7951236740b48cd94d9cbb9d3b9e Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 22 Feb 2020 15:03:39 +0100 Subject: [PATCH 097/191] Fix breaking changes in render scripts --- rcmodels/tracks/render.sh | 2 +- rcmodels/whoop-box/render.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index 62277fe..683b5ab 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -58,7 +58,7 @@ source "${scriptpath}/../../lib/camelSCAD/scripts/utils.sh" # @param right - Right oriented or left oriented renderpath() { local rightOriented=$3 - scadrenderall "$1" "$2" "" \ + scadrenderall "$1" "$2" "" "" \ "$(varif "trackSectionSize" ${trackSectionSize})" \ "$(varif "trackLaneWidth" ${trackLaneWidth})" \ "$(varif "trackRadius" ${trackRadius})" \ diff --git a/rcmodels/whoop-box/render.sh b/rcmodels/whoop-box/render.sh index 43d286f..33a4b83 100755 --- a/rcmodels/whoop-box/render.sh +++ b/rcmodels/whoop-box/render.sh @@ -124,7 +124,7 @@ done scadcheck # render the files, if exist -scadrenderall "${srcpath}" "${dstpath}" "${whoop}" \ +scadrenderall "${srcpath}" "${dstpath}" "${whoop}" "" \ "whoopType=\"${whoop}\"" \ "$(vectorif "whoopCountBox" ${boxX} ${boxY})" \ "$(vectorif "whoopCountDrawer" ${drawerX} ${drawerY})" \ From ffae1ff5ef847b2f344a0f51c27e112008b5fbe2 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 19 Feb 2020 21:28:46 +0100 Subject: [PATCH 098/191] Add barrier unibody shapes --- rcmodels/tracks/config/values.scad | 9 ++ rcmodels/tracks/shapes/curved.scad | 29 ++++ rcmodels/tracks/shapes/profiles.scad | 53 ++++++ rcmodels/tracks/shapes/straight.scad | 23 +++ rcmodels/tracks/shapes/uturn.scad | 70 ++++++++ rcmodels/tracks/test/curved.scad | 233 +++++++++++++++++---------- rcmodels/tracks/test/fragments.scad | 8 + rcmodels/tracks/test/profiles.scad | 8 + rcmodels/tracks/test/straight.scad | 8 + rcmodels/tracks/test/uturn.scad | 32 +++- 10 files changed, 388 insertions(+), 85 deletions(-) diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 73e0c5d..98bc342 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -124,6 +124,13 @@ function getBarrierHolderTopWidth(base, thickness) = nozzleAligned((getBarrierLi */ function getBarrierHolderHeight(base) = getBarrierStripHeight(base) + minThickness + printResolution; +/** + * Computes the outer width of a unibody barrier. + * @param Number base - The base unit value used to design the barrier holder. + * @returns Number + */ +function getBarrierUnibodyWidth(base) = getBarrierHolderWidth(base) + base; + /** * Computes the inner height of the barrier body, between the barrier holders. * @param Number height - The height of the barrier. @@ -279,6 +286,8 @@ module printConfig(length, width, height, radius, base) { str("Barrier base value: ", base, "mm"), str("Barrier holder width: ", getBarrierHolderWidth(base), "mm"), str("Barrier holder height: ", getBarrierHolderHeight(base), "mm"), + str("Unibody barrier width: ", getBarrierUnibodyWidth(base), "mm"), + str("Unibody barrier height:", height, "mm"), str("-- Track samples --------------"), str("Size of samples: ", sampleSize, "mm"), str("Base of samples: ", sampleBase, "mm"), diff --git a/rcmodels/tracks/shapes/curved.scad b/rcmodels/tracks/shapes/curved.scad index 3eeb8c0..528c6b0 100644 --- a/rcmodels/tracks/shapes/curved.scad +++ b/rcmodels/tracks/shapes/curved.scad @@ -161,6 +161,35 @@ module curvedBarrierMain(length, thickness, base, ratio = 1, right = false) { } } +/** + * Draws the shape of a unibody barrier for a curved track element. + * @param Number length - The length of the element. + * @param Number height - The height of the barrier. + * @param Number thickness - The thickness of the barrier body for a barrier holder. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number ratio - The ratio to apply on the radius + * @param Number right - Is the curve oriented to the right? + */ +module curvedBarrierUnibody(length, height, thickness, base, ratio = 1, right = false) { + radius = getCurveRadius(length, ratio); + angle = getCurveAngle(ratio); + linkHeight = height - getBarrierHolderHeight(base) - base; + + placeCurvedElement(length=length, radius=radius, angle=angle) { + curvedLinks(radius=radius, angle=angle, linkHeight=linkHeight, base=base, right=right) { + rotate_extrude(angle=angle, convexity=10) { + translateX(radius) { + barrierUnibodyProfile( + height = height, + base = base, + thickness = thickness + printTolerance + ); + } + } + } + } +} + /** * Draws the barrier holder for a curved track element. * @param Number length - The length of the element. diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index 6350e20..0071189 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -97,6 +97,59 @@ module barrierHolderProfile(base, thickness, distance = 0) { ]), -distance), convexity = 10); } +/** + * Draws the profile of a unibody barrier. + * @param Number height - The height of the barrier. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number thickness - The thickness of the barrier body for a barrier holder. + * @param Number [distance] - An additional distance added to the outline of the profile. + */ +module barrierUnibodyProfile(height, base, thickness, distance = 0) { + holderTopWidth = getBarrierHolderTopWidth(base, thickness); + holderWidth = getBarrierHolderWidth(base); + holderHeight = getBarrierHolderHeight(base); + holderOffset = base / 4; + holderSide = base - holderOffset; + holderOffsetWidth = holderWidth - holderOffset * 2; + holderLineX = (holderWidth - holderTopWidth) / 2 - holderOffset; + holderLineY = holderHeight - base - holderOffset; + + unibodyNeck = base / 2; + unibodyWidth = getBarrierUnibodyWidth(base); + unibodyOffsetWidth = unibodyWidth - holderOffset * 2; + unibodyLineX = (unibodyWidth - holderTopWidth) / 2 - holderOffset; + unibodyLineY = height - holderHeight - unibodyNeck - base - holderOffset; + + startX = holderTopWidth / 2; + startY = holderSide + unibodyLineY + unibodyNeck + holderOffset * 2; + + polygon(outline(path([ + ["P", -startX, startY], + // barrier holder profile + ["L", -holderOffset, holderOffset], + ["L", -holderLineX, holderLineY], + ["V", holderSide], + ["L", holderOffset, holderOffset], + ["H", holderOffsetWidth], + ["L", holderOffset, -holderOffset], + ["V", -holderSide], + ["L", -holderLineX, -holderLineY], + ["L", -holderOffset, -holderOffset], + // unibody profile + ["V", -unibodyNeck], + ["L", holderOffset, -holderOffset], + ["L", unibodyLineX, -unibodyLineY], + ["V", -holderSide], + ["L", -holderOffset, -holderOffset], + ["H", -unibodyOffsetWidth], + ["L", -holderOffset, holderOffset], + ["V", holderSide], + ["L", unibodyLineX, unibodyLineY], + ["L", holderOffset, holderOffset], + ["V", unibodyNeck] + ]), -distance), convexity = 10); +} + /** * Draws the outline of a barrier holder. * @param Number wall - The thickness of the outline. diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index e7c230b..96727cd 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -104,6 +104,29 @@ module straightBarrierMain(length, thickness, base) { } } +/** + * Draws the shape of a unibody barrier for a straight track element. + * @param Number length - The length of the element. + * @param Number height - The height of the barrier. + * @param Number thickness - The thickness of the barrier body for a barrier holder. + * @param Number base - The base unit value used to design the barrier holder. + */ +module straightBarrierUnibody(length, height, thickness, base) { + linkHeight = height - getBarrierHolderHeight(base) - base; + + straightLinks(length=length, linkHeight=linkHeight, base=base) { + rotate([90, 0, 90]) { + negativeExtrude(height=length, center=true) { + barrierUnibodyProfile( + height = height, + base = base, + thickness = thickness + printTolerance + ); + } + } + } +} + /** * Draws the barrier holder for a straight track element. * @param Number length - The length of the element. diff --git a/rcmodels/tracks/shapes/uturn.scad b/rcmodels/tracks/shapes/uturn.scad index 2d011e0..bb1949f 100644 --- a/rcmodels/tracks/shapes/uturn.scad +++ b/rcmodels/tracks/shapes/uturn.scad @@ -85,6 +85,58 @@ module uTurnBarrierHolder(length, height, thickness, base, gap, right = false) { } } +/** + * Draws the shape of a barrier unibody for a U-Turn. + * @param Number length - The length of a track element. + * @param Number height - The height of the barrier. + * @param Number thickness - The thickness of the barrier body for a barrier holder. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number gap - The distance between the two side of the u-turn. + * @param Number right - Is it the right or the left part of the track element that is added first? + */ +module uTurnBarrierUnibody(length, height, thickness, base, gap, right = false) { + interval = (getBarrierUnibodyWidth(base) + gap) / 2; + + difference() { + union() { + translateY(interval) { + rotateZ(right ? 180 : 0) { + straightBarrierUnibody( + length = length, + height = height, + thickness = thickness, + base = base + ); + } + } + translateY(-interval) { + rotateZ(right ? 0 : 180) { + straightBarrierUnibody( + length = length, + height = height, + thickness = thickness, + base = base + ); + } + } + } + translate([length, 0, -length]) { + box(length * 2); + } + } + rotateZ(270) { + rotate_extrude(angle=180, convexity=10) { + translateX(interval) { + barrierUnibodyProfile( + height = height, + base = base, + thickness = thickness + printTolerance + ); + } + } + } +} + /** * Draws the shape of a barrier border for a U-Turn. * @param Number thickness - The thickness of the barrier body. @@ -111,6 +163,24 @@ module uTurnCompensationBarrierHolder(thickness, base, gap) { } } +/** + * Draws the shape of a barrier border for a U-Turn. + * @param Number height - The height of the barrier. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number gap - The distance between the two side of the u-turn. + */ +module uTurnCompensationBarrierUnibody(height, thickness, base, gap) { + length = getBarrierHolderWidth(base) + gap; + + straightBarrierUnibody( + length = length, + height = height, + thickness = thickness, + base = base + ); +} + /** * Draws the shape of a barrier body. * @param Number length - The length of the track element. diff --git a/rcmodels/tracks/test/curved.scad b/rcmodels/tracks/test/curved.scad index bd67c89..78a5403 100644 --- a/rcmodels/tracks/test/curved.scad +++ b/rcmodels/tracks/test/curved.scad @@ -34,130 +34,197 @@ include // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=mode) { - distribute(intervalY=length * 3, center=true) { - - // test the main shape of a barrier holder for a curved track element, short curve, right turned - curvedBarrierMain( - length = length, - thickness = thickness, - base = base, - ratio = 0.5, - right = true - ); - - // test the main shape of a barrier holder for a curved track element, short curve, left turned - curvedBarrierMain( - length = length, - thickness = thickness, - base = base, - ratio = 0.5, - right = false - ); - - distributeRotate(center=true) { - - // test the main shape of a barrier holder for a curved track element, inner curve, right turned - curvedBarrierMain( - length = length, - thickness = thickness, - base = base, - ratio = getInnerCurveRatio(length, radius), - right = true - ); + distribute(intervalX=length * 3, center=true) { - // test the main shape of a barrier holder for a curved track element, outer curve, right turned - curvedBarrierMain( - length = length, - thickness = thickness, - base = base, - ratio = getOuterCurveRatio(length, width, radius), - right = true - ); + distribute(intervalY=length * 3, center=true) { - // test the main shape of a barrier holder for a curved track element, inner curve, left turned + // test the main shape of a barrier holder for a curved track element, short curve, right turned curvedBarrierMain( length = length, thickness = thickness, base = base, - ratio = getInnerCurveRatio(length, radius), - right = false + ratio = 0.5, + right = true ); - // test the main shape of a barrier holder for a curved track element, outer curve, left turned + // test the main shape of a barrier holder for a curved track element, short curve, left turned curvedBarrierMain( length = length, thickness = thickness, base = base, - ratio = getOuterCurveRatio(length, width, radius), + ratio = 0.5, right = false ); + distributeRotate(center=true) { + + // test the main shape of a barrier holder for a curved track element, inner curve, right turned + curvedBarrierMain( + length = length, + thickness = thickness, + base = base, + ratio = getInnerCurveRatio(length, radius), + right = true + ); + + // test the main shape of a barrier holder for a curved track element, outer curve, right turned + curvedBarrierMain( + length = length, + thickness = thickness, + base = base, + ratio = getOuterCurveRatio(length, width, radius), + right = true + ); + + // test the main shape of a barrier holder for a curved track element, inner curve, left turned + curvedBarrierMain( + length = length, + thickness = thickness, + base = base, + ratio = getInnerCurveRatio(length, radius), + right = false + ); + + // test the main shape of a barrier holder for a curved track element, outer curve, left turned + curvedBarrierMain( + length = length, + thickness = thickness, + base = base, + ratio = getOuterCurveRatio(length, width, radius), + right = false + ); + + } } - // test the barrier notch shape for a curved track element - curvedBarrierNotch( - radius = length, - thickness = thickness, - base = base, - distance = printTolerance - ); - - // test the barrier holder shape for a curved track element, short curve, right turned - curvedBarrierHolder( - length = length, - thickness = thickness, - base = base, - ratio = 0.5, - right = true - ); - - // test the barrier holder shape for a curved track element, short curve, left turned - curvedBarrierHolder( - length = length, - thickness = thickness, - base = base, - ratio = 0.5, - right = false - ); - - distributeRotate(center=true) { - - // test the barrier holder shape for a curved track element, inner curve, right turned + distribute(intervalY=length * 3, center=true) { + + // test the barrier holder shape for a curved track element, short curve, right turned curvedBarrierHolder( length = length, thickness = thickness, base = base, - ratio = getInnerCurveRatio(length, radius), + ratio = 0.5, right = true ); - // test the barrier holder shape for a curved track element, outer curve, right turned + // test the barrier holder shape for a curved track element, short curve, left turned curvedBarrierHolder( length = length, thickness = thickness, base = base, - ratio = getOuterCurveRatio(length, width, radius), - right = true + ratio = 0.5, + right = false ); - // test the barrier holder shape for a curved track element, inner curve, left turned - curvedBarrierHolder( + distributeRotate(center=true) { + + // test the barrier holder shape for a curved track element, inner curve, right turned + curvedBarrierHolder( + length = length, + thickness = thickness, + base = base, + ratio = getInnerCurveRatio(length, radius), + right = true + ); + + // test the barrier holder shape for a curved track element, outer curve, right turned + curvedBarrierHolder( + length = length, + thickness = thickness, + base = base, + ratio = getOuterCurveRatio(length, width, radius), + right = true + ); + + // test the barrier holder shape for a curved track element, inner curve, left turned + curvedBarrierHolder( + length = length, + thickness = thickness, + base = base, + ratio = getInnerCurveRatio(length, radius), + right = false + ); + + // test the barrier holder shape for a curved track element, outer curve, left turned + curvedBarrierHolder( + length = length, + thickness = thickness, + base = base, + ratio = getOuterCurveRatio(length, width, radius), + right = false + ); + + } + + } + + distribute(intervalY=length * 3, center=true) { + + // test the barrier unibody shape for a curved track element, short curve, right turned + curvedBarrierUnibody( length = length, + height = height, thickness = thickness, base = base, - ratio = getInnerCurveRatio(length, radius), - right = false + ratio = 0.5, + right = true ); - // test the barrier holder shape for a curved track element, outer curve, left turned - curvedBarrierHolder( + // test the barrier unibody shape for a curved track element, short curve, left turned + curvedBarrierUnibody( length = length, + height = height, thickness = thickness, base = base, - ratio = getOuterCurveRatio(length, width, radius), + ratio = 0.5, right = false ); + distributeRotate(center=true) { + + // test the barrier unibody shape for a curved track element, inner curve, right turned + curvedBarrierUnibody( + length = length, + height = height, + thickness = thickness, + base = base, + ratio = getInnerCurveRatio(length, radius), + right = true + ); + + // test the barrier unibody shape for a curved track element, outer curve, right turned + curvedBarrierUnibody( + length = length, + height = height, + thickness = thickness, + base = base, + ratio = getOuterCurveRatio(length, width, radius), + right = true + ); + + // test the barrier unibody shape for a curved track element, inner curve, left turned + curvedBarrierUnibody( + length = length, + height = height, + thickness = thickness, + base = base, + ratio = getInnerCurveRatio(length, radius), + right = false + ); + + // test the barrier unibody shape for a curved track element, outer curve, left turned + curvedBarrierUnibody( + length = length, + height = height, + thickness = thickness, + base = base, + ratio = getOuterCurveRatio(length, width, radius), + right = false + ); + + } + } } diff --git a/rcmodels/tracks/test/fragments.scad b/rcmodels/tracks/test/fragments.scad index 5e33a10..e27390d 100644 --- a/rcmodels/tracks/test/fragments.scad +++ b/rcmodels/tracks/test/fragments.scad @@ -71,5 +71,13 @@ applyMode(mode=mode) { center = true ); + // test the barrier notch shape for a curved track element + curvedBarrierNotch( + radius = length, + thickness = thickness, + base = base, + distance = printTolerance + ); + } } diff --git a/rcmodels/tracks/test/profiles.scad b/rcmodels/tracks/test/profiles.scad index 643e1c2..2aee7c6 100644 --- a/rcmodels/tracks/test/profiles.scad +++ b/rcmodels/tracks/test/profiles.scad @@ -71,5 +71,13 @@ applyMode(mode=mode) { distance = 0 ); + // test the unibody barrier profile + barrierUnibodyProfile( + height = height, + base = base, + thickness = thickness, + distance = 0 + ); + } } diff --git a/rcmodels/tracks/test/straight.scad b/rcmodels/tracks/test/straight.scad index 9837ad6..e402efd 100644 --- a/rcmodels/tracks/test/straight.scad +++ b/rcmodels/tracks/test/straight.scad @@ -87,5 +87,13 @@ applyMode(mode=mode) { right = true ); + // test the shape of the unibody barrier for a straight track element + straightBarrierUnibody( + length = length, + height = height, + thickness = thickness, + base = base + ); + } } diff --git a/rcmodels/tracks/test/uturn.scad b/rcmodels/tracks/test/uturn.scad index a29f59c..d0395b8 100644 --- a/rcmodels/tracks/test/uturn.scad +++ b/rcmodels/tracks/test/uturn.scad @@ -36,7 +36,7 @@ applyMode(mode=mode) { distribute(intervalY=length, center=true) { - // test the u-turn shape, left side + // test the u-turn holder shape, left side uTurnBarrierHolder( length = length, height = height, @@ -46,7 +46,7 @@ applyMode(mode=mode) { right = false ); - // test the u-turn shape, right side + // test the u-turn holder shape, right side uTurnBarrierHolder( length = length, height = height, @@ -56,6 +56,34 @@ applyMode(mode=mode) { right = true ); + // test the u-turn unibody shape, left side + uTurnBarrierUnibody( + length = length, + height = height, + thickness = thickness, + base = base, + gap = wall, + right = false + ); + + // test the u-turn unibody shape, right side + uTurnBarrierUnibody( + length = length, + height = height, + thickness = thickness, + base = base, + gap = wall, + right = true + ); + + // test the u-turn compensation shape + uTurnCompensationBarrierUnibody( + height = height, + thickness = thickness, + base = base, + gap = wall + ); + // test the u-turn compensation shape uTurnCompensationBarrierHolder( thickness = thickness, From d8248b4be9680f0040ec77726057d9156bc8d32f Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 19 Feb 2020 22:34:04 +0100 Subject: [PATCH 099/191] Add barrier unibody parts --- .../{led-clip.scad => cable-clip.scad} | 0 .../{accessory-flag.scad => flag.scad} | 0 .../{accessory-mast.scad => mast.scad} | 0 ...nt-curved-inner.scad => curved-inner.scad} | 0 ...nt-curved-outer.scad => curved-outer.scad} | 0 ...nt-curved-short.scad => curved-short.scad} | 0 ...nt-curved-small.scad => curved-small.scad} | 0 ...nt-curved-uturn.scad => curved-uturn.scad} | 0 ...lement-arch-tower.scad => arch-tower.scad} | 0 ...ment-curved-body.scad => body-curved.scad} | 0 ...-straight-body.scad => body-straight.scad} | 0 ...lement-uturn-body.scad => body-uturn.scad} | 0 ...aight-double.scad => straight-double.scad} | 0 ...aight-simple.scad => straight-simple.scad} | 0 ...-compensation.scad => straight-uturn.scad} | 0 ...inner-full.scad => curved-inner-full.scad} | 0 ...le-curved-inner.scad => curved-inner.scad} | 0 ...outer-full.scad => curved-outer-full.scad} | 0 ...le-curved-outer.scad => curved-outer.scad} | 0 ...le-curved-short.scad => curved-short.scad} | 0 ...le-curved-small.scad => curved-small.scad} | 0 ...le-curved-uturn.scad => curved-uturn.scad} | 0 .../{sample-arch.scad => arch-sample.scad} | 0 ...e-straight-2.scad => straight-double.scad} | 0 ...straight-10.scad => straight-long-10.scad} | 0 ...straight-20.scad => straight-long-20.scad} | 0 ...e-straight-5.scad => straight-long-5.scad} | 0 ...ple-straight.scad => straight-simple.scad} | 0 ...-compensation.scad => straight-uturn.scad} | 0 .../parts/unibody/curved/curved-inner.scad | 46 +++++++++++++++++++ .../parts/unibody/curved/curved-outer.scad | 46 +++++++++++++++++++ .../parts/unibody/curved/curved-short.scad | 46 +++++++++++++++++++ .../parts/unibody/curved/curved-small.scad | 46 +++++++++++++++++++ .../parts/unibody/curved/curved-uturn.scad | 46 +++++++++++++++++++ .../unibody/straight/straight-double.scad | 44 ++++++++++++++++++ .../unibody/straight/straight-simple.scad | 44 ++++++++++++++++++ .../unibody/straight/straight-uturn.scad | 44 ++++++++++++++++++ rcmodels/tracks/render.sh | 18 ++++++-- 38 files changed, 377 insertions(+), 3 deletions(-) rename rcmodels/tracks/parts/accessories/{led-clip.scad => cable-clip.scad} (100%) rename rcmodels/tracks/parts/accessories/{accessory-flag.scad => flag.scad} (100%) rename rcmodels/tracks/parts/accessories/{accessory-mast.scad => mast.scad} (100%) rename rcmodels/tracks/parts/elements/curved/{element-curved-inner.scad => curved-inner.scad} (100%) rename rcmodels/tracks/parts/elements/curved/{element-curved-outer.scad => curved-outer.scad} (100%) rename rcmodels/tracks/parts/elements/curved/{element-curved-short.scad => curved-short.scad} (100%) rename rcmodels/tracks/parts/elements/curved/{element-curved-small.scad => curved-small.scad} (100%) rename rcmodels/tracks/parts/elements/curved/{element-curved-uturn.scad => curved-uturn.scad} (100%) rename rcmodels/tracks/parts/elements/straight/{element-arch-tower.scad => arch-tower.scad} (100%) rename rcmodels/tracks/parts/elements/straight/{element-curved-body.scad => body-curved.scad} (100%) rename rcmodels/tracks/parts/elements/straight/{element-straight-body.scad => body-straight.scad} (100%) rename rcmodels/tracks/parts/elements/straight/{element-uturn-body.scad => body-uturn.scad} (100%) rename rcmodels/tracks/parts/elements/straight/{element-straight-double.scad => straight-double.scad} (100%) rename rcmodels/tracks/parts/elements/straight/{element-straight-simple.scad => straight-simple.scad} (100%) rename rcmodels/tracks/parts/elements/straight/{element-uturn-compensation.scad => straight-uturn.scad} (100%) rename rcmodels/tracks/parts/samples/curved/{sample-curved-inner-full.scad => curved-inner-full.scad} (100%) rename rcmodels/tracks/parts/samples/curved/{sample-curved-inner.scad => curved-inner.scad} (100%) rename rcmodels/tracks/parts/samples/curved/{sample-curved-outer-full.scad => curved-outer-full.scad} (100%) rename rcmodels/tracks/parts/samples/curved/{sample-curved-outer.scad => curved-outer.scad} (100%) rename rcmodels/tracks/parts/samples/curved/{sample-curved-short.scad => curved-short.scad} (100%) rename rcmodels/tracks/parts/samples/curved/{sample-curved-small.scad => curved-small.scad} (100%) rename rcmodels/tracks/parts/samples/curved/{sample-curved-uturn.scad => curved-uturn.scad} (100%) rename rcmodels/tracks/parts/samples/straight/{sample-arch.scad => arch-sample.scad} (100%) rename rcmodels/tracks/parts/samples/straight/{sample-straight-2.scad => straight-double.scad} (100%) rename rcmodels/tracks/parts/samples/straight/{sample-straight-10.scad => straight-long-10.scad} (100%) rename rcmodels/tracks/parts/samples/straight/{sample-straight-20.scad => straight-long-20.scad} (100%) rename rcmodels/tracks/parts/samples/straight/{sample-straight-5.scad => straight-long-5.scad} (100%) rename rcmodels/tracks/parts/samples/straight/{sample-straight.scad => straight-simple.scad} (100%) rename rcmodels/tracks/parts/samples/straight/{sample-uturn-compensation.scad => straight-uturn.scad} (100%) create mode 100644 rcmodels/tracks/parts/unibody/curved/curved-inner.scad create mode 100644 rcmodels/tracks/parts/unibody/curved/curved-outer.scad create mode 100644 rcmodels/tracks/parts/unibody/curved/curved-short.scad create mode 100644 rcmodels/tracks/parts/unibody/curved/curved-small.scad create mode 100644 rcmodels/tracks/parts/unibody/curved/curved-uturn.scad create mode 100644 rcmodels/tracks/parts/unibody/straight/straight-double.scad create mode 100644 rcmodels/tracks/parts/unibody/straight/straight-simple.scad create mode 100644 rcmodels/tracks/parts/unibody/straight/straight-uturn.scad diff --git a/rcmodels/tracks/parts/accessories/led-clip.scad b/rcmodels/tracks/parts/accessories/cable-clip.scad similarity index 100% rename from rcmodels/tracks/parts/accessories/led-clip.scad rename to rcmodels/tracks/parts/accessories/cable-clip.scad diff --git a/rcmodels/tracks/parts/accessories/accessory-flag.scad b/rcmodels/tracks/parts/accessories/flag.scad similarity index 100% rename from rcmodels/tracks/parts/accessories/accessory-flag.scad rename to rcmodels/tracks/parts/accessories/flag.scad diff --git a/rcmodels/tracks/parts/accessories/accessory-mast.scad b/rcmodels/tracks/parts/accessories/mast.scad similarity index 100% rename from rcmodels/tracks/parts/accessories/accessory-mast.scad rename to rcmodels/tracks/parts/accessories/mast.scad diff --git a/rcmodels/tracks/parts/elements/curved/element-curved-inner.scad b/rcmodels/tracks/parts/elements/curved/curved-inner.scad similarity index 100% rename from rcmodels/tracks/parts/elements/curved/element-curved-inner.scad rename to rcmodels/tracks/parts/elements/curved/curved-inner.scad diff --git a/rcmodels/tracks/parts/elements/curved/element-curved-outer.scad b/rcmodels/tracks/parts/elements/curved/curved-outer.scad similarity index 100% rename from rcmodels/tracks/parts/elements/curved/element-curved-outer.scad rename to rcmodels/tracks/parts/elements/curved/curved-outer.scad diff --git a/rcmodels/tracks/parts/elements/curved/element-curved-short.scad b/rcmodels/tracks/parts/elements/curved/curved-short.scad similarity index 100% rename from rcmodels/tracks/parts/elements/curved/element-curved-short.scad rename to rcmodels/tracks/parts/elements/curved/curved-short.scad diff --git a/rcmodels/tracks/parts/elements/curved/element-curved-small.scad b/rcmodels/tracks/parts/elements/curved/curved-small.scad similarity index 100% rename from rcmodels/tracks/parts/elements/curved/element-curved-small.scad rename to rcmodels/tracks/parts/elements/curved/curved-small.scad diff --git a/rcmodels/tracks/parts/elements/curved/element-curved-uturn.scad b/rcmodels/tracks/parts/elements/curved/curved-uturn.scad similarity index 100% rename from rcmodels/tracks/parts/elements/curved/element-curved-uturn.scad rename to rcmodels/tracks/parts/elements/curved/curved-uturn.scad diff --git a/rcmodels/tracks/parts/elements/straight/element-arch-tower.scad b/rcmodels/tracks/parts/elements/straight/arch-tower.scad similarity index 100% rename from rcmodels/tracks/parts/elements/straight/element-arch-tower.scad rename to rcmodels/tracks/parts/elements/straight/arch-tower.scad diff --git a/rcmodels/tracks/parts/elements/straight/element-curved-body.scad b/rcmodels/tracks/parts/elements/straight/body-curved.scad similarity index 100% rename from rcmodels/tracks/parts/elements/straight/element-curved-body.scad rename to rcmodels/tracks/parts/elements/straight/body-curved.scad diff --git a/rcmodels/tracks/parts/elements/straight/element-straight-body.scad b/rcmodels/tracks/parts/elements/straight/body-straight.scad similarity index 100% rename from rcmodels/tracks/parts/elements/straight/element-straight-body.scad rename to rcmodels/tracks/parts/elements/straight/body-straight.scad diff --git a/rcmodels/tracks/parts/elements/straight/element-uturn-body.scad b/rcmodels/tracks/parts/elements/straight/body-uturn.scad similarity index 100% rename from rcmodels/tracks/parts/elements/straight/element-uturn-body.scad rename to rcmodels/tracks/parts/elements/straight/body-uturn.scad diff --git a/rcmodels/tracks/parts/elements/straight/element-straight-double.scad b/rcmodels/tracks/parts/elements/straight/straight-double.scad similarity index 100% rename from rcmodels/tracks/parts/elements/straight/element-straight-double.scad rename to rcmodels/tracks/parts/elements/straight/straight-double.scad diff --git a/rcmodels/tracks/parts/elements/straight/element-straight-simple.scad b/rcmodels/tracks/parts/elements/straight/straight-simple.scad similarity index 100% rename from rcmodels/tracks/parts/elements/straight/element-straight-simple.scad rename to rcmodels/tracks/parts/elements/straight/straight-simple.scad diff --git a/rcmodels/tracks/parts/elements/straight/element-uturn-compensation.scad b/rcmodels/tracks/parts/elements/straight/straight-uturn.scad similarity index 100% rename from rcmodels/tracks/parts/elements/straight/element-uturn-compensation.scad rename to rcmodels/tracks/parts/elements/straight/straight-uturn.scad diff --git a/rcmodels/tracks/parts/samples/curved/sample-curved-inner-full.scad b/rcmodels/tracks/parts/samples/curved/curved-inner-full.scad similarity index 100% rename from rcmodels/tracks/parts/samples/curved/sample-curved-inner-full.scad rename to rcmodels/tracks/parts/samples/curved/curved-inner-full.scad diff --git a/rcmodels/tracks/parts/samples/curved/sample-curved-inner.scad b/rcmodels/tracks/parts/samples/curved/curved-inner.scad similarity index 100% rename from rcmodels/tracks/parts/samples/curved/sample-curved-inner.scad rename to rcmodels/tracks/parts/samples/curved/curved-inner.scad diff --git a/rcmodels/tracks/parts/samples/curved/sample-curved-outer-full.scad b/rcmodels/tracks/parts/samples/curved/curved-outer-full.scad similarity index 100% rename from rcmodels/tracks/parts/samples/curved/sample-curved-outer-full.scad rename to rcmodels/tracks/parts/samples/curved/curved-outer-full.scad diff --git a/rcmodels/tracks/parts/samples/curved/sample-curved-outer.scad b/rcmodels/tracks/parts/samples/curved/curved-outer.scad similarity index 100% rename from rcmodels/tracks/parts/samples/curved/sample-curved-outer.scad rename to rcmodels/tracks/parts/samples/curved/curved-outer.scad diff --git a/rcmodels/tracks/parts/samples/curved/sample-curved-short.scad b/rcmodels/tracks/parts/samples/curved/curved-short.scad similarity index 100% rename from rcmodels/tracks/parts/samples/curved/sample-curved-short.scad rename to rcmodels/tracks/parts/samples/curved/curved-short.scad diff --git a/rcmodels/tracks/parts/samples/curved/sample-curved-small.scad b/rcmodels/tracks/parts/samples/curved/curved-small.scad similarity index 100% rename from rcmodels/tracks/parts/samples/curved/sample-curved-small.scad rename to rcmodels/tracks/parts/samples/curved/curved-small.scad diff --git a/rcmodels/tracks/parts/samples/curved/sample-curved-uturn.scad b/rcmodels/tracks/parts/samples/curved/curved-uturn.scad similarity index 100% rename from rcmodels/tracks/parts/samples/curved/sample-curved-uturn.scad rename to rcmodels/tracks/parts/samples/curved/curved-uturn.scad diff --git a/rcmodels/tracks/parts/samples/straight/sample-arch.scad b/rcmodels/tracks/parts/samples/straight/arch-sample.scad similarity index 100% rename from rcmodels/tracks/parts/samples/straight/sample-arch.scad rename to rcmodels/tracks/parts/samples/straight/arch-sample.scad diff --git a/rcmodels/tracks/parts/samples/straight/sample-straight-2.scad b/rcmodels/tracks/parts/samples/straight/straight-double.scad similarity index 100% rename from rcmodels/tracks/parts/samples/straight/sample-straight-2.scad rename to rcmodels/tracks/parts/samples/straight/straight-double.scad diff --git a/rcmodels/tracks/parts/samples/straight/sample-straight-10.scad b/rcmodels/tracks/parts/samples/straight/straight-long-10.scad similarity index 100% rename from rcmodels/tracks/parts/samples/straight/sample-straight-10.scad rename to rcmodels/tracks/parts/samples/straight/straight-long-10.scad diff --git a/rcmodels/tracks/parts/samples/straight/sample-straight-20.scad b/rcmodels/tracks/parts/samples/straight/straight-long-20.scad similarity index 100% rename from rcmodels/tracks/parts/samples/straight/sample-straight-20.scad rename to rcmodels/tracks/parts/samples/straight/straight-long-20.scad diff --git a/rcmodels/tracks/parts/samples/straight/sample-straight-5.scad b/rcmodels/tracks/parts/samples/straight/straight-long-5.scad similarity index 100% rename from rcmodels/tracks/parts/samples/straight/sample-straight-5.scad rename to rcmodels/tracks/parts/samples/straight/straight-long-5.scad diff --git a/rcmodels/tracks/parts/samples/straight/sample-straight.scad b/rcmodels/tracks/parts/samples/straight/straight-simple.scad similarity index 100% rename from rcmodels/tracks/parts/samples/straight/sample-straight.scad rename to rcmodels/tracks/parts/samples/straight/straight-simple.scad diff --git a/rcmodels/tracks/parts/samples/straight/sample-uturn-compensation.scad b/rcmodels/tracks/parts/samples/straight/straight-uturn.scad similarity index 100% rename from rcmodels/tracks/parts/samples/straight/sample-uturn-compensation.scad rename to rcmodels/tracks/parts/samples/straight/straight-uturn.scad diff --git a/rcmodels/tracks/parts/unibody/curved/curved-inner.scad b/rcmodels/tracks/parts/unibody/curved/curved-inner.scad new file mode 100644 index 0000000..2a2b879 --- /dev/null +++ b/rcmodels/tracks/parts/unibody/curved/curved-inner.scad @@ -0,0 +1,46 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier unibody for an inner curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierUnibody( + length = trackSectionSize, + height = barrierHeight, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = getInnerCurveRatio(trackSectionSize, trackRadius), + right = rightOriented + ); +} diff --git a/rcmodels/tracks/parts/unibody/curved/curved-outer.scad b/rcmodels/tracks/parts/unibody/curved/curved-outer.scad new file mode 100644 index 0000000..b35f4ce --- /dev/null +++ b/rcmodels/tracks/parts/unibody/curved/curved-outer.scad @@ -0,0 +1,46 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier unibody for an outer curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierUnibody( + length = trackSectionSize, + height = barrierHeight, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth, trackRadius), + right = rightOriented + ); +} diff --git a/rcmodels/tracks/parts/unibody/curved/curved-short.scad b/rcmodels/tracks/parts/unibody/curved/curved-short.scad new file mode 100644 index 0000000..9cdd9ef --- /dev/null +++ b/rcmodels/tracks/parts/unibody/curved/curved-short.scad @@ -0,0 +1,46 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier unibody for a short curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierUnibody( + length = trackSectionSize, + height = barrierHeight, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = .5, + right = rightOriented + ); +} diff --git a/rcmodels/tracks/parts/unibody/curved/curved-small.scad b/rcmodels/tracks/parts/unibody/curved/curved-small.scad new file mode 100644 index 0000000..791d484 --- /dev/null +++ b/rcmodels/tracks/parts/unibody/curved/curved-small.scad @@ -0,0 +1,46 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier unibody for a small curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + curvedBarrierUnibody( + length = trackSectionSize, + height = barrierHeight, + thickness = barrierBodyThickness, + base = barrierHolderBase, + ratio = 1, + right = rightOriented + ); +} diff --git a/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad b/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad new file mode 100644 index 0000000..7367ec4 --- /dev/null +++ b/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad @@ -0,0 +1,46 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier unibody for a U-turn track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + uTurnBarrierUnibody( + length = trackSectionSize, + height = barrierHeight, + thickness = barrierBodyThickness, + base = barrierHolderBase, + gap = archTowerThickness * 2, + right = rightOriented + ); +} diff --git a/rcmodels/tracks/parts/unibody/straight/straight-double.scad b/rcmodels/tracks/parts/unibody/straight/straight-double.scad new file mode 100644 index 0000000..8c56477 --- /dev/null +++ b/rcmodels/tracks/parts/unibody/straight/straight-double.scad @@ -0,0 +1,44 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier unibody for a straight track part, with a double length. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + straightBarrierUnibody( + length = trackSectionSize * 2, + height = barrierHeight, + thickness = barrierBodyThickness, + base = barrierHolderBase + ); +} diff --git a/rcmodels/tracks/parts/unibody/straight/straight-simple.scad b/rcmodels/tracks/parts/unibody/straight/straight-simple.scad new file mode 100644 index 0000000..4150adc --- /dev/null +++ b/rcmodels/tracks/parts/unibody/straight/straight-simple.scad @@ -0,0 +1,44 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier unibody for a straight track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + straightBarrierUnibody( + length = trackSectionSize, + height = barrierHeight, + thickness = barrierBodyThickness, + base = barrierHolderBase + ); +} diff --git a/rcmodels/tracks/parts/unibody/straight/straight-uturn.scad b/rcmodels/tracks/parts/unibody/straight/straight-uturn.scad new file mode 100644 index 0000000..f08d1ec --- /dev/null +++ b/rcmodels/tracks/parts/unibody/straight/straight-uturn.scad @@ -0,0 +1,44 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A barrier unibody to compensate a U-turn track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + uTurnCompensationBarrierUnibody( + height = barrierHeight, + thickness = barrierBodyThickness, + base = barrierHolderBase, + gap = archTowerThickness * 2 + ); +} diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index 683b5ab..ae8a0e4 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -45,6 +45,7 @@ partpath=${srcpath}/parts showConfig= renderAccessories= renderElements= +renderUnibody= renderSamples= # include libs @@ -83,6 +84,7 @@ renderpathall() { # Display the render config showconfig() { local config="${dstpath}/config.txt" + createpath "${dstpath}" "output" printmessage "${C_MSG}Will generates the track elements with respect to the following config:" renderpath "${configpath}/print.scad" "${dstpath}" 2>&1 | sed -e '1,4d' | sed -e :a -e '$d;N;2,3ba' -e 'P;D' > "${config}" cat "${config}" @@ -99,6 +101,10 @@ while (( "$#" )); do renderElements=1 showConfig=1 ;; + "u"|"unibody") + renderUnibody=1 + showConfig=1 + ;; "s"|"samples") renderSamples=1 showConfig=1 @@ -132,7 +138,8 @@ while (( "$#" )); do echo -e "${C_CTX}\t$0 [command] [-h|--help] [-o|--option value] files${C_RST}" echo echo -e "${C_MSG} a, accessories ${C_RST}Render the accessories" - echo -e "${C_MSG} e, elements ${C_RST}Render the track elements" + echo -e "${C_MSG} e, elements ${C_RST}Render the track separated elements" + echo -e "${C_MSG} u, unibody ${C_RST}Render the track unibody elements" echo -e "${C_MSG} s, samples ${C_RST}Render the samples" echo -e "${C_MSG} c, config ${C_RST}Show the config values" echo -e "${C_MSG} -h, --help ${C_RST}Show this help" @@ -167,9 +174,10 @@ if [ "${trackSectionSize}" != "" ]; then fi # default script config -if [ "${renderAccessories}" == "" ] && [ "${renderElements}" == "" ] && [ "${renderSamples}" == "" ] && [ "${showConfig}" == "" ]; then +if [ "${renderAccessories}" == "" ] && [ "${renderElements}" == "" ] && [ "${renderUnibody}" == "" ] && [ "${renderSamples}" == "" ] && [ "${showConfig}" == "" ]; then renderAccessories=1 renderElements=1 + renderUnibody=1 renderSamples=1 showConfig=1 fi @@ -188,9 +196,13 @@ if [ "${renderAccessories}" != "" ]; then renderpath "${partpath}/accessories" "${dstpath}/accessories" fi if [ "${renderElements}" != "" ]; then - printmessage "${C_MSG}Rendering track elements" + printmessage "${C_MSG}Rendering track separated elements" renderpathall "${partpath}/elements" "${dstpath}/elements" fi +if [ "${renderUnibody}" != "" ]; then + printmessage "${C_MSG}Rendering track unibody elements" + renderpathall "${partpath}/unibody" "${dstpath}/unibody" +fi if [ "${renderSamples}" != "" ]; then printmessage "${C_MSG}Rendering track samples" renderpathall "${partpath}/samples" "${dstpath}/samples" From 017e726911d5c5bb8bdf1157f90eaa022401f7bd Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 22 Feb 2020 15:16:11 +0100 Subject: [PATCH 100/191] Add option to set the output format in the render script --- rcmodels/tracks/render.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index ae8a0e4..8ca0c82 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -42,6 +42,7 @@ srcpath=${project} dstpath=${project}/output configpath=${srcpath}/config partpath=${srcpath}/parts +format="" showConfig= renderAccessories= renderElements= @@ -55,7 +56,6 @@ source "${scriptpath}/../../lib/camelSCAD/scripts/utils.sh" # # @param sourcepath - The path of the folder containing the SCAD files to render. # @param destpath - The path to the output folder. -# @param prefix - A prefix to add to each output file. # @param right - Right oriented or left oriented renderpath() { local rightOriented=$3 @@ -132,6 +132,10 @@ while (( "$#" )); do sampleSize=$2 shift ;; + "-f"|"--format") + format=$2 + shift + ;; "-h"|"--help") echo -e "${C_INF}Renders OpenSCAD files${C_RST}" echo -e " ${C_INF}Usage:${C_RST}" @@ -148,6 +152,7 @@ while (( "$#" )); do echo -e "${C_MSG} -r --radius ${C_RST}Set the radius of the track inner curve" echo -e "${C_MSG} -t --track ${C_RST}Set the width of a track lane" echo -e "${C_MSG} -s --sample ${C_RST}Set the size of sample element" + echo -e "${C_MSG} -f --format ${C_RST}Set the output format" echo exit 0 ;; @@ -185,6 +190,9 @@ fi # check OpenSCAD scadcheck +# defines the output format +scadformat "${format}" + # show the config if [ "${showConfig}" != "" ]; then showconfig From eb300b0c80ebb3976529d3d4ce31ee43c187320b Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 23 Feb 2020 11:18:35 +0100 Subject: [PATCH 101/191] Add option to have a wavy flag, add wavy flag accessory --- .../parts/accessories/flag-straight.scad | 45 +++++++++++++++++++ .../accessories/{flag.scad => flag-wavy.scad} | 6 +-- rcmodels/tracks/shapes/accessories.scad | 14 ++++-- rcmodels/tracks/test/accessories.scad | 15 +++++-- 4 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 rcmodels/tracks/parts/accessories/flag-straight.scad rename rcmodels/tracks/parts/accessories/{flag.scad => flag-wavy.scad} (93%) diff --git a/rcmodels/tracks/parts/accessories/flag-straight.scad b/rcmodels/tracks/parts/accessories/flag-straight.scad new file mode 100644 index 0000000..8a5e0c8 --- /dev/null +++ b/rcmodels/tracks/parts/accessories/flag-straight.scad @@ -0,0 +1,45 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A straight flag to clip onto the barrier holders. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + accessoryFlag( + width = flagWidth, + height = flagHeight, + thickness = flagThickness, + mast = mastWidth, + wave = 0 + ); +} diff --git a/rcmodels/tracks/parts/accessories/flag.scad b/rcmodels/tracks/parts/accessories/flag-wavy.scad similarity index 93% rename from rcmodels/tracks/parts/accessories/flag.scad rename to rcmodels/tracks/parts/accessories/flag-wavy.scad index aeba1d9..d998fe4 100644 --- a/rcmodels/tracks/parts/accessories/flag.scad +++ b/rcmodels/tracks/parts/accessories/flag-wavy.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A flag to clip onto the barrier holders. + * A wavy flag to clip onto the barrier holders. * * @author jsconan */ @@ -39,7 +39,7 @@ applyMode(mode=renderMode) { width = flagWidth, height = flagHeight, thickness = flagThickness, - ring = mastWidth, - mast = mastWidth + mast = mastWidth, + wave = 2 ); } diff --git a/rcmodels/tracks/shapes/accessories.scad b/rcmodels/tracks/shapes/accessories.scad index db2c428..88ad67f 100644 --- a/rcmodels/tracks/shapes/accessories.scad +++ b/rcmodels/tracks/shapes/accessories.scad @@ -144,14 +144,15 @@ module accessoryMast(width, height, wall, base, thickness) { * @param Number width - The width of the flag. * @param Number height - The height of the flag. * @param Number thickness - The thickness of the flag. - * @param Number ring - The width of the rings. * @param Number mast - The width of the mast. + * @param Number wave - The height of the wave */ -module accessoryFlag(width, height, thickness, ring, mast) { +module accessoryFlag(width, height, thickness, mast, wave = 0) { distance = printResolution; ringHeight = height / 4; ringInterval = height - ringHeight; ringOffset = apothem(n=mastFacets, r=getMastRadius(mast)) + distance + thickness; + type = wave ? "S" : "V"; translateZ(ringOffset) { mastRings( @@ -164,7 +165,12 @@ module accessoryFlag(width, height, thickness, ring, mast) { center = true ); } - translateY(width / 2) { - box([height, width, thickness]); + negativeExtrude(thickness) { + polygon(path([ + ["P", height / 2, 0], + [type, width, width, wave, 0, 90], + ["H", -height], + [type, -width, width, wave, 0, 90] + ])); } } diff --git a/rcmodels/tracks/test/accessories.scad b/rcmodels/tracks/test/accessories.scad index e7d07f0..6d076cf 100644 --- a/rcmodels/tracks/test/accessories.scad +++ b/rcmodels/tracks/test/accessories.scad @@ -71,13 +71,22 @@ applyMode(mode=mode) { thickness = thickness ); - // test the accessory flag shape + // test the accessory flag shape, straight accessoryFlag( width = width, height = height, thickness = thickness, - ring = wall, - mast = base + mast = base, + wave = 0 + ); + + // test the accessory flag shape, wavy + accessoryFlag( + width = width, + height = height, + thickness = thickness, + mast = base, + wave = base ); } From 71694fe742b870e989c747b6380d9507a8912117 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 23 Feb 2020 12:45:09 +0100 Subject: [PATCH 102/191] Differenciate virtual and physical width of track lanes --- rcmodels/tracks/config/config.scad | 5 ++-- rcmodels/tracks/config/print.scad | 5 ++-- rcmodels/tracks/config/setup.scad | 5 ++-- rcmodels/tracks/config/values.scad | 29 ++++++++++++------ .../parts/elements/curved/curved-inner.scad | 4 +-- .../parts/elements/curved/curved-outer.scad | 4 +-- .../parts/elements/curved/curved-short.scad | 2 +- .../parts/elements/curved/curved-small.scad | 2 +- .../parts/elements/curved/curved-uturn.scad | 2 +- .../parts/elements/straight/arch-tower.scad | 4 +-- .../parts/elements/straight/body-curved.scad | 2 +- .../elements/straight/body-straight.scad | 2 +- .../parts/elements/straight/body-uturn.scad | 2 +- .../elements/straight/straight-double.scad | 2 +- .../elements/straight/straight-simple.scad | 2 +- .../samples/curved/curved-inner-full.scad | 2 +- .../parts/samples/curved/curved-inner.scad | 2 +- .../samples/curved/curved-outer-full.scad | 2 +- .../parts/samples/curved/curved-outer.scad | 2 +- .../parts/samples/straight/arch-sample.scad | 6 ++-- .../parts/unibody/curved/curved-inner.scad | 4 +-- .../parts/unibody/curved/curved-outer.scad | 4 +-- .../parts/unibody/curved/curved-short.scad | 2 +- .../parts/unibody/curved/curved-small.scad | 2 +- .../parts/unibody/curved/curved-uturn.scad | 2 +- .../unibody/straight/straight-double.scad | 2 +- .../unibody/straight/straight-simple.scad | 2 +- rcmodels/tracks/render.sh | 30 ++++++++++++------- rcmodels/tracks/test/setup.scad | 5 +++- 29 files changed, 83 insertions(+), 56 deletions(-) diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 8b10f26..c0321c1 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -39,8 +39,9 @@ nozzleWidth = 0.4; // The size of the print nozzle printTolerance = 0.1; // The print tolerance when pieces need to be assembled // The dimensions and constraints of a track element -trackSectionSize = 100; // The nominal size of a track element: the length for straight element, or the radius for a curved element -trackLaneWidth = 400; // The width of track lane, i.e. the distance between the barriers +trackSectionLength = 100; // The nominal length of a track element: the length for straight element, or the radius for a curved element +trackSectionWidth = 400; // The virtual width of a track lane: this will condition the outer radius for a curved element (i.e. the width used to compute the outer radius) +trackLaneWidth = 600; // The actual width of a track lane: the distance between the barriers (i.e. the width of the physical track lanes) trackRadius = 200; // The radius of the track inner curve barrierHeight = 30; // The height of the barrier, including the holders barrierHolderBase = 2; // The base unit value used to design the barrier holder diff --git a/rcmodels/tracks/config/print.scad b/rcmodels/tracks/config/print.scad index c7e4b4f..1f884d5 100644 --- a/rcmodels/tracks/config/print.scad +++ b/rcmodels/tracks/config/print.scad @@ -33,8 +33,9 @@ include // Show the values printConfig( - length = trackSectionSize, - width = trackLaneWidth, + length = trackSectionLength, + width = trackSectionWidth, + lane = trackLaneWidth, height = barrierHeight, radius = trackRadius, base = barrierHolderBase diff --git a/rcmodels/tracks/config/setup.scad b/rcmodels/tracks/config/setup.scad index c4f720d..4d1bcea 100644 --- a/rcmodels/tracks/config/setup.scad +++ b/rcmodels/tracks/config/setup.scad @@ -45,8 +45,9 @@ include <../shapes/accessories.scad> // Validate the config against the constraints validateConfig( - length = trackSectionSize, - width = trackLaneWidth, + length = trackSectionLength, + width = trackSectionWidth, + lane = trackLaneWidth, height = barrierHeight, radius = trackRadius, base = barrierHolderBase diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 98bc342..06b258a 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -184,7 +184,7 @@ function getInnerCurveRatio(length, radius) = radius / length; /** * Computes the ratio of the outer curve with respect to the track width. * @param Number length - The nominal size of a track element. - * @param Number width - The width of track lane. + * @param Number width - The width of a track lane. * @param Number radius - The radius of the track inner curve. * @returns Number */ @@ -215,12 +215,13 @@ function getMastRadius(width) = circumradius(n = mastFacets, a = width / 2); /** * Validates the config values, checking if it match the critical constraints. * @param Number length - The nominal size of a track element. - * @param Number width - The width of track lane. + * @param Number width - The virtual width of a track lane (i.e. the width used to compute the outer radius). + * @param Number lane - The actual width of a track lane (i.e. the width of the physical track lanes). * @param Number height - The height of the barrier. * @param Number radius - The radius of the track inner curve. * @param Number base - The base unit value used to design the barrier holder. */ -module validateConfig(length, width, height, radius, base) { +module validateConfig(length, width, lane, height, radius, base) { assert( length >= getMinLength(base), str( @@ -241,7 +242,11 @@ module validateConfig(length, width, height, radius, base) { ); assert( width >= length, - "The width of the track must be greater or equal than the length of one element!" + "The virtual width of the track must be greater or equal than the length of one element!" + ); + assert( + lane >= length && lane >= width, + "The actual width of the track must be greater or equal than the length of one element and than the virtual width as well!" ); assert( radius >= length, @@ -249,7 +254,11 @@ module validateConfig(length, width, height, radius, base) { ); assert( width % length == 0, - "The width of the track must be a multiple of the length of one element!" + "The virtual width of the track must be a multiple of the length of one element!" + ); + assert( + lane % length == 0, + "The actual width of the track must be a multiple of the length of one element!" ); assert( radius % length == 0, @@ -260,12 +269,13 @@ module validateConfig(length, width, height, radius, base) { /** * Prints the config values. * @param Number length - The nominal size of a track element. - * @param Number width - The width of track lane. + * @param Number width - The virtual width of a track lane (i.e. the width used to compute the outer radius). + * @param Number lane - The actual width of a track lane (i.e. the width of the physical track lanes). * @param Number height - The height of the barrier. * @param Number radius - The radius of the track inner curve. * @param Number base - The base unit value used to design the barrier holder. */ -module printConfig(length, width, height, radius, base) { +module printConfig(length, width, lane, height, radius, base) { innerCurveRatio = getInnerCurveRatio(length, radius); outerCurveRatio = getOuterCurveRatio(length, width, radius); echo(join([ @@ -274,9 +284,10 @@ module printConfig(length, width, height, radius, base) { str("Version: ", projectVersion), str("-- Track elements -------------"), str("Track section length: ", length / 10, "cm"), - str("Track lane width: ", width / 10, "cm"), - str("Track inner radius: ", radius / 10, "cm"), str("Curve section length: ", getCurveLength(length) / 10, "cm"), + str("Virtual lane width: ", width / 10, "cm"), + str("Actual lane width: ", lane / 10, "cm"), + str("Track inner radius: ", radius / 10, "cm"), str("Inner curve ratio: ", innerCurveRatio), str("Inner curve angle: ", getCurveAngle(innerCurveRatio), "°"), str("Outer curve ratio: ", outerCurveRatio), diff --git a/rcmodels/tracks/parts/elements/curved/curved-inner.scad b/rcmodels/tracks/parts/elements/curved/curved-inner.scad index ee4930e..c70fd94 100644 --- a/rcmodels/tracks/parts/elements/curved/curved-inner.scad +++ b/rcmodels/tracks/parts/elements/curved/curved-inner.scad @@ -36,10 +36,10 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) curvedBarrierHolder( - length = trackSectionSize, + length = trackSectionLength, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = getInnerCurveRatio(trackSectionSize, trackRadius), + ratio = getInnerCurveRatio(trackSectionLength, trackRadius), right = rightOriented ); } diff --git a/rcmodels/tracks/parts/elements/curved/curved-outer.scad b/rcmodels/tracks/parts/elements/curved/curved-outer.scad index e945dc4..179e367 100644 --- a/rcmodels/tracks/parts/elements/curved/curved-outer.scad +++ b/rcmodels/tracks/parts/elements/curved/curved-outer.scad @@ -36,10 +36,10 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) curvedBarrierHolder( - length = trackSectionSize, + length = trackSectionLength, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth, trackRadius), + ratio = getOuterCurveRatio(trackSectionLength, trackSectionWidth, trackRadius), right = rightOriented ); } diff --git a/rcmodels/tracks/parts/elements/curved/curved-short.scad b/rcmodels/tracks/parts/elements/curved/curved-short.scad index b56beda..04a5bd2 100644 --- a/rcmodels/tracks/parts/elements/curved/curved-short.scad +++ b/rcmodels/tracks/parts/elements/curved/curved-short.scad @@ -36,7 +36,7 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) curvedBarrierHolder( - length = trackSectionSize, + length = trackSectionLength, thickness = barrierBodyThickness, base = barrierHolderBase, ratio = .5, diff --git a/rcmodels/tracks/parts/elements/curved/curved-small.scad b/rcmodels/tracks/parts/elements/curved/curved-small.scad index 4952085..d3e5962 100644 --- a/rcmodels/tracks/parts/elements/curved/curved-small.scad +++ b/rcmodels/tracks/parts/elements/curved/curved-small.scad @@ -36,7 +36,7 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) curvedBarrierHolder( - length = trackSectionSize, + length = trackSectionLength, thickness = barrierBodyThickness, base = barrierHolderBase, ratio = 1, diff --git a/rcmodels/tracks/parts/elements/curved/curved-uturn.scad b/rcmodels/tracks/parts/elements/curved/curved-uturn.scad index d7473f7..4f8d513 100644 --- a/rcmodels/tracks/parts/elements/curved/curved-uturn.scad +++ b/rcmodels/tracks/parts/elements/curved/curved-uturn.scad @@ -36,7 +36,7 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) uTurnBarrierHolder( - length = trackSectionSize, + length = trackSectionLength, height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase, diff --git a/rcmodels/tracks/parts/elements/straight/arch-tower.scad b/rcmodels/tracks/parts/elements/straight/arch-tower.scad index 8d3f1d1..fe74e78 100644 --- a/rcmodels/tracks/parts/elements/straight/arch-tower.scad +++ b/rcmodels/tracks/parts/elements/straight/arch-tower.scad @@ -37,14 +37,14 @@ applyMode(mode=renderMode) { //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) distribute([0, getBarrierHolderWidth(barrierHolderBase) * 2, 0], center=true) { archTower( - length = trackSectionSize, + length = trackSectionLength, thickness = barrierBodyThickness, base = barrierHolderBase, wall = archTowerThickness, right = false ); archTower( - length = trackSectionSize, + length = trackSectionLength, thickness = barrierBodyThickness, base = barrierHolderBase, wall = archTowerThickness, diff --git a/rcmodels/tracks/parts/elements/straight/body-curved.scad b/rcmodels/tracks/parts/elements/straight/body-curved.scad index 5796664..ce1ba87 100644 --- a/rcmodels/tracks/parts/elements/straight/body-curved.scad +++ b/rcmodels/tracks/parts/elements/straight/body-curved.scad @@ -36,7 +36,7 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) barrierBody( - length = getCurveRemainingLength(trackSectionSize), + length = getCurveRemainingLength(trackSectionLength), height = getBarrierBodyHeight(barrierHeight), thickness = barrierBodyThickness, base = barrierHolderBase, diff --git a/rcmodels/tracks/parts/elements/straight/body-straight.scad b/rcmodels/tracks/parts/elements/straight/body-straight.scad index 074e0c7..7eed5b6 100644 --- a/rcmodels/tracks/parts/elements/straight/body-straight.scad +++ b/rcmodels/tracks/parts/elements/straight/body-straight.scad @@ -36,7 +36,7 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) barrierBody( - length = trackSectionSize, + length = trackSectionLength, height = getBarrierBodyHeight(barrierHeight), thickness = barrierBodyThickness, base = barrierHolderBase, diff --git a/rcmodels/tracks/parts/elements/straight/body-uturn.scad b/rcmodels/tracks/parts/elements/straight/body-uturn.scad index 4a742e0..99d20d6 100644 --- a/rcmodels/tracks/parts/elements/straight/body-uturn.scad +++ b/rcmodels/tracks/parts/elements/straight/body-uturn.scad @@ -36,7 +36,7 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) uTurnCompensationBarrierBody( - length = trackSectionSize, + length = trackSectionLength, height = getBarrierBodyHeight(barrierHeight), thickness = barrierBodyThickness, base = barrierHolderBase, diff --git a/rcmodels/tracks/parts/elements/straight/straight-double.scad b/rcmodels/tracks/parts/elements/straight/straight-double.scad index c09873f..04eeeb5 100644 --- a/rcmodels/tracks/parts/elements/straight/straight-double.scad +++ b/rcmodels/tracks/parts/elements/straight/straight-double.scad @@ -36,7 +36,7 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) straightBarrierHolder( - length = trackSectionSize, + length = trackSectionLength, thickness = barrierBodyThickness, base = barrierHolderBase, ratio = 2 diff --git a/rcmodels/tracks/parts/elements/straight/straight-simple.scad b/rcmodels/tracks/parts/elements/straight/straight-simple.scad index 24bd534..088d2eb 100644 --- a/rcmodels/tracks/parts/elements/straight/straight-simple.scad +++ b/rcmodels/tracks/parts/elements/straight/straight-simple.scad @@ -36,7 +36,7 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) straightBarrierHolder( - length = trackSectionSize, + length = trackSectionLength, thickness = barrierBodyThickness, base = barrierHolderBase, ratio = 1 diff --git a/rcmodels/tracks/parts/samples/curved/curved-inner-full.scad b/rcmodels/tracks/parts/samples/curved/curved-inner-full.scad index 57c2586..2589c25 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-inner-full.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-inner-full.scad @@ -36,7 +36,7 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) curvedBarrierMain( - length = sampleSize * getInnerCurveRatio(trackSectionSize, trackRadius), + length = sampleSize * getInnerCurveRatio(trackSectionLength, trackRadius), thickness = barrierBodyThickness, base = sampleBase, ratio = 1, diff --git a/rcmodels/tracks/parts/samples/curved/curved-inner.scad b/rcmodels/tracks/parts/samples/curved/curved-inner.scad index 61c89b4..653bc0c 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-inner.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-inner.scad @@ -39,7 +39,7 @@ applyMode(mode=renderMode) { length = sampleSize, thickness = barrierBodyThickness, base = sampleBase, - ratio = getInnerCurveRatio(trackSectionSize, trackRadius), + ratio = getInnerCurveRatio(trackSectionLength, trackRadius), right = rightOriented ); } diff --git a/rcmodels/tracks/parts/samples/curved/curved-outer-full.scad b/rcmodels/tracks/parts/samples/curved/curved-outer-full.scad index 1272891..43d982a 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-outer-full.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-outer-full.scad @@ -36,7 +36,7 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) curvedBarrierMain( - length = sampleSize * getOuterCurveRatio(trackSectionSize, trackLaneWidth, trackRadius), + length = sampleSize * getOuterCurveRatio(trackSectionLength, trackSectionWidth, trackRadius), thickness = barrierBodyThickness, base = sampleBase, ratio = 1, diff --git a/rcmodels/tracks/parts/samples/curved/curved-outer.scad b/rcmodels/tracks/parts/samples/curved/curved-outer.scad index c6dca8f..802f30a 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-outer.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-outer.scad @@ -39,7 +39,7 @@ applyMode(mode=renderMode) { length = sampleSize, thickness = barrierBodyThickness, base = sampleBase, - ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth, trackRadius), + ratio = getOuterCurveRatio(trackSectionLength, trackSectionWidth, trackRadius), right = rightOriented ); } diff --git a/rcmodels/tracks/parts/samples/straight/arch-sample.scad b/rcmodels/tracks/parts/samples/straight/arch-sample.scad index eadba25..58a0a76 100644 --- a/rcmodels/tracks/parts/samples/straight/arch-sample.scad +++ b/rcmodels/tracks/parts/samples/straight/arch-sample.scad @@ -32,13 +32,13 @@ include <../../../config/setup.scad> // Refine the config for the arch sample -laneWidth = trackLaneWidth / trackSectionSize * sampleSize; +laneWidth = trackLaneWidth / trackSectionLength * sampleSize; wallWidth = minWidth * 2; /** * Computes the points defining the profile of the arch sample. * @param Number length - The length of a track element. - * @param Number width - The width of track lane. + * @param Number width - The width of a track lane. * @returns Vector[] */ function getArchSamplePoints(length, width) = @@ -61,7 +61,7 @@ function getArchSamplePoints(length, width) = /** * Draws the shape of the arch sample. * @param Number length - The length of a track element. - * @param Number width - The width of track lane. + * @param Number width - The width of a track lane. * @param Number wall - The thickness of the outline. */ module archSampleProfile(length, width, wall) { diff --git a/rcmodels/tracks/parts/unibody/curved/curved-inner.scad b/rcmodels/tracks/parts/unibody/curved/curved-inner.scad index 2a2b879..40ef379 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-inner.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-inner.scad @@ -36,11 +36,11 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) curvedBarrierUnibody( - length = trackSectionSize, + length = trackSectionLength, height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = getInnerCurveRatio(trackSectionSize, trackRadius), + ratio = getInnerCurveRatio(trackSectionLength, trackRadius), right = rightOriented ); } diff --git a/rcmodels/tracks/parts/unibody/curved/curved-outer.scad b/rcmodels/tracks/parts/unibody/curved/curved-outer.scad index b35f4ce..d36cd23 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-outer.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-outer.scad @@ -36,11 +36,11 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) curvedBarrierUnibody( - length = trackSectionSize, + length = trackSectionLength, height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = getOuterCurveRatio(trackSectionSize, trackLaneWidth, trackRadius), + ratio = getOuterCurveRatio(trackSectionLength, trackSectionWidth, trackRadius), right = rightOriented ); } diff --git a/rcmodels/tracks/parts/unibody/curved/curved-short.scad b/rcmodels/tracks/parts/unibody/curved/curved-short.scad index 9cdd9ef..5279c99 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-short.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-short.scad @@ -36,7 +36,7 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) curvedBarrierUnibody( - length = trackSectionSize, + length = trackSectionLength, height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase, diff --git a/rcmodels/tracks/parts/unibody/curved/curved-small.scad b/rcmodels/tracks/parts/unibody/curved/curved-small.scad index 791d484..908c576 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-small.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-small.scad @@ -36,7 +36,7 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) curvedBarrierUnibody( - length = trackSectionSize, + length = trackSectionLength, height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase, diff --git a/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad b/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad index 7367ec4..af4258e 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad @@ -36,7 +36,7 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) uTurnBarrierUnibody( - length = trackSectionSize, + length = trackSectionLength, height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase, diff --git a/rcmodels/tracks/parts/unibody/straight/straight-double.scad b/rcmodels/tracks/parts/unibody/straight/straight-double.scad index 8c56477..965480a 100644 --- a/rcmodels/tracks/parts/unibody/straight/straight-double.scad +++ b/rcmodels/tracks/parts/unibody/straight/straight-double.scad @@ -36,7 +36,7 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) straightBarrierUnibody( - length = trackSectionSize * 2, + length = trackSectionLength * 2, height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase diff --git a/rcmodels/tracks/parts/unibody/straight/straight-simple.scad b/rcmodels/tracks/parts/unibody/straight/straight-simple.scad index 4150adc..17a9ee1 100644 --- a/rcmodels/tracks/parts/unibody/straight/straight-simple.scad +++ b/rcmodels/tracks/parts/unibody/straight/straight-simple.scad @@ -36,7 +36,7 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) straightBarrierUnibody( - length = trackSectionSize, + length = trackSectionLength, height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index 8ca0c82..bea9a7b 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -29,7 +29,8 @@ # # application params -trackSectionSize= +trackSectionLength= +trackSectionWidth= trackLaneWidth= trackRadius= barrierHeight= @@ -60,7 +61,8 @@ source "${scriptpath}/../../lib/camelSCAD/scripts/utils.sh" renderpath() { local rightOriented=$3 scadrenderall "$1" "$2" "" "" \ - "$(varif "trackSectionSize" ${trackSectionSize})" \ + "$(varif "trackSectionLength" ${trackSectionLength})" \ + "$(varif "trackSectionWidth" ${trackSectionWidth})" \ "$(varif "trackLaneWidth" ${trackLaneWidth})" \ "$(varif "trackRadius" ${trackRadius})" \ "$(varif "barrierHeight" ${barrierHeight})" \ @@ -113,10 +115,14 @@ while (( "$#" )); do showConfig=1 ;; "-l"|"--length") - trackSectionSize=$2 + trackSectionLength=$2 shift ;; - "-w"|"--height") + "-w"|"--width") + trackSectionWidth=$2 + shift + ;; + "-b"|"--height") barrierHeight=$2 shift ;; @@ -147,10 +153,11 @@ while (( "$#" )); do echo -e "${C_MSG} s, samples ${C_RST}Render the samples" echo -e "${C_MSG} c, config ${C_RST}Show the config values" echo -e "${C_MSG} -h, --help ${C_RST}Show this help" - echo -e "${C_MSG} -l, --length ${C_RST}Set the size of a track section" - echo -e "${C_MSG} -w --height ${C_RST}Set the height of the track barrier" + echo -e "${C_MSG} -l, --length ${C_RST}Set the length of a track section" + echo -e "${C_MSG} -w, --width ${C_RST}Set the virtual width of a track lane (used to compute the radius)" + echo -e "${C_MSG} -t --track ${C_RST}Set the actual width of a track lane (physical width, used for the arches)" + echo -e "${C_MSG} -b --height ${C_RST}Set the height of the track barrier" echo -e "${C_MSG} -r --radius ${C_RST}Set the radius of the track inner curve" - echo -e "${C_MSG} -t --track ${C_RST}Set the width of a track lane" echo -e "${C_MSG} -s --sample ${C_RST}Set the size of sample element" echo -e "${C_MSG} -f --format ${C_RST}Set the output format" echo @@ -169,12 +176,15 @@ while (( "$#" )); do done # allign values -if [ "${trackSectionSize}" != "" ]; then +if [ "${trackSectionLength}" != "" ]; then + if [ "${trackSectionWidth}" == "" ]; then + trackSectionWidth=$((${trackSectionLength} * 2)) + fi if [ "${trackLaneWidth}" == "" ]; then - trackLaneWidth=$((${trackSectionSize} * 2)) + trackLaneWidth=$((${trackSectionLength} * 3)) fi if [ "${trackRadius}" == "" ]; then - trackRadius=${trackSectionSize} + trackRadius=${trackSectionLength} fi fi diff --git a/rcmodels/tracks/test/setup.scad b/rcmodels/tracks/test/setup.scad index 3038fb7..27bd1ad 100644 --- a/rcmodels/tracks/test/setup.scad +++ b/rcmodels/tracks/test/setup.scad @@ -34,7 +34,8 @@ include <../config/setup.scad> // Defines the test config mode = MODE_DEV; // The render quality to apply length = 50; // The nominal size of a track element -width = 50; // The width of track lane +width = 50; // The virtual width of a track lane +lane = 100; // The actual width of a track lane radius = 50; // The radius of the track inner curve height = 30; // The height of the barrier, including the holders base = 2; // The base unit value used to design the barrier holder @@ -46,6 +47,7 @@ clip = 2; // The thickness of the cable clips validateConfig( length = length, width = width, + lane = lane, height = height, radius = radius, base = base @@ -55,6 +57,7 @@ validateConfig( printConfig( length = length, width = width, + lane = lane, height = height, radius = radius, base = base From b0e0b30cf1d3f7b5d94ff054107423330323ef2a Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 23 Feb 2020 12:46:07 +0100 Subject: [PATCH 103/191] Bump version --- rcmodels/tracks/config/config.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index c0321c1..c2b79c1 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -28,7 +28,7 @@ * @author jsconan */ - projectVersion = "0.2.0"; + projectVersion = "0.3.0"; // We will render the object using the specifications of this mode renderMode = MODE_PROD; From 9dfd274ea039fe29af84bae3ca11250d3c7f91ff Mon Sep 17 00:00:00 2001 From: jsconan Date: Mon, 24 Feb 2020 18:21:24 +0100 Subject: [PATCH 104/191] Move arch towers into a dedicated file --- rcmodels/tracks/config/setup.scad | 1 + rcmodels/tracks/shapes/special.scad | 69 ++++++++++++++++++++++++++++ rcmodels/tracks/shapes/straight.scad | 40 ---------------- rcmodels/tracks/test/special.scad | 58 +++++++++++++++++++++++ rcmodels/tracks/test/straight.scad | 18 -------- 5 files changed, 128 insertions(+), 58 deletions(-) create mode 100644 rcmodels/tracks/shapes/special.scad create mode 100644 rcmodels/tracks/test/special.scad diff --git a/rcmodels/tracks/config/setup.scad b/rcmodels/tracks/config/setup.scad index 4d1bcea..6389d6c 100644 --- a/rcmodels/tracks/config/setup.scad +++ b/rcmodels/tracks/config/setup.scad @@ -41,6 +41,7 @@ include <../shapes/fragments.scad> include <../shapes/straight.scad> include <../shapes/curved.scad> include <../shapes/uturn.scad> +include <../shapes/special.scad> include <../shapes/accessories.scad> // Validate the config against the constraints diff --git a/rcmodels/tracks/shapes/special.scad b/rcmodels/tracks/shapes/special.scad new file mode 100644 index 0000000..4ca7441 --- /dev/null +++ b/rcmodels/tracks/shapes/special.scad @@ -0,0 +1,69 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * Defines some special track parts. + * + * @author jsconan + */ + +/** + * Draws the shape of an arch tower that will clamp a barrier border. + * @param Number length - The length of a track element. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number wall - The thickness of the outline. + * @param Number right - Is it the right or the left part of the track element that is added to the tower? + */ +module archTower(length, thickness, base, wall, right = false) { + holderHeight = getBarrierHolderHeight(base); + indent = getBarrierStripIndent(base); + + rotateZ(-90) { + difference() { + clip( + wall = wall, + height = holderHeight, + base = base, + thickness = thickness + printTolerance, + distance = printTolerance + ); + translate([0, wall / 2, holderHeight - indent]) { + box([thickness, wall * 2, indent * 2]); + } + } + } + difference() { + rotateZ(right ? 180 : 0) { + straightBarrierHolder( + length = length, + thickness = thickness, + base = base + ); + } + translate([length, 0, -length] / 2) { + box(length); + } + } +} diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 96727cd..2d84bdd 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -155,43 +155,3 @@ module straightBarrierHolder(length, thickness, base, ratio = 1) { } } } - -/** - * Draws the shape of an arch tower that will clamp a barrier border. - * @param Number length - The length of a track element. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number wall - The thickness of the outline. - * @param Number right - Is it the right or the left part of the track element that is added to the tower? - */ -module archTower(length, thickness, base, wall, right = false) { - holderHeight = getBarrierHolderHeight(base); - indent = getBarrierStripIndent(base); - - rotateZ(-90) { - difference() { - clip( - wall = wall, - height = holderHeight, - base = base, - thickness = thickness + printTolerance, - distance = printTolerance - ); - translate([0, wall / 2, holderHeight - indent]) { - box([thickness, wall * 2, indent * 2]); - } - } - } - difference() { - rotateZ(right ? 180 : 0) { - straightBarrierHolder( - length = length, - thickness = thickness, - base = base - ); - } - translate([length, 0, -length] / 2) { - box(length); - } - } -} diff --git a/rcmodels/tracks/test/special.scad b/rcmodels/tracks/test/special.scad new file mode 100644 index 0000000..e6cc097 --- /dev/null +++ b/rcmodels/tracks/test/special.scad @@ -0,0 +1,58 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * Test the special elements shapes. + * + * @author jsconan + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=mode) { + + distributeGrid(intervalX=[length * 1.5, 0, 0], intervalY=[0, height * 1.5, 0], line=3, center=true) { + + // test the arch tower shape with holders, left side + archTower( + length = length, + thickness = thickness, + base = base, + wall = wall * 2, + right = false + ); + + // test the arch tower shape with holders, right side + archTower( + length = length, + thickness = thickness, + base = base, + wall = wall * 2, + right = true + ); + + } +} diff --git a/rcmodels/tracks/test/straight.scad b/rcmodels/tracks/test/straight.scad index e402efd..bf9ee3d 100644 --- a/rcmodels/tracks/test/straight.scad +++ b/rcmodels/tracks/test/straight.scad @@ -69,24 +69,6 @@ applyMode(mode=mode) { ratio = 1 ); - // test the arch tower shape with holders, left side - archTower( - length = length, - thickness = thickness, - base = base, - wall = wall * 2, - right = false - ); - - // test the arch tower shape with holders, right side - archTower( - length = length, - thickness = thickness, - base = base, - wall = wall * 2, - right = true - ); - // test the shape of the unibody barrier for a straight track element straightBarrierUnibody( length = length, From ad5c531a20c0c3d0dd1b91ffe373f0450c8fff9c Mon Sep 17 00:00:00 2001 From: jsconan Date: Mon, 24 Feb 2020 19:18:23 +0100 Subject: [PATCH 105/191] Split down the shapes for better modularity --- rcmodels/tracks/shapes/curved.scad | 61 +++++++++++++----------- rcmodels/tracks/shapes/straight.scad | 70 ++++++++++++++++++++-------- rcmodels/tracks/test/curved.scad | 36 +++++++------- rcmodels/tracks/test/straight.scad | 10 ++-- 4 files changed, 109 insertions(+), 68 deletions(-) diff --git a/rcmodels/tracks/shapes/curved.scad b/rcmodels/tracks/shapes/curved.scad index 528c6b0..d4027e1 100644 --- a/rcmodels/tracks/shapes/curved.scad +++ b/rcmodels/tracks/shapes/curved.scad @@ -29,7 +29,7 @@ */ /** - * Draws the shape of a barrier holder notch for a curved track element. + * Draws the notch shape of a curved barrier holder. * @param Number radius - The radius of the curve. * @param Number thickness - The thickness of the shape. * @param Number base - The base unit value used to design the barrier holder. @@ -103,14 +103,14 @@ module placeCurvedElement(length, radius, angle, z = 0) { */ module curvedLinks(radius, angle, linkHeight, base, right = false) { remainingAngle = curveAngle - angle; - outerLinkDirection = right ? 180 : 0; - outerLinkPosition = right ? 270 : -remainingAngle; - innerLinkDirection = right ? 90 : -90; - innerLinkPosition = right ? 90 - remainingAngle : 0; + maleLinkDirection = right ? 180 : 0; + maleLinkPosition = right ? 270 : -remainingAngle; + femaleLinkDirection = right ? 90 : -90; + femaleLinkPosition = right ? 90 - remainingAngle : 0; - rotateZ(outerLinkPosition) { + rotateZ(maleLinkPosition) { translateY(radius) { - rotateZ(outerLinkDirection) { + rotateZ(maleLinkDirection) { barrierLink( height = linkHeight - printResolution, base = base @@ -120,9 +120,9 @@ module curvedLinks(radius, angle, linkHeight, base, right = false) { } difference() { children(); - rotateZ(innerLinkPosition) { + rotateZ(femaleLinkPosition) { translate([radius, 0, -1]) { - rotateZ(innerLinkDirection) { + rotateZ(femaleLinkDirection) { barrierLink( height = linkHeight + printResolution + 1, base = base, @@ -135,7 +135,20 @@ module curvedLinks(radius, angle, linkHeight, base, right = false) { } /** - * Draws the main shape of a barrier holder for a curved track element. + * Extrudes the profile on the expected circle path. + * @param Number radius - The radius of the curve. + * @param Number angle - The extrusion angle. + */ +module extrudeCurvedProfile(radius, angle) { + rotate_extrude(angle=angle, convexity=10) { + translateX(radius) { + children(); + } + } +} + +/** + * Draws the main shape of a curved barrier holder. * @param Number length - The length of the element. * @param Number thickness - The thickness of the barrier body. * @param Number base - The base unit value used to design the barrier holder. @@ -149,20 +162,18 @@ module curvedBarrierMain(length, thickness, base, ratio = 1, right = false) { placeCurvedElement(length=length, radius=radius, angle=angle) { curvedLinks(radius=radius, angle=angle, linkHeight=linkHeight, base=base, right=right) { - rotate_extrude(angle=angle, convexity=10) { - translateX(radius) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - } + extrudeCurvedProfile(radius=radius, angle=angle) { + barrierHolderProfile( + base = base, + thickness = thickness + ); } } } } /** - * Draws the shape of a unibody barrier for a curved track element. + * Draws the shape of a curved unibody barrier. * @param Number length - The length of the element. * @param Number height - The height of the barrier. * @param Number thickness - The thickness of the barrier body for a barrier holder. @@ -177,14 +188,12 @@ module curvedBarrierUnibody(length, height, thickness, base, ratio = 1, right = placeCurvedElement(length=length, radius=radius, angle=angle) { curvedLinks(radius=radius, angle=angle, linkHeight=linkHeight, base=base, right=right) { - rotate_extrude(angle=angle, convexity=10) { - translateX(radius) { - barrierUnibodyProfile( - height = height, - base = base, - thickness = thickness + printTolerance - ); - } + extrudeCurvedProfile(radius=radius, angle=angle) { + barrierUnibodyProfile( + height = height, + base = base, + thickness = thickness + printTolerance + ); } } } diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 2d84bdd..0db0574 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -59,18 +59,28 @@ module barrierBody(length, height, thickness, base, notches = 1) { } /** - * Adds the links to a straight element. + * Adds the male link to a straight element. * @param Number length - The length of the element. * @param Number linkHeight - The height of the link. * @param Number base - The base unit value used to design the barrier holder. */ -module straightLinks(length, linkHeight, base) { +module straightLinkMale(length, linkHeight, base) { translateX(-length / 2) { barrierLink( height = linkHeight - printResolution, base = base ); } + children(); +} + +/** + * Adds the female link to a straight element. + * @param Number length - The length of the element. + * @param Number linkHeight - The height of the link. + * @param Number base - The base unit value used to design the barrier holder. + */ +module straightLinkFemale(length, linkHeight, base) { difference() { children(); translate([length / 2, 0, -1]) { @@ -84,7 +94,33 @@ module straightLinks(length, linkHeight, base) { } /** - * Draws the main shape of a barrier holder for a straight track element. + * Adds the links to a straight element. + * @param Number length - The length of the element. + * @param Number linkHeight - The height of the link. + * @param Number base - The base unit value used to design the barrier holder. + */ +module straightLinks(length, linkHeight, base) { + straightLinkMale(length=length, linkHeight=linkHeight, base=base) { + straightLinkFemale(length=length, linkHeight=linkHeight, base=base) { + children(); + } + } +} + +/** + * Extrudes the profile on the expected linear length. + * @param Number length - The length of the element. + */ +module extrudeStraightProfile(length) { + rotate([90, 0, 90]) { + negativeExtrude(height=length, center=true) { + children(); + } + } +} + +/** + * Draws the main shape of a straight barrier holder. * @param Number length - The length of the element. * @param Number thickness - The thickness of the barrier body. * @param Number base - The base unit value used to design the barrier holder. @@ -93,19 +129,17 @@ module straightBarrierMain(length, thickness, base) { linkHeight = getBarrierHolderHeight(base) - base; straightLinks(length=length, linkHeight=linkHeight, base=base) { - rotate([90, 0, 90]) { - negativeExtrude(height=length, center=true) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - } + extrudeStraightProfile(length=length) { + barrierHolderProfile( + base = base, + thickness = thickness + ); } } } /** - * Draws the shape of a unibody barrier for a straight track element. + * Draws the shape of a straight unibody barrier. * @param Number length - The length of the element. * @param Number height - The height of the barrier. * @param Number thickness - The thickness of the barrier body for a barrier holder. @@ -115,14 +149,12 @@ module straightBarrierUnibody(length, height, thickness, base) { linkHeight = height - getBarrierHolderHeight(base) - base; straightLinks(length=length, linkHeight=linkHeight, base=base) { - rotate([90, 0, 90]) { - negativeExtrude(height=length, center=true) { - barrierUnibodyProfile( - height = height, - base = base, - thickness = thickness + printTolerance - ); - } + extrudeStraightProfile(length=length) { + barrierUnibodyProfile( + height = height, + base = base, + thickness = thickness + printTolerance + ); } } } diff --git a/rcmodels/tracks/test/curved.scad b/rcmodels/tracks/test/curved.scad index 78a5403..965008e 100644 --- a/rcmodels/tracks/test/curved.scad +++ b/rcmodels/tracks/test/curved.scad @@ -38,7 +38,7 @@ applyMode(mode=mode) { distribute(intervalY=length * 3, center=true) { - // test the main shape of a barrier holder for a curved track element, short curve, right turned + // test the main shape of a curved barrier holder, short curve, right turned curvedBarrierMain( length = length, thickness = thickness, @@ -47,7 +47,7 @@ applyMode(mode=mode) { right = true ); - // test the main shape of a barrier holder for a curved track element, short curve, left turned + // test the main shape of a curved barrier holder, short curve, left turned curvedBarrierMain( length = length, thickness = thickness, @@ -58,7 +58,7 @@ applyMode(mode=mode) { distributeRotate(center=true) { - // test the main shape of a barrier holder for a curved track element, inner curve, right turned + // test the main shape of a curved barrier holder, inner curve, right turned curvedBarrierMain( length = length, thickness = thickness, @@ -67,7 +67,7 @@ applyMode(mode=mode) { right = true ); - // test the main shape of a barrier holder for a curved track element, outer curve, right turned + // test the main shape of a curved barrier holder, outer curve, right turned curvedBarrierMain( length = length, thickness = thickness, @@ -76,7 +76,7 @@ applyMode(mode=mode) { right = true ); - // test the main shape of a barrier holder for a curved track element, inner curve, left turned + // test the main shape of a curved barrier holder, inner curve, left turned curvedBarrierMain( length = length, thickness = thickness, @@ -85,7 +85,7 @@ applyMode(mode=mode) { right = false ); - // test the main shape of a barrier holder for a curved track element, outer curve, left turned + // test the main shape of a curved barrier holder, outer curve, left turned curvedBarrierMain( length = length, thickness = thickness, @@ -99,7 +99,7 @@ applyMode(mode=mode) { distribute(intervalY=length * 3, center=true) { - // test the barrier holder shape for a curved track element, short curve, right turned + // test the shape of the curved barrier holder, short curve, right turned curvedBarrierHolder( length = length, thickness = thickness, @@ -108,7 +108,7 @@ applyMode(mode=mode) { right = true ); - // test the barrier holder shape for a curved track element, short curve, left turned + // test the shape of the curved barrier holder, short curve, left turned curvedBarrierHolder( length = length, thickness = thickness, @@ -119,7 +119,7 @@ applyMode(mode=mode) { distributeRotate(center=true) { - // test the barrier holder shape for a curved track element, inner curve, right turned + // test the shape of the curved barrier holder, inner curve, right turned curvedBarrierHolder( length = length, thickness = thickness, @@ -128,7 +128,7 @@ applyMode(mode=mode) { right = true ); - // test the barrier holder shape for a curved track element, outer curve, right turned + // test the shape of the curved barrier holder, outer curve, right turned curvedBarrierHolder( length = length, thickness = thickness, @@ -137,7 +137,7 @@ applyMode(mode=mode) { right = true ); - // test the barrier holder shape for a curved track element, inner curve, left turned + // test the shape of the curved barrier holder, inner curve, left turned curvedBarrierHolder( length = length, thickness = thickness, @@ -146,7 +146,7 @@ applyMode(mode=mode) { right = false ); - // test the barrier holder shape for a curved track element, outer curve, left turned + // test the shape of the curved barrier holder, outer curve, left turned curvedBarrierHolder( length = length, thickness = thickness, @@ -161,7 +161,7 @@ applyMode(mode=mode) { distribute(intervalY=length * 3, center=true) { - // test the barrier unibody shape for a curved track element, short curve, right turned + // test the shape of a curved unibody barrier, short curve, right turned curvedBarrierUnibody( length = length, height = height, @@ -171,7 +171,7 @@ applyMode(mode=mode) { right = true ); - // test the barrier unibody shape for a curved track element, short curve, left turned + // test the shape of a curved unibody barrier, short curve, left turned curvedBarrierUnibody( length = length, height = height, @@ -183,7 +183,7 @@ applyMode(mode=mode) { distributeRotate(center=true) { - // test the barrier unibody shape for a curved track element, inner curve, right turned + // test the shape of a curved unibody barrier, inner curve, right turned curvedBarrierUnibody( length = length, height = height, @@ -193,7 +193,7 @@ applyMode(mode=mode) { right = true ); - // test the barrier unibody shape for a curved track element, outer curve, right turned + // test the shape of a curved unibody barrier, outer curve, right turned curvedBarrierUnibody( length = length, height = height, @@ -203,7 +203,7 @@ applyMode(mode=mode) { right = true ); - // test the barrier unibody shape for a curved track element, inner curve, left turned + // test the shape of a curved unibody barrier, inner curve, left turned curvedBarrierUnibody( length = length, height = height, @@ -213,7 +213,7 @@ applyMode(mode=mode) { right = false ); - // test the barrier unibody shape for a curved track element, outer curve, left turned + // test the shape of a curved unibody barrier, outer curve, left turned curvedBarrierUnibody( length = length, height = height, diff --git a/rcmodels/tracks/test/straight.scad b/rcmodels/tracks/test/straight.scad index bf9ee3d..e43950b 100644 --- a/rcmodels/tracks/test/straight.scad +++ b/rcmodels/tracks/test/straight.scad @@ -36,7 +36,7 @@ applyMode(mode=mode) { distributeGrid(intervalX=[length * 1.5, 0, 0], intervalY=[0, height * 1.5, 0], line=3, center=true) { - // test the barrier body shape + // test the shape of a barrier body barrierBody( length = length, height = height, @@ -45,14 +45,14 @@ applyMode(mode=mode) { notches = 2 ); - // test the main shape of the barrier holder for a straight track element + // test the main shape of a straight barrier holder straightBarrierMain( length = length, thickness = thickness, base = base ); - // test the barrier body shape for the remaing of a curve + // test the shape of a barrier body for the remaing of a curve barrierBody( length = getCurveRemainingLength(length), height = height, @@ -61,7 +61,7 @@ applyMode(mode=mode) { notches = 1 ); - // test the barrier holder shape for a straight track element + // test the shape of a straight barrier holder straightBarrierHolder( length = length, thickness = thickness, @@ -69,7 +69,7 @@ applyMode(mode=mode) { ratio = 1 ); - // test the shape of the unibody barrier for a straight track element + // test the shape of a straight unibody barrier straightBarrierUnibody( length = length, height = height, From 4a3aebbf0a5ca4a0096c0e04e48b05a36e19f7a9 Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 25 Feb 2020 20:43:48 +0100 Subject: [PATCH 106/191] Add functions to compute the height of the barrier link --- rcmodels/tracks/config/values.scad | 16 ++++++++++++++++ rcmodels/tracks/shapes/curved.scad | 6 +++--- rcmodels/tracks/shapes/straight.scad | 4 ++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 06b258a..4a8bd87 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -124,6 +124,13 @@ function getBarrierHolderTopWidth(base, thickness) = nozzleAligned((getBarrierLi */ function getBarrierHolderHeight(base) = getBarrierStripHeight(base) + minThickness + printResolution; +/** + * Computes the height of the link for a barrier holder. + * @param Number base - The base unit value used to design the barrier holder. + * @returns Number + */ +function getBarrierHolderLinkHeight(base) = getBarrierHolderHeight(base) - base; + /** * Computes the outer width of a unibody barrier. * @param Number base - The base unit value used to design the barrier holder. @@ -131,9 +138,18 @@ function getBarrierHolderHeight(base) = getBarrierStripHeight(base) + minThickne */ function getBarrierUnibodyWidth(base) = getBarrierHolderWidth(base) + base; +/** + * Computes the height of the link for a unibody barrier. + * @param Number height - The height of the barrier. + * @param Number base - The base unit value used to design the barrier holder. + * @returns Number + */ +function getBarrierUnibodyLinkHeight(height, base) = height - getBarrierHolderLinkHeight(base); + /** * Computes the inner height of the barrier body, between the barrier holders. * @param Number height - The height of the barrier. + * @param Number base - The base unit value used to design the barrier holder. * @returns Number */ function getBarrierBodyInnerHeight(height, base) = height - (getBarrierStripHeight(base) + minThickness) * 2; diff --git a/rcmodels/tracks/shapes/curved.scad b/rcmodels/tracks/shapes/curved.scad index d4027e1..950d8d5 100644 --- a/rcmodels/tracks/shapes/curved.scad +++ b/rcmodels/tracks/shapes/curved.scad @@ -158,7 +158,7 @@ module extrudeCurvedProfile(radius, angle) { module curvedBarrierMain(length, thickness, base, ratio = 1, right = false) { radius = getCurveRadius(length, ratio); angle = getCurveAngle(ratio); - linkHeight = getBarrierHolderHeight(base) - base; + linkHeight = getBarrierHolderLinkHeight(base); placeCurvedElement(length=length, radius=radius, angle=angle) { curvedLinks(radius=radius, angle=angle, linkHeight=linkHeight, base=base, right=right) { @@ -184,7 +184,7 @@ module curvedBarrierMain(length, thickness, base, ratio = 1, right = false) { module curvedBarrierUnibody(length, height, thickness, base, ratio = 1, right = false) { radius = getCurveRadius(length, ratio); angle = getCurveAngle(ratio); - linkHeight = height - getBarrierHolderHeight(base) - base; + linkHeight = getBarrierUnibodyLinkHeight(height, base); placeCurvedElement(length=length, radius=radius, angle=angle) { curvedLinks(radius=radius, angle=angle, linkHeight=linkHeight, base=base, right=right) { @@ -210,7 +210,7 @@ module curvedBarrierUnibody(length, height, thickness, base, ratio = 1, right = module curvedBarrierHolder(length, thickness, base, ratio = 1, right = false) { radius = getCurveRadius(length, ratio); angle = getCurveAngle(ratio); - linkHeight = getBarrierHolderHeight(base) - base; + linkHeight = getBarrierHolderLinkHeight(base); thickness = thickness + printTolerance; difference() { diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 0db0574..3f27eba 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -126,7 +126,7 @@ module extrudeStraightProfile(length) { * @param Number base - The base unit value used to design the barrier holder. */ module straightBarrierMain(length, thickness, base) { - linkHeight = getBarrierHolderHeight(base) - base; + linkHeight = getBarrierHolderLinkHeight(base); straightLinks(length=length, linkHeight=linkHeight, base=base) { extrudeStraightProfile(length=length) { @@ -146,7 +146,7 @@ module straightBarrierMain(length, thickness, base) { * @param Number base - The base unit value used to design the barrier holder. */ module straightBarrierUnibody(length, height, thickness, base) { - linkHeight = height - getBarrierHolderHeight(base) - base; + linkHeight = getBarrierUnibodyLinkHeight(height, base); straightLinks(length=length, linkHeight=linkHeight, base=base) { extrudeStraightProfile(length=length) { From fb6862e3b3026e45b7f4cbcc7369af38546dcf77 Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 25 Feb 2020 21:08:37 +0100 Subject: [PATCH 107/191] Split down again the shapes for better modularity --- rcmodels/tracks/shapes/fragments.scad | 21 +++++++++++++++++++++ rcmodels/tracks/shapes/straight.scad | 10 +--------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/rcmodels/tracks/shapes/fragments.scad b/rcmodels/tracks/shapes/fragments.scad index add116a..2516b83 100644 --- a/rcmodels/tracks/shapes/fragments.scad +++ b/rcmodels/tracks/shapes/fragments.scad @@ -93,6 +93,27 @@ module barrierNotchNegative(length, thickness, base, notches = 2) { } } +/** + * Carves the barrier notch in the child shape. + * @param Number length - The length of the element. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number [notches] - The number of notches. + */ +module carveBarrierNotch(length, thickness, base, notches = 2) { + difference() { + children(); + translateZ(minThickness) { + barrierNotchNegative( + length = length, + thickness = thickness, + base = base, + notches = notches + ); + } + } +} + /** * Draws the shape of a clip. * @param Number wall - The thickness of the clip lines. diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 3f27eba..aec5e54 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -171,19 +171,11 @@ module straightBarrierHolder(length, thickness, base, ratio = 1) { length = length * ratio; notches = ratio * 2; - difference() { + carveBarrierNotch(length=length, thickness=thickness, base=base, notches=notches) { straightBarrierMain( length = length, thickness = thickness, base = base ); - translateZ(minThickness) { - barrierNotchNegative( - length = length, - thickness = thickness, - base = base, - notches = notches - ); - } } } From accd330987a7fccf3f1be8577ae4d9fb0ef4cceb Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 25 Feb 2020 21:10:07 +0100 Subject: [PATCH 108/191] Rework the arch tower shapes using the new split fragments --- .../parts/elements/straight/arch-tower.scad | 10 +-- rcmodels/tracks/shapes/special.scad | 82 +++++++++++++++---- rcmodels/tracks/test/special.scad | 21 +++-- 3 files changed, 85 insertions(+), 28 deletions(-) diff --git a/rcmodels/tracks/parts/elements/straight/arch-tower.scad b/rcmodels/tracks/parts/elements/straight/arch-tower.scad index fe74e78..cdd7c62 100644 --- a/rcmodels/tracks/parts/elements/straight/arch-tower.scad +++ b/rcmodels/tracks/parts/elements/straight/arch-tower.scad @@ -36,19 +36,17 @@ applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) distribute([0, getBarrierHolderWidth(barrierHolderBase) * 2, 0], center=true) { - archTower( + archTowerMale( length = trackSectionLength, thickness = barrierBodyThickness, base = barrierHolderBase, - wall = archTowerThickness, - right = false + wall = archTowerThickness ); - archTower( + archTowerFemale( length = trackSectionLength, thickness = barrierBodyThickness, base = barrierHolderBase, - wall = archTowerThickness, - right = true + wall = archTowerThickness ); } } diff --git a/rcmodels/tracks/shapes/special.scad b/rcmodels/tracks/shapes/special.scad index 4ca7441..4a3fe10 100644 --- a/rcmodels/tracks/shapes/special.scad +++ b/rcmodels/tracks/shapes/special.scad @@ -29,14 +29,12 @@ */ /** - * Draws the shape of an arch tower that will clamp a barrier border. - * @param Number length - The length of a track element. + * Draws the shape of a clip that will clamp a barrier border. * @param Number thickness - The thickness of the barrier body. * @param Number base - The base unit value used to design the barrier holder. * @param Number wall - The thickness of the outline. - * @param Number right - Is it the right or the left part of the track element that is added to the tower? */ -module archTower(length, thickness, base, wall, right = false) { +module archTowerClip(thickness, base, wall) { holderHeight = getBarrierHolderHeight(base); indent = getBarrierStripIndent(base); @@ -46,7 +44,7 @@ module archTower(length, thickness, base, wall, right = false) { wall = wall, height = holderHeight, base = base, - thickness = thickness + printTolerance, + thickness = thickness, distance = printTolerance ); translate([0, wall / 2, holderHeight - indent]) { @@ -54,16 +52,72 @@ module archTower(length, thickness, base, wall, right = false) { } } } - difference() { - rotateZ(right ? 180 : 0) { - straightBarrierHolder( - length = length, - thickness = thickness, - base = base - ); +} + +/** + * Draws the shape of a male arch tower that will clamp a barrier border. + * @param Number length - The length of a track element. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number wall - The thickness of the outline. + */ +module archTowerMale(length, thickness, base, wall) { + thickness = thickness + printTolerance; + holderHeight = getBarrierHolderHeight(base); + linkHeight = getBarrierHolderLinkHeight(base); + indent = getBarrierStripIndent(base); + length = length / 2; + + translateX(length / 2) { + archTowerClip( + thickness = thickness, + base = base, + wall = wall + ); + } + carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { + straightLinkMale(length=length, linkHeight=linkHeight, base=base) { + extrudeStraightProfile(length=length) { + barrierHolderProfile( + base = base, + thickness = thickness + ); + } } - translate([length, 0, -length] / 2) { - box(length); + } +} + +/** + * Draws the shape of a female arch tower that will clamp a barrier border. + * @param Number length - The length of a track element. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number wall - The thickness of the outline. + */ +module archTowerFemale(length, thickness, base, wall) { + thickness = thickness + printTolerance; + holderHeight = getBarrierHolderHeight(base); + linkHeight = getBarrierHolderLinkHeight(base); + indent = getBarrierStripIndent(base); + length = length / 2; + + translateX(length / 2) { + archTowerClip( + thickness = thickness, + base = base, + wall = wall + ); + } + rotateZ(180) { + carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { + straightLinkFemale(length=length, linkHeight=linkHeight, base=base) { + extrudeStraightProfile(length=length) { + barrierHolderProfile( + base = base, + thickness = thickness + ); + } + } } } } diff --git a/rcmodels/tracks/test/special.scad b/rcmodels/tracks/test/special.scad index e6cc097..6605870 100644 --- a/rcmodels/tracks/test/special.scad +++ b/rcmodels/tracks/test/special.scad @@ -36,22 +36,27 @@ applyMode(mode=mode) { distributeGrid(intervalX=[length * 1.5, 0, 0], intervalY=[0, height * 1.5, 0], line=3, center=true) { - // test the arch tower shape with holders, left side - archTower( + // test the shape of an arch tower clip + archTowerClip( + thickness = thickness, + base = base, + wall = wall * 2 + ); + + // test the shape of an arch tower, male version + archTowerMale( length = length, thickness = thickness, base = base, - wall = wall * 2, - right = false + wall = wall * 2 ); - // test the arch tower shape with holders, right side - archTower( + // test the shape of an arch tower, female version + archTowerFemale( length = length, thickness = thickness, base = base, - wall = wall * 2, - right = true + wall = wall * 2 ); } From c35e35c1aa82d3cd7947c915cde50c1e6c16b8c9 Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 25 Feb 2020 21:25:03 +0100 Subject: [PATCH 109/191] Rework the U-turn shapes using the new split fragments --- rcmodels/tracks/shapes/uturn.scad | 107 ++++++++++++++++-------------- 1 file changed, 58 insertions(+), 49 deletions(-) diff --git a/rcmodels/tracks/shapes/uturn.scad b/rcmodels/tracks/shapes/uturn.scad index bb1949f..7b9d748 100644 --- a/rcmodels/tracks/shapes/uturn.scad +++ b/rcmodels/tracks/shapes/uturn.scad @@ -38,46 +38,50 @@ * @param Number right - Is it the right or the left part of the track element that is added first? */ module uTurnBarrierHolder(length, height, thickness, base, gap, right = false) { - adjustedThickness = thickness + printTolerance; + thickness = thickness + printTolerance; holderWidth = getBarrierHolderWidth(base); holderHeight = getBarrierHolderHeight(base); - towerWidth = nozzleAligned(adjustedThickness + minWidth); + linkHeight = getBarrierHolderLinkHeight(base); + towerWidth = nozzleAligned(thickness + minWidth); towerHeight = getBarrierBodyInnerHeight(height, base) / 2; interval = (holderWidth + gap) / 2; + dir = right ? -1 : 1; + length = length / 2; - difference() { - union() { - translateY(interval) { - rotateZ(right ? 180 : 0) { - straightBarrierHolder( - length = length, - thickness = thickness, - base = base + translateY(interval * dir) { + carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { + straightLinkMale(length=length, linkHeight=linkHeight, base=base) { + extrudeStraightProfile(length=length) { + barrierHolderProfile( + base = base, + thickness = thickness ); } } - translateY(-interval) { - rotateZ(right ? 0 : 180) { - straightBarrierHolder( - length = length, - thickness = thickness, - base = base - ); + } + } + translateY(-interval * dir) { + rotateZ(180) { + carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { + straightLinkFemale(length=length, linkHeight=linkHeight, base=base) { + extrudeStraightProfile(length=length) { + barrierHolderProfile( + base = base, + thickness = thickness + ); + } } } } - translate([length, 0, -length]) { - box(length * 2); - } } - rotateZ(270) { - rotate_extrude(angle=180, convexity=10) { - translateX(interval) { + translateX(length / 2) { + rotateZ(270) { + extrudeCurvedProfile(radius=interval, angle=180) { barrierHolderProfile( base = base, - thickness = adjustedThickness + thickness = thickness ); - translate([-adjustedThickness / 2, holderHeight + towerHeight / 2]) { + translate([-thickness / 2, holderHeight + towerHeight / 2]) { rectangle([towerWidth, towerHeight]); } } @@ -86,7 +90,7 @@ module uTurnBarrierHolder(length, height, thickness, base, gap, right = false) { } /** - * Draws the shape of a barrier unibody for a U-Turn. + * Draws the shape of a unibody barrier for a U-Turn. * @param Number length - The length of a track element. * @param Number height - The height of the barrier. * @param Number thickness - The thickness of the barrier body for a barrier holder. @@ -95,42 +99,47 @@ module uTurnBarrierHolder(length, height, thickness, base, gap, right = false) { * @param Number right - Is it the right or the left part of the track element that is added first? */ module uTurnBarrierUnibody(length, height, thickness, base, gap, right = false) { + thickness = thickness + printTolerance; + linkHeight = getBarrierUnibodyLinkHeight(height, base); interval = (getBarrierUnibodyWidth(base) + gap) / 2; + dir = right ? -1 : 1; + length = length / 2; - difference() { - union() { - translateY(interval) { - rotateZ(right ? 180 : 0) { - straightBarrierUnibody( - length = length, + translateY(interval * dir) { + carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { + straightLinkMale(length=length, linkHeight=linkHeight, base=base) { + extrudeStraightProfile(length=length) { + barrierUnibodyProfile( height = height, - thickness = thickness, - base = base + base = base, + thickness = thickness ); } } - translateY(-interval) { - rotateZ(right ? 0 : 180) { - straightBarrierUnibody( - length = length, - height = height, - thickness = thickness, - base = base - ); + } + } + translateY(-interval * dir) { + rotateZ(180) { + carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { + straightLinkFemale(length=length, linkHeight=linkHeight, base=base) { + extrudeStraightProfile(length=length) { + barrierUnibodyProfile( + height = height, + base = base, + thickness = thickness + ); + } } } } - translate([length, 0, -length]) { - box(length * 2); - } } - rotateZ(270) { - rotate_extrude(angle=180, convexity=10) { - translateX(interval) { + translateX(length / 2) { + rotateZ(270) { + extrudeCurvedProfile(radius=interval, angle=180) { barrierUnibodyProfile( height = height, base = base, - thickness = thickness + printTolerance + thickness = thickness ); } } From 64d95c5e822ae381a2d023dfca7d2bf16e8c9ef4 Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 25 Feb 2020 21:26:44 +0100 Subject: [PATCH 110/191] Fix typo --- rcmodels/tracks/parts/unibody/curved/curved-inner.scad | 2 +- rcmodels/tracks/parts/unibody/curved/curved-outer.scad | 2 +- rcmodels/tracks/parts/unibody/curved/curved-short.scad | 2 +- rcmodels/tracks/parts/unibody/curved/curved-small.scad | 2 +- rcmodels/tracks/parts/unibody/curved/curved-uturn.scad | 2 +- rcmodels/tracks/parts/unibody/straight/straight-double.scad | 2 +- rcmodels/tracks/parts/unibody/straight/straight-simple.scad | 2 +- rcmodels/tracks/parts/unibody/straight/straight-uturn.scad | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rcmodels/tracks/parts/unibody/curved/curved-inner.scad b/rcmodels/tracks/parts/unibody/curved/curved-inner.scad index 40ef379..05ed96b 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-inner.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-inner.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier unibody for an inner curve track part. + * A unibody barrier for an inner curve track part. * * @author jsconan */ diff --git a/rcmodels/tracks/parts/unibody/curved/curved-outer.scad b/rcmodels/tracks/parts/unibody/curved/curved-outer.scad index d36cd23..ea08671 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-outer.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-outer.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier unibody for an outer curve track part. + * A unibody barrier for an outer curve track part. * * @author jsconan */ diff --git a/rcmodels/tracks/parts/unibody/curved/curved-short.scad b/rcmodels/tracks/parts/unibody/curved/curved-short.scad index 5279c99..593c75c 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-short.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-short.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier unibody for a short curve track part. + * A unibody barrier for a short curve track part. * * @author jsconan */ diff --git a/rcmodels/tracks/parts/unibody/curved/curved-small.scad b/rcmodels/tracks/parts/unibody/curved/curved-small.scad index 908c576..b4ace37 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-small.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-small.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier unibody for a small curve track part. + * A unibody barrier for a small curve track part. * * @author jsconan */ diff --git a/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad b/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad index af4258e..4fb570b 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier unibody for a U-turn track part. + * A unibody barrier for a U-turn track part. * * @author jsconan */ diff --git a/rcmodels/tracks/parts/unibody/straight/straight-double.scad b/rcmodels/tracks/parts/unibody/straight/straight-double.scad index 965480a..1ee0e88 100644 --- a/rcmodels/tracks/parts/unibody/straight/straight-double.scad +++ b/rcmodels/tracks/parts/unibody/straight/straight-double.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier unibody for a straight track part, with a double length. + * A unibody barrier for a straight track part, with a double length. * * @author jsconan */ diff --git a/rcmodels/tracks/parts/unibody/straight/straight-simple.scad b/rcmodels/tracks/parts/unibody/straight/straight-simple.scad index 17a9ee1..12fb7f3 100644 --- a/rcmodels/tracks/parts/unibody/straight/straight-simple.scad +++ b/rcmodels/tracks/parts/unibody/straight/straight-simple.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier unibody for a straight track part. + * A unibody barrier for a straight track part. * * @author jsconan */ diff --git a/rcmodels/tracks/parts/unibody/straight/straight-uturn.scad b/rcmodels/tracks/parts/unibody/straight/straight-uturn.scad index f08d1ec..187d6eb 100644 --- a/rcmodels/tracks/parts/unibody/straight/straight-uturn.scad +++ b/rcmodels/tracks/parts/unibody/straight/straight-uturn.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A barrier unibody to compensate a U-turn track part. + * A unibody barrier to compensate a U-turn track part. * * @author jsconan */ From fa864bcf9f3062a5e7eb7eb83d9988b1e195ef5f Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 25 Feb 2020 21:34:09 +0100 Subject: [PATCH 111/191] Rework the U-turn sample using the new split fragments --- .../parts/samples/curved/curved-uturn.scad | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/rcmodels/tracks/parts/samples/curved/curved-uturn.scad b/rcmodels/tracks/parts/samples/curved/curved-uturn.scad index a511e5c..ded2c22 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-uturn.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-uturn.scad @@ -40,38 +40,36 @@ include <../../../config/setup.scad> * @param Number right - Is it the right or the left part of the track element that is added first? */ module uTurnSample(length, thickness, base, gap, right = false) { - holderWidth = getBarrierHolderWidth(base); - holderHeight = getBarrierHolderHeight(base); - interval = (gap + holderWidth) / 2; + linkHeight = getBarrierHolderLinkHeight(base); + interval = (getBarrierHolderWidth(base) + gap) / 2; + dir = right ? -1 : 1; + length = length / 2; - difference() { - union() { - translateY(interval) { - rotateZ(right ? 180 : 0) { - straightBarrierMain( - length = length, - thickness = thickness, - base = base - ); - } + translateY(interval * dir) { + straightLinkMale(length=length, linkHeight=linkHeight, base=base) { + extrudeStraightProfile(length=length) { + barrierHolderProfile( + base = base, + thickness = thickness + ); } - translateY(-interval) { - rotateZ(right ? 0 : 180) { - straightBarrierMain( - length = length, - thickness = thickness, - base = base + } + } + translateY(-interval * dir) { + rotateZ(180) { + straightLinkFemale(length=length, linkHeight=linkHeight, base=base) { + extrudeStraightProfile(length=length) { + barrierHolderProfile( + base = base, + thickness = thickness ); } } } - translate([length, 0, -length]) { - box(length * 2); - } } - rotateZ(270) { - rotate_extrude(angle=180, convexity=10) { - translateX(interval) { + translateX(length / 2) { + rotateZ(270) { + extrudeCurvedProfile(radius=interval, angle=180) { barrierHolderProfile( base = base, thickness = thickness From 6c8252c0cd56d3a00d0329398f67ff35240375b4 Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 25 Feb 2020 21:47:14 +0100 Subject: [PATCH 112/191] Remove useless carving in unibody U-turn shape --- rcmodels/tracks/shapes/uturn.scad | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/rcmodels/tracks/shapes/uturn.scad b/rcmodels/tracks/shapes/uturn.scad index 7b9d748..0a76b94 100644 --- a/rcmodels/tracks/shapes/uturn.scad +++ b/rcmodels/tracks/shapes/uturn.scad @@ -106,8 +106,19 @@ module uTurnBarrierUnibody(length, height, thickness, base, gap, right = false) length = length / 2; translateY(interval * dir) { - carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { - straightLinkMale(length=length, linkHeight=linkHeight, base=base) { + straightLinkMale(length=length, linkHeight=linkHeight, base=base) { + extrudeStraightProfile(length=length) { + barrierUnibodyProfile( + height = height, + base = base, + thickness = thickness + ); + } + } + } + translateY(-interval * dir) { + rotateZ(180) { + straightLinkFemale(length=length, linkHeight=linkHeight, base=base) { extrudeStraightProfile(length=length) { barrierUnibodyProfile( height = height, @@ -118,21 +129,6 @@ module uTurnBarrierUnibody(length, height, thickness, base, gap, right = false) } } } - translateY(-interval * dir) { - rotateZ(180) { - carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { - straightLinkFemale(length=length, linkHeight=linkHeight, base=base) { - extrudeStraightProfile(length=length) { - barrierUnibodyProfile( - height = height, - base = base, - thickness = thickness - ); - } - } - } - } - } translateX(length / 2) { rotateZ(270) { extrudeCurvedProfile(radius=interval, angle=180) { From b4d1dbb6b075637ebe781f8269ba3d747667a15b Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 25 Feb 2020 21:50:24 +0100 Subject: [PATCH 113/191] Fix wrong computation of the link height for a unibody barrier --- rcmodels/tracks/config/values.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 4a8bd87..d196225 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -144,7 +144,7 @@ function getBarrierUnibodyWidth(base) = getBarrierHolderWidth(base) + base; * @param Number base - The base unit value used to design the barrier holder. * @returns Number */ -function getBarrierUnibodyLinkHeight(height, base) = height - getBarrierHolderLinkHeight(base); +function getBarrierUnibodyLinkHeight(height, base) = height - getBarrierHolderHeight(base) - base; /** * Computes the inner height of the barrier body, between the barrier holders. From a79fd57192c54fcbfe14af46cb3a17ae1352874e Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 25 Feb 2020 22:21:24 +0100 Subject: [PATCH 114/191] Add connector shapes to link barrier holders and unibody barriers --- .../unibody/straight/straight-connector.scad | 62 +++++++ rcmodels/tracks/shapes/special.scad | 159 +++++++++++++++++- rcmodels/tracks/test/special.scad | 44 ++++- 3 files changed, 256 insertions(+), 9 deletions(-) create mode 100644 rcmodels/tracks/parts/unibody/straight/straight-connector.scad diff --git a/rcmodels/tracks/parts/unibody/straight/straight-connector.scad b/rcmodels/tracks/parts/unibody/straight/straight-connector.scad new file mode 100644 index 0000000..f0f8108 --- /dev/null +++ b/rcmodels/tracks/parts/unibody/straight/straight-connector.scad @@ -0,0 +1,62 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A unibody barrier connector to connect track part made with barrier holder. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + distribute([0, getBarrierHolderWidth(barrierHolderBase) * 2, 0], center=true) { + barrierHolderToUnibodyMale( + length = trackSectionLength, + height = barrierHeight, + thickness = barrierBodyThickness, + base = barrierHolderBase + ); + barrierHolderToUnibodyMaleConnector( + length = trackSectionLength, + thickness = barrierBodyThickness, + base = barrierHolderBase + ); + barrierHolderToUnibodyFemale( + length = trackSectionLength, + height = barrierHeight, + thickness = barrierBodyThickness, + base = barrierHolderBase + ); + barrierHolderToUnibodyFemaleConnector( + length = trackSectionLength, + thickness = barrierBodyThickness, + base = barrierHolderBase + ); + } +} diff --git a/rcmodels/tracks/shapes/special.scad b/rcmodels/tracks/shapes/special.scad index 4a3fe10..272cc87 100644 --- a/rcmodels/tracks/shapes/special.scad +++ b/rcmodels/tracks/shapes/special.scad @@ -63,7 +63,6 @@ module archTowerClip(thickness, base, wall) { */ module archTowerMale(length, thickness, base, wall) { thickness = thickness + printTolerance; - holderHeight = getBarrierHolderHeight(base); linkHeight = getBarrierHolderLinkHeight(base); indent = getBarrierStripIndent(base); length = length / 2; @@ -96,7 +95,6 @@ module archTowerMale(length, thickness, base, wall) { */ module archTowerFemale(length, thickness, base, wall) { thickness = thickness + printTolerance; - holderHeight = getBarrierHolderHeight(base); linkHeight = getBarrierHolderLinkHeight(base); indent = getBarrierStripIndent(base); length = length / 2; @@ -121,3 +119,160 @@ module archTowerFemale(length, thickness, base, wall) { } } } + +/** + * Draws the shape of the unibody barrier side of a connector with a barrier holder. + * @param Number length - The length of a track element. + * @param Number height - The height of the barrier. + * @param Number linkHeight - The height of the link. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + */ +module unibodyConnector(length, height, linkHeight, thickness, base) { + difference() { + extrudeStraightProfile(length=length) { + barrierUnibodyProfile( + height = height, + base = base, + thickness = thickness + ); + } + translate([-length / 2, 0, height - linkHeight]) { + rotateZ(180) { + barrierLink( + height = linkHeight + printResolution + 1, + base = base, + distance = printTolerance + ); + } + } + } +} + +/** + * Draws the shape of a male connector between a barrier holder and a unibody barrier. + * @param Number length - The length of a track element. + * @param Number height - The height of the barrier. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + */ +module barrierHolderToUnibodyMale(length, height, thickness, base) { + thickness = thickness + printTolerance; + holderLinkHeight = getBarrierHolderLinkHeight(base); + unibodyLinkHeight = getBarrierUnibodyLinkHeight(height, base); + length = length / 2; + + translateX(length / 2) { + carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { + straightLinkFemale(length=length, linkHeight=holderLinkHeight, base=base) { + extrudeStraightProfile(length=length) { + barrierHolderProfile( + base = base, + thickness = thickness + ); + } + } + } + } + translateX(-length / 2) { + straightLinkMale(length=length, linkHeight=unibodyLinkHeight, base=base) { + rotateZ(180) { + unibodyConnector( + length = length, + height = height, + linkHeight = holderLinkHeight, + thickness = thickness, + base = base + ); + } + } + } +} + +/** + * Draws the shape of a female connector between a barrier holder and a unibody barrier. + * @param Number length - The length of a track element. + * @param Number height - The height of the barrier. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + */ +module barrierHolderToUnibodyFemale(length, height, thickness, base) { + thickness = thickness + printTolerance; + holderLinkHeight = getBarrierHolderLinkHeight(base); + unibodyLinkHeight = getBarrierUnibodyLinkHeight(height, base); + length = length / 2; + + translateX(-length / 2) { + carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { + straightLinkMale(length=length, linkHeight=holderLinkHeight, base=base) { + extrudeStraightProfile(length=length) { + barrierHolderProfile( + base = base, + thickness = thickness + ); + } + } + } + } + translateX(length / 2) { + straightLinkFemale(length=length, linkHeight=unibodyLinkHeight, base=base) { + unibodyConnector( + length = length, + height = height, + linkHeight = holderLinkHeight, + thickness = thickness, + base = base + ); + } + } +} + +/** + * Draws the shape of an additional male connector between a barrier holder and a unibody barrier. + * @param Number length - The length of a track element. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + */ +module barrierHolderToUnibodyMaleConnector(length, thickness, base) { + thickness = thickness + printTolerance; + linkHeight = getBarrierHolderLinkHeight(base); + length = length / 2; + + carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { + straightLinkMale(length=length, linkHeight=linkHeight, base=base) { + rotateZ(180) { + straightLinkMale(length=length, linkHeight=linkHeight, base=base) { + extrudeStraightProfile(length=length) { + barrierHolderProfile( + base = base, + thickness = thickness + ); + } + } + } + } + } +} + +/** + * Draws the shape of an additional male connector between a barrier holder and a unibody barrier. + * @param Number length - The length of a track element. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + */ +module barrierHolderToUnibodyFemaleConnector(length, thickness, base) { + thickness = thickness + printTolerance; + linkHeight = getBarrierHolderLinkHeight(base); + length = length / 2; + + carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { + straightLinks(length=length, linkHeight=linkHeight, base=base) { + extrudeStraightProfile(length=length) { + barrierHolderProfile( + base = base, + thickness = thickness + ); + } + } + } +} diff --git a/rcmodels/tracks/test/special.scad b/rcmodels/tracks/test/special.scad index 6605870..e88ca50 100644 --- a/rcmodels/tracks/test/special.scad +++ b/rcmodels/tracks/test/special.scad @@ -34,26 +34,56 @@ include // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=mode) { - distributeGrid(intervalX=[length * 1.5, 0, 0], intervalY=[0, height * 1.5, 0], line=3, center=true) { + distributeGrid(intervalX=[length * 1.5, 0, 0], intervalY=[0, height * 1.5, 0], line=2, center=true) { - // test the shape of an arch tower clip - archTowerClip( + // test the shape of an arch tower, male version + archTowerMale( + length = length, thickness = thickness, base = base, wall = wall * 2 ); - // test the shape of an arch tower, male version - archTowerMale( + // test the shape of an arch tower, female version + archTowerFemale( length = length, thickness = thickness, base = base, wall = wall * 2 ); - // test the shape of an arch tower, female version - archTowerFemale( + // test the shape of a connector between a barrier holder and a unibody barrier, male version + barrierHolderToUnibodyMale( + length = length, + height = height, + thickness = thickness, + base = base + ); + + // test the shape of a connector between a barrier holder and a unibody barrier, female version + barrierHolderToUnibodyFemale( + length = length, + height = height, + thickness = thickness, + base = base + ); + + // test the shape of the additional connector between a barrier holder and a unibody barrier, male version + barrierHolderToUnibodyMaleConnector( + length = length, + thickness = thickness, + base = base + ); + + // test the shape of the additional connector between a barrier holder and a unibody barrier, female version + barrierHolderToUnibodyFemaleConnector( length = length, + thickness = thickness, + base = base + ); + + // test the shape of an arch tower clip + archTowerClip( thickness = thickness, base = base, wall = wall * 2 From 4a016611e18a1a700eed592d39de57d3188791d9 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 26 Feb 2020 21:53:55 +0100 Subject: [PATCH 115/191] Make smoother the transition of the connector from the barrier holder to the unibody barrier --- rcmodels/tracks/shapes/special.scad | 16 ++++++++++------ rcmodels/tracks/shapes/straight.scad | 5 +++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/rcmodels/tracks/shapes/special.scad b/rcmodels/tracks/shapes/special.scad index 272cc87..d0459e5 100644 --- a/rcmodels/tracks/shapes/special.scad +++ b/rcmodels/tracks/shapes/special.scad @@ -160,16 +160,19 @@ module barrierHolderToUnibodyMale(length, height, thickness, base) { thickness = thickness + printTolerance; holderLinkHeight = getBarrierHolderLinkHeight(base); unibodyLinkHeight = getBarrierUnibodyLinkHeight(height, base); + scaleRatio = [getBarrierUnibodyWidth(base)/getBarrierHolderWidth(base), 1]; length = length / 2; translateX(length / 2) { carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { straightLinkFemale(length=length, linkHeight=holderLinkHeight, base=base) { - extrudeStraightProfile(length=length) { - barrierHolderProfile( - base = base, - thickness = thickness - ); + rotateZ(180) { + extrudeStraightProfile(length=length, scale=scaleRatio) { + barrierHolderProfile( + base = base, + thickness = thickness + ); + } } } } @@ -200,12 +203,13 @@ module barrierHolderToUnibodyFemale(length, height, thickness, base) { thickness = thickness + printTolerance; holderLinkHeight = getBarrierHolderLinkHeight(base); unibodyLinkHeight = getBarrierUnibodyLinkHeight(height, base); + scaleRatio = [getBarrierUnibodyWidth(base)/getBarrierHolderWidth(base), 1]; length = length / 2; translateX(-length / 2) { carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { straightLinkMale(length=length, linkHeight=holderLinkHeight, base=base) { - extrudeStraightProfile(length=length) { + extrudeStraightProfile(length=length, scale=scaleRatio) { barrierHolderProfile( base = base, thickness = thickness diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index aec5e54..21d7dff 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -110,10 +110,11 @@ module straightLinks(length, linkHeight, base) { /** * Extrudes the profile on the expected linear length. * @param Number length - The length of the element. + * @param Number|Vector [scale] - Scales the 2D shape by this value over the height of the extrusion. */ -module extrudeStraightProfile(length) { +module extrudeStraightProfile(length, scale=1) { rotate([90, 0, 90]) { - negativeExtrude(height=length, center=true) { + negativeExtrude(height=length, center=true, scale=scale) { children(); } } From be80cfbfab8888ef6734a94fb7ce7e52e6e96375 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 26 Feb 2020 22:36:37 +0100 Subject: [PATCH 116/191] Add a bent accessory mast --- .../tracks/parts/accessories/bent-mast.scad | 45 ++++++++++ rcmodels/tracks/shapes/accessories.scad | 89 +++++++++++++++++-- rcmodels/tracks/test/accessories.scad | 16 ++++ 3 files changed, 145 insertions(+), 5 deletions(-) create mode 100644 rcmodels/tracks/parts/accessories/bent-mast.scad diff --git a/rcmodels/tracks/parts/accessories/bent-mast.scad b/rcmodels/tracks/parts/accessories/bent-mast.scad new file mode 100644 index 0000000..f5e19eb --- /dev/null +++ b/rcmodels/tracks/parts/accessories/bent-mast.scad @@ -0,0 +1,45 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A bent mast to clip accessories onto the barrier holders. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../config/setup.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + accessoryBentMast( + width = mastWidth, + height = [mastWidth, mastHeight], + wall = accessoryClipThickness, + base = barrierHolderBase, + thickness = barrierBodyThickness + ); +} diff --git a/rcmodels/tracks/shapes/accessories.scad b/rcmodels/tracks/shapes/accessories.scad index 88ad67f..4ef5544 100644 --- a/rcmodels/tracks/shapes/accessories.scad +++ b/rcmodels/tracks/shapes/accessories.scad @@ -59,6 +59,20 @@ module cableClip(height, wall, base, thickness, center = false) { } } +/** + * Draws the profile shape of an accessory mast. + * @param Number width - The width of the mast. + * @param Number [distance] - An additional distance added to the outline. + */ +module mastProfile(width, distance = 0) { + radius = getMastRadius(width); + + polygon( + points = outline(drawEllipse(r=radius, $fn=mastFacets), distance), + convexity = 10 + ); +} + /** * Draws the shape of an accessory mast. * @param Number width - The width of the mast. @@ -67,18 +81,55 @@ module cableClip(height, wall, base, thickness, center = false) { * @param Boolean [center] - The shape is centered vertically. */ module mast(width, height, distance = 0, center = false) { - radius = getMastRadius(width); - negativeExtrude(height=height, center=center) { rotateZ(getPolygonAngle(1, mastFacets) / 2) { - polygon( - points = outline(drawEllipse(r=radius, $fn=mastFacets), distance), - convexity = 10 + mastProfile( + width = width, + distance = distance ); } } } +/** + * Draws the shape of a bent accessory mast. + * @param Number width - The width of the mast. + * @param Number|Vector height - The height of the mast. The 2 sides can be defined separately using a vector. + * @param Number [distance] - An additional distance added to the outline. + */ +module bentMast(width, height, distance = 0) { + height = vector2D(height); + + mast( + width = width, + height = height[0], + distance = distance, + center = false + ); + translate([0, -width, height[0] + width]) { + rotateX(90) { + mast( + width = width, + height = height[1], + distance = distance, + center = false + ); + } + } + translate([0, -width, height[0]]) { + rotate([90, 0, 90]) { + rotate_extrude(angle=90, convexity=10) { + translateX(width) { + mastProfile( + width = width, + distance = distance + ); + } + } + } + } +} + /** * Draws the shape of rings that will maintain an accessory onto a mast. * @param Number width - The width of the mast. @@ -139,6 +190,34 @@ module accessoryMast(width, height, wall, base, thickness) { } } +/** + * Draws the shape of a bent accessory mast with a clip. + * @param Number width - The width of the mast. + * @param Number|Vector height - The height of the mast. The 2 sides can be defined separately using a vector. + * @param Number wall - The thickness of the accessory clip lines. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number thickness - The thickness of the barrier body. + */ +module accessoryBentMast(width, height, wall, base, thickness) { + rotate([90, 90, 90]) { + bentMast( + width = width, + height = height, + distance = 0 + ); + } + rotateZ(90) { + clip( + wall = wall, + height = width, + base = base, + thickness = thickness + printTolerance, + distance = printTolerance, + center = true + ); + } +} + /** * Draws the shape of an accessory flag. * @param Number width - The width of the flag. diff --git a/rcmodels/tracks/test/accessories.scad b/rcmodels/tracks/test/accessories.scad index 6d076cf..659b80b 100644 --- a/rcmodels/tracks/test/accessories.scad +++ b/rcmodels/tracks/test/accessories.scad @@ -51,6 +51,13 @@ applyMode(mode=mode) { distance = 0 ); + // test the accessory bent mast shape + bentMast( + width = base, + height = [base, height / 2], + distance = 0 + ); + // test the accessory rings shape mastRings( width = base, @@ -71,6 +78,15 @@ applyMode(mode=mode) { thickness = thickness ); + // test the bent accessory clip shape + accessoryBentMast( + width = base, + height = [base, height / 2], + wall = wall, + base = base, + thickness = thickness + ); + // test the accessory flag shape, straight accessoryFlag( width = width, From d8c2f3c8725e96f6628d0f586e9cbdd58d62129b Mon Sep 17 00:00:00 2001 From: jsconan Date: Thu, 27 Feb 2020 22:08:32 +0100 Subject: [PATCH 117/191] Rework the transition of the connector from the barrier holder to the unibody barrier --- .../unibody/straight/straight-connector.scad | 4 +- rcmodels/tracks/shapes/profiles.scad | 46 +++--- rcmodels/tracks/shapes/special.scad | 131 +++++++++--------- rcmodels/tracks/shapes/straight.scad | 5 +- rcmodels/tracks/test/special.scad | 26 ++-- 5 files changed, 115 insertions(+), 97 deletions(-) diff --git a/rcmodels/tracks/parts/unibody/straight/straight-connector.scad b/rcmodels/tracks/parts/unibody/straight/straight-connector.scad index f0f8108..4028208 100644 --- a/rcmodels/tracks/parts/unibody/straight/straight-connector.scad +++ b/rcmodels/tracks/parts/unibody/straight/straight-connector.scad @@ -42,7 +42,7 @@ applyMode(mode=renderMode) { thickness = barrierBodyThickness, base = barrierHolderBase ); - barrierHolderToUnibodyMaleConnector( + barrierHolderConnectorMale( length = trackSectionLength, thickness = barrierBodyThickness, base = barrierHolderBase @@ -53,7 +53,7 @@ applyMode(mode=renderMode) { thickness = barrierBodyThickness, base = barrierHolderBase ); - barrierHolderToUnibodyFemaleConnector( + barrierHolderConnectorFemale( length = trackSectionLength, thickness = barrierBodyThickness, base = barrierHolderBase diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index 0071189..efa3b98 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -69,32 +69,46 @@ module barrierNotchProfile(base, distance = 0) { } /** - * Draws the profile of a barrier holder. + * Draws the outline of a barrier holder profile. * @param Number base - The base unit value used to design the barrier holder. - * @param Number thickness - The thickness of the barrier body. - * @param Number [distance] - An additional distance added to the outline of the profile. + * @param Number bottomWidth - The width of the bottom of the shape. + * @param Number topWidth - The width of the top of the shape. + * @returns Vector[] */ -module barrierHolderProfile(base, thickness, distance = 0) { - holderTopWidth = getBarrierHolderTopWidth(base, thickness); - holderWidth = getBarrierHolderWidth(base); - holderHeight = getBarrierHolderHeight(base); - holderOffset = base / 4; - holderSide = base - holderOffset; - holderLineX = (holderWidth - holderTopWidth) / 2 - holderOffset; - holderLineY = holderHeight - holderSide - holderOffset * 2; - - polygon(outline(path([ - ["P", holderOffset - holderWidth / 2, 0], +function getBarrierHolderProfilePoints(base, bottomWidth, topWidth) = + let( + holderHeight = getBarrierHolderHeight(base), + holderOffset = base / 4, + holderSide = base - holderOffset, + holderLineX = (bottomWidth - topWidth) / 2 - holderOffset, + holderLineY = holderHeight - holderSide - holderOffset * 2 + ) + path([ + ["P", holderOffset - bottomWidth / 2, 0], ["L", -holderOffset, holderOffset], ["V", holderSide], ["L", holderLineX, holderLineY], ["L", holderOffset, holderOffset], - ["H", holderTopWidth], + ["H", topWidth], ["L", holderOffset, -holderOffset], ["L", holderLineX, -holderLineY], ["V", -holderSide], ["L", -holderOffset, -holderOffset] - ]), -distance), convexity = 10); + ]) +; + +/** + * Draws the profile of a barrier holder. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number thickness - The thickness of the barrier body. + * @param Number [distance] - An additional distance added to the outline of the profile. + */ +module barrierHolderProfile(base, thickness, distance = 0) { + polygon(outline(getBarrierHolderProfilePoints( + base = base, + bottomWidth = getBarrierHolderWidth(base), + topWidth = getBarrierHolderTopWidth(base, thickness) + ), -distance), convexity = 10); } /** diff --git a/rcmodels/tracks/shapes/special.scad b/rcmodels/tracks/shapes/special.scad index d0459e5..9cc9578 100644 --- a/rcmodels/tracks/shapes/special.scad +++ b/rcmodels/tracks/shapes/special.scad @@ -121,31 +121,60 @@ module archTowerFemale(length, thickness, base, wall) { } /** - * Draws the shape of the unibody barrier side of a connector with a barrier holder. + * Draws the shape of a connector between a barrier holder and a unibody barrier. * @param Number length - The length of a track element. * @param Number height - The height of the barrier. - * @param Number linkHeight - The height of the link. * @param Number thickness - The thickness of the barrier body. * @param Number base - The base unit value used to design the barrier holder. */ -module unibodyConnector(length, height, linkHeight, thickness, base) { - difference() { - extrudeStraightProfile(length=length) { - barrierUnibodyProfile( - height = height, - base = base, - thickness = thickness - ); - } - translate([-length / 2, 0, height - linkHeight]) { - rotateZ(180) { +module barrierHolderToUnibodyConnector(length, height, thickness, base) { + holderTopWidth = getBarrierHolderTopWidth(base, thickness); + holderWidth = getBarrierHolderWidth(base); + holderHeight = getBarrierHolderHeight(base); + holderLinkHeight = getBarrierHolderLinkHeight(base); + unibodyWidth = getBarrierUnibodyWidth(base); + unibodyLineX = (unibodyWidth - holderTopWidth) / 2 - base / 4; + unibodyLineY = height - holderHeight - base * 1.75; + holderLineY = holderHeight - base * 1.25; + unibodyTopWidth = unibodyWidth - base / 2 - holderLineY * (unibodyLineX / unibodyLineY) * 2; + length = length / 2; + + distribute(intervalX=length, center=true) { + difference() { + extrudeStraightProfile(length=length) { + barrierUnibodyProfile( + height = height, + base = base, + thickness = thickness + ); + } + translate([length / 2, 0, height - holderLinkHeight]) { barrierLink( - height = linkHeight + printResolution + 1, + height = holderLinkHeight + printResolution + 1, base = base, distance = printTolerance ); } } + carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { + translateX(-length / 2) { + rotate([90, 0, 90]) { + simplePolyhedron( + bottom = reverse(getBarrierHolderProfilePoints( + base = base, + bottomWidth = unibodyWidth, + topWidth = unibodyTopWidth + )), + top = reverse(getBarrierHolderProfilePoints( + base = base, + bottomWidth = holderWidth, + topWidth = holderTopWidth + )), + z = length + ); + } + } + } } } @@ -160,34 +189,15 @@ module barrierHolderToUnibodyMale(length, height, thickness, base) { thickness = thickness + printTolerance; holderLinkHeight = getBarrierHolderLinkHeight(base); unibodyLinkHeight = getBarrierUnibodyLinkHeight(height, base); - scaleRatio = [getBarrierUnibodyWidth(base)/getBarrierHolderWidth(base), 1]; - length = length / 2; - translateX(length / 2) { - carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { - straightLinkFemale(length=length, linkHeight=holderLinkHeight, base=base) { - rotateZ(180) { - extrudeStraightProfile(length=length, scale=scaleRatio) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - } - } - } - } - } - translateX(-length / 2) { - straightLinkMale(length=length, linkHeight=unibodyLinkHeight, base=base) { - rotateZ(180) { - unibodyConnector( - length = length, - height = height, - linkHeight = holderLinkHeight, - thickness = thickness, - base = base - ); - } + straightLinkMale(length=length, linkHeight=unibodyLinkHeight, base=base) { + straightLinkFemale(length=length, linkHeight=holderLinkHeight, base=base) { + barrierHolderToUnibodyConnector( + length = length, + height = height, + thickness = thickness, + base = base + ); } } } @@ -203,41 +213,28 @@ module barrierHolderToUnibodyFemale(length, height, thickness, base) { thickness = thickness + printTolerance; holderLinkHeight = getBarrierHolderLinkHeight(base); unibodyLinkHeight = getBarrierUnibodyLinkHeight(height, base); - scaleRatio = [getBarrierUnibodyWidth(base)/getBarrierHolderWidth(base), 1]; - length = length / 2; - translateX(-length / 2) { - carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { - straightLinkMale(length=length, linkHeight=holderLinkHeight, base=base) { - extrudeStraightProfile(length=length, scale=scaleRatio) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - } + straightLinkFemale(length=length, linkHeight=unibodyLinkHeight, base=base) { + straightLinkMale(length=length, linkHeight=holderLinkHeight, base=base) { + rotateZ(180) { + barrierHolderToUnibodyConnector( + length = length, + height = height, + thickness = thickness, + base = base + ); } } } - translateX(length / 2) { - straightLinkFemale(length=length, linkHeight=unibodyLinkHeight, base=base) { - unibodyConnector( - length = length, - height = height, - linkHeight = holderLinkHeight, - thickness = thickness, - base = base - ); - } - } } /** - * Draws the shape of an additional male connector between a barrier holder and a unibody barrier. + * Draws the shape of a male connector for a barrier holder. * @param Number length - The length of a track element. * @param Number thickness - The thickness of the barrier body. * @param Number base - The base unit value used to design the barrier holder. */ -module barrierHolderToUnibodyMaleConnector(length, thickness, base) { +module barrierHolderConnectorMale(length, thickness, base) { thickness = thickness + printTolerance; linkHeight = getBarrierHolderLinkHeight(base); length = length / 2; @@ -259,12 +256,12 @@ module barrierHolderToUnibodyMaleConnector(length, thickness, base) { } /** - * Draws the shape of an additional male connector between a barrier holder and a unibody barrier. + * Draws the shape of a female connector for a barrier holder. * @param Number length - The length of a track element. * @param Number thickness - The thickness of the barrier body. * @param Number base - The base unit value used to design the barrier holder. */ -module barrierHolderToUnibodyFemaleConnector(length, thickness, base) { +module barrierHolderConnectorFemale(length, thickness, base) { thickness = thickness + printTolerance; linkHeight = getBarrierHolderLinkHeight(base); length = length / 2; diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 21d7dff..aec5e54 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -110,11 +110,10 @@ module straightLinks(length, linkHeight, base) { /** * Extrudes the profile on the expected linear length. * @param Number length - The length of the element. - * @param Number|Vector [scale] - Scales the 2D shape by this value over the height of the extrusion. */ -module extrudeStraightProfile(length, scale=1) { +module extrudeStraightProfile(length) { rotate([90, 0, 90]) { - negativeExtrude(height=length, center=true, scale=scale) { + negativeExtrude(height=length, center=true) { children(); } } diff --git a/rcmodels/tracks/test/special.scad b/rcmodels/tracks/test/special.scad index e88ca50..c97d26d 100644 --- a/rcmodels/tracks/test/special.scad +++ b/rcmodels/tracks/test/special.scad @@ -36,6 +36,21 @@ applyMode(mode=mode) { distributeGrid(intervalX=[length * 1.5, 0, 0], intervalY=[0, height * 1.5, 0], line=2, center=true) { + // test the shape of an arch tower clip + archTowerClip( + thickness = thickness, + base = base, + wall = wall * 2 + ); + + // test the shape of a connector between a barrier holder and a unibody barrier + barrierHolderToUnibodyConnector( + length = length, + height = height, + thickness = thickness, + base = base + ); + // test the shape of an arch tower, male version archTowerMale( length = length, @@ -69,25 +84,18 @@ applyMode(mode=mode) { ); // test the shape of the additional connector between a barrier holder and a unibody barrier, male version - barrierHolderToUnibodyMaleConnector( + barrierHolderConnectorMale( length = length, thickness = thickness, base = base ); // test the shape of the additional connector between a barrier holder and a unibody barrier, female version - barrierHolderToUnibodyFemaleConnector( + barrierHolderConnectorFemale( length = length, thickness = thickness, base = base ); - // test the shape of an arch tower clip - archTowerClip( - thickness = thickness, - base = base, - wall = wall * 2 - ); - } } From f2db59a2f5616c45c04ddc1473c5bc854d306271 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 28 Feb 2020 22:13:12 +0100 Subject: [PATCH 118/191] Improve the shape simmetry of the connector from the barrier holder to the unibody barrier --- .../unibody/straight/straight-connector.scad | 24 ++++++++-------- rcmodels/tracks/shapes/special.scad | 28 ++++++++++--------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/rcmodels/tracks/parts/unibody/straight/straight-connector.scad b/rcmodels/tracks/parts/unibody/straight/straight-connector.scad index 4028208..827566b 100644 --- a/rcmodels/tracks/parts/unibody/straight/straight-connector.scad +++ b/rcmodels/tracks/parts/unibody/straight/straight-connector.scad @@ -35,28 +35,30 @@ include <../../../config/setup.scad> applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - distribute([0, getBarrierHolderWidth(barrierHolderBase) * 2, 0], center=true) { + distribute(intervalY=getBarrierHolderWidth(barrierHolderBase) * 2, center=true) { barrierHolderToUnibodyMale( length = trackSectionLength, height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase ); - barrierHolderConnectorMale( - length = trackSectionLength, - thickness = barrierBodyThickness, - base = barrierHolderBase - ); + distribute(intervalX=getBarrierHolderWidth(barrierHolderBase) + trackSectionLength / 2, center=true) { + barrierHolderConnectorFemale( + length = trackSectionLength, + thickness = barrierBodyThickness, + base = barrierHolderBase + ); + barrierHolderConnectorMale( + length = trackSectionLength, + thickness = barrierBodyThickness, + base = barrierHolderBase + ); + } barrierHolderToUnibodyFemale( length = trackSectionLength, height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase ); - barrierHolderConnectorFemale( - length = trackSectionLength, - thickness = barrierBodyThickness, - base = barrierHolderBase - ); } } diff --git a/rcmodels/tracks/shapes/special.scad b/rcmodels/tracks/shapes/special.scad index 9cc9578..15ec630 100644 --- a/rcmodels/tracks/shapes/special.scad +++ b/rcmodels/tracks/shapes/special.scad @@ -159,19 +159,21 @@ module barrierHolderToUnibodyConnector(length, height, thickness, base) { carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { translateX(-length / 2) { rotate([90, 0, 90]) { - simplePolyhedron( - bottom = reverse(getBarrierHolderProfilePoints( - base = base, - bottomWidth = unibodyWidth, - topWidth = unibodyTopWidth - )), - top = reverse(getBarrierHolderProfilePoints( - base = base, - bottomWidth = holderWidth, - topWidth = holderTopWidth - )), - z = length - ); + repeatMirror() { + simplePolyhedron( + bottom = reverse(getBarrierHolderProfilePoints( + base = base, + bottomWidth = unibodyWidth, + topWidth = unibodyTopWidth + )), + top = reverse(getBarrierHolderProfilePoints( + base = base, + bottomWidth = holderWidth, + topWidth = holderTopWidth + )), + z = length + ); + } } } } From e0bec694a77a25456b83c502046d93aae48a7923 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 29 Feb 2020 13:43:21 +0100 Subject: [PATCH 119/191] Fix the width of the compensation barrier for a unibody U-turn --- rcmodels/tracks/shapes/curved.scad | 3 +-- rcmodels/tracks/shapes/profiles.scad | 3 +-- rcmodels/tracks/shapes/uturn.scad | 18 ++++++------------ 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/rcmodels/tracks/shapes/curved.scad b/rcmodels/tracks/shapes/curved.scad index 950d8d5..479527b 100644 --- a/rcmodels/tracks/shapes/curved.scad +++ b/rcmodels/tracks/shapes/curved.scad @@ -37,9 +37,8 @@ */ module curvedBarrierNotch(radius, thickness, base, distance = 0) { width = getBarrierNotchWidth(base, distance); - strip = getBarrierStripHeight(base); indent = getBarrierStripIndent(base); - height = strip - indent; + height = getBarrierStripHeight(base) - indent; angle = getArcAngle(radius = radius, length = width); chord = getChordLength(radius = radius, angle = getArcAngle(radius = radius, length = indent)); startAngle = angle / 2; diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index efa3b98..55a4125 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -54,9 +54,8 @@ module barrierLinkProfile(base, distance = 0) { module barrierNotchProfile(base, distance = 0) { width = getBarrierNotchWidth(base, distance); top = getBarrierNotchDistance(base, distance); - strip = getBarrierStripHeight(base); indent = getBarrierStripIndent(base); - height = strip - indent; + height = getBarrierStripHeight(base) - indent; polygon(path([ ["P", -width / 2, 0], diff --git a/rcmodels/tracks/shapes/uturn.scad b/rcmodels/tracks/shapes/uturn.scad index 0a76b94..30b07bb 100644 --- a/rcmodels/tracks/shapes/uturn.scad +++ b/rcmodels/tracks/shapes/uturn.scad @@ -39,12 +39,11 @@ */ module uTurnBarrierHolder(length, height, thickness, base, gap, right = false) { thickness = thickness + printTolerance; - holderWidth = getBarrierHolderWidth(base); holderHeight = getBarrierHolderHeight(base); linkHeight = getBarrierHolderLinkHeight(base); towerWidth = nozzleAligned(thickness + minWidth); towerHeight = getBarrierBodyInnerHeight(height, base) / 2; - interval = (holderWidth + gap) / 2; + interval = (getBarrierHolderWidth(base) + gap) / 2; dir = right ? -1 : 1; length = length / 2; @@ -149,11 +148,9 @@ module uTurnBarrierUnibody(length, height, thickness, base, gap, right = false) * @param Number gap - The distance between the two side of the u-turn. */ module uTurnCompensationBarrierHolder(thickness, base, gap) { - holderWidth = getBarrierHolderWidth(base); - holderHeight = getBarrierHolderHeight(base); - length = holderWidth + gap; + length = getBarrierHolderWidth(base) + gap; indent = getBarrierStripIndent(base); - height = holderHeight - indent; + height = getBarrierHolderHeight(base) - indent; thickness = thickness + printTolerance; difference() { @@ -176,7 +173,7 @@ module uTurnCompensationBarrierHolder(thickness, base, gap) { * @param Number gap - The distance between the two side of the u-turn. */ module uTurnCompensationBarrierUnibody(height, thickness, base, gap) { - length = getBarrierHolderWidth(base) + gap; + length = getBarrierUnibodyWidth(base) + gap; straightBarrierUnibody( length = length, @@ -195,11 +192,8 @@ module uTurnCompensationBarrierUnibody(height, thickness, base, gap) { * @param Number gap - The distance between the two side of the u-turn. */ module uTurnCompensationBarrierBody(length, height, thickness, base, gap) { - holderWidth = getBarrierHolderWidth(base); - strip = getBarrierStripHeight(base); - indent = getBarrierStripIndent(base); - stripHeight = strip - indent; - compensation = holderWidth + gap; + stripHeight = getBarrierStripHeight(base) - getBarrierStripIndent(base); + compensation = getBarrierHolderWidth(base) + gap; compensedLength = length + compensation; interval = length / 2; From e90636a0bf996474e9ece35423f4c950c2ba012b Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 1 Mar 2020 11:43:29 +0100 Subject: [PATCH 120/191] Refine the shape of the unibody barrier --- rcmodels/tracks/shapes/profiles.scad | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index 55a4125..e56c5ba 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -127,14 +127,16 @@ module barrierUnibodyProfile(height, base, thickness, distance = 0) { holderLineX = (holderWidth - holderTopWidth) / 2 - holderOffset; holderLineY = holderHeight - base - holderOffset; + unibodyOffset = base / 2; unibodyNeck = base / 2; + unibodySide = base - unibodyOffset; unibodyWidth = getBarrierUnibodyWidth(base); - unibodyOffsetWidth = unibodyWidth - holderOffset * 2; - unibodyLineX = (unibodyWidth - holderTopWidth) / 2 - holderOffset; - unibodyLineY = height - holderHeight - unibodyNeck - base - holderOffset; + unibodyOffsetWidth = unibodyWidth - unibodyOffset * 2; + unibodyLineX = (unibodyWidth - holderTopWidth) / 2 - unibodyOffset; + unibodyLineY = height - holderHeight - unibodyNeck - base - unibodyOffset; startX = holderTopWidth / 2; - startY = holderSide + unibodyLineY + unibodyNeck + holderOffset * 2; + startY = holderSide + unibodyLineY + unibodyOffset + unibodyNeck + holderOffset; polygon(outline(path([ ["P", -startX, startY], @@ -150,15 +152,15 @@ module barrierUnibodyProfile(height, base, thickness, distance = 0) { ["L", -holderOffset, -holderOffset], // unibody profile ["V", -unibodyNeck], - ["L", holderOffset, -holderOffset], + ["L", unibodyOffset, -unibodyOffset], ["L", unibodyLineX, -unibodyLineY], - ["V", -holderSide], - ["L", -holderOffset, -holderOffset], + ["V", -unibodySide], + ["L", -unibodyOffset, -unibodyOffset], ["H", -unibodyOffsetWidth], - ["L", -holderOffset, holderOffset], - ["V", holderSide], + ["L", -unibodyOffset, unibodyOffset], + ["V", unibodySide], ["L", unibodyLineX, unibodyLineY], - ["L", holderOffset, holderOffset], + ["L", unibodyOffset, unibodyOffset], ["V", unibodyNeck] ]), -distance), convexity = 10); } From e296c90f6bb3a480c00e30cbb5843ec71c1a6345 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 1 Mar 2020 13:11:02 +0100 Subject: [PATCH 121/191] Use prefixed files instead of particular folders for curved parts --- rcmodels/tracks/render.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index bea9a7b..1347fe7 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -58,9 +58,11 @@ source "${scriptpath}/../../lib/camelSCAD/scripts/utils.sh" # @param sourcepath - The path of the folder containing the SCAD files to render. # @param destpath - The path to the output folder. # @param right - Right oriented or left oriented +# @param prefix - Optional prefix added to the output fil name +# @param suffix - Optional suffix added to the output fil name renderpath() { local rightOriented=$3 - scadrenderall "$1" "$2" "" "" \ + scadrenderall "$1" "$2" "$4" "$5" \ "$(varif "trackSectionLength" ${trackSectionLength})" \ "$(varif "trackSectionWidth" ${trackSectionWidth})" \ "$(varif "trackLaneWidth" ${trackLaneWidth})" \ @@ -78,9 +80,9 @@ renderpathall() { printmessage "${C_MSG}- straight elements" renderpath "$1/straight" "$2" printmessage "${C_MSG}- left curved elements" - renderpath "$1/curved" "$2/left" "0" + renderpath "$1/curved" "$2" "0" "left" printmessage "${C_MSG}- right curved elements" - renderpath "$1/curved" "$2/right" "1" + renderpath "$1/curved" "$2" "1" "right" } # Display the render config From ecaace029ec1d014e6b366dbacc793010cfe3596 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 1 Mar 2020 13:38:18 +0100 Subject: [PATCH 122/191] Fix wrong translation in fc-case --- rcmodels/fc-case.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rcmodels/fc-case.scad b/rcmodels/fc-case.scad index c71e96d..aa5f86b 100644 --- a/rcmodels/fc-case.scad +++ b/rcmodels/fc-case.scad @@ -181,7 +181,7 @@ buildBox(mode=renderMode) { } // bind switch peg rotateZ(bindAngle) { - translate([0, -bindPegOffset], thickness) { + translate([0, -bindPegOffset, thickness]) { bullet([bindPegDiameter, bindPegDiameter, bindPegHeight], d=bindPegDiameter / 2); } } From d3435b63532f684d8b0031989f50b40ee0c5b977 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 1 Mar 2020 13:41:24 +0100 Subject: [PATCH 123/191] Update camelSCAD to v0.10.1 --- lib/camelSCAD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/camelSCAD b/lib/camelSCAD index a748b12..316c8a1 160000 --- a/lib/camelSCAD +++ b/lib/camelSCAD @@ -1 +1 @@ -Subproject commit a748b124013464445893e80951b6716f2fd12b18 +Subproject commit 316c8a1b8bf8abe3fd043c6e9549cda009d135c6 From abf67e0e267775f54d3087a415db54155be962e1 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 1 Mar 2020 16:58:11 +0100 Subject: [PATCH 124/191] Fix the shape of the unibody to barrier holder connector --- rcmodels/tracks/shapes/profiles.scad | 5 +++-- rcmodels/tracks/shapes/special.scad | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index e56c5ba..018bdb4 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -70,14 +70,14 @@ module barrierNotchProfile(base, distance = 0) { /** * Draws the outline of a barrier holder profile. * @param Number base - The base unit value used to design the barrier holder. + * @param Number holderOffset - The offset of the shape edges. * @param Number bottomWidth - The width of the bottom of the shape. * @param Number topWidth - The width of the top of the shape. * @returns Vector[] */ -function getBarrierHolderProfilePoints(base, bottomWidth, topWidth) = +function getBarrierHolderProfilePoints(base, holderOffset, bottomWidth, topWidth) = let( holderHeight = getBarrierHolderHeight(base), - holderOffset = base / 4, holderSide = base - holderOffset, holderLineX = (bottomWidth - topWidth) / 2 - holderOffset, holderLineY = holderHeight - holderSide - holderOffset * 2 @@ -105,6 +105,7 @@ function getBarrierHolderProfilePoints(base, bottomWidth, topWidth) = module barrierHolderProfile(base, thickness, distance = 0) { polygon(outline(getBarrierHolderProfilePoints( base = base, + holderOffset = base / 4, bottomWidth = getBarrierHolderWidth(base), topWidth = getBarrierHolderTopWidth(base, thickness) ), -distance), convexity = 10); diff --git a/rcmodels/tracks/shapes/special.scad b/rcmodels/tracks/shapes/special.scad index 15ec630..1fbce1f 100644 --- a/rcmodels/tracks/shapes/special.scad +++ b/rcmodels/tracks/shapes/special.scad @@ -133,10 +133,10 @@ module barrierHolderToUnibodyConnector(length, height, thickness, base) { holderHeight = getBarrierHolderHeight(base); holderLinkHeight = getBarrierHolderLinkHeight(base); unibodyWidth = getBarrierUnibodyWidth(base); - unibodyLineX = (unibodyWidth - holderTopWidth) / 2 - base / 4; - unibodyLineY = height - holderHeight - base * 1.75; - holderLineY = holderHeight - base * 1.25; - unibodyTopWidth = unibodyWidth - base / 2 - holderLineY * (unibodyLineX / unibodyLineY) * 2; + unibodyLineX = (unibodyWidth - holderTopWidth) / 2 - base / 2; + unibodyLineY = height - holderHeight - base * 2; + holderLineY = holderHeight - base * 1.5; + unibodyTopWidth = unibodyWidth - base - holderLineY * (unibodyLineX / unibodyLineY) * 2; length = length / 2; distribute(intervalX=length, center=true) { @@ -163,11 +163,13 @@ module barrierHolderToUnibodyConnector(length, height, thickness, base) { simplePolyhedron( bottom = reverse(getBarrierHolderProfilePoints( base = base, + holderOffset = base / 2, bottomWidth = unibodyWidth, topWidth = unibodyTopWidth )), top = reverse(getBarrierHolderProfilePoints( base = base, + holderOffset = base / 4, bottomWidth = holderWidth, topWidth = holderTopWidth )), From fd3c6b3f9f63fee22e401b7f4707a59542a42df1 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 1 Mar 2020 17:34:43 +0100 Subject: [PATCH 125/191] Fix the facets issue on the bent mast when the number is increased --- rcmodels/tracks/shapes/accessories.scad | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rcmodels/tracks/shapes/accessories.scad b/rcmodels/tracks/shapes/accessories.scad index 4ef5544..7797e2e 100644 --- a/rcmodels/tracks/shapes/accessories.scad +++ b/rcmodels/tracks/shapes/accessories.scad @@ -120,10 +120,12 @@ module bentMast(width, height, distance = 0) { rotate([90, 0, 90]) { rotate_extrude(angle=90, convexity=10) { translateX(width) { - mastProfile( - width = width, - distance = distance - ); + rotateZ(getPolygonAngle(1, mastFacets) / 2) { + mastProfile( + width = width, + distance = distance + ); + } } } } From 065d797271562fca8a814373ff709761f162cc9b Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 1 Mar 2020 17:36:50 +0100 Subject: [PATCH 126/191] Move the config value for the mast facets at a proper place --- rcmodels/tracks/config/config.scad | 1 + rcmodels/tracks/config/values.scad | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index c2b79c1..095b980 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -53,6 +53,7 @@ accessoryClipThickness = 0.8; // The thickness of the cable clip cableClipWidth = 2; // The width of the cable clip mastWidth = 3; // The width of the accessory mast mastHeight = 70; // The length of the accessory mast +mastFacets = 8; // The number of facets the accessory mast have flagWidth = 40; // The width of the accessory flag flagHeight = 20; // The height of the accessory flag flagThickness = 0.8; // The thickness of the accessory flag diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index d196225..19b3943 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -345,6 +345,3 @@ stripIndentRatio = 0.5; // The angle of a typical curve curveAngle = 90; - -// The number of facets the accessory mast have -mastFacets = 6; From c16b1245b4d5e89b640bcf7b77d652b239393e9e Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 1 Mar 2020 22:22:17 +0100 Subject: [PATCH 127/191] Add print interval for sets of shapes --- rcmodels/tracks/config/config.scad | 3 ++- rcmodels/tracks/config/values.scad | 8 ++++++++ rcmodels/tracks/parts/elements/straight/arch-tower.scad | 3 ++- .../tracks/parts/unibody/straight/straight-connector.scad | 4 ++-- rcmodels/tracks/shapes/accessories.scad | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 095b980..713657d 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -35,7 +35,7 @@ renderMode = MODE_PROD; // Defines the constraints of the printer. printResolution = 0.2; // The target layer height -nozzleWidth = 0.4; // The size of the print nozzle +nozzleWidth = 0.4; // The size of the printer's nozzle printTolerance = 0.1; // The print tolerance when pieces need to be assembled // The dimensions and constraints of a track element @@ -58,3 +58,4 @@ flagWidth = 40; // The width of the accessory flag flagHeight = 20; // The height of the accessory flag flagThickness = 0.8; // The thickness of the accessory flag rightOriented = false; // The orientation of the curved elements +printInterval = 5; // Interval between 2 pieces when presented together diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 19b3943..2b3ba69 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -228,6 +228,13 @@ function getCurveAngle(ratio) = curveAngle / ratio; */ function getMastRadius(width) = circumradius(n = mastFacets, a = width / 2); +/** + * Computes the print interval between the centers of 2 objects. + * @param Number size - The size of the shape. + * @returns Number + */ +function getPrintInterval(size) = size + printInterval; + /** * Validates the config values, checking if it match the critical constraints. * @param Number length - The nominal size of a track element. @@ -329,6 +336,7 @@ module printConfig(length, width, lane, height, radius, base) { str("Nozzle diameter: ", nozzleWidth, "mm"), str("Print layer: ", printResolution, "mm"), str("Print tolerance: ", printTolerance, "mm"), + str("Print interval: ", printInterval, "mm"), "" ], str(chr(13), chr(10)))); } diff --git a/rcmodels/tracks/parts/elements/straight/arch-tower.scad b/rcmodels/tracks/parts/elements/straight/arch-tower.scad index cdd7c62..4ca5715 100644 --- a/rcmodels/tracks/parts/elements/straight/arch-tower.scad +++ b/rcmodels/tracks/parts/elements/straight/arch-tower.scad @@ -35,7 +35,8 @@ include <../../../config/setup.scad> applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - distribute([0, getBarrierHolderWidth(barrierHolderBase) * 2, 0], center=true) { + width = getBarrierHolderWidth(barrierHolderBase) + archTowerThickness * 2; + distribute([0, getPrintInterval(width), 0], center=true) { archTowerMale( length = trackSectionLength, thickness = barrierBodyThickness, diff --git a/rcmodels/tracks/parts/unibody/straight/straight-connector.scad b/rcmodels/tracks/parts/unibody/straight/straight-connector.scad index 827566b..458d78b 100644 --- a/rcmodels/tracks/parts/unibody/straight/straight-connector.scad +++ b/rcmodels/tracks/parts/unibody/straight/straight-connector.scad @@ -35,14 +35,14 @@ include <../../../config/setup.scad> applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - distribute(intervalY=getBarrierHolderWidth(barrierHolderBase) * 2, center=true) { + distribute(intervalY=getPrintInterval(getBarrierUnibodyWidth(barrierHolderBase)), center=true) { barrierHolderToUnibodyMale( length = trackSectionLength, height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase ); - distribute(intervalX=getBarrierHolderWidth(barrierHolderBase) + trackSectionLength / 2, center=true) { + distribute(intervalX=getPrintInterval(getBarrierLinkWidth(barrierHolderBase) + trackSectionLength / 2), center=true) { barrierHolderConnectorFemale( length = trackSectionLength, thickness = barrierBodyThickness, diff --git a/rcmodels/tracks/shapes/accessories.scad b/rcmodels/tracks/shapes/accessories.scad index 7797e2e..0a0b338 100644 --- a/rcmodels/tracks/shapes/accessories.scad +++ b/rcmodels/tracks/shapes/accessories.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * Defines the shapes for the track accessories. + * Defines the shapes for the track accessories. * * @author jsconan */ From 79a462657e4a4fe7025c94c7d7a5ba2973ba163d Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 1 Mar 2020 23:20:58 +0100 Subject: [PATCH 128/191] Add final shapes for the renderable parts --- .../tracks/parts/accessories/bent-mast.scad | 15 ++++++++---- .../tracks/parts/accessories/cable-clip.scad | 15 ++++++++---- .../parts/accessories/flag-straight.scad | 15 ++++++++---- .../tracks/parts/accessories/flag-wavy.scad | 15 ++++++++---- rcmodels/tracks/parts/accessories/mast.scad | 15 ++++++++---- .../parts/elements/curved/curved-inner.scad | 15 ++++++++---- .../parts/elements/curved/curved-outer.scad | 15 ++++++++---- .../parts/elements/curved/curved-short.scad | 15 ++++++++---- .../parts/elements/curved/curved-small.scad | 15 ++++++++---- .../parts/elements/curved/curved-uturn.scad | 15 ++++++++---- .../parts/elements/straight/arch-tower.scad | 16 +++++++++---- .../parts/elements/straight/body-curved.scad | 15 ++++++++---- .../elements/straight/body-straight.scad | 15 ++++++++---- .../parts/elements/straight/body-uturn.scad | 15 ++++++++---- .../elements/straight/straight-double.scad | 15 ++++++++---- .../elements/straight/straight-simple.scad | 15 ++++++++---- .../elements/straight/straight-uturn.scad | 15 ++++++++---- .../samples/curved/curved-inner-full.scad | 15 ++++++++---- .../parts/samples/curved/curved-inner.scad | 15 ++++++++---- .../samples/curved/curved-outer-full.scad | 15 ++++++++---- .../parts/samples/curved/curved-outer.scad | 15 ++++++++---- .../parts/samples/curved/curved-short.scad | 15 ++++++++---- .../parts/samples/curved/curved-small.scad | 15 ++++++++---- .../parts/samples/curved/curved-uturn.scad | 15 ++++++++---- .../parts/samples/straight/arch-sample.scad | 23 ++++++++++++------- .../samples/straight/straight-double.scad | 15 ++++++++---- .../samples/straight/straight-long-10.scad | 15 ++++++++---- .../samples/straight/straight-long-20.scad | 15 ++++++++---- .../samples/straight/straight-long-5.scad | 15 ++++++++---- .../samples/straight/straight-simple.scad | 15 ++++++++---- .../samples/straight/straight-uturn.scad | 15 ++++++++---- .../parts/unibody/curved/curved-inner.scad | 15 ++++++++---- .../parts/unibody/curved/curved-outer.scad | 15 ++++++++---- .../parts/unibody/curved/curved-short.scad | 15 ++++++++---- .../parts/unibody/curved/curved-small.scad | 15 ++++++++---- .../parts/unibody/curved/curved-uturn.scad | 15 ++++++++---- .../unibody/straight/straight-connector.scad | 15 ++++++++---- .../unibody/straight/straight-double.scad | 15 ++++++++---- .../unibody/straight/straight-simple.scad | 15 ++++++++---- .../unibody/straight/straight-uturn.scad | 15 ++++++++---- 40 files changed, 445 insertions(+), 164 deletions(-) diff --git a/rcmodels/tracks/parts/accessories/bent-mast.scad b/rcmodels/tracks/parts/accessories/bent-mast.scad index f5e19eb..d9de29d 100644 --- a/rcmodels/tracks/parts/accessories/bent-mast.scad +++ b/rcmodels/tracks/parts/accessories/bent-mast.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a bent mast. + */ +module finalBentMast() { accessoryBentMast( width = mastWidth, height = [mastWidth, mastHeight], @@ -43,3 +43,10 @@ applyMode(mode=renderMode) { thickness = barrierBodyThickness ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalBentMast(); +} diff --git a/rcmodels/tracks/parts/accessories/cable-clip.scad b/rcmodels/tracks/parts/accessories/cable-clip.scad index 128d3a7..45fdd74 100644 --- a/rcmodels/tracks/parts/accessories/cable-clip.scad +++ b/rcmodels/tracks/parts/accessories/cable-clip.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a cable clip. + */ +module finalCableClip() { cableClip( height = cableClipWidth, wall = accessoryClipThickness, @@ -42,3 +42,10 @@ applyMode(mode=renderMode) { thickness = barrierBodyThickness ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalCableClip(); +} diff --git a/rcmodels/tracks/parts/accessories/flag-straight.scad b/rcmodels/tracks/parts/accessories/flag-straight.scad index 8a5e0c8..880a746 100644 --- a/rcmodels/tracks/parts/accessories/flag-straight.scad +++ b/rcmodels/tracks/parts/accessories/flag-straight.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a straight flag. + */ +module finalStraightFlag() { accessoryFlag( width = flagWidth, height = flagHeight, @@ -43,3 +43,10 @@ applyMode(mode=renderMode) { wave = 0 ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalStraightFlag(); +} diff --git a/rcmodels/tracks/parts/accessories/flag-wavy.scad b/rcmodels/tracks/parts/accessories/flag-wavy.scad index d998fe4..31d1683 100644 --- a/rcmodels/tracks/parts/accessories/flag-wavy.scad +++ b/rcmodels/tracks/parts/accessories/flag-wavy.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a wavy flag. + */ +module finalWavyFlag() { accessoryFlag( width = flagWidth, height = flagHeight, @@ -43,3 +43,10 @@ applyMode(mode=renderMode) { wave = 2 ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalWavyFlag(); +} diff --git a/rcmodels/tracks/parts/accessories/mast.scad b/rcmodels/tracks/parts/accessories/mast.scad index 9682ff4..aabbdeb 100644 --- a/rcmodels/tracks/parts/accessories/mast.scad +++ b/rcmodels/tracks/parts/accessories/mast.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a straight mast. + */ +module finalStraightMast() { accessoryMast( width = mastWidth, height = mastHeight, @@ -43,3 +43,10 @@ applyMode(mode=renderMode) { thickness = barrierBodyThickness ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalStraightMast(); +} diff --git a/rcmodels/tracks/parts/elements/curved/curved-inner.scad b/rcmodels/tracks/parts/elements/curved/curved-inner.scad index c70fd94..b80ed35 100644 --- a/rcmodels/tracks/parts/elements/curved/curved-inner.scad +++ b/rcmodels/tracks/parts/elements/curved/curved-inner.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for an inner curve. + */ +module finalInnerCurveBarrierHolder() { curvedBarrierHolder( length = trackSectionLength, thickness = barrierBodyThickness, @@ -43,3 +43,10 @@ applyMode(mode=renderMode) { right = rightOriented ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalInnerCurveBarrierHolder(); +} diff --git a/rcmodels/tracks/parts/elements/curved/curved-outer.scad b/rcmodels/tracks/parts/elements/curved/curved-outer.scad index 179e367..83a417c 100644 --- a/rcmodels/tracks/parts/elements/curved/curved-outer.scad +++ b/rcmodels/tracks/parts/elements/curved/curved-outer.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for an outer curve. + */ +module finalOuterCurveBarrierHolder() { curvedBarrierHolder( length = trackSectionLength, thickness = barrierBodyThickness, @@ -43,3 +43,10 @@ applyMode(mode=renderMode) { right = rightOriented ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalOuterCurveBarrierHolder(); +} diff --git a/rcmodels/tracks/parts/elements/curved/curved-short.scad b/rcmodels/tracks/parts/elements/curved/curved-short.scad index 04a5bd2..f72544d 100644 --- a/rcmodels/tracks/parts/elements/curved/curved-short.scad +++ b/rcmodels/tracks/parts/elements/curved/curved-short.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a short curve. + */ +module finalShortCurveBarrierHolder() { curvedBarrierHolder( length = trackSectionLength, thickness = barrierBodyThickness, @@ -43,3 +43,10 @@ applyMode(mode=renderMode) { right = rightOriented ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalShortCurveBarrierHolder(); +} diff --git a/rcmodels/tracks/parts/elements/curved/curved-small.scad b/rcmodels/tracks/parts/elements/curved/curved-small.scad index d3e5962..7f6099f 100644 --- a/rcmodels/tracks/parts/elements/curved/curved-small.scad +++ b/rcmodels/tracks/parts/elements/curved/curved-small.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a small curve. + */ +module finalSmallCurveBarrierHolder() { curvedBarrierHolder( length = trackSectionLength, thickness = barrierBodyThickness, @@ -43,3 +43,10 @@ applyMode(mode=renderMode) { right = rightOriented ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalSmallCurveBarrierHolder(); +} diff --git a/rcmodels/tracks/parts/elements/curved/curved-uturn.scad b/rcmodels/tracks/parts/elements/curved/curved-uturn.scad index 4f8d513..92ee3ab 100644 --- a/rcmodels/tracks/parts/elements/curved/curved-uturn.scad +++ b/rcmodels/tracks/parts/elements/curved/curved-uturn.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a U-turn curve. + */ +module finalUTurnCurveBarrierHolder() { uTurnBarrierHolder( length = trackSectionLength, height = barrierHeight, @@ -44,3 +44,10 @@ applyMode(mode=renderMode) { right = rightOriented ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalUTurnCurveBarrierHolder(); +} diff --git a/rcmodels/tracks/parts/elements/straight/arch-tower.scad b/rcmodels/tracks/parts/elements/straight/arch-tower.scad index 4ca5715..c61061c 100644 --- a/rcmodels/tracks/parts/elements/straight/arch-tower.scad +++ b/rcmodels/tracks/parts/elements/straight/arch-tower.scad @@ -31,11 +31,12 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shapes for a couple of arch towers (male and female). + */ +module finalArchTower() { width = getBarrierHolderWidth(barrierHolderBase) + archTowerThickness * 2; + distribute([0, getPrintInterval(width), 0], center=true) { archTowerMale( length = trackSectionLength, @@ -51,3 +52,10 @@ applyMode(mode=renderMode) { ); } } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalArchTower(); +} diff --git a/rcmodels/tracks/parts/elements/straight/body-curved.scad b/rcmodels/tracks/parts/elements/straight/body-curved.scad index ce1ba87..0b7b1f6 100644 --- a/rcmodels/tracks/parts/elements/straight/body-curved.scad +++ b/rcmodels/tracks/parts/elements/straight/body-curved.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for the additional barrier body of a curve. + */ +module finalCurveBarrierBody() { barrierBody( length = getCurveRemainingLength(trackSectionLength), height = getBarrierBodyHeight(barrierHeight), @@ -43,3 +43,10 @@ applyMode(mode=renderMode) { notches = 1 ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalCurveBarrierBody(); +} diff --git a/rcmodels/tracks/parts/elements/straight/body-straight.scad b/rcmodels/tracks/parts/elements/straight/body-straight.scad index 7eed5b6..8f05d85 100644 --- a/rcmodels/tracks/parts/elements/straight/body-straight.scad +++ b/rcmodels/tracks/parts/elements/straight/body-straight.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a barrier body. + */ +module finalStraightBarrierBody() { barrierBody( length = trackSectionLength, height = getBarrierBodyHeight(barrierHeight), @@ -43,3 +43,10 @@ applyMode(mode=renderMode) { notches = 2 ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalStraightBarrierBody(); +} diff --git a/rcmodels/tracks/parts/elements/straight/body-uturn.scad b/rcmodels/tracks/parts/elements/straight/body-uturn.scad index 99d20d6..031d2f7 100644 --- a/rcmodels/tracks/parts/elements/straight/body-uturn.scad +++ b/rcmodels/tracks/parts/elements/straight/body-uturn.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for the additional barrier body of a U-turn. + */ +module finalUTurnBarrierBody() { uTurnCompensationBarrierBody( length = trackSectionLength, height = getBarrierBodyHeight(barrierHeight), @@ -43,3 +43,10 @@ applyMode(mode=renderMode) { gap = archTowerThickness * 2 ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalUTurnBarrierBody(); +} diff --git a/rcmodels/tracks/parts/elements/straight/straight-double.scad b/rcmodels/tracks/parts/elements/straight/straight-double.scad index 04eeeb5..7ac4d95 100644 --- a/rcmodels/tracks/parts/elements/straight/straight-double.scad +++ b/rcmodels/tracks/parts/elements/straight/straight-double.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a double length barrier holder. + */ +module finalDoubleStraightBarrierHolder() { straightBarrierHolder( length = trackSectionLength, thickness = barrierBodyThickness, @@ -42,3 +42,10 @@ applyMode(mode=renderMode) { ratio = 2 ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalDoubleStraightBarrierHolder(); +} diff --git a/rcmodels/tracks/parts/elements/straight/straight-simple.scad b/rcmodels/tracks/parts/elements/straight/straight-simple.scad index 088d2eb..389304e 100644 --- a/rcmodels/tracks/parts/elements/straight/straight-simple.scad +++ b/rcmodels/tracks/parts/elements/straight/straight-simple.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a simple length barrier holder. + */ +module finalSimpleStraightBarrierHolder() { straightBarrierHolder( length = trackSectionLength, thickness = barrierBodyThickness, @@ -42,3 +42,10 @@ applyMode(mode=renderMode) { ratio = 1 ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalSimpleStraightBarrierHolder(); +} diff --git a/rcmodels/tracks/parts/elements/straight/straight-uturn.scad b/rcmodels/tracks/parts/elements/straight/straight-uturn.scad index 04d176b..824f5fa 100644 --- a/rcmodels/tracks/parts/elements/straight/straight-uturn.scad +++ b/rcmodels/tracks/parts/elements/straight/straight-uturn.scad @@ -31,13 +31,20 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a U-turn compensation barrier holder. + */ +module finalUTurnCompensationBarrierHolder() { uTurnCompensationBarrierHolder( thickness = barrierBodyThickness, base = barrierHolderBase, gap = archTowerThickness * 2 ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalUTurnCompensationBarrierHolder(); +} diff --git a/rcmodels/tracks/parts/samples/curved/curved-inner-full.scad b/rcmodels/tracks/parts/samples/curved/curved-inner-full.scad index 2589c25..f7b7900 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-inner-full.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-inner-full.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a full inner curve. + */ +module finalFullInnerCurveBarrierSample() { curvedBarrierMain( length = sampleSize * getInnerCurveRatio(trackSectionLength, trackRadius), thickness = barrierBodyThickness, @@ -43,3 +43,10 @@ applyMode(mode=renderMode) { right = rightOriented ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalFullInnerCurveBarrierSample(); +} diff --git a/rcmodels/tracks/parts/samples/curved/curved-inner.scad b/rcmodels/tracks/parts/samples/curved/curved-inner.scad index 653bc0c..17cde10 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-inner.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-inner.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for an inner curve. + */ +module finalInnerCurveBarrierSample() { curvedBarrierMain( length = sampleSize, thickness = barrierBodyThickness, @@ -43,3 +43,10 @@ applyMode(mode=renderMode) { right = rightOriented ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalInnerCurveBarrierSample(); +} diff --git a/rcmodels/tracks/parts/samples/curved/curved-outer-full.scad b/rcmodels/tracks/parts/samples/curved/curved-outer-full.scad index 43d982a..15b6114 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-outer-full.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-outer-full.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a full outer curve. + */ +module finalFullOuterCurveBarrierSample() { curvedBarrierMain( length = sampleSize * getOuterCurveRatio(trackSectionLength, trackSectionWidth, trackRadius), thickness = barrierBodyThickness, @@ -43,3 +43,10 @@ applyMode(mode=renderMode) { right = rightOriented ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalFullOuterCurveBarrierSample(); +} diff --git a/rcmodels/tracks/parts/samples/curved/curved-outer.scad b/rcmodels/tracks/parts/samples/curved/curved-outer.scad index 802f30a..6952470 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-outer.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-outer.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for an outer curve. + */ +module finalOuterCurveBarrierSample() { curvedBarrierMain( length = sampleSize, thickness = barrierBodyThickness, @@ -43,3 +43,10 @@ applyMode(mode=renderMode) { right = rightOriented ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalOuterCurveBarrierSample(); +} diff --git a/rcmodels/tracks/parts/samples/curved/curved-short.scad b/rcmodels/tracks/parts/samples/curved/curved-short.scad index c2d09fb..2c9552c 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-short.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-short.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a short curve. + */ +module finalShortCurveBarrierSample() { curvedBarrierMain( length = sampleSize, thickness = barrierBodyThickness, @@ -43,3 +43,10 @@ applyMode(mode=renderMode) { right = rightOriented ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalShortCurveBarrierSample(); +} diff --git a/rcmodels/tracks/parts/samples/curved/curved-small.scad b/rcmodels/tracks/parts/samples/curved/curved-small.scad index 81abdee..a5d6913 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-small.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-small.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a small curve. + */ +module finalSmallCurveBarrierSample() { curvedBarrierMain( length = sampleSize, thickness = barrierBodyThickness, @@ -43,3 +43,10 @@ applyMode(mode=renderMode) { right = rightOriented ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalSmallCurveBarrierSample(); +} diff --git a/rcmodels/tracks/parts/samples/curved/curved-uturn.scad b/rcmodels/tracks/parts/samples/curved/curved-uturn.scad index ded2c22..1200048 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-uturn.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-uturn.scad @@ -79,10 +79,10 @@ module uTurnSample(length, thickness, base, gap, right = false) { } } -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a U-turn curve. + */ +module finalUTurnCurveBarrierSample() { uTurnSample( length = sampleSize, thickness = barrierBodyThickness, @@ -91,3 +91,10 @@ applyMode(mode=renderMode) { right = rightOriented ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalUTurnCurveBarrierSample(); +} diff --git a/rcmodels/tracks/parts/samples/straight/arch-sample.scad b/rcmodels/tracks/parts/samples/straight/arch-sample.scad index 58a0a76..c47f398 100644 --- a/rcmodels/tracks/parts/samples/straight/arch-sample.scad +++ b/rcmodels/tracks/parts/samples/straight/arch-sample.scad @@ -31,10 +31,6 @@ // Import the project's setup. include <../../../config/setup.scad> -// Refine the config for the arch sample -laneWidth = trackLaneWidth / trackSectionLength * sampleSize; -wallWidth = minWidth * 2; - /** * Computes the points defining the profile of the arch sample. * @param Number length - The length of a track element. @@ -66,6 +62,7 @@ function getArchSamplePoints(length, width) = */ module archSampleProfile(length, width, wall) { distance = wall / 2; + difference() { polygon(outline(getArchSamplePoints(length, width), -distance), convexity = 10); polygon(outline(getArchSamplePoints(length, width), distance), convexity = 10); @@ -73,10 +70,13 @@ module archSampleProfile(length, width, wall) { } } -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for an arch sample. + */ +module finalArchSample() { + laneWidth = trackLaneWidth / trackSectionLength * sampleSize; + wallWidth = minWidth * 2; + negativeExtrude(height=getBarrierHolderWidth(sampleBase)) { archSampleProfile(sampleSize, laneWidth, wallWidth); repeat(count=2, intervalX=laneWidth, center=true) { @@ -95,3 +95,10 @@ applyMode(mode=renderMode) { } } } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalArchSample(); +} diff --git a/rcmodels/tracks/parts/samples/straight/straight-double.scad b/rcmodels/tracks/parts/samples/straight/straight-double.scad index 9824462..1ec53f9 100644 --- a/rcmodels/tracks/parts/samples/straight/straight-double.scad +++ b/rcmodels/tracks/parts/samples/straight/straight-double.scad @@ -31,13 +31,20 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a double length barrier sample. + */ +module finalDoubleStraightBarrierSample() { straightBarrierMain( length = sampleSize * 2, thickness = barrierBodyThickness, base = sampleBase ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalDoubleStraightBarrierSample(); +} diff --git a/rcmodels/tracks/parts/samples/straight/straight-long-10.scad b/rcmodels/tracks/parts/samples/straight/straight-long-10.scad index 5a7f694..9ed8799 100644 --- a/rcmodels/tracks/parts/samples/straight/straight-long-10.scad +++ b/rcmodels/tracks/parts/samples/straight/straight-long-10.scad @@ -31,13 +31,20 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a x10 length barrier sample. + */ +module finalLong10StraightBarrierSample() { straightBarrierMain( length = sampleSize * 10, thickness = barrierBodyThickness, base = sampleBase ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalLong10StraightBarrierSample(); +} diff --git a/rcmodels/tracks/parts/samples/straight/straight-long-20.scad b/rcmodels/tracks/parts/samples/straight/straight-long-20.scad index a2219fd..e6d5458 100644 --- a/rcmodels/tracks/parts/samples/straight/straight-long-20.scad +++ b/rcmodels/tracks/parts/samples/straight/straight-long-20.scad @@ -31,13 +31,20 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a x20 length barrier sample. + */ +module finalLong20StraightBarrierSample() { straightBarrierMain( length = sampleSize * 20, thickness = barrierBodyThickness, base = sampleBase ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalLong20StraightBarrierSample(); +} diff --git a/rcmodels/tracks/parts/samples/straight/straight-long-5.scad b/rcmodels/tracks/parts/samples/straight/straight-long-5.scad index 05f73e0..4f9c2f3 100644 --- a/rcmodels/tracks/parts/samples/straight/straight-long-5.scad +++ b/rcmodels/tracks/parts/samples/straight/straight-long-5.scad @@ -31,13 +31,20 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a x5 length barrier sample. + */ +module finalLong5StraightBarrierSample() { straightBarrierMain( length = sampleSize * 5, thickness = barrierBodyThickness, base = sampleBase ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalLong5StraightBarrierSample(); +} diff --git a/rcmodels/tracks/parts/samples/straight/straight-simple.scad b/rcmodels/tracks/parts/samples/straight/straight-simple.scad index e75eed7..d530b00 100644 --- a/rcmodels/tracks/parts/samples/straight/straight-simple.scad +++ b/rcmodels/tracks/parts/samples/straight/straight-simple.scad @@ -31,13 +31,20 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a simple length barrier sample. + */ +module finalSimpleStraightBarrierSample() { straightBarrierMain( length = sampleSize, thickness = barrierBodyThickness, base = sampleBase ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalSimpleStraightBarrierSample(); +} diff --git a/rcmodels/tracks/parts/samples/straight/straight-uturn.scad b/rcmodels/tracks/parts/samples/straight/straight-uturn.scad index 3fb57d6..2bf0bee 100644 --- a/rcmodels/tracks/parts/samples/straight/straight-uturn.scad +++ b/rcmodels/tracks/parts/samples/straight/straight-uturn.scad @@ -31,13 +31,20 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a U-turn compensation barrier sample. + */ +module finalUTurnCompensationBarrierSample() { straightBarrierMain( length = getBarrierHolderWidth(sampleBase) + minWidth * 2, thickness = barrierBodyThickness, base = sampleBase ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalUTurnCompensationBarrierSample(); +} diff --git a/rcmodels/tracks/parts/unibody/curved/curved-inner.scad b/rcmodels/tracks/parts/unibody/curved/curved-inner.scad index 05ed96b..aeb1938 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-inner.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-inner.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for an inner curve. + */ +module finalInnerCurveBarrierUnibody() { curvedBarrierUnibody( length = trackSectionLength, height = barrierHeight, @@ -44,3 +44,10 @@ applyMode(mode=renderMode) { right = rightOriented ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalInnerCurveBarrierUnibody(); +} diff --git a/rcmodels/tracks/parts/unibody/curved/curved-outer.scad b/rcmodels/tracks/parts/unibody/curved/curved-outer.scad index ea08671..72eb741 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-outer.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-outer.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for an outer curve. + */ +module finalOuterCurveBarrierUnibody() { curvedBarrierUnibody( length = trackSectionLength, height = barrierHeight, @@ -44,3 +44,10 @@ applyMode(mode=renderMode) { right = rightOriented ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalOuterCurveBarrierUnibody(); +} diff --git a/rcmodels/tracks/parts/unibody/curved/curved-short.scad b/rcmodels/tracks/parts/unibody/curved/curved-short.scad index 593c75c..ebd2f8e 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-short.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-short.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a short curve. + */ +module finalShortCurveBarrierUnibody() { curvedBarrierUnibody( length = trackSectionLength, height = barrierHeight, @@ -44,3 +44,10 @@ applyMode(mode=renderMode) { right = rightOriented ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalShortCurveBarrierUnibody(); +} diff --git a/rcmodels/tracks/parts/unibody/curved/curved-small.scad b/rcmodels/tracks/parts/unibody/curved/curved-small.scad index b4ace37..8b38fc4 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-small.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-small.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a small curve. + */ +module finalSmallCurveBarrierUnibody() { curvedBarrierUnibody( length = trackSectionLength, height = barrierHeight, @@ -44,3 +44,10 @@ applyMode(mode=renderMode) { right = rightOriented ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalSmallCurveBarrierUnibody(); +} diff --git a/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad b/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad index 4fb570b..050fb7a 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a U-turn curve. + */ +module finalUTurnCurveBarrierUnibody() { uTurnBarrierUnibody( length = trackSectionLength, height = barrierHeight, @@ -44,3 +44,10 @@ applyMode(mode=renderMode) { right = rightOriented ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalUTurnCurveBarrierUnibody(); +} diff --git a/rcmodels/tracks/parts/unibody/straight/straight-connector.scad b/rcmodels/tracks/parts/unibody/straight/straight-connector.scad index 458d78b..3530ae4 100644 --- a/rcmodels/tracks/parts/unibody/straight/straight-connector.scad +++ b/rcmodels/tracks/parts/unibody/straight/straight-connector.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a unibody barrier connector. + */ +module finalConnectorBarrierUnibody() { distribute(intervalY=getPrintInterval(getBarrierUnibodyWidth(barrierHolderBase)), center=true) { barrierHolderToUnibodyMale( length = trackSectionLength, @@ -62,3 +62,10 @@ applyMode(mode=renderMode) { ); } } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalConnectorBarrierUnibody(); +} diff --git a/rcmodels/tracks/parts/unibody/straight/straight-double.scad b/rcmodels/tracks/parts/unibody/straight/straight-double.scad index 1ee0e88..b9a440c 100644 --- a/rcmodels/tracks/parts/unibody/straight/straight-double.scad +++ b/rcmodels/tracks/parts/unibody/straight/straight-double.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a double length unibody barrier. + */ +module finalDoubleStraightBarrierUnibody() { straightBarrierUnibody( length = trackSectionLength * 2, height = barrierHeight, @@ -42,3 +42,10 @@ applyMode(mode=renderMode) { base = barrierHolderBase ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalDoubleStraightBarrierUnibody(); +} diff --git a/rcmodels/tracks/parts/unibody/straight/straight-simple.scad b/rcmodels/tracks/parts/unibody/straight/straight-simple.scad index 12fb7f3..5fac910 100644 --- a/rcmodels/tracks/parts/unibody/straight/straight-simple.scad +++ b/rcmodels/tracks/parts/unibody/straight/straight-simple.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a simple length unibody barrier. + */ +module finalSimpleStraightBarrierUnibody() { straightBarrierUnibody( length = trackSectionLength, height = barrierHeight, @@ -42,3 +42,10 @@ applyMode(mode=renderMode) { base = barrierHolderBase ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalSimpleStraightBarrierUnibody(); +} diff --git a/rcmodels/tracks/parts/unibody/straight/straight-uturn.scad b/rcmodels/tracks/parts/unibody/straight/straight-uturn.scad index 187d6eb..eebd3fd 100644 --- a/rcmodels/tracks/parts/unibody/straight/straight-uturn.scad +++ b/rcmodels/tracks/parts/unibody/straight/straight-uturn.scad @@ -31,10 +31,10 @@ // Import the project's setup. include <../../../config/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) +/** + * Defines the final shape for a U-turn compensation unibody barrier. + */ +module finalUTurnCompensationBarrierUnibody() { uTurnCompensationBarrierUnibody( height = barrierHeight, thickness = barrierBodyThickness, @@ -42,3 +42,10 @@ applyMode(mode=renderMode) { gap = archTowerThickness * 2 ); } + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + finalUTurnCompensationBarrierUnibody(); +} From 21938e2c52208733df53f9a9a7a0a63e70bb8549 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 6 Mar 2020 21:04:19 +0100 Subject: [PATCH 129/191] Improve positioning of curved parts --- rcmodels/tracks/config/values.scad | 7 + rcmodels/tracks/shapes/curved.scad | 7 +- rcmodels/tracks/test/curved.scad | 254 +++++++---------------------- 3 files changed, 71 insertions(+), 197 deletions(-) diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 2b3ba69..83ab9f1 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -221,6 +221,13 @@ function getCurveRadius(length, ratio) = length * ratio; */ function getCurveAngle(ratio) = curveAngle / ratio; +/** + * Computes the rotation angle used to place a curve. + * @param Number angle - The angle of the curve. + * @returns Number + */ +function getCurveRotationAngle(angle) = 45 + (curveAngle - angle) / 2; + /** * Computes the radius of the accessory mast. * @param Number width - The width of the mast. diff --git a/rcmodels/tracks/shapes/curved.scad b/rcmodels/tracks/shapes/curved.scad index 479527b..099cfd6 100644 --- a/rcmodels/tracks/shapes/curved.scad +++ b/rcmodels/tracks/shapes/curved.scad @@ -82,11 +82,8 @@ module curvedBarrierNotch(radius, thickness, base, distance = 0) { * @param Number z - An option Z-axis translation */ module placeCurvedElement(length, radius, angle, z = 0) { - remainingAngle = curveAngle - angle; - offset = (length - radius) * cos(45) * [1, 1, 0] + [0, 0, z]; - - translate(offset) { - rotateZ(remainingAngle / 2) { + translate([0, getChordHeight(angle, radius) / 2 - radius, z]) { + rotateZ(getCurveRotationAngle(angle)) { children(); } } diff --git a/rcmodels/tracks/test/curved.scad b/rcmodels/tracks/test/curved.scad index 965008e..f3bdcad 100644 --- a/rcmodels/tracks/test/curved.scad +++ b/rcmodels/tracks/test/curved.scad @@ -34,198 +34,68 @@ include // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=mode) { - distribute(intervalX=length * 3, center=true) { - - distribute(intervalY=length * 3, center=true) { - - // test the main shape of a curved barrier holder, short curve, right turned - curvedBarrierMain( - length = length, - thickness = thickness, - base = base, - ratio = 0.5, - right = true - ); - - // test the main shape of a curved barrier holder, short curve, left turned - curvedBarrierMain( - length = length, - thickness = thickness, - base = base, - ratio = 0.5, - right = false - ); - - distributeRotate(center=true) { - - // test the main shape of a curved barrier holder, inner curve, right turned - curvedBarrierMain( - length = length, - thickness = thickness, - base = base, - ratio = getInnerCurveRatio(length, radius), - right = true - ); - - // test the main shape of a curved barrier holder, outer curve, right turned - curvedBarrierMain( - length = length, - thickness = thickness, - base = base, - ratio = getOuterCurveRatio(length, width, radius), - right = true - ); - - // test the main shape of a curved barrier holder, inner curve, left turned - curvedBarrierMain( - length = length, - thickness = thickness, - base = base, - ratio = getInnerCurveRatio(length, radius), - right = false - ); - - // test the main shape of a curved barrier holder, outer curve, left turned - curvedBarrierMain( - length = length, - thickness = thickness, - base = base, - ratio = getOuterCurveRatio(length, width, radius), - right = false - ); - - } - } - - distribute(intervalY=length * 3, center=true) { - - // test the shape of the curved barrier holder, short curve, right turned - curvedBarrierHolder( - length = length, - thickness = thickness, - base = base, - ratio = 0.5, - right = true - ); - - // test the shape of the curved barrier holder, short curve, left turned - curvedBarrierHolder( - length = length, - thickness = thickness, - base = base, - ratio = 0.5, - right = false - ); - - distributeRotate(center=true) { - - // test the shape of the curved barrier holder, inner curve, right turned - curvedBarrierHolder( - length = length, - thickness = thickness, - base = base, - ratio = getInnerCurveRatio(length, radius), - right = true - ); - - // test the shape of the curved barrier holder, outer curve, right turned - curvedBarrierHolder( - length = length, - thickness = thickness, - base = base, - ratio = getOuterCurveRatio(length, width, radius), - right = true - ); - - // test the shape of the curved barrier holder, inner curve, left turned - curvedBarrierHolder( - length = length, - thickness = thickness, - base = base, - ratio = getInnerCurveRatio(length, radius), - right = false - ); - - // test the shape of the curved barrier holder, outer curve, left turned - curvedBarrierHolder( - length = length, - thickness = thickness, - base = base, - ratio = getOuterCurveRatio(length, width, radius), - right = false - ); - - } - - } - - distribute(intervalY=length * 3, center=true) { - - // test the shape of a curved unibody barrier, short curve, right turned - curvedBarrierUnibody( - length = length, - height = height, - thickness = thickness, - base = base, - ratio = 0.5, - right = true - ); - - // test the shape of a curved unibody barrier, short curve, left turned - curvedBarrierUnibody( - length = length, - height = height, - thickness = thickness, - base = base, - ratio = 0.5, - right = false - ); - - distributeRotate(center=true) { - - // test the shape of a curved unibody barrier, inner curve, right turned - curvedBarrierUnibody( - length = length, - height = height, - thickness = thickness, - base = base, - ratio = getInnerCurveRatio(length, radius), - right = true - ); - - // test the shape of a curved unibody barrier, outer curve, right turned - curvedBarrierUnibody( - length = length, - height = height, - thickness = thickness, - base = base, - ratio = getOuterCurveRatio(length, width, radius), - right = true - ); - - // test the shape of a curved unibody barrier, inner curve, left turned - curvedBarrierUnibody( - length = length, - height = height, - thickness = thickness, - base = base, - ratio = getInnerCurveRatio(length, radius), - right = false - ); - - // test the shape of a curved unibody barrier, outer curve, left turned - curvedBarrierUnibody( - length = length, - height = height, - thickness = thickness, - base = base, - ratio = getOuterCurveRatio(length, width, radius), - right = false - ); - - } - - } + distributeGrid( + intervalX = [length * 2, 0, 0], + intervalY = [0, length * 2, 0], + line = 2, + center = true + ) { + + // test the main shape of a curved barrier holder, left turned + curvedBarrierMain( + length = length, + thickness = thickness, + base = base, + ratio = 1, + right = false + ); + + // test the main shape of a curved barrier holder, right turned + curvedBarrierMain( + length = length, + thickness = thickness, + base = base, + ratio = 1, + right = true + ); + + // test the shape of the curved barrier holder, left turned + curvedBarrierHolder( + length = length, + thickness = thickness, + base = base, + ratio = 1, + right = false + ); + + // test the shape of the curved barrier holder, right turned + curvedBarrierHolder( + length = length, + thickness = thickness, + base = base, + ratio = 1, + right = true + ); + + // test the shape of a curved unibody barrier, left turned + curvedBarrierUnibody( + length = length, + height = height, + thickness = thickness, + base = base, + ratio = 1, + right = false + ); + + // test the shape of a curved unibody barrier, right turned + curvedBarrierUnibody( + length = length, + height = height, + thickness = thickness, + base = base, + ratio = 1, + right = true + ); } } From 1fe1bd7c7edab68c0d5edd164d2cac262fcd6271 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 6 Mar 2020 21:12:55 +0100 Subject: [PATCH 130/191] Rename some accessory parts files --- .../{flag-straight.scad => straight-flag.scad} | 0 .../accessories/{mast.scad => straight-mast.scad} | 0 .../accessories/{flag-wavy.scad => wavy-flag.scad} | 0 rcmodels/tracks/test/uturn.scad | 14 +++++++------- 4 files changed, 7 insertions(+), 7 deletions(-) rename rcmodels/tracks/parts/accessories/{flag-straight.scad => straight-flag.scad} (100%) rename rcmodels/tracks/parts/accessories/{mast.scad => straight-mast.scad} (100%) rename rcmodels/tracks/parts/accessories/{flag-wavy.scad => wavy-flag.scad} (100%) diff --git a/rcmodels/tracks/parts/accessories/flag-straight.scad b/rcmodels/tracks/parts/accessories/straight-flag.scad similarity index 100% rename from rcmodels/tracks/parts/accessories/flag-straight.scad rename to rcmodels/tracks/parts/accessories/straight-flag.scad diff --git a/rcmodels/tracks/parts/accessories/mast.scad b/rcmodels/tracks/parts/accessories/straight-mast.scad similarity index 100% rename from rcmodels/tracks/parts/accessories/mast.scad rename to rcmodels/tracks/parts/accessories/straight-mast.scad diff --git a/rcmodels/tracks/parts/accessories/flag-wavy.scad b/rcmodels/tracks/parts/accessories/wavy-flag.scad similarity index 100% rename from rcmodels/tracks/parts/accessories/flag-wavy.scad rename to rcmodels/tracks/parts/accessories/wavy-flag.scad diff --git a/rcmodels/tracks/test/uturn.scad b/rcmodels/tracks/test/uturn.scad index d0395b8..9514b18 100644 --- a/rcmodels/tracks/test/uturn.scad +++ b/rcmodels/tracks/test/uturn.scad @@ -36,7 +36,7 @@ applyMode(mode=mode) { distribute(intervalY=length, center=true) { - // test the u-turn holder shape, left side + // test the U-turn holder shape, left side uTurnBarrierHolder( length = length, height = height, @@ -46,7 +46,7 @@ applyMode(mode=mode) { right = false ); - // test the u-turn holder shape, right side + // test the U-turn holder shape, right side uTurnBarrierHolder( length = length, height = height, @@ -56,7 +56,7 @@ applyMode(mode=mode) { right = true ); - // test the u-turn unibody shape, left side + // test the U-turn unibody shape, left side uTurnBarrierUnibody( length = length, height = height, @@ -66,7 +66,7 @@ applyMode(mode=mode) { right = false ); - // test the u-turn unibody shape, right side + // test the U-turn unibody shape, right side uTurnBarrierUnibody( length = length, height = height, @@ -76,7 +76,7 @@ applyMode(mode=mode) { right = true ); - // test the u-turn compensation shape + // test the U-turn compensation shape uTurnCompensationBarrierUnibody( height = height, thickness = thickness, @@ -84,14 +84,14 @@ applyMode(mode=mode) { gap = wall ); - // test the u-turn compensation shape + // test the U-turn compensation shape uTurnCompensationBarrierHolder( thickness = thickness, base = base, gap = wall ); - // test the u-turn compensation body shape + // test the U-turn compensation body shape uTurnCompensationBarrierBody( length = length, height = height, From 3e276ef96132efb61cbaa628f84bcdc189592cd6 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 6 Mar 2020 23:02:05 +0100 Subject: [PATCH 131/191] Add size functions for the shapes and center the shapes --- rcmodels/tracks/config/values.scad | 9 +- rcmodels/tracks/shapes/accessories.scad | 255 +++++++++++++++++------- rcmodels/tracks/shapes/curved.scad | 40 ++++ rcmodels/tracks/shapes/special.scad | 99 ++++++--- rcmodels/tracks/shapes/straight.scad | 11 + rcmodels/tracks/shapes/uturn.scad | 67 +++++-- rcmodels/tracks/test/accessories.scad | 4 +- 7 files changed, 370 insertions(+), 115 deletions(-) diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 83ab9f1..01a759b 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -105,9 +105,10 @@ function getBarrierNotchDistance(base, distance = 0) = (getBarrierLinkWidth(base /** * Computes the outer width of a barrier holder. * @param Number base - The base unit value used to design the barrier holder. + * @param Number [distance] - An additional distance added to the outline of the barrier holder. * @returns Number */ -function getBarrierHolderWidth(base) = getBarrierLinkWidth(base, printTolerance) + minWidth * 4; +function getBarrierHolderWidth(base, distance = 0) = getBarrierLinkWidth(base, printTolerance) + minWidth * 4 + distance * 2; /** * Computes the top width of a barrier holder. @@ -120,9 +121,10 @@ function getBarrierHolderTopWidth(base, thickness) = nozzleAligned((getBarrierLi /** * Computes the outer height of a barrier holder. * @param Number base - The base unit value used to design the barrier holder. + * @param Number [distance] - An additional distance added to the outline of the barrier holder. * @returns Number */ -function getBarrierHolderHeight(base) = getBarrierStripHeight(base) + minThickness + printResolution; +function getBarrierHolderHeight(base, distance = 0) = getBarrierStripHeight(base) + minThickness + printResolution + distance * 2; /** * Computes the height of the link for a barrier holder. @@ -134,9 +136,10 @@ function getBarrierHolderLinkHeight(base) = getBarrierHolderHeight(base) - base; /** * Computes the outer width of a unibody barrier. * @param Number base - The base unit value used to design the barrier holder. + * @param Number [distance] - An additional distance added to the outline of the barrier. * @returns Number */ -function getBarrierUnibodyWidth(base) = getBarrierHolderWidth(base) + base; +function getBarrierUnibodyWidth(base, distance = 0) = getBarrierHolderWidth(base) + base + distance * 2; /** * Computes the height of the link for a unibody barrier. diff --git a/rcmodels/tracks/shapes/accessories.scad b/rcmodels/tracks/shapes/accessories.scad index 0a0b338..64f5b39 100644 --- a/rcmodels/tracks/shapes/accessories.scad +++ b/rcmodels/tracks/shapes/accessories.scad @@ -28,6 +28,101 @@ * @author jsconan */ +/** + * Gets the approximated length of the shape of a cable clip. + * @param Number wall - The thickness of the cable clip lines. + * @param Number base - The base unit value used to design the barrier holder. + * @returns Number + */ +function getCableClipLength(wall, base) = + getBarrierHolderWidth(base, wall + printTolerance) +; + +/** + * Gets the approximated width of the shape of a cable clip. + * @param Number wall - The thickness of the cable clip lines. + * @param Number base - The base unit value used to design the barrier holder. + * @returns Number + */ +function getCableClipWidth(wall, base) = + getBarrierHolderHeight(base, wall + printTolerance) + + apothem(n=10, r=getCableClipLength(wall, base) / 2) +; + +/** + * Gets the approximated length of the shape of a bent accessory mast. + * @param Number width - The width of the mast. + * @param Number|Vector height - The height of the mast. The 2 sides can be defined separately using a vector. + * @param Number wall - The thickness of the accessory clip lines. + * @param Number base - The base unit value used to design the barrier holder. + * @returns Number + */ +function getAccessoryBentMastLength(width, height, wall, base) = + let( + height = vector2D(height) + ) + getBarrierHolderHeight(base, wall + printTolerance) + + width * 1.5 + height[0] +; + +/** + * Gets the approximated width of the shape of a bent accessory mast. + * @param Number width - The width of the mast. + * @param Number|Vector height - The height of the mast. The 2 sides can be defined separately using a vector. + * @param Number wall - The thickness of the accessory clip lines. + * @param Number base - The base unit value used to design the barrier holder. + * @returns Number + */ +function getAccessoryBentMastWidth(width, height, wall, base) = + let( + height = vector2D(height) + ) + getBarrierHolderWidth(base, wall + printTolerance) / 2 + + width + height[1] +; + +/** + * Gets the approximated length of the shape of an accessory mast. + * @param Number height - The height of the mast. + * @param Number wall - The thickness of the accessory clip lines. + * @param Number base - The base unit value used to design the barrier holder. + * @returns Number + */ +function getAccessoryStraightMastLength(height, wall, base) = + getBarrierHolderHeight(base, wall + printTolerance) + height +; + +/** + * Gets the approximated width of the shape of an accessory mast. + * @param Number wall - The thickness of the accessory clip lines. + * @param Number base - The base unit value used to design the barrier holder. + * @returns Number + */ +function getAccessoryStraightMastWidth(wall, base) = + getBarrierHolderWidth(base, wall + printTolerance) +; + +/** + * Gets the approximated length of the shape of an accessory flag. + * @param Number width - The width of the flag. + * @param Number thickness - The thickness of the flag. + * @param Number mast - The width of the mast. + * @returns Number + */ +function getAccessoryFlagLength(width, thickness, mast) = + width + mast / 2 + printResolution + thickness +; + +/** + * Gets the approximated length of the shape of an accessory flag. + * @param Number height - The height of the flag. + * @param Number wave - The height of the wave + * @returns Number + */ +function getAccessoryFlagWidth(height, wave = 0) = + height + wave * 2 +; + /** * Draws the shape of a cable clip. * @param Number height - The thickness of the clip. @@ -37,25 +132,28 @@ * @param Boolean [center] - The shape is centered vertically. */ module cableClip(height, wall, base, thickness, center = false) { - holderWidth = getBarrierHolderWidth(base) + (wall + printTolerance) * 2; - negativeExtrude(height=height, center=center) { - clipProfile( - wall = wall, - base = base, - thickness = thickness + printTolerance, - distance = printTolerance - ); - repeat(intervalX = holderWidth - wall, center = true) { - translateY(base / 2) { - rectangle([wall, base]); + holderWidth = getCableClipLength(wall, base); + + translateY((apothem(n=10, r=holderWidth) - getCableClipWidth(wall, base)) / 2) { + negativeExtrude(height=height, center=center) { + clipProfile( + wall = wall, + base = base, + thickness = thickness + printTolerance, + distance = printTolerance + ); + repeat(intervalX = holderWidth - wall, center = true) { + translateY(base / 2) { + rectangle([wall, base]); + } } + ringSegment( + r = [1, 1] * (holderWidth / 2), + w = wall, + a = -180, + $fn = 10 + ); } - ringSegment( - r = [1, 1] * (holderWidth / 2), - w = wall, - a = -180, - $fn = 10 - ); } } @@ -171,24 +269,28 @@ module mastRings(width, height, wall, interval = 0, count = 1, distance = 0, cen * @param Number base - The base unit value used to design the barrier holder. * @param Number thickness - The thickness of the barrier body. */ -module accessoryMast(width, height, wall, base, thickness) { - rotateY(90) { - mast( - width = width, - height = height, - distance = 0, - center = false - ); - } - rotateZ(90) { - clip( - wall = wall, - height = width, - base = base, - thickness = thickness + printTolerance, - distance = printTolerance, - center = true - ); +module accessoryStraightMast(width, height, wall, base, thickness) { + holderHeight = getBarrierHolderHeight(base, wall + printTolerance); + + translateX((holderHeight - height) / 2) { + rotateY(90) { + mast( + width = width, + height = height, + distance = 0, + center = false + ); + } + rotateZ(90) { + clip( + wall = wall, + height = width, + base = base, + thickness = thickness + printTolerance, + distance = printTolerance, + center = true + ); + } } } @@ -201,22 +303,33 @@ module accessoryMast(width, height, wall, base, thickness) { * @param Number thickness - The thickness of the barrier body. */ module accessoryBentMast(width, height, wall, base, thickness) { - rotate([90, 90, 90]) { - bentMast( - width = width, - height = height, - distance = 0 - ); - } - rotateZ(90) { - clip( - wall = wall, - height = width, - base = base, - thickness = thickness + printTolerance, - distance = printTolerance, - center = true - ); + height = vector2D(height); + holderWidth = getBarrierHolderWidth(base, wall + printTolerance); + holderHeight = getBarrierHolderHeight(base, wall + printTolerance); + bentMastWidth = getAccessoryBentMastWidth(width, height, wall, base); + + translate([ + (holderHeight - height[0] - width) / 2, + (bentMastWidth - holderWidth) / 2, + 0 + ]) { + rotate([90, 90, 90]) { + bentMast( + width = width, + height = height, + distance = 0 + ); + } + rotateZ(90) { + clip( + wall = wall, + height = width, + base = base, + thickness = thickness + printTolerance, + distance = printTolerance, + center = true + ); + } } } @@ -235,23 +348,27 @@ module accessoryFlag(width, height, thickness, mast, wave = 0) { ringOffset = apothem(n=mastFacets, r=getMastRadius(mast)) + distance + thickness; type = wave ? "S" : "V"; - translateZ(ringOffset) { - mastRings( - width = mast, - height = ringHeight, - wall = thickness, - interval = ringInterval, - count = 2, - distance = distance, - center = true - ); - } - negativeExtrude(thickness) { - polygon(path([ - ["P", height / 2, 0], - [type, width, width, wave, 0, 90], - ["H", -height], - [type, -width, width, wave, 0, 90] - ])); + rotateZ(270) { + translateY((mast - width) / 2 - printResolution) { + translateZ(ringOffset) { + mastRings( + width = mast, + height = ringHeight, + wall = thickness, + interval = ringInterval, + count = 2, + distance = distance, + center = true + ); + } + negativeExtrude(thickness) { + polygon(path([ + ["P", height / 2, 0], + [type, width, width, wave, 0, 90], + ["H", -height], + [type, -width, width, wave, 0, 90] + ])); + } + } } } diff --git a/rcmodels/tracks/shapes/curved.scad b/rcmodels/tracks/shapes/curved.scad index 099cfd6..bc10f76 100644 --- a/rcmodels/tracks/shapes/curved.scad +++ b/rcmodels/tracks/shapes/curved.scad @@ -28,6 +28,46 @@ * @author jsconan */ +/** + * Gets the approximated length of the shape of a curved barrier. + * @param Number length - The length of the element. + * @param Number width - The width of the element. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number ratio - The ratio to apply on the radius + * @returns Number + */ +function getCurvedBarrierLength(length, width, base, ratio) = + let( + angle = getCurveAngle(ratio), + radius = getCurveRadius(length, ratio), + rotationAngle = getCurveRotationAngle(angle), + projectedWidth = width * cos(rotationAngle) / 2, + projectedLink = getBarrierLinkLength(base) * cos(curveAngle + rotationAngle) + ) + getChordLength(angle, radius) + + width / 2 + projectedWidth + max(0, projectedLink - projectedWidth) +; + +/** + * Gets the approximated width of the shape of a curved barrier. + * @param Number length - The length of the element. + * @param Number width - The width of the element. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number ratio - The ratio to apply on the radius + * @returns Number + */ +function getCurvedBarrierWidth(length, width, base, ratio) = + let( + angle = getCurveAngle(ratio), + radius = getCurveRadius(length, ratio), + rotationAngle = getCurveRotationAngle(angle), + projectedWidth = width * sin(rotationAngle) / 2, + projectedLink = getBarrierLinkLength(base) * sin(curveAngle + rotationAngle) + ) + getChordHeight(angle, radius) + + width / 2 + projectedWidth + max(0, projectedLink - projectedWidth) +; + /** * Draws the notch shape of a curved barrier holder. * @param Number radius - The radius of the curve. diff --git a/rcmodels/tracks/shapes/special.scad b/rcmodels/tracks/shapes/special.scad index 1fbce1f..4a44c48 100644 --- a/rcmodels/tracks/shapes/special.scad +++ b/rcmodels/tracks/shapes/special.scad @@ -28,6 +28,43 @@ * @author jsconan */ +/** + * Gets the length of a female arch tower. + * @param Number length - The length of a track element. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number wall - The thickness of the clip outline. + * @returns Number + */ +function getArchTowerLengthFemale(length, base, wall) = + getBarrierHolderHeight(base, wall + printTolerance) + + length / 2 +; + +/** + * Gets the length of a male arch tower. + * @param Number length - The length of a track element. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number wall - The thickness of the clip outline. + * @returns Number + */ +function getArchTowerLengthMale(length, base, wall) = + getArchTowerLengthFemale( + length = length, + base = base, + wall = wall + ) + getBarrierLinkLength(base) +; + +/** + * Gets the width of an arch tower. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number wall - The thickness of the clip outline. + * @returns Number + */ +function getArchTowerWidth(base, wall) = + getBarrierHolderWidth(base, wall + printTolerance) +; + /** * Draws the shape of a clip that will clamp a barrier border. * @param Number thickness - The thickness of the barrier body. @@ -67,20 +104,22 @@ module archTowerMale(length, thickness, base, wall) { indent = getBarrierStripIndent(base); length = length / 2; - translateX(length / 2) { - archTowerClip( - thickness = thickness, - base = base, - wall = wall - ); - } - carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { - straightLinkMale(length=length, linkHeight=linkHeight, base=base) { - extrudeStraightProfile(length=length) { - barrierHolderProfile( - base = base, - thickness = thickness - ); + translateX(-getBarrierHolderHeight(base, wall + printTolerance) / 2) { + translateX(length / 2) { + archTowerClip( + thickness = thickness, + base = base, + wall = wall + ); + } + carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { + straightLinkMale(length=length, linkHeight=linkHeight, base=base) { + extrudeStraightProfile(length=length) { + barrierHolderProfile( + base = base, + thickness = thickness + ); + } } } } @@ -99,21 +138,23 @@ module archTowerFemale(length, thickness, base, wall) { indent = getBarrierStripIndent(base); length = length / 2; - translateX(length / 2) { - archTowerClip( - thickness = thickness, - base = base, - wall = wall - ); - } - rotateZ(180) { - carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { - straightLinkFemale(length=length, linkHeight=linkHeight, base=base) { - extrudeStraightProfile(length=length) { - barrierHolderProfile( - base = base, - thickness = thickness - ); + translateX(-getBarrierHolderHeight(base, wall + printTolerance) / 2) { + translateX(length / 2) { + archTowerClip( + thickness = thickness, + base = base, + wall = wall + ); + } + rotateZ(180) { + carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { + straightLinkFemale(length=length, linkHeight=linkHeight, base=base) { + extrudeStraightProfile(length=length) { + barrierHolderProfile( + base = base, + thickness = thickness + ); + } } } } diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index aec5e54..302c8a0 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -28,6 +28,17 @@ * @author jsconan */ +/** + * Gets the approximated length of the shape of a straight barrier. + * @param Number length - The length of the element. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number ratio - The ratio to apply on the length + * @returns Number + */ +function getStraightBarrierLength(length, base, ratio) = + length * ratio + getBarrierLinkLength(base) +; + /** * Draws the shape of a barrier body. * @param Number length - The length of the track element. diff --git a/rcmodels/tracks/shapes/uturn.scad b/rcmodels/tracks/shapes/uturn.scad index 30b07bb..693cf4e 100644 --- a/rcmodels/tracks/shapes/uturn.scad +++ b/rcmodels/tracks/shapes/uturn.scad @@ -28,13 +28,56 @@ * @author jsconan */ +/** + * Gets the length of the final shape for a U-turn curve. + * @param Number length - The length of a track element. + * @param Number width - The width of a track element. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number gap - The distance between the two side of the U-turn. + * @returns Number + */ +function getUTurnBarrierLength(length, width, base, gap) = + getStraightBarrierLength(length, base, .5) + width + gap / 2 +; + +/** + * Gets the width of the final shape for a U-turn curve. + * @param Number width - The width of a track element. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number gap - The distance between the two side of the U-turn. + * @returns Number + */ +function getUTurnBarrierWidth(width, base, gap) = gap + width * 2; + +/** + * Gets the length of a U-turn compensation barrier. + * @param Number width - The width of a track element. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number gap - The distance between the two side of the U-turn. + * @returns Number + */ +function getUTurnCompensationBarrierLength(width, base, gap) = + width + gap + getBarrierLinkLength(base) +; + +/** + * Gets the length of a U-turn compensation barrier body. + * @param Number length - The length of a track element. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number gap - The distance between the two side of the U-turn. + * @returns Number + */ +function getUTurnCompensationBarrierBodyLength(length, base, gap) = + length + getBarrierHolderWidth(base) + gap +; + /** * Draws the shape of a barrier border for a U-Turn. * @param Number length - The length of a track element. * @param Number height - The height of the barrier. * @param Number thickness - The thickness of the barrier body. * @param Number base - The base unit value used to design the barrier holder. - * @param Number gap - The distance between the two side of the u-turn. + * @param Number gap - The distance between the two side of the U-turn. * @param Number right - Is it the right or the left part of the track element that is added first? */ module uTurnBarrierHolder(length, height, thickness, base, gap, right = false) { @@ -47,7 +90,7 @@ module uTurnBarrierHolder(length, height, thickness, base, gap, right = false) { dir = right ? -1 : 1; length = length / 2; - translateY(interval * dir) { + translate([-interval, interval * dir, 0]) { carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { straightLinkMale(length=length, linkHeight=linkHeight, base=base) { extrudeStraightProfile(length=length) { @@ -59,7 +102,7 @@ module uTurnBarrierHolder(length, height, thickness, base, gap, right = false) { } } } - translateY(-interval * dir) { + translate([-interval, -interval * dir, 0]) { rotateZ(180) { carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { straightLinkFemale(length=length, linkHeight=linkHeight, base=base) { @@ -73,7 +116,7 @@ module uTurnBarrierHolder(length, height, thickness, base, gap, right = false) { } } } - translateX(length / 2) { + translateX(length / 2 - interval) { rotateZ(270) { extrudeCurvedProfile(radius=interval, angle=180) { barrierHolderProfile( @@ -94,7 +137,7 @@ module uTurnBarrierHolder(length, height, thickness, base, gap, right = false) { * @param Number height - The height of the barrier. * @param Number thickness - The thickness of the barrier body for a barrier holder. * @param Number base - The base unit value used to design the barrier holder. - * @param Number gap - The distance between the two side of the u-turn. + * @param Number gap - The distance between the two side of the U-turn. * @param Number right - Is it the right or the left part of the track element that is added first? */ module uTurnBarrierUnibody(length, height, thickness, base, gap, right = false) { @@ -104,7 +147,7 @@ module uTurnBarrierUnibody(length, height, thickness, base, gap, right = false) dir = right ? -1 : 1; length = length / 2; - translateY(interval * dir) { + translate([-interval, interval * dir, 0]) { straightLinkMale(length=length, linkHeight=linkHeight, base=base) { extrudeStraightProfile(length=length) { barrierUnibodyProfile( @@ -115,7 +158,7 @@ module uTurnBarrierUnibody(length, height, thickness, base, gap, right = false) } } } - translateY(-interval * dir) { + translate([-interval, -interval * dir, 0]) { rotateZ(180) { straightLinkFemale(length=length, linkHeight=linkHeight, base=base) { extrudeStraightProfile(length=length) { @@ -128,7 +171,7 @@ module uTurnBarrierUnibody(length, height, thickness, base, gap, right = false) } } } - translateX(length / 2) { + translateX(length / 2 - interval) { rotateZ(270) { extrudeCurvedProfile(radius=interval, angle=180) { barrierUnibodyProfile( @@ -145,7 +188,7 @@ module uTurnBarrierUnibody(length, height, thickness, base, gap, right = false) * Draws the shape of a barrier border for a U-Turn. * @param Number thickness - The thickness of the barrier body. * @param Number base - The base unit value used to design the barrier holder. - * @param Number gap - The distance between the two side of the u-turn. + * @param Number gap - The distance between the two side of the U-turn. */ module uTurnCompensationBarrierHolder(thickness, base, gap) { length = getBarrierHolderWidth(base) + gap; @@ -170,7 +213,7 @@ module uTurnCompensationBarrierHolder(thickness, base, gap) { * @param Number height - The height of the barrier. * @param Number thickness - The thickness of the barrier body. * @param Number base - The base unit value used to design the barrier holder. - * @param Number gap - The distance between the two side of the u-turn. + * @param Number gap - The distance between the two side of the U-turn. */ module uTurnCompensationBarrierUnibody(height, thickness, base, gap) { length = getBarrierUnibodyWidth(base) + gap; @@ -184,12 +227,12 @@ module uTurnCompensationBarrierUnibody(height, thickness, base, gap) { } /** - * Draws the shape of a barrier body. + * Draws the shape of a body for a U-turn compensation barrier. * @param Number length - The length of the track element. * @param Number height - The height of the barrier. * @param Number thickness - The thickness of the barrier body. * @param Number base - The base unit value used to design the barrier holder. - * @param Number gap - The distance between the two side of the u-turn. + * @param Number gap - The distance between the two side of the U-turn. */ module uTurnCompensationBarrierBody(length, height, thickness, base, gap) { stripHeight = getBarrierStripHeight(base) - getBarrierStripIndent(base); diff --git a/rcmodels/tracks/test/accessories.scad b/rcmodels/tracks/test/accessories.scad index 659b80b..b630c4c 100644 --- a/rcmodels/tracks/test/accessories.scad +++ b/rcmodels/tracks/test/accessories.scad @@ -34,7 +34,7 @@ include // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=mode) { - distributeGrid(intervalX=[length, 0, 0], intervalY=[0, height, 0], line=2, center=true) { + distributeGrid(intervalX=[length + printInterval, 0, 0], intervalY=[0, height, 0], line=2, center=true) { // test the cable clip shape cableClip( @@ -70,7 +70,7 @@ applyMode(mode=mode) { ); // test the accessory clip shape - accessoryMast( + accessoryStraightMast( width = base, height = height, wall = wall, From 5c86a66bdcdef3c152fad07f3ef8f3098e0dc3e9 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 6 Mar 2020 23:04:08 +0100 Subject: [PATCH 132/191] Compute size and interval for the final shapes --- .../tracks/parts/accessories/bent-mast.scad | 46 +++++++++++++++ .../tracks/parts/accessories/cable-clip.scad | 42 +++++++++++++ .../parts/accessories/straight-flag.scad | 43 ++++++++++++++ .../parts/accessories/straight-mast.scad | 45 +++++++++++++- .../tracks/parts/accessories/wavy-flag.scad | 43 ++++++++++++++ .../parts/elements/curved/curved-inner.scad | 58 +++++++++++++++++- .../parts/elements/curved/curved-outer.scad | 58 +++++++++++++++++- .../parts/elements/curved/curved-short.scad | 58 +++++++++++++++++- .../parts/elements/curved/curved-small.scad | 59 ++++++++++++++++++- .../parts/elements/curved/curved-uturn.scad | 57 +++++++++++++++++- .../parts/elements/straight/arch-tower.scad | 47 ++++++++++++++- .../parts/elements/straight/body-curved.scad | 40 +++++++++++-- .../elements/straight/body-straight.scad | 36 ++++++++++- .../parts/elements/straight/body-uturn.scad | 50 +++++++++++++++- .../elements/straight/straight-double.scad | 46 ++++++++++++++- .../elements/straight/straight-simple.scad | 46 ++++++++++++++- .../elements/straight/straight-uturn.scad | 46 ++++++++++++++- .../samples/curved/curved-inner-full.scad | 58 +++++++++++++++++- .../parts/samples/curved/curved-inner.scad | 58 +++++++++++++++++- .../samples/curved/curved-outer-full.scad | 58 +++++++++++++++++- .../parts/samples/curved/curved-outer.scad | 58 +++++++++++++++++- .../parts/samples/curved/curved-short.scad | 58 +++++++++++++++++- .../parts/samples/curved/curved-small.scad | 58 +++++++++++++++++- .../parts/samples/curved/curved-uturn.scad | 59 +++++++++++++++++-- .../parts/samples/straight/arch-sample.scad | 56 +++++++++++++++++- .../samples/straight/straight-double.scad | 46 ++++++++++++++- .../samples/straight/straight-long-10.scad | 46 ++++++++++++++- .../samples/straight/straight-long-20.scad | 46 ++++++++++++++- .../samples/straight/straight-long-5.scad | 46 ++++++++++++++- .../samples/straight/straight-simple.scad | 46 ++++++++++++++- .../samples/straight/straight-uturn.scad | 46 ++++++++++++++- .../parts/unibody/curved/curved-inner.scad | 58 +++++++++++++++++- .../parts/unibody/curved/curved-outer.scad | 58 +++++++++++++++++- .../parts/unibody/curved/curved-short.scad | 58 +++++++++++++++++- .../parts/unibody/curved/curved-small.scad | 58 +++++++++++++++++- .../parts/unibody/curved/curved-uturn.scad | 57 +++++++++++++++++- .../unibody/straight/straight-connector.scad | 45 +++++++++++++- .../unibody/straight/straight-double.scad | 46 ++++++++++++++- .../unibody/straight/straight-simple.scad | 46 ++++++++++++++- .../unibody/straight/straight-uturn.scad | 46 ++++++++++++++- 40 files changed, 1950 insertions(+), 81 deletions(-) diff --git a/rcmodels/tracks/parts/accessories/bent-mast.scad b/rcmodels/tracks/parts/accessories/bent-mast.scad index d9de29d..1eb35eb 100644 --- a/rcmodels/tracks/parts/accessories/bent-mast.scad +++ b/rcmodels/tracks/parts/accessories/bent-mast.scad @@ -31,6 +31,52 @@ // Import the project's setup. include <../../config/setup.scad> +/** + * Gets the length of the final shape for a bent mast. + * @returns Number + */ +function finalBentMastLength() = + getAccessoryBentMastLength( + width = mastWidth, + height = [mastWidth, mastHeight], + wall = accessoryClipThickness, + base = barrierHolderBase + ) +; + +/** + * Gets the width of the final shape for a bent mast. + * @returns Number + */ +function finalBentMastWidth() = + getAccessoryBentMastWidth( + width = mastWidth, + height = [mastWidth, mastHeight], + wall = accessoryClipThickness, + base = barrierHolderBase + ) +; + +/** + * Gets the horizontal interval of the final shape for a bent mast. + * @returns Number + */ +function finalBentMastIntervalX() = + getPrintInterval( + finalBentMastLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a bent mast. + * @returns Number + */ +function finalBentMastIntervalY() = + getPrintInterval( + finalBentMastWidth() + ) +; + /** * Defines the final shape for a bent mast. */ diff --git a/rcmodels/tracks/parts/accessories/cable-clip.scad b/rcmodels/tracks/parts/accessories/cable-clip.scad index 45fdd74..2398151 100644 --- a/rcmodels/tracks/parts/accessories/cable-clip.scad +++ b/rcmodels/tracks/parts/accessories/cable-clip.scad @@ -31,6 +31,48 @@ // Import the project's setup. include <../../config/setup.scad> +/** + * Gets the length of the final shape for a cable clip. + * @returns Number + */ +function finalCableClipLength() = + getCableClipLength( + wall = accessoryClipThickness, + base = barrierHolderBase + ) +; + +/** + * Gets the width of the final shape for a cable clip. + * @returns Number + */ +function finalCableClipWidth() = + getCableClipWidth( + wall = accessoryClipThickness, + base = barrierHolderBase + ) +; + +/** + * Gets the horizontal interval of the final shape for a cable clip. + * @returns Number + */ +function finalCableClipIntervalX() = + getPrintInterval( + finalCableClipLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a cable clip. + * @returns Number + */ +function finalCableClipIntervalY() = + getPrintInterval( + finalCableClipWidth() + ) +; + /** * Defines the final shape for a cable clip. */ diff --git a/rcmodels/tracks/parts/accessories/straight-flag.scad b/rcmodels/tracks/parts/accessories/straight-flag.scad index 880a746..2870725 100644 --- a/rcmodels/tracks/parts/accessories/straight-flag.scad +++ b/rcmodels/tracks/parts/accessories/straight-flag.scad @@ -31,6 +31,49 @@ // Import the project's setup. include <../../config/setup.scad> +/** + * Gets the length of the final shape for a straight flag. + * @returns Number + */ +function finalStraightFlagLength() = + getAccessoryFlagLength( + width = flagWidth, + thickness = flagThickness, + mast = mastWidth + ) +; + +/** + * Gets the width of the final shape for a straight flag. + * @returns Number + */ +function finalStraightFlagWidth() = + getAccessoryFlagWidth( + height = flagHeight, + wave = 0 + ) +; + +/** + * Gets the horizontal interval of the final shape for a straight flag. + * @returns Number + */ +function finalStraightFlagIntervalX() = + getPrintInterval( + finalStraightFlagLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a straight flag. + * @returns Number + */ +function finalStraightFlagIntervalY() = + getPrintInterval( + finalStraightFlagWidth() + ) +; + /** * Defines the final shape for a straight flag. */ diff --git a/rcmodels/tracks/parts/accessories/straight-mast.scad b/rcmodels/tracks/parts/accessories/straight-mast.scad index aabbdeb..dc761dc 100644 --- a/rcmodels/tracks/parts/accessories/straight-mast.scad +++ b/rcmodels/tracks/parts/accessories/straight-mast.scad @@ -31,11 +31,54 @@ // Import the project's setup. include <../../config/setup.scad> +/** + * Gets the length of the final shape for a straight mast. + * @returns Number + */ +function finalStraightMastLength() = + getAccessoryStraightMastLength( + height = mastHeight, + wall = accessoryClipThickness, + base = barrierHolderBase + ) +; + +/** + * Gets the width of the final shape for a straight mast. + * @returns Number + */ +function finalStraightMastWidth() = + getAccessoryStraightMastWidth( + wall = accessoryClipThickness, + base = barrierHolderBase + ) +; + +/** + * Gets the horizontal interval of the final shape for a straight mast. + * @returns Number + */ +function finalStraightMastIntervalX() = + getPrintInterval( + finalStraightMastLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a straight mast. + * @returns Number + */ +function finalStraightMastIntervalY() = + getPrintInterval( + finalStraightMastWidth() + ) +; + /** * Defines the final shape for a straight mast. */ module finalStraightMast() { - accessoryMast( + accessoryStraightMast( width = mastWidth, height = mastHeight, wall = accessoryClipThickness, diff --git a/rcmodels/tracks/parts/accessories/wavy-flag.scad b/rcmodels/tracks/parts/accessories/wavy-flag.scad index 31d1683..757cb13 100644 --- a/rcmodels/tracks/parts/accessories/wavy-flag.scad +++ b/rcmodels/tracks/parts/accessories/wavy-flag.scad @@ -31,6 +31,49 @@ // Import the project's setup. include <../../config/setup.scad> +/** + * Gets the length of the final shape for a wavy flag. + * @returns Number + */ +function finalWavyFlagLength() = + getAccessoryFlagLength( + width = flagWidth, + thickness = flagThickness, + mast = mastWidth + ) +; + +/** + * Gets the width of the final shape for a wavy flag. + * @returns Number + */ +function finalWavyFlagWidth() = + getAccessoryFlagWidth( + height = flagHeight, + wave = 2 + ) +; + +/** + * Gets the horizontal interval of the final shape for a wavy flag. + * @returns Number + */ +function finalWavyFlagIntervalX() = + getPrintInterval( + finalWavyFlagLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a wavy flag. + * @returns Number + */ +function finalWavyFlagIntervalY() = + getPrintInterval( + finalWavyFlagWidth() + ) +; + /** * Defines the final shape for a wavy flag. */ diff --git a/rcmodels/tracks/parts/elements/curved/curved-inner.scad b/rcmodels/tracks/parts/elements/curved/curved-inner.scad index b80ed35..a24b371 100644 --- a/rcmodels/tracks/parts/elements/curved/curved-inner.scad +++ b/rcmodels/tracks/parts/elements/curved/curved-inner.scad @@ -31,15 +31,67 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the curve ratio of the final shape for an inner curve. + * @returns Number + */ +function finalInnerCurvedBarrierHolderRatio() = getInnerCurveRatio(trackSectionLength, trackRadius); + +/** + * Gets the length of the final shape for an inner curve. + * @returns Number + */ +function finalInnerCurvedBarrierHolderLength() = + getCurvedBarrierLength( + length = trackSectionLength, + width = getBarrierHolderWidth(barrierHolderBase), + base = barrierHolderBase, + ratio = finalInnerCurvedBarrierHolderRatio() + ) +; + +/** + * Gets the width of the final shape for an inner curve. + * @returns Number + */ +function finalInnerCurvedBarrierHolderWidth() = + getCurvedBarrierWidth( + length = trackSectionLength, + width = getBarrierHolderWidth(barrierHolderBase), + base = barrierHolderBase, + ratio = finalInnerCurvedBarrierHolderRatio() + ) +; + +/** + * Gets the horizontal interval of the final shape for an inner curve. + * @returns Number + */ +function finalInnerCurvedBarrierHolderIntervalX() = + getPrintInterval( + finalInnerCurvedBarrierHolderLength() + ) +; + +/** + * Gets the vertical interval of the final shape for an inner curve. + * @returns Number + */ +function finalInnerCurvedBarrierHolderIntervalY() = + getPrintInterval( + getBarrierHolderWidth(barrierHolderBase) + ) +; + /** * Defines the final shape for an inner curve. */ -module finalInnerCurveBarrierHolder() { +module finalInnerCurvedBarrierHolder() { curvedBarrierHolder( length = trackSectionLength, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = getInnerCurveRatio(trackSectionLength, trackRadius), + ratio = finalInnerCurvedBarrierHolderRatio(), right = rightOriented ); } @@ -48,5 +100,5 @@ module finalInnerCurveBarrierHolder() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalInnerCurveBarrierHolder(); + finalInnerCurvedBarrierHolder(); } diff --git a/rcmodels/tracks/parts/elements/curved/curved-outer.scad b/rcmodels/tracks/parts/elements/curved/curved-outer.scad index 83a417c..52f3fa0 100644 --- a/rcmodels/tracks/parts/elements/curved/curved-outer.scad +++ b/rcmodels/tracks/parts/elements/curved/curved-outer.scad @@ -31,15 +31,67 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the curve ratio of the final shape for an outer curve. + * @returns Number + */ +function finalOuterCurvedBarrierHolderRatio() = getOuterCurveRatio(trackSectionLength, trackSectionWidth, trackRadius); + +/** + * Gets the length of the final shape for an outer curve. + * @returns Number + */ +function finalOuterCurvedBarrierHolderLength() = + getCurvedBarrierLength( + length = trackSectionLength, + width = getBarrierHolderWidth(barrierHolderBase), + base = barrierHolderBase, + ratio = finalOuterCurvedBarrierHolderRatio() + ) +; + +/** + * Gets the horizontal interval of the final shape for an outer curve. + * @returns Number + */ +function finalOuterCurvedBarrierHolderWidth() = + getCurvedBarrierWidth( + length = trackSectionLength, + width = getBarrierHolderWidth(barrierHolderBase), + base = barrierHolderBase, + ratio = finalOuterCurvedBarrierHolderRatio() + ) +; + +/** + * Gets the vertical interval of the final shape for an outer curve. + * @returns Number + */ +function finalOuterCurvedBarrierHolderIntervalX() = + getPrintInterval( + finalOuterCurvedBarrierHolderLength() + ) +; + +/** + * Gets the width of the final shape for an outer curve. + * @returns Number + */ +function finalOuterCurvedBarrierHolderIntervalY() = + getPrintInterval( + getBarrierHolderWidth(barrierHolderBase) + ) +; + /** * Defines the final shape for an outer curve. */ -module finalOuterCurveBarrierHolder() { +module finalOuterCurvedBarrierHolder() { curvedBarrierHolder( length = trackSectionLength, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = getOuterCurveRatio(trackSectionLength, trackSectionWidth, trackRadius), + ratio = finalOuterCurvedBarrierHolderRatio(), right = rightOriented ); } @@ -48,5 +100,5 @@ module finalOuterCurveBarrierHolder() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalOuterCurveBarrierHolder(); + finalOuterCurvedBarrierHolder(); } diff --git a/rcmodels/tracks/parts/elements/curved/curved-short.scad b/rcmodels/tracks/parts/elements/curved/curved-short.scad index f72544d..6198225 100644 --- a/rcmodels/tracks/parts/elements/curved/curved-short.scad +++ b/rcmodels/tracks/parts/elements/curved/curved-short.scad @@ -31,15 +31,67 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the curve ratio of the final shape for an small curve. + * @returns Number + */ +function finalShortCurvedBarrierHolderRatio() = .5; + +/** + * Gets the length of the final shape for an small curve. + * @returns Number + */ +function finalShortCurvedBarrierHolderLength() = + getCurvedBarrierLength( + length = trackSectionLength, + width = getBarrierHolderWidth(barrierHolderBase), + base = barrierHolderBase, + ratio = finalShortCurvedBarrierHolderRatio() + ) +; + +/** + * Gets the width of the final shape for an small curve. + * @returns Number + */ +function finalShortCurvedBarrierHolderWidth() = + getCurvedBarrierWidth( + length = trackSectionLength, + width = getBarrierHolderWidth(barrierHolderBase), + base = barrierHolderBase, + ratio = finalShortCurvedBarrierHolderRatio() + ) +; + +/** + * Gets the horizontal interval of the final shape for an small curve. + * @returns Number + */ +function finalShortCurvedBarrierHolderIntervalX() = + getPrintInterval( + finalShortCurvedBarrierHolderLength() + ) +; + +/** + * Gets the vertical interval of the final shape for an small curve. + * @returns Number + */ +function finalShortCurvedBarrierHolderIntervalY() = + getPrintInterval( + finalShortCurvedBarrierHolderWidth() / 2 + ) +; + /** * Defines the final shape for a short curve. */ -module finalShortCurveBarrierHolder() { +module finalShortCurvedBarrierHolder() { curvedBarrierHolder( length = trackSectionLength, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = .5, + ratio = finalShortCurvedBarrierHolderRatio(), right = rightOriented ); } @@ -48,5 +100,5 @@ module finalShortCurveBarrierHolder() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalShortCurveBarrierHolder(); + finalShortCurvedBarrierHolder(); } diff --git a/rcmodels/tracks/parts/elements/curved/curved-small.scad b/rcmodels/tracks/parts/elements/curved/curved-small.scad index 7f6099f..6679db3 100644 --- a/rcmodels/tracks/parts/elements/curved/curved-small.scad +++ b/rcmodels/tracks/parts/elements/curved/curved-small.scad @@ -31,15 +31,68 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the curve ratio of the final shape for an small curve. + * @returns Number + */ +function finalSmallCurvedBarrierHolderRatio() = 1; + +/** + * Gets the length of the final shape for an small curve. + * @returns Number + */ +function finalSmallCurvedBarrierHolderLength() = + getCurvedBarrierLength( + length = trackSectionLength, + width = getBarrierHolderWidth(barrierHolderBase), + width = getBarrierHolderWidth(barrierHolderBase), + base = barrierHolderBase, + ratio = finalSmallCurvedBarrierHolderRatio() + ) +; + +/** + * Gets the width of the final shape for an small curve. + * @returns Number + */ +function finalSmallCurvedBarrierHolderWidth() = + getCurvedBarrierWidth( + length = trackSectionLength, + width = getBarrierHolderWidth(barrierHolderBase), + base = barrierHolderBase, + ratio = finalSmallCurvedBarrierHolderRatio() + ) +; + +/** + * Gets the horizontal interval of the final shape for an small curve. + * @returns Number + */ +function finalSmallCurvedBarrierHolderIntervalX() = + getPrintInterval( + finalSmallCurvedBarrierHolderLength() + ) +; + +/** + * Gets the vertical interval of the final shape for an small curve. + * @returns Number + */ +function finalSmallCurvedBarrierHolderIntervalY() = + getPrintInterval( + finalSmallCurvedBarrierHolderWidth() / 2 + ) +; + /** * Defines the final shape for a small curve. */ -module finalSmallCurveBarrierHolder() { +module finalSmallCurvedBarrierHolder() { curvedBarrierHolder( length = trackSectionLength, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = 1, + ratio = finalSmallCurvedBarrierHolderRatio(), right = rightOriented ); } @@ -48,5 +101,5 @@ module finalSmallCurveBarrierHolder() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalSmallCurveBarrierHolder(); + finalSmallCurvedBarrierHolder(); } diff --git a/rcmodels/tracks/parts/elements/curved/curved-uturn.scad b/rcmodels/tracks/parts/elements/curved/curved-uturn.scad index 92ee3ab..21856fd 100644 --- a/rcmodels/tracks/parts/elements/curved/curved-uturn.scad +++ b/rcmodels/tracks/parts/elements/curved/curved-uturn.scad @@ -31,16 +31,67 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the size of the gap between the 2 sides of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnCurvedBarrierHolderGap() = archTowerThickness * 2; + +/** + * Gets the length of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnCurvedBarrierHolderLength() = + getUTurnBarrierLength( + length = trackSectionLength, + width = getBarrierHolderWidth(barrierHolderBase), + base = barrierHolderBase, + gap = finalUTurnCurvedBarrierHolderGap() + ) +; + +/** + * Gets the width of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnCurvedBarrierHolderWidth() = + getUTurnBarrierWidth( + width = getBarrierHolderWidth(barrierHolderBase), + base = barrierHolderBase, + gap = finalUTurnCurvedBarrierHolderGap() + ) +; + +/** + * Gets the horizontal interval of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnCurvedBarrierHolderIntervalX() = + getPrintInterval( + finalUTurnCurvedBarrierHolderLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnCurvedBarrierHolderIntervalY() = + getPrintInterval( + finalUTurnCurvedBarrierHolderWidth() + ) +; + /** * Defines the final shape for a U-turn curve. */ -module finalUTurnCurveBarrierHolder() { +module finalUTurnCurvedBarrierHolder() { uTurnBarrierHolder( length = trackSectionLength, height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase, - gap = archTowerThickness * 2, + gap = finalUTurnCurvedBarrierHolderGap(), right = rightOriented ); } @@ -49,5 +100,5 @@ module finalUTurnCurveBarrierHolder() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalUTurnCurveBarrierHolder(); + finalUTurnCurvedBarrierHolder(); } diff --git a/rcmodels/tracks/parts/elements/straight/arch-tower.scad b/rcmodels/tracks/parts/elements/straight/arch-tower.scad index c61061c..fd2e33a 100644 --- a/rcmodels/tracks/parts/elements/straight/arch-tower.scad +++ b/rcmodels/tracks/parts/elements/straight/arch-tower.scad @@ -31,13 +31,54 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the length of the final shape for a couple of arch towers (male and female) + * @returns Number + */ +function finalArchTowerLength() = + getArchTowerLengthMale( + length = trackSectionLength, + base = barrierHolderBase, + wall = archTowerThickness + ) +; + +/** + * Gets the width of the final shape for a couple of arch towers (male and female) + * @returns Number + */ +function finalArchTowerWidth() = + getArchTowerWidth( + base = barrierHolderBase, + wall = archTowerThickness + ) +; + +/** + * Gets the horizontal interval of the final shape for a couple of arch towers (male and female) + * @returns Number + */ +function finalArchTowerIntervalX() = + getPrintInterval( + finalArchTowerLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a couple of arch towers (male and female) + * @returns Number + */ +function finalArchTowerIntervalY() = + 2 * getPrintInterval( + finalArchTowerWidth() + ) +; + /** * Defines the final shapes for a couple of arch towers (male and female). */ module finalArchTower() { - width = getBarrierHolderWidth(barrierHolderBase) + archTowerThickness * 2; - - distribute([0, getPrintInterval(width), 0], center=true) { + distribute([0, finalArchTowerIntervalY() / 2, 0], center=true) { archTowerMale( length = trackSectionLength, thickness = barrierBodyThickness, diff --git a/rcmodels/tracks/parts/elements/straight/body-curved.scad b/rcmodels/tracks/parts/elements/straight/body-curved.scad index 0b7b1f6..5b46bf8 100644 --- a/rcmodels/tracks/parts/elements/straight/body-curved.scad +++ b/rcmodels/tracks/parts/elements/straight/body-curved.scad @@ -31,13 +31,45 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the length of the final shape for the additional barrier body of a curve. + * @returns Number + */ +function finalCurvedBarrierBodyLength() = getCurveRemainingLength(trackSectionLength); + +/** + * Gets the width of the final shape for the additional barrier body of a curve. + * @returns Number + */ +function finalCurvedBarrierBodyWidth() = getBarrierBodyHeight(barrierHeight); + +/** + * Gets the width of the final shape for the additional barrier body of a curve. + * @returns Number + */ +function finalCurvedBarrierBodyIntervalX() = + getPrintInterval( + finalCurvedBarrierBodyLength() + ) +; + +/** + * Gets the width of the final shape for the additional barrier body of a curve. + * @returns Number + */ +function finalCurvedBarrierBodyIntervalY() = + getPrintInterval( + finalCurvedBarrierBodyWidth() + ) +; + /** * Defines the final shape for the additional barrier body of a curve. */ -module finalCurveBarrierBody() { +module finalCurvedBarrierBody() { barrierBody( - length = getCurveRemainingLength(trackSectionLength), - height = getBarrierBodyHeight(barrierHeight), + length = finalCurvedBarrierBodyLength(), + height = finalCurvedBarrierBodyWidth(), thickness = barrierBodyThickness, base = barrierHolderBase, notches = 1 @@ -48,5 +80,5 @@ module finalCurveBarrierBody() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalCurveBarrierBody(); + finalCurvedBarrierBody(); } diff --git a/rcmodels/tracks/parts/elements/straight/body-straight.scad b/rcmodels/tracks/parts/elements/straight/body-straight.scad index 8f05d85..3c60439 100644 --- a/rcmodels/tracks/parts/elements/straight/body-straight.scad +++ b/rcmodels/tracks/parts/elements/straight/body-straight.scad @@ -31,13 +31,45 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the length of the final shape for a barrier body. + * @returns Number + */ +function finalStraightBarrierBodyLength() = trackSectionLength; + +/** + * Gets the width of the final shape for a barrier body. + * @returns Number + */ +function finalStraightBarrierBodyWidth() = getBarrierBodyHeight(barrierHeight); + +/** + * Gets the horizontal interval of the final shape for a barrier body. + * @returns Number + */ +function finalStraightBarrierBodyIntervalX() = + getPrintInterval( + finalStraightBarrierBodyLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a barrier body. + * @returns Number + */ +function finalStraightBarrierBodyIntervalY() = + getPrintInterval( + finalStraightBarrierBodyWidth() + ) +; + /** * Defines the final shape for a barrier body. */ module finalStraightBarrierBody() { barrierBody( - length = trackSectionLength, - height = getBarrierBodyHeight(barrierHeight), + length = finalStraightBarrierBodyLength(), + height = finalStraightBarrierBodyWidth(), thickness = barrierBodyThickness, base = barrierHolderBase, notches = 2 diff --git a/rcmodels/tracks/parts/elements/straight/body-uturn.scad b/rcmodels/tracks/parts/elements/straight/body-uturn.scad index 031d2f7..d8409be 100644 --- a/rcmodels/tracks/parts/elements/straight/body-uturn.scad +++ b/rcmodels/tracks/parts/elements/straight/body-uturn.scad @@ -31,16 +31,60 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the size of the gap between the 2 sides of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnBarrierBodyGap() = archTowerThickness * 2; + +/** + * Gets the length of the final shape for the additional barrier body of a U-turn. + * @returns Number + */ +function finalUTurnBarrierBodyLength() = + getUTurnCompensationBarrierBodyLength( + length = trackSectionLength, + base = barrierHolderBase, + gap = finalUTurnBarrierBodyGap() + ) +; + +/** + * Gets the width of the final shape for the additional barrier body of a U-turn. + * @returns Number + */ +function finalUTurnBarrierBodyWidth() = getBarrierBodyHeight(barrierHeight); + +/** + * Gets the horizontal interval of the final shape for the additional barrier body of a U-turn. + * @returns Number + */ +function finalUTurnBarrierBodyIntervalX() = + getPrintInterval( + finalUTurnBarrierBodyLength() + ) +; + +/** + * Gets the vertical interval of the final shape for the additional barrier body of a U-turn. + * @returns Number + */ +function finalUTurnBarrierBodyIntervalY() = + getPrintInterval( + finalUTurnBarrierBodyWidth() + ) +; + /** * Defines the final shape for the additional barrier body of a U-turn. */ module finalUTurnBarrierBody() { uTurnCompensationBarrierBody( - length = trackSectionLength, - height = getBarrierBodyHeight(barrierHeight), + length = finalUTurnBarrierBodyLength(), + height = finalUTurnBarrierBodyWidth(), thickness = barrierBodyThickness, base = barrierHolderBase, - gap = archTowerThickness * 2 + gap = finalUTurnBarrierBodyGap() ); } diff --git a/rcmodels/tracks/parts/elements/straight/straight-double.scad b/rcmodels/tracks/parts/elements/straight/straight-double.scad index 7ac4d95..051c30e 100644 --- a/rcmodels/tracks/parts/elements/straight/straight-double.scad +++ b/rcmodels/tracks/parts/elements/straight/straight-double.scad @@ -31,6 +31,50 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the length ratio of the final shape for a double length barrier holder. + * @returns Number + */ +function finalDoubleStraightBarrierHolderRatio() = 2; + +/** + * Gets the length of the final shape for a double length barrier holder. + * @returns Number + */ +function finalDoubleStraightBarrierHolderLength() = + getStraightBarrierLength( + length = trackSectionLength, + base = barrierHolderBase, + ratio = finalDoubleStraightBarrierHolderRatio() + ) +; + +/** + * Gets the width of the final shape for a double length barrier holder. + * @returns Number + */ +function finalDoubleStraightBarrierHolderWidth() = getBarrierHolderWidth(barrierHolderBase); + +/** + * Gets the horizontal interval of the final shape for a double length barrier holder. + * @returns Number + */ +function finalDoubleStraightBarrierHolderIntervalX() = + getPrintInterval( + finalDoubleStraightBarrierHolderLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a double length barrier holder. + * @returns Number + */ +function finalDoubleStraightBarrierHolderIntervalY() = + getPrintInterval( + finalDoubleStraightBarrierHolderWidth() + ) +; + /** * Defines the final shape for a double length barrier holder. */ @@ -39,7 +83,7 @@ module finalDoubleStraightBarrierHolder() { length = trackSectionLength, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = 2 + ratio = finalDoubleStraightBarrierHolderRatio() ); } diff --git a/rcmodels/tracks/parts/elements/straight/straight-simple.scad b/rcmodels/tracks/parts/elements/straight/straight-simple.scad index 389304e..8daa035 100644 --- a/rcmodels/tracks/parts/elements/straight/straight-simple.scad +++ b/rcmodels/tracks/parts/elements/straight/straight-simple.scad @@ -31,6 +31,50 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the length ratio of the final shape for a simple length barrier holder. + * @returns Number + */ +function finalSimpleStraightBarrierHolderRatio() = 1; + +/** + * Gets the length of the final shape for a simple length barrier holder. + * @returns Number + */ +function finalSimpleStraightBarrierHolderLength() = + getStraightBarrierLength( + length = trackSectionLength, + base = barrierHolderBase, + ratio = finalSimpleStraightBarrierHolderRatio() + ) +; + +/** + * Gets the width of the final shape for a simple length barrier holder. + * @returns Number + */ +function finalSimpleStraightBarrierHolderWidth() = getBarrierHolderWidth(barrierHolderBase); + +/** + * Gets the horizontal interval of the final shape for a simple length barrier holder. + * @returns Number + */ +function finalSimpleStraightBarrierHolderIntervalX() = + getPrintInterval( + finalSimpleStraightBarrierHolderLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a simple length barrier holder. + * @returns Number + */ +function finalSimpleStraightBarrierHolderIntervalY() = + getPrintInterval( + finalSimpleStraightBarrierHolderWidth() + ) +; + /** * Defines the final shape for a simple length barrier holder. */ @@ -39,7 +83,7 @@ module finalSimpleStraightBarrierHolder() { length = trackSectionLength, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = 1 + ratio = finalSimpleStraightBarrierHolderRatio() ); } diff --git a/rcmodels/tracks/parts/elements/straight/straight-uturn.scad b/rcmodels/tracks/parts/elements/straight/straight-uturn.scad index 824f5fa..f54a6c4 100644 --- a/rcmodels/tracks/parts/elements/straight/straight-uturn.scad +++ b/rcmodels/tracks/parts/elements/straight/straight-uturn.scad @@ -31,6 +31,50 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the size of the gap between the 2 sides of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnCompensationBarrierHolderGap() = archTowerThickness * 2; + +/** + * Gets the length of the final shape for a U-turn compensation barrier holder. + * @returns Number + */ +function finalUTurnCompensationBarrierHolderLength() = + getUTurnCompensationBarrierLength( + width = getBarrierHolderWidth(barrierHolderBase), + base = barrierHolderBase, + gap = finalUTurnCompensationBarrierHolderGap() + ) +; + +/** + * Gets the width of the final shape for a U-turn compensation barrier holder. + * @returns Number + */ +function finalUTurnCompensationBarrierHolderWidth() = getBarrierHolderWidth(barrierHolderBase); + +/** + * Gets the horizontal interval of the final shape for a U-turn compensation barrier holder. + * @returns Number + */ +function finalUTurnCompensationBarrierHolderIntervalX() = + getPrintInterval( + finalUTurnCompensationBarrierHolderLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a U-turn compensation barrier holder. + * @returns Number + */ +function finalUTurnCompensationBarrierHolderIntervalY() = + getPrintInterval( + finalUTurnCompensationBarrierHolderWidth() + ) +; + /** * Defines the final shape for a U-turn compensation barrier holder. */ @@ -38,7 +82,7 @@ module finalUTurnCompensationBarrierHolder() { uTurnCompensationBarrierHolder( thickness = barrierBodyThickness, base = barrierHolderBase, - gap = archTowerThickness * 2 + gap = finalUTurnCompensationBarrierHolderGap() ); } diff --git a/rcmodels/tracks/parts/samples/curved/curved-inner-full.scad b/rcmodels/tracks/parts/samples/curved/curved-inner-full.scad index f7b7900..cb43f2f 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-inner-full.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-inner-full.scad @@ -31,12 +31,64 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the curve ratio of the final shape for an inner curve. + * @returns Number + */ +function finalFullInnerCurvedBarrierSampleRatio() = getInnerCurveRatio(trackSectionLength, trackRadius); + +/** + * Gets the length of the final shape for an inner curve. + * @returns Number + */ +function finalFullInnerCurvedBarrierSampleLength() = + getCurvedBarrierLength( + length = sampleSize * finalFullInnerCurvedBarrierSampleRatio(), + width = getBarrierHolderWidth(sampleBase), + base = sampleBase, + ratio = 1 + ) +; + +/** + * Gets the width of the final shape for an inner curve. + * @returns Number + */ +function finalFullInnerCurvedBarrierSampleWidth() = + getCurvedBarrierWidth( + length = sampleSize * finalFullInnerCurvedBarrierSampleRatio(), + width = getBarrierHolderWidth(sampleBase), + base = sampleBase, + ratio = 1 + ) +; + +/** + * Gets the horizontal interval of the final shape for an inner curve. + * @returns Number + */ +function finalFullInnerCurvedBarrierSampleIntervalX() = + getPrintInterval( + finalFullInnerCurvedBarrierSampleLength() + ) +; + +/** + * Gets the vertical interval of the final shape for an inner curve. + * @returns Number + */ +function finalFullInnerCurvedBarrierSampleIntervalY() = + getPrintInterval( + getBarrierHolderWidth(sampleBase) + ) +; + /** * Defines the final shape for a full inner curve. */ -module finalFullInnerCurveBarrierSample() { +module finalFullInnerCurvedBarrierSample() { curvedBarrierMain( - length = sampleSize * getInnerCurveRatio(trackSectionLength, trackRadius), + length = sampleSize * finalFullInnerCurvedBarrierSampleRatio(), thickness = barrierBodyThickness, base = sampleBase, ratio = 1, @@ -48,5 +100,5 @@ module finalFullInnerCurveBarrierSample() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalFullInnerCurveBarrierSample(); + finalFullInnerCurvedBarrierSample(); } diff --git a/rcmodels/tracks/parts/samples/curved/curved-inner.scad b/rcmodels/tracks/parts/samples/curved/curved-inner.scad index 17cde10..57abea2 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-inner.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-inner.scad @@ -31,15 +31,67 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the curve ratio of the final shape for an inner curve. + * @returns Number + */ +function finalInnerCurvedBarrierSampleRatio() = getInnerCurveRatio(trackSectionLength, trackRadius); + +/** + * Gets the length of the final shape for an inner curve. + * @returns Number + */ +function finalInnerCurvedBarrierSampleLength() = + getCurvedBarrierLength( + length = sampleSize, + width = getBarrierHolderWidth(sampleBase), + base = sampleBase, + ratio = finalInnerCurvedBarrierSampleRatio() + ) +; + +/** + * Gets the width of the final shape for an inner curve. + * @returns Number + */ +function finalInnerCurvedBarrierSampleWidth() = + getCurvedBarrierWidth( + length = sampleSize, + width = getBarrierHolderWidth(sampleBase), + base = sampleBase, + ratio = finalInnerCurvedBarrierSampleRatio() + ) +; + +/** + * Gets the horizontal interval of the final shape for an inner curve. + * @returns Number + */ +function finalInnerCurvedBarrierSampleIntervalX() = + getPrintInterval( + finalInnerCurvedBarrierSampleLength() + ) +; + +/** + * Gets the vertical interval of the final shape for an inner curve. + * @returns Number + */ +function finalInnerCurvedBarrierSampleIntervalY() = + getPrintInterval( + getBarrierHolderWidth(sampleBase) + ) +; + /** * Defines the final shape for an inner curve. */ -module finalInnerCurveBarrierSample() { +module finalInnerCurvedBarrierSample() { curvedBarrierMain( length = sampleSize, thickness = barrierBodyThickness, base = sampleBase, - ratio = getInnerCurveRatio(trackSectionLength, trackRadius), + ratio = finalInnerCurvedBarrierSampleRatio(), right = rightOriented ); } @@ -48,5 +100,5 @@ module finalInnerCurveBarrierSample() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalInnerCurveBarrierSample(); + finalInnerCurvedBarrierSample(); } diff --git a/rcmodels/tracks/parts/samples/curved/curved-outer-full.scad b/rcmodels/tracks/parts/samples/curved/curved-outer-full.scad index 15b6114..1f822ab 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-outer-full.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-outer-full.scad @@ -31,12 +31,64 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the curve ratio of the final shape for an outer curve. + * @returns Number + */ +function finalFullOuterCurvedBarrierSampleRatio() = getOuterCurveRatio(trackSectionLength, trackSectionWidth, trackRadius); + +/** + * Gets the length of the final shape for an outer curve. + * @returns Number + */ +function finalFullOuterCurvedBarrierSampleLength() = + getCurvedBarrierLength( + length = sampleSize * finalFullOuterCurvedBarrierSampleRatio(), + width = getBarrierHolderWidth(sampleBase), + base = sampleBase, + ratio = 1 + ) +; + +/** + * Gets the width of the final shape for an outer curve. + * @returns Number + */ +function finalFullOuterCurvedBarrierSampleWidth() = + getCurvedBarrierWidth( + length = sampleSize * finalFullOuterCurvedBarrierSampleRatio(), + width = getBarrierHolderWidth(sampleBase), + base = sampleBase, + ratio = 1 + ) +; + +/** + * Gets the horizontal interval of the final shape for an outer curve. + * @returns Number + */ +function finalFullOuterCurvedBarrierSampleIntervalX() = + getPrintInterval( + finalFullOuterCurvedBarrierSampleLength() + ) +; + +/** + * Gets the vertical interval of the final shape for an outer curve. + * @returns Number + */ +function finalFullOuterCurvedBarrierSampleIntervalY() = + getPrintInterval( + getBarrierHolderWidth(sampleBase) + ) +; + /** * Defines the final shape for a full outer curve. */ -module finalFullOuterCurveBarrierSample() { +module finalFullOuterCurvedBarrierSample() { curvedBarrierMain( - length = sampleSize * getOuterCurveRatio(trackSectionLength, trackSectionWidth, trackRadius), + length = sampleSize * finalFullOuterCurvedBarrierSampleRatio(), thickness = barrierBodyThickness, base = sampleBase, ratio = 1, @@ -48,5 +100,5 @@ module finalFullOuterCurveBarrierSample() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalFullOuterCurveBarrierSample(); + finalFullOuterCurvedBarrierSample(); } diff --git a/rcmodels/tracks/parts/samples/curved/curved-outer.scad b/rcmodels/tracks/parts/samples/curved/curved-outer.scad index 6952470..c601d3b 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-outer.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-outer.scad @@ -31,15 +31,67 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the curve ratio of the final shape for an outer curve. + * @returns Number + */ +function finalOuterCurvedBarrierSampleRatio() = getOuterCurveRatio(trackSectionLength, trackSectionWidth, trackRadius); + +/** + * Gets the length of the final shape for an outer curve. + * @returns Number + */ +function finalOuterCurvedBarrierSampleLength() = + getCurvedBarrierLength( + length = sampleSize, + width = getBarrierHolderWidth(sampleBase), + base = sampleBase, + ratio = finalOuterCurvedBarrierSampleRatio() + ) +; + +/** + * Gets the width of the final shape for an outer curve. + * @returns Number + */ +function finalOuterCurvedBarrierSampleWidth() = + getCurvedBarrierWidth( + length = sampleSize, + width = getBarrierHolderWidth(sampleBase), + base = sampleBase, + ratio = finalOuterCurvedBarrierSampleRatio() + ) +; + +/** + * Gets the horizontal interval of the final shape for an outer curve. + * @returns Number + */ +function finalOuterCurvedBarrierSampleIntervalX() = + getPrintInterval( + finalOuterCurvedBarrierSampleLength() + ) +; + +/** + * Gets the vertical interval of the final shape for an outer curve. + * @returns Number + */ +function finalOuterCurvedBarrierSampleIntervalY() = + getPrintInterval( + getBarrierHolderWidth(sampleBase) + ) +; + /** * Defines the final shape for an outer curve. */ -module finalOuterCurveBarrierSample() { +module finalOuterCurvedBarrierSample() { curvedBarrierMain( length = sampleSize, thickness = barrierBodyThickness, base = sampleBase, - ratio = getOuterCurveRatio(trackSectionLength, trackSectionWidth, trackRadius), + ratio = finalOuterCurvedBarrierSampleRatio(), right = rightOriented ); } @@ -48,5 +100,5 @@ module finalOuterCurveBarrierSample() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalOuterCurveBarrierSample(); + finalOuterCurvedBarrierSample(); } diff --git a/rcmodels/tracks/parts/samples/curved/curved-short.scad b/rcmodels/tracks/parts/samples/curved/curved-short.scad index 2c9552c..a54d894 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-short.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-short.scad @@ -31,15 +31,67 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the curve ratio of the final shape for an short curve. + * @returns Number + */ +function finalShortCurvedBarrierSampleRatio() = .5; + +/** + * Gets the length of the final shape for an short curve. + * @returns Number + */ +function finalShortCurvedBarrierSampleLength() = + getCurvedBarrierLength( + length = sampleSize, + width = getBarrierHolderWidth(sampleBase), + base = sampleBase, + ratio = finalShortCurvedBarrierSampleRatio() + ) +; + +/** + * Gets the width of the final shape for an short curve. + * @returns Number + */ +function finalShortCurvedBarrierSampleWidth() = + getCurvedBarrierWidth( + length = sampleSize, + width = getBarrierHolderWidth(sampleBase), + base = sampleBase, + ratio = finalShortCurvedBarrierSampleRatio() + ) +; + +/** + * Gets the horizontal interval of the final shape for an short curve. + * @returns Number + */ +function finalShortCurvedBarrierSampleIntervalX() = + getPrintInterval( + finalShortCurvedBarrierSampleLength() + ) +; + +/** + * Gets the vertical interval of the final shape for an short curve. + * @returns Number + */ +function finalShortCurvedBarrierSampleIntervalY() = + getPrintInterval( + finalShortCurvedBarrierSampleWidth() / 2 + ) +; + /** * Defines the final shape for a short curve. */ -module finalShortCurveBarrierSample() { +module finalShortCurvedBarrierSample() { curvedBarrierMain( length = sampleSize, thickness = barrierBodyThickness, base = sampleBase, - ratio = .5, + ratio = finalShortCurvedBarrierSampleRatio(), right = rightOriented ); } @@ -48,5 +100,5 @@ module finalShortCurveBarrierSample() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalShortCurveBarrierSample(); + finalShortCurvedBarrierSample(); } diff --git a/rcmodels/tracks/parts/samples/curved/curved-small.scad b/rcmodels/tracks/parts/samples/curved/curved-small.scad index a5d6913..07d55da 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-small.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-small.scad @@ -31,15 +31,67 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the curve ratio of the final shape for an small curve. + * @returns Number + */ +function finalSmallCurvedBarrierSampleRatio() = 1; + +/** + * Gets the length of the final shape for an small curve. + * @returns Number + */ +function finalSmallCurvedBarrierSampleLength() = + getCurvedBarrierLength( + length = sampleSize, + width = getBarrierHolderWidth(sampleBase), + base = sampleBase, + ratio = finalSmallCurvedBarrierSampleRatio() + ) +; + +/** + * Gets the width of the final shape for an small curve. + * @returns Number + */ +function finalSmallCurvedBarrierSampleWidth() = + getCurvedBarrierWidth( + length = sampleSize, + width = getBarrierHolderWidth(sampleBase), + base = sampleBase, + ratio = finalSmallCurvedBarrierSampleRatio() + ) +; + +/** + * Gets the horizontal interval of the final shape for an small curve. + * @returns Number + */ +function finalSmallCurvedBarrierSampleIntervalX() = + getPrintInterval( + finalSmallCurvedBarrierSampleLength() + ) +; + +/** + * Gets the vertical interval of the final shape for an small curve. + * @returns Number + */ +function finalSmallCurvedBarrierSampleIntervalY() = + getPrintInterval( + finalSmallCurvedBarrierSampleWidth() / 2 + ) +; + /** * Defines the final shape for a small curve. */ -module finalSmallCurveBarrierSample() { +module finalSmallCurvedBarrierSample() { curvedBarrierMain( length = sampleSize, thickness = barrierBodyThickness, base = sampleBase, - ratio = 1, + ratio = finalSmallCurvedBarrierSampleRatio(), right = rightOriented ); } @@ -48,5 +100,5 @@ module finalSmallCurveBarrierSample() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalSmallCurveBarrierSample(); + finalSmallCurvedBarrierSample(); } diff --git a/rcmodels/tracks/parts/samples/curved/curved-uturn.scad b/rcmodels/tracks/parts/samples/curved/curved-uturn.scad index 1200048..b284924 100644 --- a/rcmodels/tracks/parts/samples/curved/curved-uturn.scad +++ b/rcmodels/tracks/parts/samples/curved/curved-uturn.scad @@ -31,12 +31,63 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the size of the gap between the 2 sides of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnCurvedBarrierSampleGap() = minWidth * 2; + +/** + * Gets the length of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnCurvedBarrierSampleLength() = + getUTurnBarrierLength( + length = sampleSize, + width = getBarrierHolderWidth(sampleBase), + base = sampleBase, + gap = finalUTurnCurvedBarrierSampleGap() + ) +; + +/** + * Gets the width of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnCurvedBarrierSampleWidth() = + getUTurnBarrierWidth( + width = getBarrierHolderWidth(sampleBase), + base = sampleBase, + gap = finalUTurnCurvedBarrierSampleGap() + ) +; + +/** + * Gets the horizontal interval of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnCurvedBarrierSampleIntervalX() = + getPrintInterval( + finalUTurnCurvedBarrierSampleLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnCurvedBarrierSampleIntervalY() = + getPrintInterval( + finalUTurnCurvedBarrierSampleWidth() + ) +; + /** * Draws the shape of a barrier border for a U-Turn. * @param Number length - The length of a track element. * @param Number thickness - The thickness of the barrier body. * @param Number base - The base unit value used to design the barrier holder. - * @param Number gap - The distance between the two side of the u-turn. + * @param Number gap - The distance between the two side of the U-turn. * @param Number right - Is it the right or the left part of the track element that is added first? */ module uTurnSample(length, thickness, base, gap, right = false) { @@ -82,12 +133,12 @@ module uTurnSample(length, thickness, base, gap, right = false) { /** * Defines the final shape for a U-turn curve. */ -module finalUTurnCurveBarrierSample() { +module finalUTurnCurvedBarrierSample() { uTurnSample( length = sampleSize, thickness = barrierBodyThickness, base = sampleBase, - gap = minWidth * 2, + gap = finalUTurnCurvedBarrierSampleGap(), right = rightOriented ); } @@ -96,5 +147,5 @@ module finalUTurnCurveBarrierSample() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalUTurnCurveBarrierSample(); + finalUTurnCurvedBarrierSample(); } diff --git a/rcmodels/tracks/parts/samples/straight/arch-sample.scad b/rcmodels/tracks/parts/samples/straight/arch-sample.scad index c47f398..d43a64f 100644 --- a/rcmodels/tracks/parts/samples/straight/arch-sample.scad +++ b/rcmodels/tracks/parts/samples/straight/arch-sample.scad @@ -31,6 +31,58 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the width of a lane with respect to the samples. + * @returns Number + */ +function getSampleLaneWidth() = trackLaneWidth / trackSectionLength * sampleSize; + +/** + * Gets the thickness of the clip outline.. + * @returns Number + */ +function getSampleWallWidth() = minWidth * 2; + +/** + * Gets the length of the final shape for an arch sample. + * @returns Number + */ +function finalArchSampleLength() = + getSampleLaneWidth() + + getBarrierHolderWidth(sampleBase) + + getSampleWallWidth() * 2 +; + +/** + * Gets the width of the final shape for an arch sample. + * @returns Number + */ +function finalArchSampleWidth() = + sampleSize * 1.5 + + getBarrierHolderHeight(sampleBase) + + getSampleWallWidth() * 2 +; + +/** + * Gets the horizontal interval of the final shape for an arch sample. + * @returns Number + */ +function finalArchSampleIntervalX() = + getPrintInterval( + finalArchSampleLength() + ) +; + +/** + * Gets the vertical interval of the final shape for an arch sample. + * @returns Number + */ +function finalArchSampleIntervalY() = + getPrintInterval( + finalArchSampleWidth() + ) +; + /** * Computes the points defining the profile of the arch sample. * @param Number length - The length of a track element. @@ -74,8 +126,8 @@ module archSampleProfile(length, width, wall) { * Defines the final shape for an arch sample. */ module finalArchSample() { - laneWidth = trackLaneWidth / trackSectionLength * sampleSize; - wallWidth = minWidth * 2; + laneWidth = getSampleLaneWidth(); + wallWidth = getSampleWallWidth(); negativeExtrude(height=getBarrierHolderWidth(sampleBase)) { archSampleProfile(sampleSize, laneWidth, wallWidth); diff --git a/rcmodels/tracks/parts/samples/straight/straight-double.scad b/rcmodels/tracks/parts/samples/straight/straight-double.scad index 1ec53f9..790e898 100644 --- a/rcmodels/tracks/parts/samples/straight/straight-double.scad +++ b/rcmodels/tracks/parts/samples/straight/straight-double.scad @@ -31,12 +31,56 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the length ratio of the final shape for a double length barrier sample. + * @returns Number + */ +function finalDoubleStraightBarrierSampleRatio() = 2; + +/** + * Gets the length of the final shape for a double length barrier sample. + * @returns Number + */ +function finalDoubleStraightBarrierSampleLength() = + getStraightBarrierLength( + length = sampleSize, + base = sampleBase, + ratio = finalDoubleStraightBarrierSampleRatio() + ) +; + +/** + * Gets the width of the final shape for a double length barrier sample. + * @returns Number + */ +function finalDoubleStraightBarrierSampleWidth() = getBarrierHolderWidth(sampleBase); + +/** + * Gets the horizontal interval of the final shape for a double length barrier sample. + * @returns Number + */ +function finalDoubleStraightBarrierSampleIntervalX() = + getPrintInterval( + finalDoubleStraightBarrierSampleLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a double length barrier sample. + * @returns Number + */ +function finalDoubleStraightBarrierSampleIntervalY() = + getPrintInterval( + finalDoubleStraightBarrierSampleWidth() + ) +; + /** * Defines the final shape for a double length barrier sample. */ module finalDoubleStraightBarrierSample() { straightBarrierMain( - length = sampleSize * 2, + length = sampleSize * finalDoubleStraightBarrierSampleRatio(), thickness = barrierBodyThickness, base = sampleBase ); diff --git a/rcmodels/tracks/parts/samples/straight/straight-long-10.scad b/rcmodels/tracks/parts/samples/straight/straight-long-10.scad index 9ed8799..6635d62 100644 --- a/rcmodels/tracks/parts/samples/straight/straight-long-10.scad +++ b/rcmodels/tracks/parts/samples/straight/straight-long-10.scad @@ -31,12 +31,56 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the length ratio of the final shape for a x10 length barrier sample. + * @returns Number + */ +function finalLong10StraightBarrierSampleRatio() = 10; + +/** + * Gets the length of the final shape for a x10 length barrier sample. + * @returns Number + */ +function finalLong10StraightBarrierSampleLength() = + getStraightBarrierLength( + length = sampleSize, + base = sampleBase, + ratio = finalLong10StraightBarrierSampleRatio() + ) +; + +/** + * Gets the width of the final shape for a x10 length barrier sample. + * @returns Number + */ +function finalLong10StraightBarrierSampleWidth() = getBarrierHolderWidth(sampleBase); + +/** + * Gets the horizontal interval of the final shape for a x10 length barrier sample. + * @returns Number + */ +function finalLong10StraightBarrierSampleIntervalX() = + getPrintInterval( + finalLong10StraightBarrierSampleLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a x10 length barrier sample. + * @returns Number + */ +function finalLong10StraightBarrierSampleIntervalY() = + getPrintInterval( + finalLong10StraightBarrierSampleWidth() + ) +; + /** * Defines the final shape for a x10 length barrier sample. */ module finalLong10StraightBarrierSample() { straightBarrierMain( - length = sampleSize * 10, + length = sampleSize * finalLong10StraightBarrierSampleRatio(), thickness = barrierBodyThickness, base = sampleBase ); diff --git a/rcmodels/tracks/parts/samples/straight/straight-long-20.scad b/rcmodels/tracks/parts/samples/straight/straight-long-20.scad index e6d5458..b11e3dd 100644 --- a/rcmodels/tracks/parts/samples/straight/straight-long-20.scad +++ b/rcmodels/tracks/parts/samples/straight/straight-long-20.scad @@ -31,12 +31,56 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the length ratio of the final shape for a x20 length barrier sample. + * @returns Number + */ +function finalLong20StraightBarrierSampleRatio() = 20; + +/** + * Gets the length of the final shape for a x20 length barrier sample. + * @returns Number + */ +function finalLong20StraightBarrierSampleLength() = + getStraightBarrierLength( + length = sampleSize, + base = sampleBase, + ratio = finalLong20StraightBarrierSampleRatio() + ) +; + +/** + * Gets the width of the final shape for a x20 length barrier sample. + * @returns Number + */ +function finalLong20StraightBarrierSampleWidth() = getBarrierHolderWidth(sampleBase); + +/** + * Gets the horizontal interval of the final shape for a x20 length barrier sample. + * @returns Number + */ +function finalLong20StraightBarrierSampleIntervalX() = + getPrintInterval( + finalLong20StraightBarrierSampleLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a x20 length barrier sample. + * @returns Number + */ +function finalLong20StraightBarrierSampleIntervalY() = + getPrintInterval( + finalLong20StraightBarrierSampleWidth() + ) +; + /** * Defines the final shape for a x20 length barrier sample. */ module finalLong20StraightBarrierSample() { straightBarrierMain( - length = sampleSize * 20, + length = sampleSize * finalLong20StraightBarrierSampleRatio(), thickness = barrierBodyThickness, base = sampleBase ); diff --git a/rcmodels/tracks/parts/samples/straight/straight-long-5.scad b/rcmodels/tracks/parts/samples/straight/straight-long-5.scad index 4f9c2f3..ffccae8 100644 --- a/rcmodels/tracks/parts/samples/straight/straight-long-5.scad +++ b/rcmodels/tracks/parts/samples/straight/straight-long-5.scad @@ -31,12 +31,56 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the length ratio of the final shape for a x5 length barrier sample. + * @returns Number + */ +function finalLong5StraightBarrierSampleRatio() = 5; + +/** + * Gets the length of the final shape for a x5 length barrier sample. + * @returns Number + */ +function finalLong5StraightBarrierSampleLength() = + getStraightBarrierLength( + length = sampleSize, + base = sampleBase, + ratio = finalLong5StraightBarrierSampleRatio() + ) +; + +/** + * Gets the width of the final shape for a x5 length barrier sample. + * @returns Number + */ +function finalLong5StraightBarrierSampleWidth() = getBarrierHolderWidth(sampleBase); + +/** + * Gets the horizontal interval of the final shape for a x5 length barrier sample. + * @returns Number + */ +function finalLong5StraightBarrierSampleIntervalX() = + getPrintInterval( + finalLong5StraightBarrierSampleLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a x5 length barrier sample. + * @returns Number + */ +function finalLong5StraightBarrierSampleIntervalY() = + getPrintInterval( + finalLong5StraightBarrierSampleWidth() + ) +; + /** * Defines the final shape for a x5 length barrier sample. */ module finalLong5StraightBarrierSample() { straightBarrierMain( - length = sampleSize * 5, + length = sampleSize * finalLong5StraightBarrierSampleRatio(), thickness = barrierBodyThickness, base = sampleBase ); diff --git a/rcmodels/tracks/parts/samples/straight/straight-simple.scad b/rcmodels/tracks/parts/samples/straight/straight-simple.scad index d530b00..23d7be4 100644 --- a/rcmodels/tracks/parts/samples/straight/straight-simple.scad +++ b/rcmodels/tracks/parts/samples/straight/straight-simple.scad @@ -31,12 +31,56 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the length ratio of the final shape for a simple length barrier sample. + * @returns Number + */ +function finalSimpleStraightBarrierSampleRatio() = 1; + +/** + * Gets the length of the final shape for a simple length barrier sample. + * @returns Number + */ +function finalSimpleStraightBarrierSampleLength() = + getStraightBarrierLength( + length = sampleSize, + base = sampleBase, + ratio = finalSimpleStraightBarrierSampleRatio() + ) +; + +/** + * Gets the width of the final shape for a simple length barrier sample. + * @returns Number + */ +function finalSimpleStraightBarrierSampleWidth() = getBarrierHolderWidth(sampleBase); + +/** + * Gets the horizontal interval of the final shape for a simple length barrier sample. + * @returns Number + */ +function finalSimpleStraightBarrierSampleIntervalX() = + getPrintInterval( + finalSimpleStraightBarrierSampleLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a simple length barrier sample. + * @returns Number + */ +function finalSimpleStraightBarrierSampleIntervalY() = + getPrintInterval( + finalSimpleStraightBarrierSampleWidth() + ) +; + /** * Defines the final shape for a simple length barrier sample. */ module finalSimpleStraightBarrierSample() { straightBarrierMain( - length = sampleSize, + length = sampleSize * finalSimpleStraightBarrierSampleRatio(), thickness = barrierBodyThickness, base = sampleBase ); diff --git a/rcmodels/tracks/parts/samples/straight/straight-uturn.scad b/rcmodels/tracks/parts/samples/straight/straight-uturn.scad index 2bf0bee..293155e 100644 --- a/rcmodels/tracks/parts/samples/straight/straight-uturn.scad +++ b/rcmodels/tracks/parts/samples/straight/straight-uturn.scad @@ -31,12 +31,56 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the size of the gap between the 2 sides of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnCompensationBarrierSampleGap() = minWidth * 2; + +/** + * Gets the length of the final shape for a U-turn compensation barrier sample. + * @returns Number + */ +function finalUTurnCompensationBarrierSampleLength() = + getUTurnCompensationBarrierLength( + width = getBarrierHolderWidth(sampleBase), + base = sampleBase, + gap = finalUTurnCompensationBarrierSampleGap() + ) +; + +/** + * Gets the width of the final shape for a U-turn compensation barrier sample. + * @returns Number + */ +function finalUTurnCompensationBarrierSampleWidth() = getBarrierHolderWidth(sampleBase); + +/** + * Gets the horizontal interval of the final shape for a U-turn compensation barrier sample. + * @returns Number + */ +function finalUTurnCompensationBarrierSampleIntervalX() = + getPrintInterval( + finalUTurnCompensationBarrierSampleLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a U-turn compensation barrier sample. + * @returns Number + */ +function finalUTurnCompensationBarrierSampleIntervalY() = + getPrintInterval( + finalUTurnCompensationBarrierSampleWidth() + ) +; + /** * Defines the final shape for a U-turn compensation barrier sample. */ module finalUTurnCompensationBarrierSample() { straightBarrierMain( - length = getBarrierHolderWidth(sampleBase) + minWidth * 2, + length = getBarrierHolderWidth(sampleBase) + finalUTurnCompensationBarrierSampleGap(), thickness = barrierBodyThickness, base = sampleBase ); diff --git a/rcmodels/tracks/parts/unibody/curved/curved-inner.scad b/rcmodels/tracks/parts/unibody/curved/curved-inner.scad index aeb1938..4b9e66f 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-inner.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-inner.scad @@ -31,16 +31,68 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the curve ratio of the final shape for an inner curve. + * @returns Number + */ +function finalInnerCurvedBarrierUnibodyRatio() = getInnerCurveRatio(trackSectionLength, trackRadius); + +/** + * Gets the length of the final shape for an inner curve. + * @returns Number + */ +function finalInnerCurvedBarrierUnibodyLength() = + getCurvedBarrierLength( + length = trackSectionLength, + width = getBarrierUnibodyWidth(barrierHolderBase), + base = barrierHolderBase, + ratio = finalInnerCurvedBarrierUnibodyRatio() + ) +; + +/** + * Gets the width of the final shape for an inner curve. + * @returns Number + */ +function finalInnerCurvedBarrierUnibodyWidth() = + getCurvedBarrierWidth( + length = trackSectionLength, + width = getBarrierUnibodyWidth(barrierHolderBase), + base = barrierHolderBase, + ratio = finalInnerCurvedBarrierUnibodyRatio() + ) +; + +/** + * Gets the horizontal interval of the final shape for an inner curve. + * @returns Number + */ +function finalInnerCurvedBarrierUnibodyIntervalX() = + getPrintInterval( + finalInnerCurvedBarrierUnibodyLength() + ) +; + +/** + * Gets the vertical interval of the final shape for an inner curve. + * @returns Number + */ +function finalInnerCurvedBarrierUnibodyIntervalY() = + getPrintInterval( + getBarrierUnibodyWidth(barrierHolderBase) + ) +; + /** * Defines the final shape for an inner curve. */ -module finalInnerCurveBarrierUnibody() { +module finalInnerCurvedBarrierUnibody() { curvedBarrierUnibody( length = trackSectionLength, height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = getInnerCurveRatio(trackSectionLength, trackRadius), + ratio = finalInnerCurvedBarrierUnibodyRatio(), right = rightOriented ); } @@ -49,5 +101,5 @@ module finalInnerCurveBarrierUnibody() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalInnerCurveBarrierUnibody(); + finalInnerCurvedBarrierUnibody(); } diff --git a/rcmodels/tracks/parts/unibody/curved/curved-outer.scad b/rcmodels/tracks/parts/unibody/curved/curved-outer.scad index 72eb741..f1f5be5 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-outer.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-outer.scad @@ -31,16 +31,68 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the curve ratio of the final shape for an outer curve. + * @returns Number + */ +function finalOuterCurvedBarrierUnibodyRatio() = getOuterCurveRatio(trackSectionLength, trackSectionWidth, trackRadius); + +/** + * Gets the length of the final shape for an outer curve. + * @returns Number + */ +function finalOuterCurvedBarrierUnibodyLength() = + getCurvedBarrierLength( + length = trackSectionLength, + width = getBarrierUnibodyWidth(barrierHolderBase), + base = barrierHolderBase, + ratio = finalOuterCurvedBarrierUnibodyRatio() + ) +; + +/** + * Gets the width of the final shape for an outer curve. + * @returns Number + */ +function finalOuterCurvedBarrierUnibodyWidth() = + getCurvedBarrierWidth( + length = trackSectionLength, + width = getBarrierUnibodyWidth(barrierHolderBase), + base = barrierHolderBase, + ratio = finalOuterCurvedBarrierUnibodyRatio() + ) +; + +/** + * Gets the horizontal interval of the final shape for an outer curve. + * @returns Number + */ +function finalOuterCurvedBarrierUnibodyIntervalX() = + getPrintInterval( + finalOuterCurvedBarrierUnibodyLength() + ) +; + +/** + * Gets the vertical interval of the final shape for an outer curve. + * @returns Number + */ +function finalOuterCurvedBarrierUnibodyIntervalY() = + getPrintInterval( + getBarrierUnibodyWidth(barrierHolderBase) + ) +; + /** * Defines the final shape for an outer curve. */ -module finalOuterCurveBarrierUnibody() { +module finalOuterCurvedBarrierUnibody() { curvedBarrierUnibody( length = trackSectionLength, height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = getOuterCurveRatio(trackSectionLength, trackSectionWidth, trackRadius), + ratio = finalOuterCurvedBarrierUnibodyRatio(), right = rightOriented ); } @@ -49,5 +101,5 @@ module finalOuterCurveBarrierUnibody() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalOuterCurveBarrierUnibody(); + finalOuterCurvedBarrierUnibody(); } diff --git a/rcmodels/tracks/parts/unibody/curved/curved-short.scad b/rcmodels/tracks/parts/unibody/curved/curved-short.scad index ebd2f8e..7f1d89a 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-short.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-short.scad @@ -31,16 +31,68 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the curve ratio of the final shape for an small curve. + * @returns Number + */ +function finalShortCurvedBarrierUnibodyRatio() = .5; + +/** + * Gets the length of the final shape for an small curve. + * @returns Number + */ +function finalShortCurvedBarrierUnibodyLength() = + getCurvedBarrierLength( + length = trackSectionLength, + width = getBarrierUnibodyWidth(barrierHolderBase), + base = barrierHolderBase, + ratio = finalShortCurvedBarrierUnibodyRatio() + ) +; + +/** + * Gets the width of the final shape for an small curve. + * @returns Number + */ +function finalShortCurvedBarrierUnibodyWidth() = + getCurvedBarrierWidth( + length = trackSectionLength, + width = getBarrierUnibodyWidth(barrierHolderBase), + base = barrierHolderBase, + ratio = finalShortCurvedBarrierUnibodyRatio() + ) +; + +/** + * Gets the horizontal interval of the final shape for an small curve. + * @returns Number + */ +function finalShortCurvedBarrierUnibodyIntervalX() = + getPrintInterval( + finalShortCurvedBarrierUnibodyLength() + ) +; + +/** + * Gets the vertical interval of the final shape for an small curve. + * @returns Number + */ +function finalShortCurvedBarrierUnibodyIntervalY() = + getPrintInterval( + finalShortCurvedBarrierUnibodyWidth() / 2 + ) +; + /** * Defines the final shape for a short curve. */ -module finalShortCurveBarrierUnibody() { +module finalShortCurvedBarrierUnibody() { curvedBarrierUnibody( length = trackSectionLength, height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = .5, + ratio = finalShortCurvedBarrierUnibodyRatio(), right = rightOriented ); } @@ -49,5 +101,5 @@ module finalShortCurveBarrierUnibody() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalShortCurveBarrierUnibody(); + finalShortCurvedBarrierUnibody(); } diff --git a/rcmodels/tracks/parts/unibody/curved/curved-small.scad b/rcmodels/tracks/parts/unibody/curved/curved-small.scad index 8b38fc4..297456a 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-small.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-small.scad @@ -31,16 +31,68 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the curve ratio of the final shape for an small curve. + * @returns Number + */ +function finalSmallCurvedBarrierUnibodyRatio() = 1; + +/** + * Gets the length of the final shape for an small curve. + * @returns Number + */ +function finalSmallCurvedBarrierUnibodyLength() = + getCurvedBarrierLength( + length = trackSectionLength, + width = getBarrierUnibodyWidth(barrierHolderBase), + base = barrierHolderBase, + ratio = finalSmallCurvedBarrierUnibodyRatio() + ) +; + +/** + * Gets the width of the final shape for an small curve. + * @returns Number + */ +function finalSmallCurvedBarrierUnibodyWidth() = + getCurvedBarrierWidth( + length = trackSectionLength, + width = getBarrierUnibodyWidth(barrierHolderBase), + base = barrierHolderBase, + ratio = finalSmallCurvedBarrierUnibodyRatio() + ) +; + +/** + * Gets the horizontal interval of the final shape for an small curve. + * @returns Number + */ +function finalSmallCurvedBarrierUnibodyIntervalX() = + getPrintInterval( + finalSmallCurvedBarrierUnibodyLength() + ) +; + +/** + * Gets the vertical interval of the final shape for an small curve. + * @returns Number + */ +function finalSmallCurvedBarrierUnibodyIntervalY() = + getPrintInterval( + finalSmallCurvedBarrierUnibodyWidth() / 2 + ) +; + /** * Defines the final shape for a small curve. */ -module finalSmallCurveBarrierUnibody() { +module finalSmallCurvedBarrierUnibody() { curvedBarrierUnibody( length = trackSectionLength, height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase, - ratio = 1, + ratio = finalSmallCurvedBarrierUnibodyRatio(), right = rightOriented ); } @@ -49,5 +101,5 @@ module finalSmallCurveBarrierUnibody() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalSmallCurveBarrierUnibody(); + finalSmallCurvedBarrierUnibody(); } diff --git a/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad b/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad index 050fb7a..a55c69a 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad @@ -31,16 +31,67 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the size of the gap between the 2 sides of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnCurvedBarrierUnibodyGap() = archTowerThickness * 2; + +/** + * Gets the length of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnCurvedBarrierUnibodyLength() = + getUTurnBarrierLength( + length = trackSectionLength, + width = getBarrierUnibodyWidth(barrierHolderBase), + base = barrierHolderBase, + gap = finalUTurnCurvedBarrierUnibodyGap() + ) +; + +/** + * Gets the width of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnCurvedBarrierUnibodyWidth() = + getUTurnBarrierWidth( + width = getBarrierUnibodyWidth(barrierHolderBase), + base = barrierHolderBase, + gap = finalUTurnCurvedBarrierUnibodyGap() + ) +; + +/** + * Gets the horizontal interval of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnCurvedBarrierUnibodyIntervalX() = + getPrintInterval( + finalUTurnCurvedBarrierUnibodyLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnCurvedBarrierUnibodyIntervalY() = + getPrintInterval( + finalUTurnCurvedBarrierUnibodyWidth() + ) +; + /** * Defines the final shape for a U-turn curve. */ -module finalUTurnCurveBarrierUnibody() { +module finalUTurnCurvedBarrierUnibody() { uTurnBarrierUnibody( length = trackSectionLength, height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase, - gap = archTowerThickness * 2, + gap = finalUTurnCurvedBarrierUnibodyGap(), right = rightOriented ); } @@ -49,5 +100,5 @@ module finalUTurnCurveBarrierUnibody() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalUTurnCurveBarrierUnibody(); + finalUTurnCurvedBarrierUnibody(); } diff --git a/rcmodels/tracks/parts/unibody/straight/straight-connector.scad b/rcmodels/tracks/parts/unibody/straight/straight-connector.scad index 3530ae4..bb8967c 100644 --- a/rcmodels/tracks/parts/unibody/straight/straight-connector.scad +++ b/rcmodels/tracks/parts/unibody/straight/straight-connector.scad @@ -31,18 +31,59 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the length of the final shape for a unibody barrier connector. + * @returns Number + */ +function finalConnectorBarrierUnibodyLength() = + 2 * getStraightBarrierLength(trackSectionLength, barrierHolderBase, .5) + + getBarrierLinkLength(barrierHolderBase) + + printInterval +; + +/** + * Gets the width of the final shape for a unibody barrier connector. + * @returns Number + */ +function finalConnectorBarrierUnibodyWidth() = + 3 * getBarrierUnibodyWidth(barrierHolderBase) + + 2 * printInterval +; + +/** + * Gets the horizontal interval of the final shape for a unibody barrier connector. + * @returns Number + */ +function finalConnectorBarrierUnibodyIntervalX() = + getPrintInterval( + finalConnectorBarrierUnibodyLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a unibody barrier connector. + * @returns Number + */ +function finalConnectorBarrierUnibodyIntervalY() = + getPrintInterval( + finalConnectorBarrierUnibodyWidth() + ) +; + /** * Defines the final shape for a unibody barrier connector. */ module finalConnectorBarrierUnibody() { - distribute(intervalY=getPrintInterval(getBarrierUnibodyWidth(barrierHolderBase)), center=true) { + intervalX = getPrintInterval(getStraightBarrierLength(trackSectionLength, barrierHolderBase, .5)); + intervalY = getPrintInterval(getBarrierUnibodyWidth(barrierHolderBase)); + distribute(intervalY=intervalY, center=true) { barrierHolderToUnibodyMale( length = trackSectionLength, height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase ); - distribute(intervalX=getPrintInterval(getBarrierLinkWidth(barrierHolderBase) + trackSectionLength / 2), center=true) { + distribute(intervalX=intervalX, center=true) { barrierHolderConnectorFemale( length = trackSectionLength, thickness = barrierBodyThickness, diff --git a/rcmodels/tracks/parts/unibody/straight/straight-double.scad b/rcmodels/tracks/parts/unibody/straight/straight-double.scad index b9a440c..c355734 100644 --- a/rcmodels/tracks/parts/unibody/straight/straight-double.scad +++ b/rcmodels/tracks/parts/unibody/straight/straight-double.scad @@ -31,12 +31,56 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the length ratio of the final shape for a double length unibody barrier. + * @returns Number + */ +function finalDoubleStraightBarrierUnibodyRatio() = 2; + +/** + * Gets the length of the final shape for a double length unibody barrier. + * @returns Number + */ +function finalDoubleStraightBarrierUnibodyLength() = + getStraightBarrierLength( + length = trackSectionLength, + base = barrierHolderBase, + ratio = finalDoubleStraightBarrierUnibodyRatio() + ) +; + +/** + * Gets the width of the final shape for a double length unibody barrier. + * @returns Number + */ +function finalDoubleStraightBarrierUnibodyWidth() = getBarrierUnibodyWidth(barrierHolderBase); + +/** + * Gets the horizontal interval of the final shape for a double length unibody barrier. + * @returns Number + */ +function finalDoubleStraightBarrierUnibodyIntervalX() = + getPrintInterval( + finalDoubleStraightBarrierUnibodyLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a double length unibody barrier. + * @returns Number + */ +function finalDoubleStraightBarrierUnibodyIntervalY() = + getPrintInterval( + finalDoubleStraightBarrierUnibodyWidth() + ) +; + /** * Defines the final shape for a double length unibody barrier. */ module finalDoubleStraightBarrierUnibody() { straightBarrierUnibody( - length = trackSectionLength * 2, + length = trackSectionLength * finalDoubleStraightBarrierUnibodyRatio(), height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase diff --git a/rcmodels/tracks/parts/unibody/straight/straight-simple.scad b/rcmodels/tracks/parts/unibody/straight/straight-simple.scad index 5fac910..ca2783f 100644 --- a/rcmodels/tracks/parts/unibody/straight/straight-simple.scad +++ b/rcmodels/tracks/parts/unibody/straight/straight-simple.scad @@ -31,12 +31,56 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the length ratio of the final shape for a simple length unibody barrier. + * @returns Number + */ +function finalSimpleStraightBarrierUnibodyRatio() = 1; + +/** + * Gets the length of the final shape for a simple length unibody barrier. + * @returns Number + */ +function finalSimpleStraightBarrierUnibodyLength() = + getStraightBarrierLength( + length = trackSectionLength, + base = barrierHolderBase, + ratio = finalSimpleStraightBarrierUnibodyRatio() + ) +; + +/** + * Gets the width of the final shape for a simple length unibody barrier. + * @returns Number + */ +function finalSimpleStraightBarrierUnibodyWidth() = getBarrierUnibodyWidth(barrierHolderBase); + +/** + * Gets the horizontal interval of the final shape for a simple length unibody barrier. + * @returns Number + */ +function finalSimpleStraightBarrierUnibodyIntervalX() = + getPrintInterval( + finalSimpleStraightBarrierUnibodyLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a simple length unibody barrier. + * @returns Number + */ +function finalSimpleStraightBarrierUnibodyIntervalY() = + getPrintInterval( + finalSimpleStraightBarrierUnibodyWidth() + ) +; + /** * Defines the final shape for a simple length unibody barrier. */ module finalSimpleStraightBarrierUnibody() { straightBarrierUnibody( - length = trackSectionLength, + length = trackSectionLength * finalSimpleStraightBarrierUnibodyRatio(), height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase diff --git a/rcmodels/tracks/parts/unibody/straight/straight-uturn.scad b/rcmodels/tracks/parts/unibody/straight/straight-uturn.scad index eebd3fd..6ba213f 100644 --- a/rcmodels/tracks/parts/unibody/straight/straight-uturn.scad +++ b/rcmodels/tracks/parts/unibody/straight/straight-uturn.scad @@ -31,6 +31,50 @@ // Import the project's setup. include <../../../config/setup.scad> +/** + * Gets the size of the gap between the 2 sides of the final shape for a U-turn curve. + * @returns Number + */ +function finalUTurnCompensationBarrierUnibodyGap() = archTowerThickness * 2; + +/** + * Gets the length of the final shape for a U-turn compensation unibody barrier. + * @returns Number + */ +function finalUTurnCompensationBarrierUnibodyLength() = + getUTurnCompensationBarrierLength( + width = getBarrierUnibodyWidth(barrierHolderBase), + base = barrierHolderBase, + gap = finalUTurnCompensationBarrierUnibodyGap() + ) +; + +/** + * Gets the width of the final shape for a U-turn compensation unibody barrier. + * @returns Number + */ +function finalUTurnCompensationBarrierUnibodyWidth() = getBarrierUnibodyWidth(barrierHolderBase); + +/** + * Gets the horizontal interval of the final shape for a U-turn compensation unibody barrier. + * @returns Number + */ +function finalUTurnCompensationBarrierUnibodyIntervalX() = + getPrintInterval( + finalUTurnCompensationBarrierUnibodyLength() + ) +; + +/** + * Gets the vertical interval of the final shape for a U-turn compensation unibody barrier. + * @returns Number + */ +function finalUTurnCompensationBarrierUnibodyIntervalY() = + getPrintInterval( + finalUTurnCompensationBarrierUnibodyWidth() + ) +; + /** * Defines the final shape for a U-turn compensation unibody barrier. */ @@ -39,7 +83,7 @@ module finalUTurnCompensationBarrierUnibody() { height = barrierHeight, thickness = barrierBodyThickness, base = barrierHolderBase, - gap = archTowerThickness * 2 + gap = finalUTurnCompensationBarrierUnibodyGap() ); } From a404bfb02e6313858c2be6194716feb38fe7cf59 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 7 Mar 2020 11:52:45 +0100 Subject: [PATCH 133/191] Rotate the bent mast for a better consistency in placement with respect to the other shapes --- rcmodels/tracks/shapes/accessories.scad | 49 ++++++++++++------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/rcmodels/tracks/shapes/accessories.scad b/rcmodels/tracks/shapes/accessories.scad index 64f5b39..e7c5b5d 100644 --- a/rcmodels/tracks/shapes/accessories.scad +++ b/rcmodels/tracks/shapes/accessories.scad @@ -61,8 +61,8 @@ function getAccessoryBentMastLength(width, height, wall, base) = let( height = vector2D(height) ) - getBarrierHolderHeight(base, wall + printTolerance) + - width * 1.5 + height[0] + getBarrierHolderWidth(base, wall + printTolerance) / 2 + + width + height[1] ; /** @@ -77,8 +77,8 @@ function getAccessoryBentMastWidth(width, height, wall, base) = let( height = vector2D(height) ) - getBarrierHolderWidth(base, wall + printTolerance) / 2 + - width + height[1] + getBarrierHolderHeight(base, wall + printTolerance) + + width * 1.5 + height[0] ; /** @@ -132,9 +132,9 @@ function getAccessoryFlagWidth(height, wave = 0) = * @param Boolean [center] - The shape is centered vertically. */ module cableClip(height, wall, base, thickness, center = false) { - holderWidth = getCableClipLength(wall, base); + clipWidth = getCableClipLength(wall, base); - translateY((apothem(n=10, r=holderWidth) - getCableClipWidth(wall, base)) / 2) { + translateY((apothem(n=10, r=clipWidth) - getCableClipWidth(wall, base)) / 2) { negativeExtrude(height=height, center=center) { clipProfile( wall = wall, @@ -142,13 +142,13 @@ module cableClip(height, wall, base, thickness, center = false) { thickness = thickness + printTolerance, distance = printTolerance ); - repeat(intervalX = holderWidth - wall, center = true) { + repeat(intervalX = clipWidth - wall, center = true) { translateY(base / 2) { rectangle([wall, base]); } } ringSegment( - r = [1, 1] * (holderWidth / 2), + r = [1, 1] * (clipWidth / 2), w = wall, a = -180, $fn = 10 @@ -270,9 +270,9 @@ module mastRings(width, height, wall, interval = 0, count = 1, distance = 0, cen * @param Number thickness - The thickness of the barrier body. */ module accessoryStraightMast(width, height, wall, base, thickness) { - holderHeight = getBarrierHolderHeight(base, wall + printTolerance); + clipHeight = getBarrierHolderHeight(base, wall + printTolerance); - translateX((holderHeight - height) / 2) { + translateX((clipHeight - height) / 2) { rotateY(90) { mast( width = width, @@ -304,32 +304,31 @@ module accessoryStraightMast(width, height, wall, base, thickness) { */ module accessoryBentMast(width, height, wall, base, thickness) { height = vector2D(height); - holderWidth = getBarrierHolderWidth(base, wall + printTolerance); - holderHeight = getBarrierHolderHeight(base, wall + printTolerance); + clipWidth = getBarrierHolderWidth(base, wall + printTolerance); + clipHeight = getBarrierHolderHeight(base, wall + printTolerance); + bentMastLength = getAccessoryBentMastLength(width, height, wall, base); bentMastWidth = getAccessoryBentMastWidth(width, height, wall, base); translate([ - (holderHeight - height[0] - width) / 2, - (bentMastWidth - holderWidth) / 2, + (clipWidth - bentMastLength) / 2, + bentMastWidth / 2 - clipHeight, 0 ]) { - rotate([90, 90, 90]) { + rotate([0, 270, 90]) { bentMast( width = width, height = height, distance = 0 ); } - rotateZ(90) { - clip( - wall = wall, - height = width, - base = base, - thickness = thickness + printTolerance, - distance = printTolerance, - center = true - ); - } + clip( + wall = wall, + height = width, + base = base, + thickness = thickness + printTolerance, + distance = printTolerance, + center = true + ); } } From f3efcde1773dae09de1a8bc568887516fa28fb49 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 7 Mar 2020 12:31:22 +0100 Subject: [PATCH 134/191] Simplify the system of shapes for the arch towers --- rcmodels/tracks/shapes/special.scad | 117 ++++++++++++++-------------- rcmodels/tracks/test/special.scad | 3 +- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/rcmodels/tracks/shapes/special.scad b/rcmodels/tracks/shapes/special.scad index 4a44c48..44f2e51 100644 --- a/rcmodels/tracks/shapes/special.scad +++ b/rcmodels/tracks/shapes/special.scad @@ -29,26 +29,26 @@ */ /** - * Gets the length of a female arch tower. + * Gets the length of an arch tower. * @param Number length - The length of a track element. * @param Number base - The base unit value used to design the barrier holder. * @param Number wall - The thickness of the clip outline. * @returns Number */ -function getArchTowerLengthFemale(length, base, wall) = +function getArchTowerLength(length, base, wall) = getBarrierHolderHeight(base, wall + printTolerance) + length / 2 ; /** - * Gets the length of a male arch tower. + * Gets the length of an arch tower with a male connector. * @param Number length - The length of a track element. * @param Number base - The base unit value used to design the barrier holder. * @param Number wall - The thickness of the clip outline. * @returns Number */ function getArchTowerLengthMale(length, base, wall) = - getArchTowerLengthFemale( + getArchTowerLength( length = length, base = base, wall = wall @@ -66,26 +66,41 @@ function getArchTowerWidth(base, wall) = ; /** - * Draws the shape of a clip that will clamp a barrier border. + * Draws the shape of an arch tower that will clamp a barrier border. * @param Number thickness - The thickness of the barrier body. * @param Number base - The base unit value used to design the barrier holder. * @param Number wall - The thickness of the outline. */ -module archTowerClip(thickness, base, wall) { +module archTower(length, thickness, base, wall) { + thickness = thickness + printTolerance; holderHeight = getBarrierHolderHeight(base); + clipHeight = getBarrierHolderHeight(base, wall + printTolerance); indent = getBarrierStripIndent(base); + length = length / 2; - rotateZ(-90) { - difference() { - clip( - wall = wall, - height = holderHeight, - base = base, - thickness = thickness, - distance = printTolerance - ); - translate([0, wall / 2, holderHeight - indent]) { - box([thickness, wall * 2, indent * 2]); + translateX(-clipHeight / 2) { + translateX(length / 2) { + rotateZ(-90) { + difference() { + clip( + wall = wall, + height = holderHeight, + base = base, + thickness = thickness, + distance = printTolerance + ); + translate([0, wall / 2, holderHeight - indent]) { + box([thickness, wall * 2, indent * 2]); + } + } + } + } + carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { + extrudeStraightProfile(length=length) { + barrierHolderProfile( + base = base, + thickness = thickness + ); } } } @@ -99,29 +114,20 @@ module archTowerClip(thickness, base, wall) { * @param Number wall - The thickness of the outline. */ module archTowerMale(length, thickness, base, wall) { - thickness = thickness + printTolerance; linkHeight = getBarrierHolderLinkHeight(base); - indent = getBarrierStripIndent(base); - length = length / 2; + archTowerLength = getArchTowerLength( + length = length, + base = base, + wall = wall + ); - translateX(-getBarrierHolderHeight(base, wall + printTolerance) / 2) { - translateX(length / 2) { - archTowerClip( - thickness = thickness, - base = base, - wall = wall - ); - } - carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { - straightLinkMale(length=length, linkHeight=linkHeight, base=base) { - extrudeStraightProfile(length=length) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - } - } - } + straightLinkMale(length=archTowerLength, linkHeight=linkHeight, base=base) { + archTower( + length = length, + thickness = thickness, + base = base, + wall = wall + ); } } @@ -133,29 +139,22 @@ module archTowerMale(length, thickness, base, wall) { * @param Number wall - The thickness of the outline. */ module archTowerFemale(length, thickness, base, wall) { - thickness = thickness + printTolerance; linkHeight = getBarrierHolderLinkHeight(base); - indent = getBarrierStripIndent(base); - length = length / 2; + archTowerLength = getArchTowerLength( + length = length, + base = base, + wall = wall + ); - translateX(-getBarrierHolderHeight(base, wall + printTolerance) / 2) { - translateX(length / 2) { - archTowerClip( - thickness = thickness, - base = base, - wall = wall - ); - } - rotateZ(180) { - carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { - straightLinkFemale(length=length, linkHeight=linkHeight, base=base) { - extrudeStraightProfile(length=length) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - } - } + rotateZ(180) { + straightLinkFemale(length=archTowerLength, linkHeight=linkHeight, base=base) { + rotateZ(180) { + archTower( + length = length, + thickness = thickness, + base = base, + wall = wall + ); } } } diff --git a/rcmodels/tracks/test/special.scad b/rcmodels/tracks/test/special.scad index c97d26d..3760dff 100644 --- a/rcmodels/tracks/test/special.scad +++ b/rcmodels/tracks/test/special.scad @@ -37,7 +37,8 @@ applyMode(mode=mode) { distributeGrid(intervalX=[length * 1.5, 0, 0], intervalY=[0, height * 1.5, 0], line=2, center=true) { // test the shape of an arch tower clip - archTowerClip( + archTower( + length = length, thickness = thickness, base = base, wall = wall * 2 From 3040dec5839ab41d023aa74f114cab06dfaff49c Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 7 Mar 2020 12:52:39 +0100 Subject: [PATCH 135/191] Improve print precision for the special shapes --- rcmodels/tracks/shapes/special.scad | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rcmodels/tracks/shapes/special.scad b/rcmodels/tracks/shapes/special.scad index 44f2e51..f5ceea6 100644 --- a/rcmodels/tracks/shapes/special.scad +++ b/rcmodels/tracks/shapes/special.scad @@ -75,7 +75,7 @@ module archTower(length, thickness, base, wall) { thickness = thickness + printTolerance; holderHeight = getBarrierHolderHeight(base); clipHeight = getBarrierHolderHeight(base, wall + printTolerance); - indent = getBarrierStripIndent(base); + indent = getBarrierStripIndent(base) + printResolution; length = length / 2; translateX(-clipHeight / 2) { @@ -177,6 +177,7 @@ module barrierHolderToUnibodyConnector(length, height, thickness, base) { unibodyLineY = height - holderHeight - base * 2; holderLineY = holderHeight - base * 1.5; unibodyTopWidth = unibodyWidth - base - holderLineY * (unibodyLineX / unibodyLineY) * 2; + indent = getBarrierStripIndent(base) + printResolution; length = length / 2; distribute(intervalX=length, center=true) { @@ -195,6 +196,9 @@ module barrierHolderToUnibodyConnector(length, height, thickness, base) { distance = printTolerance ); } + translate([length / 2, 0, holderHeight - indent]) { + box([thickness, thickness, indent]); + } } carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { translateX(-length / 2) { From d3e4a3a71024688975c459312302612865900378 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 7 Mar 2020 13:10:12 +0100 Subject: [PATCH 136/191] Fix shape extrusion accuracy --- rcmodels/tracks/parts/samples/straight/arch-sample.scad | 2 +- rcmodels/tracks/shapes/accessories.scad | 6 +++--- rcmodels/tracks/shapes/curved.scad | 2 +- rcmodels/tracks/shapes/fragments.scad | 6 +++--- rcmodels/tracks/shapes/straight.scad | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/rcmodels/tracks/parts/samples/straight/arch-sample.scad b/rcmodels/tracks/parts/samples/straight/arch-sample.scad index d43a64f..3636d8e 100644 --- a/rcmodels/tracks/parts/samples/straight/arch-sample.scad +++ b/rcmodels/tracks/parts/samples/straight/arch-sample.scad @@ -129,7 +129,7 @@ module finalArchSample() { laneWidth = getSampleLaneWidth(); wallWidth = getSampleWallWidth(); - negativeExtrude(height=getBarrierHolderWidth(sampleBase)) { + linear_extrude(height=getBarrierHolderWidth(sampleBase), convexity=10) { archSampleProfile(sampleSize, laneWidth, wallWidth); repeat(count=2, intervalX=laneWidth, center=true) { translateY(-getBarrierHolderHeight(sampleBase) - wallWidth * 2) { diff --git a/rcmodels/tracks/shapes/accessories.scad b/rcmodels/tracks/shapes/accessories.scad index e7c5b5d..bda019c 100644 --- a/rcmodels/tracks/shapes/accessories.scad +++ b/rcmodels/tracks/shapes/accessories.scad @@ -135,7 +135,7 @@ module cableClip(height, wall, base, thickness, center = false) { clipWidth = getCableClipLength(wall, base); translateY((apothem(n=10, r=clipWidth) - getCableClipWidth(wall, base)) / 2) { - negativeExtrude(height=height, center=center) { + linear_extrude(height=height, center=center, convexity=10) { clipProfile( wall = wall, base = base, @@ -179,7 +179,7 @@ module mastProfile(width, distance = 0) { * @param Boolean [center] - The shape is centered vertically. */ module mast(width, height, distance = 0, center = false) { - negativeExtrude(height=height, center=center) { + linear_extrude(height=height, center=center, convexity=10) { rotateZ(getPolygonAngle(1, mastFacets) / 2) { mastProfile( width = width, @@ -360,7 +360,7 @@ module accessoryFlag(width, height, thickness, mast, wave = 0) { center = true ); } - negativeExtrude(thickness) { + linear_extrude(height=thickness, convexity=10) { polygon(path([ ["P", height / 2, 0], [type, width, width, wave, 0, 90], diff --git a/rcmodels/tracks/shapes/curved.scad b/rcmodels/tracks/shapes/curved.scad index bc10f76..7ba8738 100644 --- a/rcmodels/tracks/shapes/curved.scad +++ b/rcmodels/tracks/shapes/curved.scad @@ -97,7 +97,7 @@ module curvedBarrierNotch(radius, thickness, base, distance = 0) { rotateZ(startAngle) { translateX(radius) { rotate([90, 0, 270]) { - negativeExtrude(height = thickness + 1, center = true) { + linear_extrude(height=thickness + 1, center=true, convexity=10) { polygon(path([ ["P", 0, -base], ["V", base], diff --git a/rcmodels/tracks/shapes/fragments.scad b/rcmodels/tracks/shapes/fragments.scad index 2516b83..2caa222 100644 --- a/rcmodels/tracks/shapes/fragments.scad +++ b/rcmodels/tracks/shapes/fragments.scad @@ -36,7 +36,7 @@ * @param Boolean [center] - The shape is centered vertically. */ module barrierLink(height, base, distance = 0, center = false) { - negativeExtrude(height=height, center=center) { + linear_extrude(height=height, center=center, convexity=10) { barrierLinkProfile( base = base, distance = distance @@ -55,7 +55,7 @@ module barrierLink(height, base, distance = 0, center = false) { */ module barrierNotch(thickness, base, distance = 0, interval = 0, count = 1, center = false) { repeat(count=count, interval=[interval, 0, 0], center=true) { - negativeExtrude(height=thickness, center=center) { + linear_extrude(height=thickness, center=center, convexity=10) { barrierNotchProfile( base = base, distance = distance @@ -124,7 +124,7 @@ module carveBarrierNotch(length, thickness, base, notches = 2) { * @param Boolean [center] - The shape is centered vertically. */ module clip(wall, height, base, thickness, distance = 0, center = false) { - negativeExtrude(height=height, center=center) { + linear_extrude(height=height, center=center, convexity=10) { clipProfile( wall = wall, base = base, diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad index 302c8a0..ed9ed15 100644 --- a/rcmodels/tracks/shapes/straight.scad +++ b/rcmodels/tracks/shapes/straight.scad @@ -124,7 +124,7 @@ module straightLinks(length, linkHeight, base) { */ module extrudeStraightProfile(length) { rotate([90, 0, 90]) { - negativeExtrude(height=length, center=true) { + linear_extrude(height=length, center=true, convexity=10) { children(); } } From c50e523672d2dd4254c38de7d76c97473543c143 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 8 Mar 2020 13:09:05 +0100 Subject: [PATCH 137/191] Refine the positionning of the curved track parts --- rcmodels/tracks/parts/elements/curved/curved-short.scad | 5 +++-- rcmodels/tracks/parts/elements/curved/curved-small.scad | 3 ++- rcmodels/tracks/parts/unibody/curved/curved-short.scad | 5 +++-- rcmodels/tracks/parts/unibody/curved/curved-small.scad | 3 ++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/rcmodels/tracks/parts/elements/curved/curved-short.scad b/rcmodels/tracks/parts/elements/curved/curved-short.scad index 6198225..307f1fd 100644 --- a/rcmodels/tracks/parts/elements/curved/curved-short.scad +++ b/rcmodels/tracks/parts/elements/curved/curved-short.scad @@ -69,7 +69,7 @@ function finalShortCurvedBarrierHolderWidth() = */ function finalShortCurvedBarrierHolderIntervalX() = getPrintInterval( - finalShortCurvedBarrierHolderLength() + finalShortCurvedBarrierHolderLength() / 4 ) ; @@ -79,7 +79,8 @@ function finalShortCurvedBarrierHolderIntervalX() = */ function finalShortCurvedBarrierHolderIntervalY() = getPrintInterval( - finalShortCurvedBarrierHolderWidth() / 2 + getBarrierHolderWidth(barrierHolderBase) + + getBarrierLinkLength(barrierHolderBase) ) ; diff --git a/rcmodels/tracks/parts/elements/curved/curved-small.scad b/rcmodels/tracks/parts/elements/curved/curved-small.scad index 6679db3..cb6d60e 100644 --- a/rcmodels/tracks/parts/elements/curved/curved-small.scad +++ b/rcmodels/tracks/parts/elements/curved/curved-small.scad @@ -80,7 +80,8 @@ function finalSmallCurvedBarrierHolderIntervalX() = */ function finalSmallCurvedBarrierHolderIntervalY() = getPrintInterval( - finalSmallCurvedBarrierHolderWidth() / 2 + getBarrierHolderWidth(barrierHolderBase) + + getBarrierLinkLength(barrierHolderBase) ) ; diff --git a/rcmodels/tracks/parts/unibody/curved/curved-short.scad b/rcmodels/tracks/parts/unibody/curved/curved-short.scad index 7f1d89a..c168854 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-short.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-short.scad @@ -69,7 +69,7 @@ function finalShortCurvedBarrierUnibodyWidth() = */ function finalShortCurvedBarrierUnibodyIntervalX() = getPrintInterval( - finalShortCurvedBarrierUnibodyLength() + finalShortCurvedBarrierUnibodyLength() / 4 ) ; @@ -79,7 +79,8 @@ function finalShortCurvedBarrierUnibodyIntervalX() = */ function finalShortCurvedBarrierUnibodyIntervalY() = getPrintInterval( - finalShortCurvedBarrierUnibodyWidth() / 2 + getBarrierUnibodyWidth(barrierHolderBase) + + getBarrierLinkLength(barrierHolderBase) ) ; diff --git a/rcmodels/tracks/parts/unibody/curved/curved-small.scad b/rcmodels/tracks/parts/unibody/curved/curved-small.scad index 297456a..785fab5 100644 --- a/rcmodels/tracks/parts/unibody/curved/curved-small.scad +++ b/rcmodels/tracks/parts/unibody/curved/curved-small.scad @@ -79,7 +79,8 @@ function finalSmallCurvedBarrierUnibodyIntervalX() = */ function finalSmallCurvedBarrierUnibodyIntervalY() = getPrintInterval( - finalSmallCurvedBarrierUnibodyWidth() / 2 + getBarrierUnibodyWidth(barrierHolderBase) + + getBarrierLinkLength(barrierHolderBase) ) ; From 27d98b0108c1c924717a3cfa686e7841d3c681dc Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 8 Mar 2020 13:10:47 +0100 Subject: [PATCH 138/191] Refine the set of straight track samples --- .../samples/straight/straight-long-10.scad | 94 ------------------- .../samples/straight/straight-long-20.scad | 94 ------------------- ...traight-long-5.scad => straight-long.scad} | 36 +++---- 3 files changed, 18 insertions(+), 206 deletions(-) delete mode 100644 rcmodels/tracks/parts/samples/straight/straight-long-10.scad delete mode 100644 rcmodels/tracks/parts/samples/straight/straight-long-20.scad rename rcmodels/tracks/parts/samples/straight/{straight-long-5.scad => straight-long.scad} (60%) diff --git a/rcmodels/tracks/parts/samples/straight/straight-long-10.scad b/rcmodels/tracks/parts/samples/straight/straight-long-10.scad deleted file mode 100644 index 6635d62..0000000 --- a/rcmodels/tracks/parts/samples/straight/straight-long-10.scad +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for a straight track part, 5x the length. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the length ratio of the final shape for a x10 length barrier sample. - * @returns Number - */ -function finalLong10StraightBarrierSampleRatio() = 10; - -/** - * Gets the length of the final shape for a x10 length barrier sample. - * @returns Number - */ -function finalLong10StraightBarrierSampleLength() = - getStraightBarrierLength( - length = sampleSize, - base = sampleBase, - ratio = finalLong10StraightBarrierSampleRatio() - ) -; - -/** - * Gets the width of the final shape for a x10 length barrier sample. - * @returns Number - */ -function finalLong10StraightBarrierSampleWidth() = getBarrierHolderWidth(sampleBase); - -/** - * Gets the horizontal interval of the final shape for a x10 length barrier sample. - * @returns Number - */ -function finalLong10StraightBarrierSampleIntervalX() = - getPrintInterval( - finalLong10StraightBarrierSampleLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a x10 length barrier sample. - * @returns Number - */ -function finalLong10StraightBarrierSampleIntervalY() = - getPrintInterval( - finalLong10StraightBarrierSampleWidth() - ) -; - -/** - * Defines the final shape for a x10 length barrier sample. - */ -module finalLong10StraightBarrierSample() { - straightBarrierMain( - length = sampleSize * finalLong10StraightBarrierSampleRatio(), - thickness = barrierBodyThickness, - base = sampleBase - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalLong10StraightBarrierSample(); -} diff --git a/rcmodels/tracks/parts/samples/straight/straight-long-20.scad b/rcmodels/tracks/parts/samples/straight/straight-long-20.scad deleted file mode 100644 index b11e3dd..0000000 --- a/rcmodels/tracks/parts/samples/straight/straight-long-20.scad +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for a straight track part, 20x the length. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the length ratio of the final shape for a x20 length barrier sample. - * @returns Number - */ -function finalLong20StraightBarrierSampleRatio() = 20; - -/** - * Gets the length of the final shape for a x20 length barrier sample. - * @returns Number - */ -function finalLong20StraightBarrierSampleLength() = - getStraightBarrierLength( - length = sampleSize, - base = sampleBase, - ratio = finalLong20StraightBarrierSampleRatio() - ) -; - -/** - * Gets the width of the final shape for a x20 length barrier sample. - * @returns Number - */ -function finalLong20StraightBarrierSampleWidth() = getBarrierHolderWidth(sampleBase); - -/** - * Gets the horizontal interval of the final shape for a x20 length barrier sample. - * @returns Number - */ -function finalLong20StraightBarrierSampleIntervalX() = - getPrintInterval( - finalLong20StraightBarrierSampleLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a x20 length barrier sample. - * @returns Number - */ -function finalLong20StraightBarrierSampleIntervalY() = - getPrintInterval( - finalLong20StraightBarrierSampleWidth() - ) -; - -/** - * Defines the final shape for a x20 length barrier sample. - */ -module finalLong20StraightBarrierSample() { - straightBarrierMain( - length = sampleSize * finalLong20StraightBarrierSampleRatio(), - thickness = barrierBodyThickness, - base = sampleBase - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalLong20StraightBarrierSample(); -} diff --git a/rcmodels/tracks/parts/samples/straight/straight-long-5.scad b/rcmodels/tracks/parts/samples/straight/straight-long.scad similarity index 60% rename from rcmodels/tracks/parts/samples/straight/straight-long-5.scad rename to rcmodels/tracks/parts/samples/straight/straight-long.scad index ffccae8..c1f29c7 100644 --- a/rcmodels/tracks/parts/samples/straight/straight-long-5.scad +++ b/rcmodels/tracks/parts/samples/straight/straight-long.scad @@ -23,7 +23,7 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * A sample for a straight track part, 5x the length. + * A sample for a straight track part, 10x the length. * * @author jsconan */ @@ -32,55 +32,55 @@ include <../../../config/setup.scad> /** - * Gets the length ratio of the final shape for a x5 length barrier sample. + * Gets the length ratio of the final shape for a long length barrier sample. * @returns Number */ -function finalLong5StraightBarrierSampleRatio() = 5; +function finalLongStraightBarrierSampleRatio() = 10; /** - * Gets the length of the final shape for a x5 length barrier sample. + * Gets the length of the final shape for a long length barrier sample. * @returns Number */ -function finalLong5StraightBarrierSampleLength() = +function finalLongStraightBarrierSampleLength() = getStraightBarrierLength( length = sampleSize, base = sampleBase, - ratio = finalLong5StraightBarrierSampleRatio() + ratio = finalLongStraightBarrierSampleRatio() ) ; /** - * Gets the width of the final shape for a x5 length barrier sample. + * Gets the width of the final shape for a long length barrier sample. * @returns Number */ -function finalLong5StraightBarrierSampleWidth() = getBarrierHolderWidth(sampleBase); +function finalLongStraightBarrierSampleWidth() = getBarrierHolderWidth(sampleBase); /** - * Gets the horizontal interval of the final shape for a x5 length barrier sample. + * Gets the horizontal interval of the final shape for a long length barrier sample. * @returns Number */ -function finalLong5StraightBarrierSampleIntervalX() = +function finalLongStraightBarrierSampleIntervalX() = getPrintInterval( - finalLong5StraightBarrierSampleLength() + finalLongStraightBarrierSampleLength() ) ; /** - * Gets the vertical interval of the final shape for a x5 length barrier sample. + * Gets the vertical interval of the final shape for a long length barrier sample. * @returns Number */ -function finalLong5StraightBarrierSampleIntervalY() = +function finalLongStraightBarrierSampleIntervalY() = getPrintInterval( - finalLong5StraightBarrierSampleWidth() + finalLongStraightBarrierSampleWidth() ) ; /** - * Defines the final shape for a x5 length barrier sample. + * Defines the final shape for a long length barrier sample. */ -module finalLong5StraightBarrierSample() { +module finalLongStraightBarrierSample() { straightBarrierMain( - length = sampleSize * finalLong5StraightBarrierSampleRatio(), + length = sampleSize * finalLongStraightBarrierSampleRatio(), thickness = barrierBodyThickness, base = sampleBase ); @@ -90,5 +90,5 @@ module finalLong5StraightBarrierSample() { applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalLong5StraightBarrierSample(); + finalLongStraightBarrierSample(); } From e7b05330c1ac54d6d9698f3b73187c26d138b4c9 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 8 Mar 2020 13:11:43 +0100 Subject: [PATCH 139/191] Add print helper --- rcmodels/tracks/config/config.scad | 2 ++ rcmodels/tracks/config/values.scad | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 713657d..864e37c 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -37,6 +37,8 @@ renderMode = MODE_PROD; printResolution = 0.2; // The target layer height nozzleWidth = 0.4; // The size of the printer's nozzle printTolerance = 0.1; // The print tolerance when pieces need to be assembled +printerLength = 250; // The length of the printer's build plate +printerWidth = 210; // The width of the printer's build plate // The dimensions and constraints of a track element trackSectionLength = 100; // The nominal length of a track element: the length for straight element, or the radius for a curved element diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 01a759b..11d1c17 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -245,6 +245,16 @@ function getMastRadius(width) = circumradius(n = mastFacets, a = width / 2); */ function getPrintInterval(size) = size + printInterval; +/** + * Centers the children elements to te printer's build plate. + */ +module centerBuildPlate(moveOrigin = false) { + buildPlate([printerLength, printerWidth], center=!moveOrigin); + translate(moveOrigin ? [printerLength, printerWidth, 0] / 2 : [0, 0, 0]) { + children(); + } +}; + /** * Validates the config values, checking if it match the critical constraints. * @param Number length - The nominal size of a track element. @@ -346,6 +356,8 @@ module printConfig(length, width, lane, height, radius, base) { str("Nozzle diameter: ", nozzleWidth, "mm"), str("Print layer: ", printResolution, "mm"), str("Print tolerance: ", printTolerance, "mm"), + str("Printer's length: ", printerLength / 10, "cm"), + str("Printer's width: ", printerWidth / 10, "cm"), str("Print interval: ", printInterval, "mm"), "" ], str(chr(13), chr(10)))); From e54739fe52085765fab4d93a77a36f3fe676e718 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 8 Mar 2020 13:12:25 +0100 Subject: [PATCH 140/191] Add set of shapes as printing plates --- .../tracks/plates/accessories/bent-mast.scad | 50 +++++++++++++++++ .../tracks/plates/accessories/cable-clip.scad | 50 +++++++++++++++++ .../plates/accessories/straight-flag.scad | 50 +++++++++++++++++ .../plates/accessories/straight-mast.scad | 50 +++++++++++++++++ .../tracks/plates/accessories/wavy-flag.scad | 50 +++++++++++++++++ .../plates/elements/curved/curved-inner.scad | 48 ++++++++++++++++ .../plates/elements/curved/curved-outer.scad | 48 ++++++++++++++++ .../plates/elements/curved/curved-short.scad | 55 +++++++++++++++++++ .../plates/elements/curved/curved-small.scad | 48 ++++++++++++++++ .../plates/elements/curved/curved-uturn.scad | 48 ++++++++++++++++ .../plates/elements/straight/arch-tower.scad | 50 +++++++++++++++++ .../plates/elements/straight/body-curved.scad | 50 +++++++++++++++++ .../elements/straight/body-straight.scad | 50 +++++++++++++++++ .../plates/elements/straight/body-uturn.scad | 48 ++++++++++++++++ .../elements/straight/straight-double.scad | 48 ++++++++++++++++ .../elements/straight/straight-simple.scad | 48 ++++++++++++++++ .../elements/straight/straight-uturn.scad | 50 +++++++++++++++++ .../samples/curved/curved-inner-full.scad | 50 +++++++++++++++++ .../plates/samples/curved/curved-inner.scad | 50 +++++++++++++++++ .../samples/curved/curved-outer-full.scad | 50 +++++++++++++++++ .../plates/samples/curved/curved-outer.scad | 50 +++++++++++++++++ .../plates/samples/curved/curved-short.scad | 50 +++++++++++++++++ .../plates/samples/curved/curved-small.scad | 50 +++++++++++++++++ .../plates/samples/curved/curved-uturn.scad | 50 +++++++++++++++++ .../plates/samples/straight/arch-sample.scad | 50 +++++++++++++++++ .../samples/straight/straight-double.scad | 50 +++++++++++++++++ .../samples/straight/straight-long.scad | 48 ++++++++++++++++ .../samples/straight/straight-simple.scad | 50 +++++++++++++++++ .../samples/straight/straight-uturn.scad | 50 +++++++++++++++++ .../plates/unibody/curved/curved-inner.scad | 48 ++++++++++++++++ .../plates/unibody/curved/curved-outer.scad | 48 ++++++++++++++++ .../plates/unibody/curved/curved-short.scad | 55 +++++++++++++++++++ .../plates/unibody/curved/curved-small.scad | 48 ++++++++++++++++ .../plates/unibody/curved/curved-uturn.scad | 48 ++++++++++++++++ .../unibody/straight/straight-connector.scad | 50 +++++++++++++++++ .../unibody/straight/straight-double.scad | 49 +++++++++++++++++ .../unibody/straight/straight-simple.scad | 48 ++++++++++++++++ .../unibody/straight/straight-uturn.scad | 50 +++++++++++++++++ 38 files changed, 1883 insertions(+) create mode 100644 rcmodels/tracks/plates/accessories/bent-mast.scad create mode 100644 rcmodels/tracks/plates/accessories/cable-clip.scad create mode 100644 rcmodels/tracks/plates/accessories/straight-flag.scad create mode 100644 rcmodels/tracks/plates/accessories/straight-mast.scad create mode 100644 rcmodels/tracks/plates/accessories/wavy-flag.scad create mode 100644 rcmodels/tracks/plates/elements/curved/curved-inner.scad create mode 100644 rcmodels/tracks/plates/elements/curved/curved-outer.scad create mode 100644 rcmodels/tracks/plates/elements/curved/curved-short.scad create mode 100644 rcmodels/tracks/plates/elements/curved/curved-small.scad create mode 100644 rcmodels/tracks/plates/elements/curved/curved-uturn.scad create mode 100644 rcmodels/tracks/plates/elements/straight/arch-tower.scad create mode 100644 rcmodels/tracks/plates/elements/straight/body-curved.scad create mode 100644 rcmodels/tracks/plates/elements/straight/body-straight.scad create mode 100644 rcmodels/tracks/plates/elements/straight/body-uturn.scad create mode 100644 rcmodels/tracks/plates/elements/straight/straight-double.scad create mode 100644 rcmodels/tracks/plates/elements/straight/straight-simple.scad create mode 100644 rcmodels/tracks/plates/elements/straight/straight-uturn.scad create mode 100644 rcmodels/tracks/plates/samples/curved/curved-inner-full.scad create mode 100644 rcmodels/tracks/plates/samples/curved/curved-inner.scad create mode 100644 rcmodels/tracks/plates/samples/curved/curved-outer-full.scad create mode 100644 rcmodels/tracks/plates/samples/curved/curved-outer.scad create mode 100644 rcmodels/tracks/plates/samples/curved/curved-short.scad create mode 100644 rcmodels/tracks/plates/samples/curved/curved-small.scad create mode 100644 rcmodels/tracks/plates/samples/curved/curved-uturn.scad create mode 100644 rcmodels/tracks/plates/samples/straight/arch-sample.scad create mode 100644 rcmodels/tracks/plates/samples/straight/straight-double.scad create mode 100644 rcmodels/tracks/plates/samples/straight/straight-long.scad create mode 100644 rcmodels/tracks/plates/samples/straight/straight-simple.scad create mode 100644 rcmodels/tracks/plates/samples/straight/straight-uturn.scad create mode 100644 rcmodels/tracks/plates/unibody/curved/curved-inner.scad create mode 100644 rcmodels/tracks/plates/unibody/curved/curved-outer.scad create mode 100644 rcmodels/tracks/plates/unibody/curved/curved-short.scad create mode 100644 rcmodels/tracks/plates/unibody/curved/curved-small.scad create mode 100644 rcmodels/tracks/plates/unibody/curved/curved-uturn.scad create mode 100644 rcmodels/tracks/plates/unibody/straight/straight-connector.scad create mode 100644 rcmodels/tracks/plates/unibody/straight/straight-double.scad create mode 100644 rcmodels/tracks/plates/unibody/straight/straight-simple.scad create mode 100644 rcmodels/tracks/plates/unibody/straight/straight-uturn.scad diff --git a/rcmodels/tracks/plates/accessories/bent-mast.scad b/rcmodels/tracks/plates/accessories/bent-mast.scad new file mode 100644 index 0000000..6cab11c --- /dev/null +++ b/rcmodels/tracks/plates/accessories/bent-mast.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of bent masts to clip accessories onto the barrier holders. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../config/setup.scad> +use <../../parts/accessories/bent-mast.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 2, + countY = 5, + intervalX = [finalBentMastIntervalX(), 0, 0], + intervalY = [0, finalBentMastIntervalY(), 0], + center = true + ) { + finalBentMast(); + } + } +} diff --git a/rcmodels/tracks/plates/accessories/cable-clip.scad b/rcmodels/tracks/plates/accessories/cable-clip.scad new file mode 100644 index 0000000..d61f10d --- /dev/null +++ b/rcmodels/tracks/plates/accessories/cable-clip.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of LED cable clips for the barrier holders. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../config/setup.scad> +use <../../parts/accessories/cable-clip.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 15, + countY = 10, + intervalX = [finalCableClipIntervalX(), 0, 0], + intervalY = [0, finalCableClipIntervalY(), 0], + center = true + ) { + finalCableClip(); + } + } +} diff --git a/rcmodels/tracks/plates/accessories/straight-flag.scad b/rcmodels/tracks/plates/accessories/straight-flag.scad new file mode 100644 index 0000000..e28f89a --- /dev/null +++ b/rcmodels/tracks/plates/accessories/straight-flag.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of straight flags to clip onto the barrier holders. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../config/setup.scad> +use <../../parts/accessories/straight-flag.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 3, + countY = 4, + intervalX = [finalStraightFlagIntervalX(), 0, 0], + intervalY = [0, finalStraightFlagIntervalY(), 0], + center = true + ) { + finalStraightFlag(); + } + } +} diff --git a/rcmodels/tracks/plates/accessories/straight-mast.scad b/rcmodels/tracks/plates/accessories/straight-mast.scad new file mode 100644 index 0000000..8ba56dc --- /dev/null +++ b/rcmodels/tracks/plates/accessories/straight-mast.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of masts to clip accessories onto the barrier holders. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../config/setup.scad> +use <../../parts/accessories/straight-mast.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 2, + countY = 10, + intervalX = [finalStraightMastIntervalX(), 0, 0], + intervalY = [0, finalStraightMastIntervalY(), 0], + center = true + ) { + finalStraightMast(); + } + } +} diff --git a/rcmodels/tracks/plates/accessories/wavy-flag.scad b/rcmodels/tracks/plates/accessories/wavy-flag.scad new file mode 100644 index 0000000..64be3c1 --- /dev/null +++ b/rcmodels/tracks/plates/accessories/wavy-flag.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of straight flags to clip onto the barrier holders. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../config/setup.scad> +use <../../parts/accessories/wavy-flag.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 3, + countY = 4, + intervalX = [finalWavyFlagIntervalX(), 0, 0], + intervalY = [0, finalWavyFlagIntervalY(), 0], + center = true + ) { + finalWavyFlag(); + } + } +} diff --git a/rcmodels/tracks/plates/elements/curved/curved-inner.scad b/rcmodels/tracks/plates/elements/curved/curved-inner.scad new file mode 100644 index 0000000..792abb9 --- /dev/null +++ b/rcmodels/tracks/plates/elements/curved/curved-inner.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of barrier holders for an inner curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/elements/curved/curved-inner.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat( + count = finalInnerCurvedBarrierHolderRatio() * 2, + intervalY = finalInnerCurvedBarrierHolderIntervalY(), + center = true + ) { + finalInnerCurvedBarrierHolder(); + } + } +} diff --git a/rcmodels/tracks/plates/elements/curved/curved-outer.scad b/rcmodels/tracks/plates/elements/curved/curved-outer.scad new file mode 100644 index 0000000..efbc95a --- /dev/null +++ b/rcmodels/tracks/plates/elements/curved/curved-outer.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of barrier holders for an outer curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/elements/curved/curved-outer.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat( + count = finalOuterCurvedBarrierHolderRatio() * 2, + intervalY = finalOuterCurvedBarrierHolderIntervalY(), + center = true + ) { + finalOuterCurvedBarrierHolder(); + } + } +} diff --git a/rcmodels/tracks/plates/elements/curved/curved-short.scad b/rcmodels/tracks/plates/elements/curved/curved-short.scad new file mode 100644 index 0000000..f82ac97 --- /dev/null +++ b/rcmodels/tracks/plates/elements/curved/curved-short.scad @@ -0,0 +1,55 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of barrier holders for a short curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/elements/curved/curved-short.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat( + count = 2, + intervalY = finalShortCurvedBarrierHolderWidth() + finalShortCurvedBarrierHolderIntervalY(), + center = true + ) { + repeatRotate( + count = 2, + intervalX = finalShortCurvedBarrierHolderIntervalX(), + intervalY = -finalShortCurvedBarrierHolderIntervalY(), + center = true + ) { + finalShortCurvedBarrierHolder(); + } + } + } +} diff --git a/rcmodels/tracks/plates/elements/curved/curved-small.scad b/rcmodels/tracks/plates/elements/curved/curved-small.scad new file mode 100644 index 0000000..27d2e4d --- /dev/null +++ b/rcmodels/tracks/plates/elements/curved/curved-small.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of barrier holders for a small curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/elements/curved/curved-small.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat( + count = 4, + intervalY = finalSmallCurvedBarrierHolderIntervalY(), + center = true + ) { + finalSmallCurvedBarrierHolder(); + } + } +} diff --git a/rcmodels/tracks/plates/elements/curved/curved-uturn.scad b/rcmodels/tracks/plates/elements/curved/curved-uturn.scad new file mode 100644 index 0000000..885489a --- /dev/null +++ b/rcmodels/tracks/plates/elements/curved/curved-uturn.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of barrier holders for a U-turn track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/elements/curved/curved-uturn.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat( + count = 4, + intervalY = finalUTurnCurvedBarrierHolderIntervalY(), + center = true + ) { + finalUTurnCurvedBarrierHolder(); + } + } +} diff --git a/rcmodels/tracks/plates/elements/straight/arch-tower.scad b/rcmodels/tracks/plates/elements/straight/arch-tower.scad new file mode 100644 index 0000000..e8fdd78 --- /dev/null +++ b/rcmodels/tracks/plates/elements/straight/arch-tower.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of couples of arch towers that clamp the barrier holders. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/elements/straight/arch-tower.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 2, + countY = 4, + intervalX = [finalArchTowerIntervalX(), 0, 0], + intervalY = [0, finalArchTowerIntervalY(), 0], + center = true + ) { + finalArchTower(); + } + } +} diff --git a/rcmodels/tracks/plates/elements/straight/body-curved.scad b/rcmodels/tracks/plates/elements/straight/body-curved.scad new file mode 100644 index 0000000..f5adfd3 --- /dev/null +++ b/rcmodels/tracks/plates/elements/straight/body-curved.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of additional barrier bodies for curved track parts. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/elements/straight/body-curved.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 3, + countY = 5, + intervalX = [finalCurvedBarrierBodyIntervalX(), 0, 0], + intervalY = [0, finalCurvedBarrierBodyIntervalY(), 0], + center = true + ) { + finalCurvedBarrierBody(); + } + } +} diff --git a/rcmodels/tracks/plates/elements/straight/body-straight.scad b/rcmodels/tracks/plates/elements/straight/body-straight.scad new file mode 100644 index 0000000..16f6d0c --- /dev/null +++ b/rcmodels/tracks/plates/elements/straight/body-straight.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of barrier bodies for straight track parts. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/elements/straight/body-straight.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 2, + countY = 5, + intervalX = [finalStraightBarrierBodyIntervalX(), 0, 0], + intervalY = [0, finalStraightBarrierBodyIntervalY(), 0], + center = true + ) { + finalStraightBarrierBody(); + } + } +} diff --git a/rcmodels/tracks/plates/elements/straight/body-uturn.scad b/rcmodels/tracks/plates/elements/straight/body-uturn.scad new file mode 100644 index 0000000..25fe2f4 --- /dev/null +++ b/rcmodels/tracks/plates/elements/straight/body-uturn.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of additional barrier bodies for U-turn compensation track parts. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/elements/straight/body-uturn.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat( + count = 5, + intervalY = finalUTurnBarrierBodyIntervalY(), + center = true + ) { + finalUTurnBarrierBody(); + } + } +} diff --git a/rcmodels/tracks/plates/elements/straight/straight-double.scad b/rcmodels/tracks/plates/elements/straight/straight-double.scad new file mode 100644 index 0000000..c7d78e3 --- /dev/null +++ b/rcmodels/tracks/plates/elements/straight/straight-double.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of straight barrier holders with a double length. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/elements/straight/straight-double.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat( + count = 10, + intervalY = finalDoubleStraightBarrierHolderIntervalY(), + center = true + ) { + finalDoubleStraightBarrierHolder(); + } + } +} diff --git a/rcmodels/tracks/plates/elements/straight/straight-simple.scad b/rcmodels/tracks/plates/elements/straight/straight-simple.scad new file mode 100644 index 0000000..b6f044e --- /dev/null +++ b/rcmodels/tracks/plates/elements/straight/straight-simple.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of straight barrier holders with a simple length. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/elements/straight/straight-simple.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat( + count = 10, + intervalY = finalSimpleStraightBarrierHolderIntervalY(), + center = true + ) { + finalSimpleStraightBarrierHolder(); + } + } +} diff --git a/rcmodels/tracks/plates/elements/straight/straight-uturn.scad b/rcmodels/tracks/plates/elements/straight/straight-uturn.scad new file mode 100644 index 0000000..5175897 --- /dev/null +++ b/rcmodels/tracks/plates/elements/straight/straight-uturn.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of straight barrier holders to compensate a U-turn track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/elements/straight/straight-uturn.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 4, + countY = 5, + intervalX = [finalUTurnCompensationBarrierHolderIntervalX(), 0, 0], + intervalY = [0, finalUTurnCompensationBarrierHolderIntervalY(), 0], + center = true + ) { + finalUTurnCompensationBarrierHolder(); + } + } +} diff --git a/rcmodels/tracks/plates/samples/curved/curved-inner-full.scad b/rcmodels/tracks/plates/samples/curved/curved-inner-full.scad new file mode 100644 index 0000000..6b9c2ad --- /dev/null +++ b/rcmodels/tracks/plates/samples/curved/curved-inner-full.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of barrier samples for a full inner curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/samples/curved/curved-inner-full.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 4, + countY = 4, + intervalX = [finalFullInnerCurvedBarrierSampleIntervalX(), 0, 0], + intervalY = [0, finalFullInnerCurvedBarrierSampleIntervalY(), 0], + center = true + ) { + finalFullInnerCurvedBarrierSample(); + } + } +} diff --git a/rcmodels/tracks/plates/samples/curved/curved-inner.scad b/rcmodels/tracks/plates/samples/curved/curved-inner.scad new file mode 100644 index 0000000..5ef15d1 --- /dev/null +++ b/rcmodels/tracks/plates/samples/curved/curved-inner.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of barrier samples for an inner curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/samples/curved/curved-inner.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 4, + countY = finalInnerCurvedBarrierSampleRatio() * 2, + intervalX = [finalInnerCurvedBarrierSampleIntervalX(), 0, 0], + intervalY = [0, finalInnerCurvedBarrierSampleIntervalY(), 0], + center = true + ) { + finalInnerCurvedBarrierSample(); + } + } +} diff --git a/rcmodels/tracks/plates/samples/curved/curved-outer-full.scad b/rcmodels/tracks/plates/samples/curved/curved-outer-full.scad new file mode 100644 index 0000000..1a9d007 --- /dev/null +++ b/rcmodels/tracks/plates/samples/curved/curved-outer-full.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of barrier samples for a full outer curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/samples/curved/curved-outer-full.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 2, + countY = 8, + intervalX = [finalFullOuterCurvedBarrierSampleIntervalX(), 0, 0], + intervalY = [0, finalFullOuterCurvedBarrierSampleIntervalY(), 0], + center = true + ) { + finalFullOuterCurvedBarrierSample(); + } + } +} diff --git a/rcmodels/tracks/plates/samples/curved/curved-outer.scad b/rcmodels/tracks/plates/samples/curved/curved-outer.scad new file mode 100644 index 0000000..f2247fd --- /dev/null +++ b/rcmodels/tracks/plates/samples/curved/curved-outer.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of barrier samples for an outer curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/samples/curved/curved-outer.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 4, + countY = finalOuterCurvedBarrierSampleRatio(), + intervalX = [finalOuterCurvedBarrierSampleIntervalX(), 0, 0], + intervalY = [0, finalOuterCurvedBarrierSampleIntervalY(), 0], + center = true + ) { + finalOuterCurvedBarrierSample(); + } + } +} diff --git a/rcmodels/tracks/plates/samples/curved/curved-short.scad b/rcmodels/tracks/plates/samples/curved/curved-short.scad new file mode 100644 index 0000000..5fe6de8 --- /dev/null +++ b/rcmodels/tracks/plates/samples/curved/curved-short.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of barrier samples for a short curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/samples/curved/curved-short.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 4, + countY = 4, + intervalX = [finalShortCurvedBarrierSampleIntervalX(), 0, 0], + intervalY = [0, finalShortCurvedBarrierSampleIntervalY(), 0], + center = true + ) { + finalShortCurvedBarrierSample(); + } + } +} diff --git a/rcmodels/tracks/plates/samples/curved/curved-small.scad b/rcmodels/tracks/plates/samples/curved/curved-small.scad new file mode 100644 index 0000000..9a2967a --- /dev/null +++ b/rcmodels/tracks/plates/samples/curved/curved-small.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of barrier samples for a small curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/samples/curved/curved-small.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 4, + countY = 4, + intervalX = [finalSmallCurvedBarrierSampleIntervalX(), 0, 0], + intervalY = [0, finalSmallCurvedBarrierSampleIntervalY(), 0], + center = true + ) { + finalSmallCurvedBarrierSample(); + } + } +} diff --git a/rcmodels/tracks/plates/samples/curved/curved-uturn.scad b/rcmodels/tracks/plates/samples/curved/curved-uturn.scad new file mode 100644 index 0000000..d3dbc65 --- /dev/null +++ b/rcmodels/tracks/plates/samples/curved/curved-uturn.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of barrier samples for a U-turn curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/samples/curved/curved-uturn.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 4, + countY = 4, + intervalX = [finalUTurnCurvedBarrierSampleIntervalX(), 0, 0], + intervalY = [0, finalUTurnCurvedBarrierSampleIntervalY(), 0], + center = true + ) { + finalUTurnCurvedBarrierSample(); + } + } +} diff --git a/rcmodels/tracks/plates/samples/straight/arch-sample.scad b/rcmodels/tracks/plates/samples/straight/arch-sample.scad new file mode 100644 index 0000000..ec2ab10 --- /dev/null +++ b/rcmodels/tracks/plates/samples/straight/arch-sample.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of arch samples. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/samples/straight/arch-sample.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 3, + countY = 4, + intervalX = [finalArchSampleIntervalX(), 0, 0], + intervalY = [0, finalArchSampleIntervalY(), 0], + center = true + ) { + finalArchSample(); + } + } +} diff --git a/rcmodels/tracks/plates/samples/straight/straight-double.scad b/rcmodels/tracks/plates/samples/straight/straight-double.scad new file mode 100644 index 0000000..41e5956 --- /dev/null +++ b/rcmodels/tracks/plates/samples/straight/straight-double.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of straight barrier samples with a double length. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/samples/straight/straight-double.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 4, + countY = 5, + intervalX = [finalDoubleStraightBarrierSampleIntervalX(), 0, 0], + intervalY = [0, finalDoubleStraightBarrierSampleIntervalY(), 0], + center = true + ) { + finalDoubleStraightBarrierSample(); + } + } +} diff --git a/rcmodels/tracks/plates/samples/straight/straight-long.scad b/rcmodels/tracks/plates/samples/straight/straight-long.scad new file mode 100644 index 0000000..ce4c595 --- /dev/null +++ b/rcmodels/tracks/plates/samples/straight/straight-long.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of straight barrier samples with 10x the length. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/samples/straight/straight-long.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat( + count = 10, + intervalY = finalLongStraightBarrierSampleIntervalY(), + center = true + ) { + finalLongStraightBarrierSample(); + } + } +} diff --git a/rcmodels/tracks/plates/samples/straight/straight-simple.scad b/rcmodels/tracks/plates/samples/straight/straight-simple.scad new file mode 100644 index 0000000..5a2aff8 --- /dev/null +++ b/rcmodels/tracks/plates/samples/straight/straight-simple.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of straight barrier samples with a simple length. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/samples/straight/straight-simple.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 4, + countY = 5, + intervalX = [finalSimpleStraightBarrierSampleIntervalX(), 0, 0], + intervalY = [0, finalSimpleStraightBarrierSampleIntervalY(), 0], + center = true + ) { + finalSimpleStraightBarrierSample(); + } + } +} diff --git a/rcmodels/tracks/plates/samples/straight/straight-uturn.scad b/rcmodels/tracks/plates/samples/straight/straight-uturn.scad new file mode 100644 index 0000000..9837ae2 --- /dev/null +++ b/rcmodels/tracks/plates/samples/straight/straight-uturn.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of straight barrier samples for a U-turn compensation track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/samples/straight/straight-uturn.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 4, + countY = 5, + intervalX = [finalUTurnCompensationBarrierSampleIntervalX(), 0, 0], + intervalY = [0, finalUTurnCompensationBarrierSampleIntervalY(), 0], + center = true + ) { + finalUTurnCompensationBarrierSample(); + } + } +} diff --git a/rcmodels/tracks/plates/unibody/curved/curved-inner.scad b/rcmodels/tracks/plates/unibody/curved/curved-inner.scad new file mode 100644 index 0000000..b3c9ee5 --- /dev/null +++ b/rcmodels/tracks/plates/unibody/curved/curved-inner.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of unibody barriers for an inner curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/unibody/curved/curved-inner.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat( + count = finalInnerCurvedBarrierUnibodyRatio() * 2, + intervalY = finalInnerCurvedBarrierUnibodyIntervalY(), + center = true + ) { + finalInnerCurvedBarrierUnibody(); + } + } +} diff --git a/rcmodels/tracks/plates/unibody/curved/curved-outer.scad b/rcmodels/tracks/plates/unibody/curved/curved-outer.scad new file mode 100644 index 0000000..4816b80 --- /dev/null +++ b/rcmodels/tracks/plates/unibody/curved/curved-outer.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of unibody barriers for an outer curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/unibody/curved/curved-outer.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat( + count = finalOuterCurvedBarrierUnibodyRatio(), + intervalY = finalOuterCurvedBarrierUnibodyIntervalY(), + center = true + ) { + finalOuterCurvedBarrierUnibody(); + } + } +} diff --git a/rcmodels/tracks/plates/unibody/curved/curved-short.scad b/rcmodels/tracks/plates/unibody/curved/curved-short.scad new file mode 100644 index 0000000..6f177f9 --- /dev/null +++ b/rcmodels/tracks/plates/unibody/curved/curved-short.scad @@ -0,0 +1,55 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of unibody barriers for a short curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/unibody/curved/curved-short.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat( + count = 2, + intervalY = finalShortCurvedBarrierUnibodyWidth() + finalShortCurvedBarrierUnibodyIntervalY(), + center = true + ) { + repeatRotate( + count = 2, + intervalX = finalShortCurvedBarrierUnibodyIntervalX(), + intervalY = -finalShortCurvedBarrierUnibodyIntervalY(), + center = true + ) { + finalShortCurvedBarrierUnibody(); + } + } + } +} diff --git a/rcmodels/tracks/plates/unibody/curved/curved-small.scad b/rcmodels/tracks/plates/unibody/curved/curved-small.scad new file mode 100644 index 0000000..f81e5d8 --- /dev/null +++ b/rcmodels/tracks/plates/unibody/curved/curved-small.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of unibody barriers for a small curve track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/unibody/curved/curved-small.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat( + count = 4, + intervalY = finalSmallCurvedBarrierUnibodyIntervalY(), + center = true + ) { + finalSmallCurvedBarrierUnibody(); + } + } +} diff --git a/rcmodels/tracks/plates/unibody/curved/curved-uturn.scad b/rcmodels/tracks/plates/unibody/curved/curved-uturn.scad new file mode 100644 index 0000000..bb5d963 --- /dev/null +++ b/rcmodels/tracks/plates/unibody/curved/curved-uturn.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of unibody barriers for a U-turn track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/unibody/curved/curved-uturn.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat( + count = 4, + intervalY = finalUTurnCurvedBarrierUnibodyIntervalY(), + center = true + ) { + finalUTurnCurvedBarrierUnibody(); + } + } +} diff --git a/rcmodels/tracks/plates/unibody/straight/straight-connector.scad b/rcmodels/tracks/plates/unibody/straight/straight-connector.scad new file mode 100644 index 0000000..573186a --- /dev/null +++ b/rcmodels/tracks/plates/unibody/straight/straight-connector.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of unibody barrier connectors to connect a track part made with barrier holder. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/unibody/straight/straight-connector.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 2, + countY = 2, + intervalX = [finalConnectorBarrierUnibodyIntervalX(), 0, 0], + intervalY = [0, finalConnectorBarrierUnibodyIntervalY(), 0], + center = true + ) { + finalConnectorBarrierUnibody(); + } + } +} diff --git a/rcmodels/tracks/plates/unibody/straight/straight-double.scad b/rcmodels/tracks/plates/unibody/straight/straight-double.scad new file mode 100644 index 0000000..37ff9d6 --- /dev/null +++ b/rcmodels/tracks/plates/unibody/straight/straight-double.scad @@ -0,0 +1,49 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of straight unibody barriers with a double length. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +use <../../../parts/unibody/straight/straight-double.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat( + count = 6, + intervalY = finalDoubleStraightBarrierUnibodyIntervalY(), + center = true + ) { + finalDoubleStraightBarrierUnibody(); + } + } +} diff --git a/rcmodels/tracks/plates/unibody/straight/straight-simple.scad b/rcmodels/tracks/plates/unibody/straight/straight-simple.scad new file mode 100644 index 0000000..3ff7bc3 --- /dev/null +++ b/rcmodels/tracks/plates/unibody/straight/straight-simple.scad @@ -0,0 +1,48 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of straight unibody barriers with a simple length. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/unibody/straight/straight-simple.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat( + count = 10, + intervalY = finalSimpleStraightBarrierUnibodyIntervalY(), + center = true + ) { + finalSimpleStraightBarrierUnibody(); + } + } +} diff --git a/rcmodels/tracks/plates/unibody/straight/straight-uturn.scad b/rcmodels/tracks/plates/unibody/straight/straight-uturn.scad new file mode 100644 index 0000000..175f7f9 --- /dev/null +++ b/rcmodels/tracks/plates/unibody/straight/straight-uturn.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * A print plate presenting a set of straight unibody barriers to compensate a U-turn track part. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> +use <../../../parts/unibody/straight/straight-uturn.scad> + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + centerBuildPlate() { + repeat2D( + countX = 2, + countY = 5, + intervalX = [finalUTurnCompensationBarrierUnibodyIntervalX(), 0, 0], + intervalY = [0, finalUTurnCompensationBarrierUnibodyIntervalY(), 0], + center = true + ) { + finalUTurnCompensationBarrierUnibody(); + } + } +} From bd66791f9453ff27d820d90ce09f321fa57e57d0 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 8 Mar 2020 14:22:32 +0100 Subject: [PATCH 141/191] Add option to the render script for the printing plate --- rcmodels/tracks/render.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index 1347fe7..01d7765 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -43,12 +43,14 @@ srcpath=${project} dstpath=${project}/output configpath=${srcpath}/config partpath=${srcpath}/parts -format="" +platepath=${srcpath}/plates +format= showConfig= renderAccessories= renderElements= renderUnibody= renderSamples= +renderPlates= # include libs source "${scriptpath}/../../lib/camelSCAD/scripts/utils.sh" @@ -113,6 +115,9 @@ while (( "$#" )); do renderSamples=1 showConfig=1 ;; + "p"|"plates") + renderPlates=1 + ;; "c"|"config") showConfig=1 ;; @@ -153,6 +158,7 @@ while (( "$#" )); do echo -e "${C_MSG} e, elements ${C_RST}Render the track separated elements" echo -e "${C_MSG} u, unibody ${C_RST}Render the track unibody elements" echo -e "${C_MSG} s, samples ${C_RST}Render the samples" + echo -e "${C_MSG} p, plates ${C_RST}Render the plates" echo -e "${C_MSG} c, config ${C_RST}Show the config values" echo -e "${C_MSG} -h, --help ${C_RST}Show this help" echo -e "${C_MSG} -l, --length ${C_RST}Set the length of a track section" @@ -210,6 +216,15 @@ if [ "${showConfig}" != "" ]; then showconfig fi +# render the plates +if [ "${renderPlates}" != "" ]; then + printmessage "${C_CTX}Will render the print plates" + partpath=${platepath} + dstpath=${dstpath}/plates +else + printmessage "${C_CTX}Will render the parts separately" +fi + # render the files if [ "${renderAccessories}" != "" ]; then printmessage "${C_MSG}Rendering accessories" From 4b5c308cf154231aabca97020022a6996cc06066 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 8 Mar 2020 14:23:40 +0100 Subject: [PATCH 142/191] Add option to clean up the output folder before rendering --- rcmodels/tracks/render.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index 01d7765..35ce69a 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -51,6 +51,7 @@ renderElements= renderUnibody= renderSamples= renderPlates= +cleanUp= # include libs source "${scriptpath}/../../lib/camelSCAD/scripts/utils.sh" @@ -149,6 +150,9 @@ while (( "$#" )); do format=$2 shift ;; + "-c"|"--clean") + cleanUp=1 + ;; "-h"|"--help") echo -e "${C_INF}Renders OpenSCAD files${C_RST}" echo -e " ${C_INF}Usage:${C_RST}" @@ -168,6 +172,7 @@ while (( "$#" )); do echo -e "${C_MSG} -r --radius ${C_RST}Set the radius of the track inner curve" echo -e "${C_MSG} -s --sample ${C_RST}Set the size of sample element" echo -e "${C_MSG} -f --format ${C_RST}Set the output format" + echo -e "${C_MSG} -c --clean ${C_RST}Clean up the output folder before rendering" echo exit 0 ;; @@ -211,6 +216,12 @@ scadcheck # defines the output format scadformat "${format}" +# clean up the output +if [ "${cleanUp}" != "" ]; then + printmessage "${C_CTX}Cleaning up the output folder" + rm -rf "${dstpath}" +fi + # show the config if [ "${showConfig}" != "" ]; then showconfig From ae95051f1a2d0b225d5decdd6555ca3c1723ae55 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 8 Mar 2020 19:51:48 +0100 Subject: [PATCH 143/191] Improve the clips clampness --- rcmodels/tracks/shapes/accessories.scad | 23 ++++++++++------------- rcmodels/tracks/shapes/special.scad | 9 ++++----- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/rcmodels/tracks/shapes/accessories.scad b/rcmodels/tracks/shapes/accessories.scad index bda019c..214ccfb 100644 --- a/rcmodels/tracks/shapes/accessories.scad +++ b/rcmodels/tracks/shapes/accessories.scad @@ -35,7 +35,7 @@ * @returns Number */ function getCableClipLength(wall, base) = - getBarrierHolderWidth(base, wall + printTolerance) + getBarrierHolderWidth(base, wall) ; /** @@ -45,7 +45,7 @@ function getCableClipLength(wall, base) = * @returns Number */ function getCableClipWidth(wall, base) = - getBarrierHolderHeight(base, wall + printTolerance) + + getBarrierHolderHeight(base, wall) + apothem(n=10, r=getCableClipLength(wall, base) / 2) ; @@ -61,7 +61,7 @@ function getAccessoryBentMastLength(width, height, wall, base) = let( height = vector2D(height) ) - getBarrierHolderWidth(base, wall + printTolerance) / 2 + + getBarrierHolderWidth(base, wall) / 2 + width + height[1] ; @@ -77,7 +77,7 @@ function getAccessoryBentMastWidth(width, height, wall, base) = let( height = vector2D(height) ) - getBarrierHolderHeight(base, wall + printTolerance) + + getBarrierHolderHeight(base, wall) + width * 1.5 + height[0] ; @@ -89,7 +89,7 @@ function getAccessoryBentMastWidth(width, height, wall, base) = * @returns Number */ function getAccessoryStraightMastLength(height, wall, base) = - getBarrierHolderHeight(base, wall + printTolerance) + height + getBarrierHolderHeight(base, wall) + height ; /** @@ -99,7 +99,7 @@ function getAccessoryStraightMastLength(height, wall, base) = * @returns Number */ function getAccessoryStraightMastWidth(wall, base) = - getBarrierHolderWidth(base, wall + printTolerance) + getBarrierHolderWidth(base, wall) ; /** @@ -139,8 +139,7 @@ module cableClip(height, wall, base, thickness, center = false) { clipProfile( wall = wall, base = base, - thickness = thickness + printTolerance, - distance = printTolerance + thickness = thickness + printTolerance ); repeat(intervalX = clipWidth - wall, center = true) { translateY(base / 2) { @@ -270,7 +269,7 @@ module mastRings(width, height, wall, interval = 0, count = 1, distance = 0, cen * @param Number thickness - The thickness of the barrier body. */ module accessoryStraightMast(width, height, wall, base, thickness) { - clipHeight = getBarrierHolderHeight(base, wall + printTolerance); + clipHeight = getBarrierHolderHeight(base, wall); translateX((clipHeight - height) / 2) { rotateY(90) { @@ -287,7 +286,6 @@ module accessoryStraightMast(width, height, wall, base, thickness) { height = width, base = base, thickness = thickness + printTolerance, - distance = printTolerance, center = true ); } @@ -304,8 +302,8 @@ module accessoryStraightMast(width, height, wall, base, thickness) { */ module accessoryBentMast(width, height, wall, base, thickness) { height = vector2D(height); - clipWidth = getBarrierHolderWidth(base, wall + printTolerance); - clipHeight = getBarrierHolderHeight(base, wall + printTolerance); + clipWidth = getBarrierHolderWidth(base, wall); + clipHeight = getBarrierHolderHeight(base, wall); bentMastLength = getAccessoryBentMastLength(width, height, wall, base); bentMastWidth = getAccessoryBentMastWidth(width, height, wall, base); @@ -326,7 +324,6 @@ module accessoryBentMast(width, height, wall, base, thickness) { height = width, base = base, thickness = thickness + printTolerance, - distance = printTolerance, center = true ); } diff --git a/rcmodels/tracks/shapes/special.scad b/rcmodels/tracks/shapes/special.scad index f5ceea6..5ff8015 100644 --- a/rcmodels/tracks/shapes/special.scad +++ b/rcmodels/tracks/shapes/special.scad @@ -36,7 +36,7 @@ * @returns Number */ function getArchTowerLength(length, base, wall) = - getBarrierHolderHeight(base, wall + printTolerance) + + getBarrierHolderHeight(base, wall) + length / 2 ; @@ -62,7 +62,7 @@ function getArchTowerLengthMale(length, base, wall) = * @returns Number */ function getArchTowerWidth(base, wall) = - getBarrierHolderWidth(base, wall + printTolerance) + getBarrierHolderWidth(base, wall) ; /** @@ -74,7 +74,7 @@ function getArchTowerWidth(base, wall) = module archTower(length, thickness, base, wall) { thickness = thickness + printTolerance; holderHeight = getBarrierHolderHeight(base); - clipHeight = getBarrierHolderHeight(base, wall + printTolerance); + clipHeight = getBarrierHolderHeight(base, wall); indent = getBarrierStripIndent(base) + printResolution; length = length / 2; @@ -86,8 +86,7 @@ module archTower(length, thickness, base, wall) { wall = wall, height = holderHeight, base = base, - thickness = thickness, - distance = printTolerance + thickness = thickness ); translate([0, wall / 2, holderHeight - indent]) { box([thickness, wall * 2, indent * 2]); From fbcd3abc825f1c61c5d5c8ded121858a2b2c4d98 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 8 Mar 2020 20:04:30 +0100 Subject: [PATCH 144/191] Add an option to set the number of parallel rendering processes --- rcmodels/tracks/render.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index 35ce69a..40f7477 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -45,6 +45,7 @@ configpath=${srcpath}/config partpath=${srcpath}/parts platepath=${srcpath}/plates format= +parallel= showConfig= renderAccessories= renderElements= @@ -150,6 +151,10 @@ while (( "$#" )); do format=$2 shift ;; + "-p"|"--parallel") + parallel=$2 + shift + ;; "-c"|"--clean") cleanUp=1 ;; @@ -172,6 +177,7 @@ while (( "$#" )); do echo -e "${C_MSG} -r --radius ${C_RST}Set the radius of the track inner curve" echo -e "${C_MSG} -s --sample ${C_RST}Set the size of sample element" echo -e "${C_MSG} -f --format ${C_RST}Set the output format" + echo -e "${C_MSG} -p --parallel ${C_RST}Set the number of parallel processes" echo -e "${C_MSG} -c --clean ${C_RST}Clean up the output folder before rendering" echo exit 0 @@ -216,6 +222,9 @@ scadcheck # defines the output format scadformat "${format}" +# defines the number of parallel processes +scadprocesses "${parallel}" + # clean up the output if [ "${cleanUp}" != "" ]; then printmessage "${C_CTX}Cleaning up the output folder" From 34eec04c16cf323d9f9715c0547ec2beab53aeeb Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 8 Mar 2020 20:07:55 +0100 Subject: [PATCH 145/191] -Update camelSCAD to v0.11.0 --- lib/camelSCAD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/camelSCAD b/lib/camelSCAD index 316c8a1..2d9faca 160000 --- a/lib/camelSCAD +++ b/lib/camelSCAD @@ -1 +1 @@ -Subproject commit 316c8a1b8bf8abe3fd043c6e9549cda009d135c6 +Subproject commit 2d9faca35c149e5fb2922913a991e63cb1a97167 From 99048b7ed7545f69949db12d0e17a19c8d20ab49 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 8 Mar 2020 20:31:05 +0100 Subject: [PATCH 146/191] Fix breaking changes with the buildBox --- misc/dart-target.scad | 8 +++++--- misc/eyelet.scad | 8 +++++--- misc/honeycomb-box.scad | 8 +++++--- misc/led-strip-holder.scad | 8 +++++--- misc/mesh-grid.scad | 8 +++++--- misc/triominos-holder.scad | 6 ++++-- printer/dehydratator-feet.scad | 8 +++++--- printer/dehydratator-spool-holder-v2.scad | 6 ++++-- printer/dehydratator-spool-holder.scad | 6 ++++-- printer/wheel-spool-holder.scad | 8 +++++--- rcmodels/betafpv-beta85x/betafpv-beta85x-needle.scad | 10 ++++++---- rcmodels/betafpv-beta85x/betafpv-beta85x-stand.scad | 8 +++++--- rcmodels/blade-inductrix/tiny-whoop-camera-holder.scad | 8 +++++--- .../blade-torrent-battery-spacer.scad | 8 +++++--- .../blade-torrent-110/blade-torrent-landing-gear.scad | 8 +++++--- rcmodels/blade-torrent-110/blade-torrent-stand.scad | 8 +++++--- rcmodels/fc-case.scad | 8 +++++--- rcmodels/utils/batteries-organizer.scad | 8 +++++--- rcmodels/whoop-box/angled-box.scad | 8 +++++--- rcmodels/whoop-box/container.scad | 8 +++++--- rcmodels/whoop-box/cupboard.scad | 8 +++++--- rcmodels/whoop-box/drawer.scad | 8 +++++--- rcmodels/whoop-box/rounded-box.scad | 8 +++++--- rcmodels/whoop-box/test/all-box.scad | 8 +++++--- skeleton.scad | 10 ++++++---- tools/angle-guide.scad | 8 +++++--- tools/spatula.scad | 8 +++++--- 27 files changed, 134 insertions(+), 80 deletions(-) diff --git a/misc/dart-target.scad b/misc/dart-target.scad index dcd5d59..0f47319 100644 --- a/misc/dart-target.scad +++ b/misc/dart-target.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017 Jean-Sebastien CONAN + * Copyright (c) 2017-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -49,9 +49,11 @@ armWidth = ringWidth / 2; armLength = targetDiameter * 1.1; cornerRadius = socleWidth / 4; -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { // First draw the rings cylinder(d=ringDiameter, h=thickness); if (rings > 1) { diff --git a/misc/eyelet.scad b/misc/eyelet.scad index 2ec9f70..f3c6656 100644 --- a/misc/eyelet.scad +++ b/misc/eyelet.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017 Jean-Sebastien CONAN + * Copyright (c) 2017-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -41,9 +41,11 @@ holeDiameter = 30; tubeDiameter = holeDiameter + 2 * thickness; tubeDepth = 5; -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { difference() { union() { pipe(d=tubeDiameter, w=thickness, h=tubeDepth + thickness); diff --git a/misc/honeycomb-box.scad b/misc/honeycomb-box.scad index 38cad2b..0c46518 100644 --- a/misc/honeycomb-box.scad +++ b/misc/honeycomb-box.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017 Jean-Sebastien CONAN + * Copyright (c) 2017-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -58,9 +58,11 @@ even = true; offset = offsetHexGrid(size=outerCell, count=count, pointy=pointy, linear=linear, even=even); size = sizeHexGrid(size=outerCell, count=count, pointy=pointy, linear=linear, even=even); -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { //sample(size=apply3D(size, z=5), offset=[0,0,outerHeight-5]) for(hex = buildHexGrid(count=count, linear=linear)) { translate(offset + coordHexCell(hex=hex, size=outerCell, linear=linear, even=even, pointy=pointy)) { diff --git a/misc/led-strip-holder.scad b/misc/led-strip-holder.scad index a05a122..1ea8a97 100644 --- a/misc/led-strip-holder.scad +++ b/misc/led-strip-holder.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019 Jean-Sebastien CONAN + * Copyright (c) 2019-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -53,9 +53,11 @@ length = ledStripWidth + screwDiameter + 2 * screwPadding + ledStripPadding; width = screwDiameter + 2 * screwPadding; height = ceilBy(thickness - ledStripThickness, printResolution) + groove; -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { difference() { // main shape union() { diff --git a/misc/mesh-grid.scad b/misc/mesh-grid.scad index 2af3e29..9d0cca4 100644 --- a/misc/mesh-grid.scad +++ b/misc/mesh-grid.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017 Jean-Sebastien CONAN + * Copyright (c) 2017-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -52,9 +52,11 @@ cellSpaceY = 1; meshLength = length - 2 * paddingX; meshWidth = width - 2 * paddingY; -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { difference() { cushion([length, width, thickness], d=corner); diff --git a/misc/triominos-holder.scad b/misc/triominos-holder.scad index a1b7289..d5c642d 100644 --- a/misc/triominos-holder.scad +++ b/misc/triominos-holder.scad @@ -183,9 +183,11 @@ module standBoard(pieceSize, count, thickness, padding) { } } -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) diff --git a/printer/dehydratator-feet.scad b/printer/dehydratator-feet.scad index f179a22..90ce248 100644 --- a/printer/dehydratator-feet.scad +++ b/printer/dehydratator-feet.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019 Jean-Sebastien CONAN + * Copyright (c) 2019-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -69,9 +69,11 @@ module foot(bottom, top, height) { } } -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { translateX(-((count - 1) * intervalX) / 2) { repeat( count=count, diff --git a/printer/dehydratator-spool-holder-v2.scad b/printer/dehydratator-spool-holder-v2.scad index 767aa62..5ffad14 100644 --- a/printer/dehydratator-spool-holder-v2.scad +++ b/printer/dehydratator-spool-holder-v2.scad @@ -70,9 +70,11 @@ plateRidgeY = plateRidgeHeight; wallRidgeX = wallRidgeHeight; wallRidgeY = wallRidgeWidth / 2 * cos(60); -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { rotate_extrude() { polygon( points=path(concat([ diff --git a/printer/dehydratator-spool-holder.scad b/printer/dehydratator-spool-holder.scad index 03c440e..b001ed1 100644 --- a/printer/dehydratator-spool-holder.scad +++ b/printer/dehydratator-spool-holder.scad @@ -69,9 +69,11 @@ spoolHoleRidgeInterval = (spoolHoleHeight - spoolHoleRidgeWidth) / spoolHoleRidg spoolHoleRidgeX = spoolHoleRidgeHeight; spoolHoleRidgeY = spoolHoleRidgeWidth / 2 * cos(60); -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { //sample(size=vadd([plateDiameter, plateDiameter, 8], ALIGN2), offset=[0, 0, -ALIGN]) //sample(size=vadd([plateDiameter, plateDiameter, 8], ALIGN2), offset=[0, 0, plateHeight+spoolHoleHeight-8-ALIGN]) rotate_extrude() { diff --git a/printer/wheel-spool-holder.scad b/printer/wheel-spool-holder.scad index 751e5cc..b001c6e 100644 --- a/printer/wheel-spool-holder.scad +++ b/printer/wheel-spool-holder.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019 Jean-Sebastien CONAN + * Copyright (c) 2019-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -158,9 +158,11 @@ module spoolHolderLeg(wheelDiameter, wheelDistance, axleDiameter, axleDistance, } } -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) union() { diff --git a/rcmodels/betafpv-beta85x/betafpv-beta85x-needle.scad b/rcmodels/betafpv-beta85x/betafpv-beta85x-needle.scad index 8e8045f..3425fd8 100644 --- a/rcmodels/betafpv-beta85x/betafpv-beta85x-needle.scad +++ b/rcmodels/betafpv-beta85x/betafpv-beta85x-needle.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019 Jean-Sebastien CONAN + * Copyright (c) 2019-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -48,10 +48,12 @@ handleLength = 60; // Defines the dimensions of the object needleSide = (handleWidth - needleWidth) / 2; -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -//sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 2], offset=[0, 0, 2]) -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 2], offset=[0, 0, 2]) negativeExtrude(needleThickness) { polygon( points=path([ diff --git a/rcmodels/betafpv-beta85x/betafpv-beta85x-stand.scad b/rcmodels/betafpv-beta85x/betafpv-beta85x-stand.scad index 8afa352..dad76f0 100644 --- a/rcmodels/betafpv-beta85x/betafpv-beta85x-stand.scad +++ b/rcmodels/betafpv-beta85x/betafpv-beta85x-stand.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019 Jean-Sebastien CONAN + * Copyright (c) 2019-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -49,10 +49,12 @@ armLength = (motorDistance - plateDiameter) / 2 + pillarDiameter; platformHeight = platformDiameter - pillarDiameter; pillarBottom = pillarHeight - platformHeight; -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 2], offset=[0, 0, 2]) -buildBox(mode=renderMode) { +applyMode(mode=renderMode) { // the base negativeExtrude(height=plateThickness) { ring(d=plateDiameter, w=pillarDiameter); diff --git a/rcmodels/blade-inductrix/tiny-whoop-camera-holder.scad b/rcmodels/blade-inductrix/tiny-whoop-camera-holder.scad index 0d052bb..f245ee0 100644 --- a/rcmodels/blade-inductrix/tiny-whoop-camera-holder.scad +++ b/rcmodels/blade-inductrix/tiny-whoop-camera-holder.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017-2019 Jean-Sebastien CONAN + * Copyright (c) 2017-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -85,9 +85,11 @@ module triangle(side) { } } -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { difference() { union() { // Draws the plate diff --git a/rcmodels/blade-torrent-110/blade-torrent-battery-spacer.scad b/rcmodels/blade-torrent-110/blade-torrent-battery-spacer.scad index 9c2b668..9d6906d 100644 --- a/rcmodels/blade-torrent-110/blade-torrent-battery-spacer.scad +++ b/rcmodels/blade-torrent-110/blade-torrent-battery-spacer.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017 Jean-Sebastien CONAN + * Copyright (c) 2017-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -87,9 +87,11 @@ velcroWidth = floor(beltHoleInterval - beltHoleWidth - 2 * screwHeadThickness); echo("Plate thickness:", plateThickness); echo("Velcro place:", [velcroLength, velcroWidth]); -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { // build the plate difference() { // the raw plate diff --git a/rcmodels/blade-torrent-110/blade-torrent-landing-gear.scad b/rcmodels/blade-torrent-110/blade-torrent-landing-gear.scad index 5cbd58b..f57065d 100644 --- a/rcmodels/blade-torrent-110/blade-torrent-landing-gear.scad +++ b/rcmodels/blade-torrent-110/blade-torrent-landing-gear.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017 Jean-Sebastien CONAN + * Copyright (c) 2017-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -85,9 +85,11 @@ meshCountY = 3; meshLength = floor(plateInnerWidth - 2 * plateThickness); meshWidth = floor(beltHoleInterval - beltHoleWidth - 2 * plateThickness); -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { // build the plate difference() { // the raw plate diff --git a/rcmodels/blade-torrent-110/blade-torrent-stand.scad b/rcmodels/blade-torrent-110/blade-torrent-stand.scad index 7f4e705..0a9138c 100644 --- a/rcmodels/blade-torrent-110/blade-torrent-stand.scad +++ b/rcmodels/blade-torrent-110/blade-torrent-stand.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017-2019 Jean-Sebastien CONAN + * Copyright (c) 2017-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -65,9 +65,11 @@ armOffset = pillarThickness; armSize = [(armLength - coreWidth) / 2 + armOffset, pillarWidth]; armX = coreWidth / 2 - armOffset; -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { difference() { union() { // the base diff --git a/rcmodels/fc-case.scad b/rcmodels/fc-case.scad index aa5f86b..35e0275 100644 --- a/rcmodels/fc-case.scad +++ b/rcmodels/fc-case.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019 Jean-Sebastien CONAN + * Copyright (c) 2019-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -142,9 +142,11 @@ module circleVents(diameter, thickness, height) { } } -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { translateY(-placementDistribution / 2) { distributeGrid(intervalX=[0, placementDistribution, 0]) { // top box diff --git a/rcmodels/utils/batteries-organizer.scad b/rcmodels/utils/batteries-organizer.scad index 94c6f2c..f0299a6 100644 --- a/rcmodels/utils/batteries-organizer.scad +++ b/rcmodels/utils/batteries-organizer.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017 Jean-Sebastien CONAN + * Copyright (c) 2017-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -66,9 +66,11 @@ overallLength = thickness + (batteryThickness + thickness) * batteryCountX; overallWidth = thickness + (batteryWidth + thickness) * batteryCountY; overallHeight = thickness + batteryDepth; -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { //sample(size=[overallLength, overallWidth, 5], offset=[0,0,batteryDepth-5]) difference() { cushion([overallLength, overallWidth, overallHeight], d=outerRound); diff --git a/rcmodels/whoop-box/angled-box.scad b/rcmodels/whoop-box/angled-box.scad index c2a414d..d055d3c 100644 --- a/rcmodels/whoop-box/angled-box.scad +++ b/rcmodels/whoop-box/angled-box.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019 Jean-Sebastien CONAN + * Copyright (c) 2019-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -33,9 +33,11 @@ // Import the project's setup. include -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 5]) whoopAngledBox( diff --git a/rcmodels/whoop-box/container.scad b/rcmodels/whoop-box/container.scad index aa59b9e..67ec9f6 100644 --- a/rcmodels/whoop-box/container.scad +++ b/rcmodels/whoop-box/container.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019 Jean-Sebastien CONAN + * Copyright (c) 2019-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -33,9 +33,11 @@ // Import the project's setup. include -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 5]) whoopContainer( diff --git a/rcmodels/whoop-box/cupboard.scad b/rcmodels/whoop-box/cupboard.scad index a1e5122..2fc46cd 100644 --- a/rcmodels/whoop-box/cupboard.scad +++ b/rcmodels/whoop-box/cupboard.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019 Jean-Sebastien CONAN + * Copyright (c) 2019-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -34,9 +34,11 @@ // Import the project's setup. include -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 20]) whoopCupboard( diff --git a/rcmodels/whoop-box/drawer.scad b/rcmodels/whoop-box/drawer.scad index 9af0f3d..e9f8629 100644 --- a/rcmodels/whoop-box/drawer.scad +++ b/rcmodels/whoop-box/drawer.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019 Jean-Sebastien CONAN + * Copyright (c) 2019-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -33,9 +33,11 @@ // Import the project's setup. include -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 5]) whoopDrawer( diff --git a/rcmodels/whoop-box/rounded-box.scad b/rcmodels/whoop-box/rounded-box.scad index 2a9989d..7f25972 100644 --- a/rcmodels/whoop-box/rounded-box.scad +++ b/rcmodels/whoop-box/rounded-box.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019 Jean-Sebastien CONAN + * Copyright (c) 2019-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -33,9 +33,11 @@ // Import the project's setup. include -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 10], offset=[0, 0, 5]) whoopRoundedBox( diff --git a/rcmodels/whoop-box/test/all-box.scad b/rcmodels/whoop-box/test/all-box.scad index 80367a1..8c06ad6 100644 --- a/rcmodels/whoop-box/test/all-box.scad +++ b/rcmodels/whoop-box/test/all-box.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019 Jean-Sebastien CONAN + * Copyright (c) 2019-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -32,9 +32,11 @@ // Import the project's setup. include <../util/setup.scad> -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 5]) union() { diff --git a/skeleton.scad b/skeleton.scad index c105671..882a60b 100644 --- a/skeleton.scad +++ b/skeleton.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017-2019 Jean-Sebastien CONAN + * Copyright (c) 2017-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -39,7 +39,7 @@ renderMode = MODE_PROD; // Defines the constraints of the print. printResolution = 0.2; // the target layer height nozzle = 0.4; // the size of the print nozzle -wallDistance = 0.1; // the distance between the walls of two objects +printTolerance = 0.1; // The print tolerance when pieces need to be assembled // Defines the constraints of the object. //count = 2; @@ -49,9 +49,11 @@ wallDistance = 0.1; // the distance between the walls of two objects //width = 10; //height = 10; -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) union() { diff --git a/tools/angle-guide.scad b/tools/angle-guide.scad index d428bd2..1080661 100644 --- a/tools/angle-guide.scad +++ b/tools/angle-guide.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019 Jean-Sebastien CONAN + * Copyright (c) 2019-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -64,9 +64,11 @@ module holeLine(length, interval, diameter) { } } -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { translate(-[radius / 2, radius / 2 * sin(angle), 0]) { difference() { wedge(r=radius, h=thickness, a=angle); diff --git a/tools/spatula.scad b/tools/spatula.scad index 54a6839..de12b43 100644 --- a/tools/spatula.scad +++ b/tools/spatula.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017 Jean-Sebastien CONAN + * Copyright (c) 2017-2020 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -53,9 +53,11 @@ bladeSize = [bladeLength, bladeWidth, bladeThickness]; handleSize = [handleLength, handleWidth, bladeThickness]; handleRound = handleWidth; -// Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. -buildBox(mode=renderMode) { +buildBox(center=true); + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { cushion(size=bladeSize, r=bladeRound); translateX(handleLength / 2) { cushion(size=handleSize, r=handleRound); From 0180d287a2e083e57358598e1a98109ff17a9c62 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 8 Mar 2020 20:49:35 +0100 Subject: [PATCH 147/191] Update camelSCAD to v0.11.1 --- lib/camelSCAD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/camelSCAD b/lib/camelSCAD index 2d9faca..21ee609 160000 --- a/lib/camelSCAD +++ b/lib/camelSCAD @@ -1 +1 @@ -Subproject commit 2d9faca35c149e5fb2922913a991e63cb1a97167 +Subproject commit 21ee609578e7aaed9670ae6362d5ce435abb2b25 From 978e15d5561ffd5121355ce4649ca18dfecad64c Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 8 Mar 2020 23:22:49 +0100 Subject: [PATCH 148/191] Bump version --- rcmodels/tracks/config/config.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 864e37c..17f15e0 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -28,7 +28,7 @@ * @author jsconan */ - projectVersion = "0.3.0"; + projectVersion = "0.4.0"; // We will render the object using the specifications of this mode renderMode = MODE_PROD; From 6a60144ee424b2d8f25399b6b555d07b272cf53f Mon Sep 17 00:00:00 2001 From: jsconan Date: Thu, 12 Mar 2020 22:50:52 +0100 Subject: [PATCH 149/191] Loose slightly the arch tower clamps --- rcmodels/tracks/shapes/special.scad | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rcmodels/tracks/shapes/special.scad b/rcmodels/tracks/shapes/special.scad index 5ff8015..f5ceea6 100644 --- a/rcmodels/tracks/shapes/special.scad +++ b/rcmodels/tracks/shapes/special.scad @@ -36,7 +36,7 @@ * @returns Number */ function getArchTowerLength(length, base, wall) = - getBarrierHolderHeight(base, wall) + + getBarrierHolderHeight(base, wall + printTolerance) + length / 2 ; @@ -62,7 +62,7 @@ function getArchTowerLengthMale(length, base, wall) = * @returns Number */ function getArchTowerWidth(base, wall) = - getBarrierHolderWidth(base, wall) + getBarrierHolderWidth(base, wall + printTolerance) ; /** @@ -74,7 +74,7 @@ function getArchTowerWidth(base, wall) = module archTower(length, thickness, base, wall) { thickness = thickness + printTolerance; holderHeight = getBarrierHolderHeight(base); - clipHeight = getBarrierHolderHeight(base, wall); + clipHeight = getBarrierHolderHeight(base, wall + printTolerance); indent = getBarrierStripIndent(base) + printResolution; length = length / 2; @@ -86,7 +86,8 @@ module archTower(length, thickness, base, wall) { wall = wall, height = holderHeight, base = base, - thickness = thickness + thickness = thickness, + distance = printTolerance ); translate([0, wall / 2, holderHeight - indent]) { box([thickness, wall * 2, indent * 2]); From ace1559c1d9fb2685b95ae2faa5cd6a6eae159a5 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 20 Mar 2020 22:23:39 +0100 Subject: [PATCH 150/191] Fix number of notches in straight barrier holders --- rcmodels/tracks/shapes/fragments.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rcmodels/tracks/shapes/fragments.scad b/rcmodels/tracks/shapes/fragments.scad index 2caa222..9efd76b 100644 --- a/rcmodels/tracks/shapes/fragments.scad +++ b/rcmodels/tracks/shapes/fragments.scad @@ -73,7 +73,7 @@ module barrierNotch(thickness, base, distance = 0, interval = 0, count = 1, cent */ module barrierNotchNegative(length, thickness, base, notches = 2) { height = getBarrierHolderHeight(base) * 2; - notches = min(notches, 2); + notches = max(notches, 1); interval = length / notches; count = notches + 1; From fdd2016cab0a1c8535b852ed96c389b14121b809 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 20 Mar 2020 22:25:58 +0100 Subject: [PATCH 151/191] Split special shapes and dispatch them in more appropriate files --- rcmodels/tracks/config/setup.scad | 3 +- rcmodels/tracks/shapes/arch.scad | 161 ++++++++++++++++++ .../shapes/{special.scad => connector.scad} | 134 +-------------- 3 files changed, 164 insertions(+), 134 deletions(-) create mode 100644 rcmodels/tracks/shapes/arch.scad rename rcmodels/tracks/shapes/{special.scad => connector.scad} (61%) diff --git a/rcmodels/tracks/config/setup.scad b/rcmodels/tracks/config/setup.scad index 6389d6c..7f8f47b 100644 --- a/rcmodels/tracks/config/setup.scad +++ b/rcmodels/tracks/config/setup.scad @@ -41,7 +41,8 @@ include <../shapes/fragments.scad> include <../shapes/straight.scad> include <../shapes/curved.scad> include <../shapes/uturn.scad> -include <../shapes/special.scad> +include <../shapes/arch.scad> +include <../shapes/connector.scad> include <../shapes/accessories.scad> // Validate the config against the constraints diff --git a/rcmodels/tracks/shapes/arch.scad b/rcmodels/tracks/shapes/arch.scad new file mode 100644 index 0000000..7f33fa9 --- /dev/null +++ b/rcmodels/tracks/shapes/arch.scad @@ -0,0 +1,161 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A race track system for 1/24 to 1/32 scale RC cars. + * + * Defines arch related track parts. + * + * @author jsconan + */ + +/** + * Gets the length of an arch tower. + * @param Number length - The length of a track element. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number wall - The thickness of the clip outline. + * @returns Number + */ +function getArchTowerLength(length, base, wall) = + getBarrierHolderHeight(base, wall + printTolerance) + + length / 2 +; + +/** + * Gets the length of an arch tower with a male connector. + * @param Number length - The length of a track element. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number wall - The thickness of the clip outline. + * @returns Number + */ +function getArchTowerLengthMale(length, base, wall) = + getArchTowerLength( + length = length, + base = base, + wall = wall + ) + getBarrierLinkLength(base) +; + +/** + * Gets the width of an arch tower. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number wall - The thickness of the clip outline. + * @returns Number + */ +function getArchTowerWidth(base, wall) = + getBarrierHolderWidth(base, wall + printTolerance) +; + +/** + * Draws the shape of an arch tower that will clamp a barrier border. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number wall - The thickness of the outline. + */ +module archTower(length, thickness, base, wall) { + thickness = thickness + printTolerance; + holderHeight = getBarrierHolderHeight(base); + clipHeight = getBarrierHolderHeight(base, wall + printTolerance); + indent = getBarrierStripIndent(base) + printResolution; + length = length / 2; + + translateX(-clipHeight / 2) { + translateX(length / 2) { + rotateZ(-90) { + difference() { + clip( + wall = wall, + height = holderHeight, + base = base, + thickness = thickness, + distance = printTolerance + ); + translate([0, wall / 2, holderHeight - indent]) { + box([thickness, wall * 2, indent * 2]); + } + } + } + } + carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { + extrudeStraightProfile(length=length) { + barrierHolderProfile( + base = base, + thickness = thickness + ); + } + } + } +} + +/** + * Draws the shape of a male arch tower that will clamp a barrier border. + * @param Number length - The length of a track element. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number wall - The thickness of the outline. + */ +module archTowerMale(length, thickness, base, wall) { + linkHeight = getBarrierHolderLinkHeight(base); + archTowerLength = getArchTowerLength( + length = length, + base = base, + wall = wall + ); + + straightLinkMale(length=archTowerLength, linkHeight=linkHeight, base=base) { + archTower( + length = length, + thickness = thickness, + base = base, + wall = wall + ); + } +} + +/** + * Draws the shape of a female arch tower that will clamp a barrier border. + * @param Number length - The length of a track element. + * @param Number thickness - The thickness of the barrier body. + * @param Number base - The base unit value used to design the barrier holder. + * @param Number wall - The thickness of the outline. + */ +module archTowerFemale(length, thickness, base, wall) { + linkHeight = getBarrierHolderLinkHeight(base); + archTowerLength = getArchTowerLength( + length = length, + base = base, + wall = wall + ); + + rotateZ(180) { + straightLinkFemale(length=archTowerLength, linkHeight=linkHeight, base=base) { + rotateZ(180) { + archTower( + length = length, + thickness = thickness, + base = base, + wall = wall + ); + } + } + } +} diff --git a/rcmodels/tracks/shapes/special.scad b/rcmodels/tracks/shapes/connector.scad similarity index 61% rename from rcmodels/tracks/shapes/special.scad rename to rcmodels/tracks/shapes/connector.scad index f5ceea6..6868a3a 100644 --- a/rcmodels/tracks/shapes/special.scad +++ b/rcmodels/tracks/shapes/connector.scad @@ -23,143 +23,11 @@ /** * A race track system for 1/24 to 1/32 scale RC cars. * - * Defines some special track parts. + * Defines connector track parts. * * @author jsconan */ -/** - * Gets the length of an arch tower. - * @param Number length - The length of a track element. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number wall - The thickness of the clip outline. - * @returns Number - */ -function getArchTowerLength(length, base, wall) = - getBarrierHolderHeight(base, wall + printTolerance) + - length / 2 -; - -/** - * Gets the length of an arch tower with a male connector. - * @param Number length - The length of a track element. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number wall - The thickness of the clip outline. - * @returns Number - */ -function getArchTowerLengthMale(length, base, wall) = - getArchTowerLength( - length = length, - base = base, - wall = wall - ) + getBarrierLinkLength(base) -; - -/** - * Gets the width of an arch tower. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number wall - The thickness of the clip outline. - * @returns Number - */ -function getArchTowerWidth(base, wall) = - getBarrierHolderWidth(base, wall + printTolerance) -; - -/** - * Draws the shape of an arch tower that will clamp a barrier border. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number wall - The thickness of the outline. - */ -module archTower(length, thickness, base, wall) { - thickness = thickness + printTolerance; - holderHeight = getBarrierHolderHeight(base); - clipHeight = getBarrierHolderHeight(base, wall + printTolerance); - indent = getBarrierStripIndent(base) + printResolution; - length = length / 2; - - translateX(-clipHeight / 2) { - translateX(length / 2) { - rotateZ(-90) { - difference() { - clip( - wall = wall, - height = holderHeight, - base = base, - thickness = thickness, - distance = printTolerance - ); - translate([0, wall / 2, holderHeight - indent]) { - box([thickness, wall * 2, indent * 2]); - } - } - } - } - carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { - extrudeStraightProfile(length=length) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - } - } - } -} - -/** - * Draws the shape of a male arch tower that will clamp a barrier border. - * @param Number length - The length of a track element. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number wall - The thickness of the outline. - */ -module archTowerMale(length, thickness, base, wall) { - linkHeight = getBarrierHolderLinkHeight(base); - archTowerLength = getArchTowerLength( - length = length, - base = base, - wall = wall - ); - - straightLinkMale(length=archTowerLength, linkHeight=linkHeight, base=base) { - archTower( - length = length, - thickness = thickness, - base = base, - wall = wall - ); - } -} - -/** - * Draws the shape of a female arch tower that will clamp a barrier border. - * @param Number length - The length of a track element. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number wall - The thickness of the outline. - */ -module archTowerFemale(length, thickness, base, wall) { - linkHeight = getBarrierHolderLinkHeight(base); - archTowerLength = getArchTowerLength( - length = length, - base = base, - wall = wall - ); - - rotateZ(180) { - straightLinkFemale(length=archTowerLength, linkHeight=linkHeight, base=base) { - rotateZ(180) { - archTower( - length = length, - thickness = thickness, - base = base, - wall = wall - ); - } - } - } -} - /** * Draws the shape of a connector between a barrier holder and a unibody barrier. * @param Number length - The length of a track element. From c77bd45a919839a608fab4478e5b68285eef7fbc Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 20 Mar 2020 22:27:33 +0100 Subject: [PATCH 152/191] Improve the design of the U-turn barrier holders by adding a pocket to prevent round edges on the slot near the tower --- rcmodels/tracks/shapes/uturn.scad | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/rcmodels/tracks/shapes/uturn.scad b/rcmodels/tracks/shapes/uturn.scad index 693cf4e..cdb8c38 100644 --- a/rcmodels/tracks/shapes/uturn.scad +++ b/rcmodels/tracks/shapes/uturn.scad @@ -87,6 +87,7 @@ module uTurnBarrierHolder(length, height, thickness, base, gap, right = false) { towerWidth = nozzleAligned(thickness + minWidth); towerHeight = getBarrierBodyInnerHeight(height, base) / 2; interval = (getBarrierHolderWidth(base) + gap) / 2; + indent = getBarrierStripIndent(base) + printResolution; dir = right ? -1 : 1; length = length / 2; @@ -118,13 +119,20 @@ module uTurnBarrierHolder(length, height, thickness, base, gap, right = false) { } translateX(length / 2 - interval) { rotateZ(270) { - extrudeCurvedProfile(radius=interval, angle=180) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - translate([-thickness / 2, holderHeight + towerHeight / 2]) { - rectangle([towerWidth, towerHeight]); + difference() { + extrudeCurvedProfile(radius=interval, angle=180) { + barrierHolderProfile( + base = base, + thickness = thickness + ); + translate([-thickness / 2, holderHeight + towerHeight / 2]) { + rectangle([towerWidth, towerHeight]); + } + } + repeat(count=2, intervalX=interval * 2, center=true) { + translateZ(holderHeight - indent) { + box([thickness, thickness, indent]); + } } } } From c966d67331fb39688178a6d0e84ac195c6011799 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 20 Mar 2020 22:27:58 +0100 Subject: [PATCH 153/191] Bump version --- rcmodels/tracks/config/config.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index 17f15e0..c89a176 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -28,7 +28,7 @@ * @author jsconan */ - projectVersion = "0.4.0"; + projectVersion = "0.4.1"; // We will render the object using the specifications of this mode renderMode = MODE_PROD; From 03845b2a9cc0e55d34ff0c24c9257a7c40ace757 Mon Sep 17 00:00:00 2001 From: jsconan Date: Thu, 26 Mar 2020 17:47:12 +0100 Subject: [PATCH 154/191] Fix the size of the U-turn compensed barrier body --- rcmodels/tracks/shapes/uturn.scad | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rcmodels/tracks/shapes/uturn.scad b/rcmodels/tracks/shapes/uturn.scad index cdb8c38..82cb8fb 100644 --- a/rcmodels/tracks/shapes/uturn.scad +++ b/rcmodels/tracks/shapes/uturn.scad @@ -245,17 +245,16 @@ module uTurnCompensationBarrierUnibody(height, thickness, base, gap) { module uTurnCompensationBarrierBody(length, height, thickness, base, gap) { stripHeight = getBarrierStripHeight(base) - getBarrierStripIndent(base); compensation = getBarrierHolderWidth(base) + gap; - compensedLength = length + compensation; - interval = length / 2; + interval = (length - compensation) / 2; difference() { box( - size = [compensedLength, height, thickness], + size = [length, height, thickness], center = true ); repeatMirror(interval=[0, height, 0], axis=[0, 1, 0], center=true) { repeatMirror() { - translateX((compensedLength - interval) / 2) { + translateX((length - interval) / 2) { barrierNotch( thickness = thickness * 2, base = base, From b2e49defc39f143ed617a0d56bbb1a7eea5115cc Mon Sep 17 00:00:00 2001 From: jsconan Date: Thu, 26 Mar 2020 17:47:33 +0100 Subject: [PATCH 155/191] Bump version --- rcmodels/tracks/config/config.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad index c89a176..3ab24c7 100644 --- a/rcmodels/tracks/config/config.scad +++ b/rcmodels/tracks/config/config.scad @@ -28,7 +28,7 @@ * @author jsconan */ - projectVersion = "0.4.1"; + projectVersion = "0.4.2"; // We will render the object using the specifications of this mode renderMode = MODE_PROD; From 32cfe24b193602569da8b6a6097ebd1b9f7f9766 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 27 Mar 2020 21:46:47 +0100 Subject: [PATCH 156/191] Update camelSCAD to v0.12.0 --- lib/camelSCAD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/camelSCAD b/lib/camelSCAD index 21ee609..e5702b1 160000 --- a/lib/camelSCAD +++ b/lib/camelSCAD @@ -1 +1 @@ -Subproject commit 21ee609578e7aaed9670ae6362d5ce435abb2b25 +Subproject commit e5702b1f3d478ae272a01b92c1aad802c7ed84af From 16aacaaa4daf381ee4c3a6fd737caaf8d7b795e3 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 8 Apr 2020 19:22:17 +0200 Subject: [PATCH 157/191] Update camelSCAD to v0.12.1 --- lib/camelSCAD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/camelSCAD b/lib/camelSCAD index e5702b1..95661f9 160000 --- a/lib/camelSCAD +++ b/lib/camelSCAD @@ -1 +1 @@ -Subproject commit e5702b1f3d478ae272a01b92c1aad802c7ed84af +Subproject commit 95661f9a244ee8c81c130a44efc7593289829d65 From a04e3112d54f1b364f355f3d103ec0f3c80c5e0d Mon Sep 17 00:00:00 2001 From: jsconan Date: Thu, 9 Apr 2020 18:59:53 +0200 Subject: [PATCH 158/191] Add a ball bearing sleeve for a spool holder --- printer/bearing-spool-holder.scad | 93 +++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 printer/bearing-spool-holder.scad diff --git a/printer/bearing-spool-holder.scad b/printer/bearing-spool-holder.scad new file mode 100644 index 0000000..2385057 --- /dev/null +++ b/printer/bearing-spool-holder.scad @@ -0,0 +1,93 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A sleeve to adapt on a ball bearing axle for a spool holder. + * + * @author jsconan + * @version 0.1.0 + */ + +// As we need to use some shapes, use the right entry point of the library. +use <../lib/camelSCAD/shapes.scad> + +// To be able to use the library shared constants we import the definition file. +include <../lib/camelSCAD/core/constants.scad> + +// We will render the object using the specifications of this mode +renderMode = MODE_PROD; + +// Defines the constraints of the print. +printResolution = 0.2; // The target layer height +nozzleWidth = 0.4; // The size of the printer's nozzle +printTolerance = 0.1; // The print tolerance when pieces need to be assembled + +// Defines the constraints of the object. +spoolDiameter = 50; +bearingDiameter = 30; +bearingWidth = 9; +bearingAxle = 18; +flange = 10; +plate = 5; +tread = 35; +chamfer = 1; + +// Defines the dimensions of the object. +height = tread + plate; +flangeDiameter = spoolDiameter + flange * 2; +topBrim = (spoolDiameter - bearingAxle) / 2 - chamfer * 2; +bottomBrim = (flangeDiameter - bearingDiameter) / 2 - chamfer * 2; +innerFlange = flange - chamfer; +innerTread = tread - chamfer; +innerPlate = plate - chamfer * 2; +innerBearing = bearingWidth - chamfer; +innerAxle = height - bearingWidth - chamfer; + +startX = bearingDiameter / 2; +startY = bearingWidth; + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + rotate_extrude() { + polygon( + points=path([ + ["P", startX, startY], + ["H", -startX], + ["V", printResolution], + ["H", bearingAxle / 2], + ["V", innerAxle - printResolution], + ["L", chamfer, chamfer], + ["H", topBrim], + ["L", chamfer, -chamfer], + ["V", -innerTread], + ["H", innerFlange], + ["L", chamfer, -chamfer], + ["V", -innerPlate], + ["L", -chamfer, -chamfer], + ["H", -bottomBrim], + ["L", -chamfer, chamfer], + ["V", bearingWidth] + ]), + convexity=10 + ); + } +} From 2739c415bb342f036eb8814ffdbc6878e98ef219 Mon Sep 17 00:00:00 2001 From: jsconan Date: Thu, 9 Apr 2020 19:00:20 +0200 Subject: [PATCH 159/191] Add a sleeve for a printed axle of a spool holder --- printer/sleeve-spool-holder.scad | 86 ++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 printer/sleeve-spool-holder.scad diff --git a/printer/sleeve-spool-holder.scad b/printer/sleeve-spool-holder.scad new file mode 100644 index 0000000..9ed4b4f --- /dev/null +++ b/printer/sleeve-spool-holder.scad @@ -0,0 +1,86 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A sleeve to adapt on a printed axle for a spool holder. + * + * @author jsconan + * @version 0.1.0 + */ + +// As we need to use some shapes, use the right entry point of the library. +use <../lib/camelSCAD/shapes.scad> + +// To be able to use the library shared constants we import the definition file. +include <../lib/camelSCAD/core/constants.scad> + +// We will render the object using the specifications of this mode +renderMode = MODE_PROD; + +// Defines the constraints of the print. +printResolution = 0.2; // The target layer height +nozzleWidth = 0.4; // The size of the printer's nozzle +printTolerance = 0.1; // The print tolerance when pieces need to be assembled + +// Defines the constraints of the object. +spoolDiameter = 50; +axleDiameter = 26; +flange = 10; +plate = 3; +tread = 35; +chamfer = 1; + +// Defines the dimensions of the object. +height = tread + plate; +flangeDiameter = spoolDiameter + flange * 2; +topBrim = (spoolDiameter - axleDiameter) / 2 - chamfer; +bottomBrim = (flangeDiameter - axleDiameter) / 2 - chamfer; +innerFlange = flange - chamfer; +innerTread = tread - chamfer; +innerPlate = plate - chamfer * 2; +holeHeight = height - chamfer * 2; + +startX = axleDiameter / 2 + chamfer; +startY = 0; + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + rotate_extrude() { + polygon( + points=path([ + ["P", startX, startY], + ["L", -chamfer, chamfer], + ["V", holeHeight], + ["L", chamfer, chamfer], + ["H", topBrim], + ["L", chamfer, -chamfer], + ["V", -innerTread], + ["H", innerFlange], + ["L", chamfer, -chamfer], + ["V", -innerPlate], + ["L", -chamfer, -chamfer], + ["H", -bottomBrim] + ]), + convexity=10 + ); + } +} From 78b49a7a05d3f46bd9516a9037cb2c33421dab74 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 12 Apr 2020 11:03:23 +0200 Subject: [PATCH 160/191] Update camelSCAD to v0.13.0 --- lib/camelSCAD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/camelSCAD b/lib/camelSCAD index 95661f9..a75059e 160000 --- a/lib/camelSCAD +++ b/lib/camelSCAD @@ -1 +1 @@ -Subproject commit 95661f9a244ee8c81c130a44efc7593289829d65 +Subproject commit a75059edf758917bc81330c113345fe33ac1a453 From fe2bebe82fd5758cf492ddfc31273812d1f1eddb Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 12 Apr 2020 12:47:45 +0200 Subject: [PATCH 161/191] Update camelSCAD to v0.14.0 --- lib/camelSCAD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/camelSCAD b/lib/camelSCAD index a75059e..2e5a589 160000 --- a/lib/camelSCAD +++ b/lib/camelSCAD @@ -1 +1 @@ -Subproject commit a75059edf758917bc81330c113345fe33ac1a453 +Subproject commit 2e5a58990bcb19e82b821166570c920f8a951b7a From 18b11c4aff1e2b6a6a24876cb8dd8d0ea2afd3a9 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 12 Apr 2020 23:19:00 +0200 Subject: [PATCH 162/191] Add shapes for a curtain rod system --- misc/rod/config/config.scad | 60 ++++++++++++++ misc/rod/config/setup.scad | 40 +++++++++ misc/rod/shapes/bracket.scad | 141 +++++++++++++++++++++++++++++++ misc/rod/shapes/rod.scad | 156 +++++++++++++++++++++++++++++++++++ misc/rod/shapes/stopper.scad | 122 +++++++++++++++++++++++++++ 5 files changed, 519 insertions(+) create mode 100644 misc/rod/config/config.scad create mode 100644 misc/rod/config/setup.scad create mode 100644 misc/rod/shapes/bracket.scad create mode 100644 misc/rod/shapes/rod.scad create mode 100644 misc/rod/shapes/stopper.scad diff --git a/misc/rod/config/config.scad b/misc/rod/config/config.scad new file mode 100644 index 0000000..4afefd1 --- /dev/null +++ b/misc/rod/config/config.scad @@ -0,0 +1,60 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A curtain rod system. + * + * Configures the project. + * + * @author jsconan + */ + + projectVersion = "0.1.0"; + +// We will render the object using the specifications of this mode +renderMode = MODE_PROD; + +// Defines the constraints of the printer. +printResolution = 0.2; // The target layer height +nozzleWidth = 0.4; // The size of the printer's nozzle +printTolerance = 0.1; // The print tolerance when pieces need to be assembled + +// The dimensions and constraints of the elements +panelThickness = 23; // The thickness of the panel the bracket must fit + +rodWidth = 15; // The width of the rod +rodLength = 165; // The length of a rod piece +rodDiameter = [8, 10]; // The diameter of the rounded part of the rod and the bracket +rodThickness = 6; // The thickness of the rod + +rodStopperWidth = 30; // The width of the rod stoppers +rodStopperHeight = 30; // The height of the rod stoppers +rodStopperDiameter = 20; // The diameter of round part of the rod stoppers + +rodSleeveThickness = 1; // The thickness of the sleeve that will cover the rod at the link area +rodSleeveLength = 15; // The length of a rod sleeve + +rodBracketWidth = 10; // The width of a bracket +rodBracketHeight = 30; // The height of a bracket, including the rodThickness +rodBracketThickness = 2; // The thickness of a bracket +rodBracketHookThickness = 0.6; // The thickness of the hook that will clamp the panel +rodBracketHookHeight = 15; // The height of the hook that will clamp the panel diff --git a/misc/rod/config/setup.scad b/misc/rod/config/setup.scad new file mode 100644 index 0000000..1baeb19 --- /dev/null +++ b/misc/rod/config/setup.scad @@ -0,0 +1,40 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A curtain rod system. + * + * Setup the context. + * + * @author jsconan + */ + +// As we need to use some shapes, use the right entry point of the library. +include <../../../lib/camelSCAD/shapes.scad> + +// Then we need the config for the project, as well as the related functions +include + +// Finally, include the shapes +include <../shapes/rod.scad> +include <../shapes/stopper.scad> +include <../shapes/bracket.scad> diff --git a/misc/rod/shapes/bracket.scad b/misc/rod/shapes/bracket.scad new file mode 100644 index 0000000..5f42d0e --- /dev/null +++ b/misc/rod/shapes/bracket.scad @@ -0,0 +1,141 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A curtain rod system. + * + * Defines the shapes for the rod bracket. + * + * @author jsconan + */ + +/** + * Gets the outline of the bracket's profile + * @param Vector|Number rodDiameter + * @param Number rodWidth + * @param Number rodThickness + * @param Number panelWidth + * @param Number height + * @param Number thickness + * @param Number hookHeight + * @param Number hookThickness + */ +function getRodBracketProfilePoints(rodDiameter, rodWidth, rodThickness, panelWidth, height, thickness, hookHeight, hookThickness) = + let( + rodThickness = rodThickness + printTolerance, + radius = vadd(vector2D(rodDiameter / 2), printTolerance), + radiusOut = vadd(radius, thickness), + + rodRoundAngle = getChordAngle(length=rodThickness, radius=radius[0]), + rodRoundDistance = getChordDistance(angle=rodRoundAngle, radius=radius[0]), + rodRoundStartAngle = (180 - rodRoundAngle) / 2, + + rodRoundAngleOut = getChordAngle(length=rodThickness + thickness*2, radius=radiusOut[0]), + rodRoundDistanceOut = getChordDistance(angle=rodRoundAngleOut, radius=radiusOut[0]), + rodRoundStartAngleOut = (180 - rodRoundAngleOut) / 2, + + filletRod = thickness / 2, + filletHook = hookThickness / 2, + filletOut = thickness, + filletIn = 1, + innerHeight = height - filletOut - radiusOut[1], + innerWidth = panelWidth - filletIn * 2, + outerWidth = hookThickness + thickness + panelWidth - filletOut * 2, + hookInnerHeight = hookHeight - filletIn - filletHook, + hookOuterHeight = hookHeight + thickness - filletOut - filletHook, + rodHookInnerHeight = rodWidth - radius[1] - filletOut, + startX = 0, + startY = height / 2 - thickness - filletIn + ) + path([ + ["P", startX, startY], + ["C", filletIn, 0, 90], + ["H", -innerWidth], + ["C", filletIn, 90, 180], + ["V", -hookInnerHeight], + ["C", filletHook, 360, 180], + ["V", hookOuterHeight], + ["C", filletOut, 180, 90], + ["H", outerWidth], + ["C", filletOut, 90, 0], + ["V", -innerHeight - rodRoundDistance], + ["C", radius, 180 + rodRoundStartAngle, 360 - rodRoundStartAngle], + ["V", rodHookInnerHeight + rodRoundDistance], + ["C", filletRod, 180, 0], + ["V", -rodHookInnerHeight - rodRoundDistanceOut], + ["C", radiusOut, 360 - rodRoundStartAngleOut, 180 + rodRoundStartAngleOut] + ]) +; + +/** + * Draws the outline of the bracket's profile + * @param Vector|Number rodDiameter + * @param Number rodWidth + * @param Number panelWidth + * @param Number rodThickness + * @param Number height + * @param Number thickness + * @param Number hookHeight + * @param Number hookThickness + */ +module rodBracketProfile(rodDiameter, rodWidth, rodThickness, panelWidth, height, thickness, hookHeight, hookThickness) { + polygon( + points = getRodBracketProfilePoints( + rodDiameter = rodDiameter, + rodWidth = rodWidth, + rodThickness = rodThickness, + panelWidth = panelWidth, + height = height, + thickness = thickness, + hookHeight = hookHeight, + hookThickness = hookThickness + ), + convexity = 10 + ); +} + +/** + * Draws a rod bracket + * @param Vector|Number rodDiameter + * @param Number rodWidth + * @param Number panelWidth + * @param Number rodThickness + * @param Number width + * @param Number height + * @param Number thickness + * @param Number hookHeight + * @param Number hookThickness + */ +module rodBracket(rodDiameter, rodWidth, rodThickness, panelWidth, width, height, thickness, hookHeight, hookThickness) { + linear_extrude(height=width, center=true, convexity=10) { + rodBracketProfile( + rodDiameter = rodDiameter, + rodWidth = rodWidth, + rodThickness = rodThickness, + panelWidth = panelWidth, + height = height, + thickness = thickness, + hookHeight = hookHeight, + hookThickness = hookThickness + ); + } +} diff --git a/misc/rod/shapes/rod.scad b/misc/rod/shapes/rod.scad new file mode 100644 index 0000000..1c1615a --- /dev/null +++ b/misc/rod/shapes/rod.scad @@ -0,0 +1,156 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A curtain rod system. + * + * Defines the shapes for the rod. + * + * @author jsconan + */ + +/** + * Gets the outline of the rod's profile + * @param Vector|Number diameter + * @param Number width + * @param Number thickness + */ +function getRodProfilePoints(diameter, width, thickness) = + let( + diameter = vector2D(diameter), + thickness = min(thickness, diameter[0]), + radius = diameter / 2, + origin = [0, max(0, max(diameter[1], width) - diameter[1])] / 2, + angle1 = (180 - getChordAngle(length=thickness, radius=radius[0])) / 2, + angle2 = 180 - angle1, + angle3 = 180 + angle1, + angle4 = 180 + angle2 + ) + concat( + arc(r=radius, o=origin, a1=angle1, a2=angle2), + arc(r=radius, o=-origin, a1=angle3, a2=angle4) + ) +; + +/** + * Draws the outline of the rod's profile + * @param Vector|Number diameter + * @param Number width + * @param Number thickness + * @param Number distance + */ +module rodProfile(diameter, width, thickness, distance = 0) { + polygon( + points = outline( + points = getRodProfilePoints( + diameter = diameter, + width = width, + thickness = thickness + ), + distance = distance + ), + convexity = 10 + ); +} + +/** + * Draws a rod + * @param Vector|Number diameter + * @param Number length + * @param Number width + * @param Number thickness + */ +module rodBody(diameter, length, width, thickness) { + rotateY(90) { + linear_extrude(height=length, center=true, convexity=10) { + rodProfile( + diameter = diameter, + width = width, + thickness = thickness + ); + } + } +} + +/** + * Draws a rod + * @param Vector|Number diameter + * @param Number length + * @param Number width + * @param Number thickness + */ +module rod(diameter, length, width, thickness) { + linkBase = width / 4; + translateX(-length / 2) { + link( + neck = linkBase, + bulb = linkBase, + height = thickness, + center = true + ); + } + difference() { + rodBody( + diameter = diameter, + length = length, + width = width, + thickness = thickness + ); + translateX(length / 2) { + link( + neck = linkBase, + bulb = linkBase, + height = thickness + 1, + distance = printTolerance, + center = true + ); + } + } +} + +/** + * Draws a rod sleeve + * @param Vector|Number diameter + * @param Number thickness + * @param Number width + * @param Number sleeveLength + * @param Number sleeveThickness + */ +module rodSleeve(diameter, width, thickness, sleeveLength, sleeveThickness) { + distance = printTolerance / 2; + linear_extrude(height=sleeveLength, center=true, convexity=10) { + difference() { + rodProfile( + diameter = diameter, + width = width, + thickness = thickness, + distance = distance + sleeveThickness + ); + rodProfile( + diameter = diameter, + width = width, + thickness = thickness, + distance = distance + ); + } + } +} diff --git a/misc/rod/shapes/stopper.scad b/misc/rod/shapes/stopper.scad new file mode 100644 index 0000000..f98e8a2 --- /dev/null +++ b/misc/rod/shapes/stopper.scad @@ -0,0 +1,122 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A curtain rod system. + * + * Defines the shapes for the rod stoppers. + * + * @author jsconan + */ + +/** + * Draws a rod stopper + * @param Number width + * @param Number height + * @param Number diameter + * @param Number thickness + */ +module rodStopper(width, height, diameter, thickness, rodWidth, rodDiameter) { + diameter = vector2D(diameter); + stopperWidth = diameter[0]; + stopperHeight = max(height, diameter[1] + rodWidth); + rodLength = width - stopperWidth; + + translateX(-rodLength / 2) { + linear_extrude(height=thickness, center=true, convexity=10) { + stadium( + w = stopperWidth, + h = stopperHeight, + d = diameter + ); + } + translateX((diameter[0] + rodLength) / 2) { + rodBody( + diameter = rodDiameter, + length = rodLength, + width = rodWidth, + thickness = thickness + ); + } + } +} + +/** + * Draws a rod stopper with a male connector + * @param Number width + * @param Number height + * @param Number diameter + * @param Number thickness + * @param Number rodWidth + */ +module rodStopperMale(width, height, diameter, thickness, rodWidth, rodDiameter) { + linkBase = rodWidth / 4; + translateX(-width / 2) { + link( + neck = linkBase, + bulb = linkBase, + height = thickness, + center = true + ); + } + rotateZ(180) { + rodStopper( + width = width, + height = height, + diameter = diameter, + thickness = thickness, + rodWidth = rodWidth, + rodDiameter = rodDiameter + ); + } +} + +/** + * Draws a rod stopper with a female connector + * @param Number width + * @param Number height + * @param Number diameter + * @param Number thickness + * @param Number rodWidth + */ +module rodStopperFemale(width, height, diameter, thickness, rodWidth, rodDiameter) { + linkBase = rodWidth / 4; + difference() { + rodStopper( + width = width, + height = height, + diameter = diameter, + thickness = thickness, + rodWidth = rodWidth, + rodDiameter = rodDiameter + ); + translateX(width / 2) { + link( + neck = linkBase, + bulb = linkBase, + height = thickness + 1, + distance = printTolerance, + center = true + ); + } + } +} From 9101593000b4c6e7fbd63a24683ee2301cbf1b4b Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 12 Apr 2020 23:19:22 +0200 Subject: [PATCH 163/191] Add elements for a curtain rod system --- misc/rod/curtain-rod-bracket.scad | 50 ++++++++++++++++++++++++++ misc/rod/curtain-rod-sleeve.scad | 46 ++++++++++++++++++++++++ misc/rod/curtain-rod-stoppers.scad | 57 ++++++++++++++++++++++++++++++ misc/rod/curtain-rod.scad | 45 +++++++++++++++++++++++ 4 files changed, 198 insertions(+) create mode 100644 misc/rod/curtain-rod-bracket.scad create mode 100644 misc/rod/curtain-rod-sleeve.scad create mode 100644 misc/rod/curtain-rod-stoppers.scad create mode 100644 misc/rod/curtain-rod.scad diff --git a/misc/rod/curtain-rod-bracket.scad b/misc/rod/curtain-rod-bracket.scad new file mode 100644 index 0000000..e4b1594 --- /dev/null +++ b/misc/rod/curtain-rod-bracket.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A curtain rod system. + * + * A bracket to suspend a curtain rod to a window or to a door + * + * @author jsconan + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +// Displays a build box visualization to preview the printer area. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + rodBracket( + rodDiameter = rodDiameter, + rodWidth = rodWidth, + rodThickness = rodThickness, + panelWidth = panelThickness, + width = rodBracketWidth, + height = rodBracketHeight, + thickness = rodBracketThickness, + hookHeight = rodBracketHookHeight, + hookThickness = rodBracketHookThickness + ); +} diff --git a/misc/rod/curtain-rod-sleeve.scad b/misc/rod/curtain-rod-sleeve.scad new file mode 100644 index 0000000..02cd3dc --- /dev/null +++ b/misc/rod/curtain-rod-sleeve.scad @@ -0,0 +1,46 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A curtain rod system. + * + * A sleeve that will cover the link area of an assembled curtain rod. + * + * @author jsconan + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +// Displays a build box visualization to preview the printer area. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + rodSleeve( + diameter = rodDiameter, + width = rodWidth, + thickness = rodThickness, + sleeveLength = rodSleeveLength, + sleeveThickness = rodSleeveThickness + ); +} diff --git a/misc/rod/curtain-rod-stoppers.scad b/misc/rod/curtain-rod-stoppers.scad new file mode 100644 index 0000000..70ef24c --- /dev/null +++ b/misc/rod/curtain-rod-stoppers.scad @@ -0,0 +1,57 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A curtain rod system. + * + * A set of rod stoppers + * + * @author jsconan + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +// Displays a build box visualization to preview the printer area. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + distribute(interval=[rodStopperWidth + 5, 0, 0], center=true) { + rodStopperMale( + width = rodStopperWidth, + height = rodStopperHeight, + diameter = rodStopperDiameter, + thickness = rodThickness, + rodWidth = rodWidth, + rodDiameter = rodDiameter + ); + rodStopperFemale( + width = rodStopperWidth, + height = rodStopperHeight, + diameter = rodStopperDiameter, + thickness = rodThickness, + rodWidth = rodWidth, + rodDiameter = rodDiameter + ); + } +} diff --git a/misc/rod/curtain-rod.scad b/misc/rod/curtain-rod.scad new file mode 100644 index 0000000..e717fd7 --- /dev/null +++ b/misc/rod/curtain-rod.scad @@ -0,0 +1,45 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2020 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A curtain rod system. + * + * An assembled curtain rod + * + * @author jsconan + */ + +// Import the project's setup. +include + +// Sets the minimum facet angle and size using the defined render mode. +// Displays a build box visualization to preview the printer area. +applyMode(mode=renderMode) { + // Uncomment the next line to cut a sample from the object + //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) + rod( + diameter = rodDiameter, + length = rodLength, + width = rodWidth, + thickness = rodThickness + ); +} From 67accf5008fae2c099dc50b4236765bc5ce6e940 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 12 Apr 2020 23:19:36 +0200 Subject: [PATCH 164/191] Add render script --- misc/rod/.gitignore | 3 +++ misc/rod/render.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 misc/rod/.gitignore create mode 100755 misc/rod/render.sh diff --git a/misc/rod/.gitignore b/misc/rod/.gitignore new file mode 100644 index 0000000..e4a80ae --- /dev/null +++ b/misc/rod/.gitignore @@ -0,0 +1,3 @@ +/output +/dist +/config/config.ini diff --git a/misc/rod/render.sh b/misc/rod/render.sh new file mode 100755 index 0000000..38694e4 --- /dev/null +++ b/misc/rod/render.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# +# GPLv3 License +# +# Copyright (c) 2020 Jean-Sebastien CONAN +# +# This file is part of jsconan/things. +# +# jsconan/things is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# jsconan/things is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with jsconan/things. If not, see . +# + +# +# A curtain rod system. +# +# Generates the STL files for the project. +# +# @author jsconan +# + +# redirect to the lib utils +"$(dirname $0)/../../lib/camelSCAD/scripts/render.sh" "$@" From 7c4de97a17e6370d4041a5b44820df0a8ccf9370 Mon Sep 17 00:00:00 2001 From: jsconan Date: Mon, 13 Apr 2020 16:09:23 +0200 Subject: [PATCH 165/191] Update camelSCAD to v0.14.1 --- lib/camelSCAD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/camelSCAD b/lib/camelSCAD index 2e5a589..294a382 160000 --- a/lib/camelSCAD +++ b/lib/camelSCAD @@ -1 +1 @@ -Subproject commit 2e5a58990bcb19e82b821166570c920f8a951b7a +Subproject commit 294a382625217bef0e095d21c4e5dc77c4c22781 From ee463722f27274460be21cc4998d1527629c3b23 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 31 Dec 2021 20:28:26 +0100 Subject: [PATCH 166/191] Add a cross-mark helper to place a handle on a door --- tools/handle-helper.scad | 83 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 tools/handle-helper.scad diff --git a/tools/handle-helper.scad b/tools/handle-helper.scad new file mode 100644 index 0000000..8bb87f1 --- /dev/null +++ b/tools/handle-helper.scad @@ -0,0 +1,83 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2021 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A helper to place an ikea handle. + * + * @author jsconan + * @version 0.1.0 + */ + +// As we need to use some shapes, use the right entry point of the library. +use <../lib/camelSCAD/shapes.scad> + +// To be able to use the library shared constants we import the definition file. +include <../lib/camelSCAD/core/constants.scad> + +// We will render the object using the specifications of this mode +renderMode = MODE_PROD; + +// Defines the constraints of the object. +pencilLeadSize = 0.7; +markWidth = 20; +markCount = 2; +markInterval = 96; +markX = 15; +markY = 15; +paddingX = 30; +paddingY = 5; +plateThickness = .6; +wallThickness = .5; +wallHeight = 10; + +// Defines the dimensions of the object. +innerLength = markInterval * (markCount - 1); +length =innerLength + (markX + paddingX) * 2; +width = (markY + paddingY) * 2; + +// Draws a cross-mark at the origin +module mark(width, height, thickness) { + box([width, thickness, height], center=true); + box([thickness, width, height], center=true); +} + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + repeatMirror(axis = [0, 1, 0]) { + translateY(width/2 + 10) { + difference() { + box([length, width, wallHeight]); + translate([wallThickness, wallThickness, plateThickness]) { + box([length, width, wallHeight]); + } + translateX(-innerLength / 2) { + repeat( + count = markCount, + intervalX = markInterval + ) { + mark(markWidth, wallHeight, pencilLeadSize); + } + } + } + } + } +} From 488bc2b55b722f77c7811ac280700d18627c57c6 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 31 Dec 2021 20:30:57 +0100 Subject: [PATCH 167/191] dd a label holder --- misc/label.scad | 79 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 misc/label.scad diff --git a/misc/label.scad b/misc/label.scad new file mode 100644 index 0000000..fecd648 --- /dev/null +++ b/misc/label.scad @@ -0,0 +1,79 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2021 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A label holder. + * + * @author jsconan + * @version 0.1.0 + */ + +// As we need to use some shapes, use the right entry point of the library. +use <../lib/camelSCAD/shapes.scad> + +// To be able to use the library shared constants we import the definition file. +include <../lib/camelSCAD/core/constants.scad> + +// We will render the object using the specifications of this mode +renderMode = MODE_PROD; + +// Defines the constraints of the object. +holeDiameter = 6; +holePadding = 2; +labelWidth = 37; +labelLength = 70; +labelThickness = .8; +labelPocketThickness = .2; +labelPocketMargin = .8; +labelPocketPadding = .5; + +// Defines the dimensions of the object. +padding = labelPocketMargin + labelPocketPadding; +width = labelWidth + 2 * padding; +length = labelLength + 2 * padding; +roundRadius = holeDiameter / 2 + holePadding; +roundDiff = pythagoras(a=roundRadius, b=roundRadius) - roundRadius; +arrowWidth = width * cos(45); +arrowInnerWidth = arrowWidth + roundRadius - roundDiff; +arrowHeight = pythagoras(a=arrowWidth, b=arrowWidth) / 2; +pocketLength = labelLength + labelPocketPadding * 2; +pocketWidth = labelWidth + labelPocketPadding * 2; + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + difference() { + linear_extrude(height=labelThickness) { + rotateZ(45) { + roundedRectangle(size=arrowInnerWidth, r=roundRadius); + } + translateX(length / 2) { + rectangle([length, width]); + } + } + translateX(roundRadius - arrowHeight) { + cylinder(d=holeDiameter, h=labelThickness * 3, center=true); + } + translate([length / 2, 0, labelThickness - labelPocketThickness]) { + box([pocketLength, pocketWidth, labelThickness]); + } + } +} From 8ed4a0f25cbae5654dc0af814e9839d636bb9940 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 31 Dec 2021 22:09:25 +0100 Subject: [PATCH 168/191] Fix typo in comments --- rcmodels/tracks/config/values.scad | 4 ++-- rcmodels/tracks/render.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad index 11d1c17..c069f02 100644 --- a/rcmodels/tracks/config/values.scad +++ b/rcmodels/tracks/config/values.scad @@ -29,14 +29,14 @@ */ /** - * Alligns a value with respect to the target layer height. + * Aligns a value with respect to the target layer height. * @param Number value * @returns Number */ function layerAligned(value) = roundBy(value, printResolution); /** - * Alligns a value with respect to the target nozzle size. + * Aligns a value with respect to the target nozzle size. * @param Number value * @returns Number */ diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh index 40f7477..b9bd2f3 100755 --- a/rcmodels/tracks/render.sh +++ b/rcmodels/tracks/render.sh @@ -194,7 +194,7 @@ while (( "$#" )); do shift done -# allign values +# align values if [ "${trackSectionLength}" != "" ]; then if [ "${trackSectionWidth}" == "" ]; then trackSectionWidth=$((${trackSectionLength} * 2)) From b88781809022e8cc6b09888a7c96251c57f747b2 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 31 Dec 2021 22:15:57 +0100 Subject: [PATCH 169/191] Fix the shape barrierLinkProfile, use the shared internal shape insteaf of redefining it --- rcmodels/tracks/shapes/profiles.scad | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad index 018bdb4..9c4cdd5 100644 --- a/rcmodels/tracks/shapes/profiles.scad +++ b/rcmodels/tracks/shapes/profiles.scad @@ -34,16 +34,11 @@ * @param Number [distance] - An additional distance added to the outline of the profile. */ module barrierLinkProfile(base, distance = 0) { - half = base / 2; - - polygon(outline(path([ - ["P", half, half], - ["H", -base], - ["C", [half, half], 0, 180], - ["V", -base], - ["C", [half, half], 180, 360], - ["H", base], - ]), distance), convexity = 10); + linkProfile( + neck = [base / 2, base], + bulb = base, + distance = distance + ); } /** From 830e421c53a4a6a05420bc4805c2fd5369e47ab9 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 31 Dec 2021 22:16:43 +0100 Subject: [PATCH 170/191] Add default printer config --- rcmodels/tracks/.gitignore | 1 + rcmodels/tracks/config/config-dist.ini | 242 +++++++++++++++++++++++++ 2 files changed, 243 insertions(+) create mode 100644 rcmodels/tracks/config/config-dist.ini diff --git a/rcmodels/tracks/.gitignore b/rcmodels/tracks/.gitignore index 89f984e..e4a80ae 100644 --- a/rcmodels/tracks/.gitignore +++ b/rcmodels/tracks/.gitignore @@ -1,2 +1,3 @@ /output /dist +/config/config.ini diff --git a/rcmodels/tracks/config/config-dist.ini b/rcmodels/tracks/config/config-dist.ini new file mode 100644 index 0000000..52e5457 --- /dev/null +++ b/rcmodels/tracks/config/config-dist.ini @@ -0,0 +1,242 @@ +# generated by PrusaSlicer 2.2.0+ on 2020-04-10 at 09:30:48 UTC +avoid_crossing_perimeters = 0 +bed_custom_model = +bed_custom_texture = +bed_shape = 0x0,250x0,250x210,0x210 +bed_temperature = 60 +before_layer_gcode = ;BEFORE_LAYER_CHANGE\nG92 E0.0\n;[layer_z]\n\n +between_objects_gcode = +bottom_fill_pattern = rectilinear +bottom_solid_layers = 4 +bottom_solid_min_thickness = 0.5 +bridge_acceleration = 1000 +bridge_angle = 0 +bridge_fan_speed = 100 +bridge_flow_ratio = 0.95 +bridge_speed = 30 +brim_width = 0 +clip_multipart_objects = 1 +colorprint_heights = +compatible_printers_condition_cummulative = "printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK3.*/ and nozzle_diameter[0]==0.4";"! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material)" +complete_objects = 0 +cooling = 1 +cooling_tube_length = 5 +cooling_tube_retraction = 91.5 +default_acceleration = 1000 +default_filament_profile = "Prusament PLA" +default_print_profile = 0.15mm QUALITY @MK3 +deretract_speed = 0 +disable_fan_first_layers = 1 +dont_support_bridges = 1 +draft_shield = 0 +duplicate_distance = 6 +elefant_foot_compensation = 0.2 +end_filament_gcode = "; Filament-specific end gcode" +end_gcode = G4 ; wait\nM221 S100\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+30, max_print_height)}{endif} ; Move print head up\nG1 X0 Y200 F3000 ; home X axis\nM84 ; disable motors +ensure_vertical_shell_thickness = 1 +external_perimeter_extrusion_width = 0.5 +external_perimeter_speed = 70 +external_perimeters_first = 0 +extra_loading_move = -2 +extra_perimeters = 1 +extruder_clearance_height = 20 +extruder_clearance_radius = 45 +extruder_colour = "" +extruder_offset = 0x0 +extrusion_axis = E +extrusion_multiplier = 1 +extrusion_width = 0.45 +fan_always_on = 1 +fan_below_layer_time = 100 +filament_colour = #FF8000 +filament_cooling_final_speed = 3.4 +filament_cooling_initial_speed = 2.2 +filament_cooling_moves = 4 +filament_cost = 24.99 +filament_density = 1.24 +filament_deretract_speed = nil +filament_diameter = 1.75 +filament_load_time = 0 +filament_loading_speed = 28 +filament_loading_speed_start = 3 +filament_max_volumetric_speed = 15 +filament_minimal_purge_on_wipe_tower = 15 +filament_notes = "Affordable filament for everyday printing in premium quality manufactured in-house by Josef Prusa" +filament_ramming_parameters = "120 100 6.6 6.8 7.2 7.6 7.9 8.2 8.7 9.4 9.9 10.0| 0.05 6.6 0.45 6.8 0.95 7.8 1.45 8.3 1.95 9.7 2.45 10 2.95 7.6 3.45 7.6 3.95 7.6 4.45 7.6 4.95 7.6" +filament_retract_before_travel = nil +filament_retract_before_wipe = nil +filament_retract_layer_change = nil +filament_retract_length = nil +filament_retract_lift = nil +filament_retract_lift_above = nil +filament_retract_lift_below = nil +filament_retract_restart_extra = nil +filament_retract_speed = nil +filament_settings_id = "Prusament PLA" +filament_soluble = 0 +filament_toolchange_delay = 0 +filament_type = PLA +filament_unload_time = 0 +filament_unloading_speed = 90 +filament_unloading_speed_start = 100 +filament_vendor = Prusa Polymers +filament_wipe = nil +fill_angle = 45 +fill_density = 0% +fill_pattern = grid +first_layer_acceleration = 1000 +first_layer_bed_temperature = 60 +first_layer_extrusion_width = 0.42 +first_layer_height = 0.2 +first_layer_speed = 20 +first_layer_temperature = 215 +gap_fill_speed = 40 +gcode_comments = 0 +gcode_flavor = marlin +gcode_label_objects = 0 +high_current_on_filament_swap = 0 +host_type = octoprint +infill_acceleration = 1000 +infill_every_layers = 1 +infill_extruder = 1 +infill_extrusion_width = 0.45 +infill_first = 0 +infill_only_where_needed = 0 +infill_overlap = 25% +infill_speed = 200 +inherits_cummulative = "0.20mm SPEED @MK3";; +interface_shells = 0 +layer_gcode = ;AFTER_LAYER_CHANGE\n;[layer_z] +layer_height = 0.2 +machine_max_acceleration_e = 5000,5000 +machine_max_acceleration_extruding = 1250,1250 +machine_max_acceleration_retracting = 1250,1250 +machine_max_acceleration_x = 1000,960 +machine_max_acceleration_y = 1000,960 +machine_max_acceleration_z = 1000,1000 +machine_max_feedrate_e = 120,120 +machine_max_feedrate_x = 200,100 +machine_max_feedrate_y = 200,100 +machine_max_feedrate_z = 12,12 +machine_max_jerk_e = 4.5,4.5 +machine_max_jerk_x = 8,8 +machine_max_jerk_y = 8,8 +machine_max_jerk_z = 0.4,0.4 +machine_min_extruding_rate = 0,0 +machine_min_travel_rate = 0,0 +max_fan_speed = 100 +max_layer_height = 0.25 +max_print_height = 210 +max_print_speed = 200 +max_volumetric_speed = 0 +min_fan_speed = 100 +min_layer_height = 0.07 +min_print_speed = 15 +min_skirt_length = 4 +notes = +nozzle_diameter = 0.4 +only_retract_when_crossing_perimeters = 1 +ooze_prevention = 0 +output_filename_format = {input_filename_base}_{layer_height}mm_{filament_type[0]}_{printer_model}_{print_time}.gcode +overhangs = 0 +parking_pos_retraction = 92 +perimeter_acceleration = 800 +perimeter_extruder = 1 +perimeter_extrusion_width = 0.6 +perimeter_speed = 120 +perimeters = 2 +post_process = +print_host = +print_settings_id = 0.20mm FAST & EMPTY @MK3 +printer_model = MK3 +printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_MK3\n +printer_settings_id = Original Prusa i3 MK3 +printer_technology = FFF +printer_variant = 0.4 +printer_vendor = +printhost_apikey = +printhost_cafile = +raft_layers = 0 +remaining_times = 1 +resolution = 0 +retract_before_travel = 1 +retract_before_wipe = 0% +retract_layer_change = 1 +retract_length = 0.8 +retract_length_toolchange = 4 +retract_lift = 0.6 +retract_lift_above = 0 +retract_lift_below = 209 +retract_restart_extra = 0 +retract_restart_extra_toolchange = 0 +retract_speed = 35 +seam_position = nearest +serial_port = +serial_speed = 250000 +silent_mode = 1 +single_extruder_multi_material = 0 +single_extruder_multi_material_priming = 0 +skirt_distance = 2 +skirt_height = 3 +skirts = 1 +slice_closing_radius = 0.049 +slowdown_below_layer_time = 20 +small_perimeter_speed = 50 +solid_infill_below_area = 0 +solid_infill_every_layers = 0 +solid_infill_extruder = 1 +solid_infill_extrusion_width = 0.45 +solid_infill_speed = 200 +spiral_vase = 0 +standby_temperature_delta = -5 +start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.6}0.12{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/}0.2{elsif printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}200{elsif nozzle_diameter[0]==0.6}18{else}30{endif} ; Filament gcode" +start_gcode = M862.3 P "[printer_model]" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.8.1 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\nG1 Y-3.0 F1000.0 ; go outside print area\nG92 E0.0\nG1 X60.0 E9.0 F1000.0 ; intro line\nG1 X100.0 E12.5 F1000.0 ; intro line\nG92 E0.0\nM221 S{if layer_height<0.075}100{else}95{endif} +support_material = 0 +support_material_angle = 0 +support_material_auto = 1 +support_material_buildplate_only = 0 +support_material_contact_distance = 0.1 +support_material_enforce_layers = 0 +support_material_extruder = 0 +support_material_extrusion_width = 0.35 +support_material_interface_contact_loops = 0 +support_material_interface_extruder = 0 +support_material_interface_layers = 2 +support_material_interface_spacing = 0.2 +support_material_interface_speed = 100% +support_material_pattern = rectilinear +support_material_spacing = 2 +support_material_speed = 50 +support_material_synchronize_layers = 0 +support_material_threshold = 55 +support_material_with_sheath = 0 +support_material_xy_spacing = 50% +temperature = 215 +thin_walls = 1 +threads = 8 +thumbnails = +toolchange_gcode = +top_fill_pattern = rectilinear +top_infill_extrusion_width = 0.4 +top_solid_infill_speed = 50 +top_solid_layers = 5 +top_solid_min_thickness = 0.6 +travel_speed = 180 +use_firmware_retraction = 0 +use_relative_e_distances = 1 +use_volumetric_e = 0 +variable_layer_height = 1 +wipe = 1 +wipe_into_infill = 0 +wipe_into_objects = 0 +wipe_tower = 1 +wipe_tower_bridging = 10 +wipe_tower_no_sparse_layers = 0 +wipe_tower_rotation_angle = 0 +wipe_tower_width = 60 +wipe_tower_x = 170 +wipe_tower_y = 125 +wiping_volumes_extruders = 70,70 +wiping_volumes_matrix = 0 +xy_size_compensation = 0 +z_offset = 0 From 2832e2f0d1591a7f1109d9fd93c311b0c0d8addc Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 31 Dec 2021 22:17:38 +0100 Subject: [PATCH 171/191] Add slicer script --- rcmodels/tracks/slice.sh | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 rcmodels/tracks/slice.sh diff --git a/rcmodels/tracks/slice.sh b/rcmodels/tracks/slice.sh new file mode 100755 index 0000000..2a2f3ed --- /dev/null +++ b/rcmodels/tracks/slice.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# GPLv3 License +# +# Copyright (c) 2020 Jean-Sebastien CONAN +# +# This file is part of jsconan/things. +# +# jsconan/things is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# jsconan/things is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with jsconan/things. If not, see . +# + +# +# A race track system for 1/24 to 1/32 scale RC cars. +# +# Slices the STL files for the project. +# +# @author jsconan +# + +# script config +configpath="config/config.ini" +configdefault="config/config-dist.ini" + +# defines the config path +if [ "${configpath}" != "" ] && [ ! -f "${configpath}" ]; then + printmessage "${C_ERR}Warning! The config for Slic3r does not exist.\nWill use the default one" + cp "${configdefault}" "${configpath}" +fi + +# redirect to the lib utils +"$(dirname $0)/../../lib/camelSCAD/scripts/slice.sh" \ + --input "output" \ + --output "dist" \ + --config "${configpath}" \ + --prusaslicer \ + --recurse \ + "$@" From 50fa385cf625c78f641960741908b3726f7954cd Mon Sep 17 00:00:00 2001 From: jsconan Date: Tue, 4 Jan 2022 17:50:12 +0100 Subject: [PATCH 172/191] Add a hook model that fits onto a cabinet door --- misc/hook.scad | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 misc/hook.scad diff --git a/misc/hook.scad b/misc/hook.scad new file mode 100644 index 0000000..dea29e0 --- /dev/null +++ b/misc/hook.scad @@ -0,0 +1,96 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2022 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A hook that fits onto a cabinet door. + * + * @author jsconan + * @version 0.1.0 + */ + +// As we need to use some shapes, use the right entry point of the library. +use <../lib/camelSCAD/shapes.scad> + +// To be able to use the library shared constants we import the definition file. +include <../lib/camelSCAD/core/constants.scad> + +// We will render the object using the specifications of this mode +renderMode = MODE_PROD; + +// Defines the constraints of the object. +doorThickness = 16; +thickness = 3; +width = 15; +length = 60; +flange = 10; +hookDepth = 12; +hookHeight = 10; +roundRadius = 5; + +// Defines the dimensions of the object. +radius = thickness / 2; +flangeInnerHeight = flange - radius; +flangeOuterHeight = flangeInnerHeight + thickness - radius; +doorInnerThickness = doorThickness; +doorOuterThickness = doorInnerThickness + (thickness - radius) * 2; +hookInnerHeight = hookHeight - radius; +hookOuterHeight = hookOuterHeight; +hookInnerRadius = hookDepth / 2; +hookOuterRadius = hookInnerRadius + thickness; +innerLength = length - hookOuterRadius - thickness; +outerLength = innerLength + thickness - radius; + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // sample([100, 100, 3]) + difference() { + linear_extrude(height=width) { + polygon(path([ + ["P", 0, -radius], + ["C", radius, 180, 0], + ["V", -hookInnerHeight], + ["C", hookOuterRadius, 360, 180], + ["V", innerLength], + ["H", -doorInnerThickness], + ["V", -flangeInnerHeight], + ["C", radius, 360, 180], + ["V", flangeOuterHeight], + ["C", radius, 180, 90], + ["H", doorOuterThickness], + ["C", radius, 90, 0], + ["V", -outerLength], + ["C", hookInnerRadius, 180, 360], + ]), convexity = 10); + } + + translate([thickness, 0, width] / 2) { + rotateY(90) { + translateX(-width / 2) { + roundedCornerWedge(r=roundRadius, h=thickness*2, p=[1,-1], adjust=1, center=true); + translateX(width) { + roundedCornerWedge(r=roundRadius, h=thickness*2, p=[-1,-1], adjust=1, center=true); + } + } + } + } + } +} From a157a1eb3351f6903e02170003012cfd873ea47e Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 7 Jan 2022 12:11:17 +0100 Subject: [PATCH 173/191] Move the race track systems for RC cars to another repo --- rcmodels/tracks/.gitignore | 3 - rcmodels/tracks/config/config-dist.ini | 242 ----------- rcmodels/tracks/config/config.scad | 63 --- rcmodels/tracks/config/print.scad | 42 -- rcmodels/tracks/config/setup.scad | 56 --- rcmodels/tracks/config/values.scad | 377 ------------------ .../tracks/parts/accessories/bent-mast.scad | 98 ----- .../tracks/parts/accessories/cable-clip.scad | 93 ----- .../parts/accessories/straight-flag.scad | 95 ----- .../parts/accessories/straight-mast.scad | 95 ----- .../tracks/parts/accessories/wavy-flag.scad | 95 ----- .../parts/elements/curved/curved-inner.scad | 104 ----- .../parts/elements/curved/curved-outer.scad | 104 ----- .../parts/elements/curved/curved-short.scad | 105 ----- .../parts/elements/curved/curved-small.scad | 106 ----- .../parts/elements/curved/curved-uturn.scad | 104 ----- .../parts/elements/straight/arch-tower.scad | 102 ----- .../parts/elements/straight/body-curved.scad | 84 ---- .../elements/straight/body-straight.scad | 84 ---- .../parts/elements/straight/body-uturn.scad | 96 ----- .../elements/straight/straight-double.scad | 95 ----- .../elements/straight/straight-simple.scad | 95 ----- .../elements/straight/straight-uturn.scad | 94 ----- .../samples/curved/curved-inner-full.scad | 104 ----- .../parts/samples/curved/curved-inner.scad | 104 ----- .../samples/curved/curved-outer-full.scad | 104 ----- .../parts/samples/curved/curved-outer.scad | 104 ----- .../parts/samples/curved/curved-short.scad | 104 ----- .../parts/samples/curved/curved-small.scad | 104 ----- .../parts/samples/curved/curved-uturn.scad | 151 ------- .../parts/samples/straight/arch-sample.scad | 156 -------- .../samples/straight/straight-double.scad | 94 ----- .../parts/samples/straight/straight-long.scad | 94 ----- .../samples/straight/straight-simple.scad | 94 ----- .../samples/straight/straight-uturn.scad | 94 ----- .../parts/unibody/curved/curved-inner.scad | 105 ----- .../parts/unibody/curved/curved-outer.scad | 105 ----- .../parts/unibody/curved/curved-short.scad | 106 ----- .../parts/unibody/curved/curved-small.scad | 106 ----- .../parts/unibody/curved/curved-uturn.scad | 104 ----- .../unibody/straight/straight-connector.scad | 112 ------ .../unibody/straight/straight-double.scad | 95 ----- .../unibody/straight/straight-simple.scad | 95 ----- .../unibody/straight/straight-uturn.scad | 95 ----- .../tracks/plates/accessories/bent-mast.scad | 50 --- .../tracks/plates/accessories/cable-clip.scad | 50 --- .../plates/accessories/straight-flag.scad | 50 --- .../plates/accessories/straight-mast.scad | 50 --- .../tracks/plates/accessories/wavy-flag.scad | 50 --- .../plates/elements/curved/curved-inner.scad | 48 --- .../plates/elements/curved/curved-outer.scad | 48 --- .../plates/elements/curved/curved-short.scad | 55 --- .../plates/elements/curved/curved-small.scad | 48 --- .../plates/elements/curved/curved-uturn.scad | 48 --- .../plates/elements/straight/arch-tower.scad | 50 --- .../plates/elements/straight/body-curved.scad | 50 --- .../elements/straight/body-straight.scad | 50 --- .../plates/elements/straight/body-uturn.scad | 48 --- .../elements/straight/straight-double.scad | 48 --- .../elements/straight/straight-simple.scad | 48 --- .../elements/straight/straight-uturn.scad | 50 --- .../samples/curved/curved-inner-full.scad | 50 --- .../plates/samples/curved/curved-inner.scad | 50 --- .../samples/curved/curved-outer-full.scad | 50 --- .../plates/samples/curved/curved-outer.scad | 50 --- .../plates/samples/curved/curved-short.scad | 50 --- .../plates/samples/curved/curved-small.scad | 50 --- .../plates/samples/curved/curved-uturn.scad | 50 --- .../plates/samples/straight/arch-sample.scad | 50 --- .../samples/straight/straight-double.scad | 50 --- .../samples/straight/straight-long.scad | 48 --- .../samples/straight/straight-simple.scad | 50 --- .../samples/straight/straight-uturn.scad | 50 --- .../plates/unibody/curved/curved-inner.scad | 48 --- .../plates/unibody/curved/curved-outer.scad | 48 --- .../plates/unibody/curved/curved-short.scad | 55 --- .../plates/unibody/curved/curved-small.scad | 48 --- .../plates/unibody/curved/curved-uturn.scad | 48 --- .../unibody/straight/straight-connector.scad | 50 --- .../unibody/straight/straight-double.scad | 49 --- .../unibody/straight/straight-simple.scad | 48 --- .../unibody/straight/straight-uturn.scad | 50 --- rcmodels/tracks/render.sh | 264 ------------ rcmodels/tracks/shapes/accessories.scad | 370 ----------------- rcmodels/tracks/shapes/arch.scad | 161 -------- rcmodels/tracks/shapes/connector.scad | 195 --------- rcmodels/tracks/shapes/curved.scad | 288 ------------- rcmodels/tracks/shapes/fragments.scad | 135 ------- rcmodels/tracks/shapes/profiles.scad | 211 ---------- rcmodels/tracks/shapes/straight.scad | 192 --------- rcmodels/tracks/shapes/uturn.scad | 274 ------------- rcmodels/tracks/slice.sh | 48 --- rcmodels/tracks/test/accessories.scad | 109 ----- rcmodels/tracks/test/curved.scad | 101 ----- rcmodels/tracks/test/fragments.scad | 83 ---- rcmodels/tracks/test/profiles.scad | 83 ---- rcmodels/tracks/test/setup.scad | 64 --- rcmodels/tracks/test/special.scad | 102 ----- rcmodels/tracks/test/straight.scad | 81 ---- rcmodels/tracks/test/uturn.scad | 104 ----- 100 files changed, 9410 deletions(-) delete mode 100644 rcmodels/tracks/.gitignore delete mode 100644 rcmodels/tracks/config/config-dist.ini delete mode 100644 rcmodels/tracks/config/config.scad delete mode 100644 rcmodels/tracks/config/print.scad delete mode 100644 rcmodels/tracks/config/setup.scad delete mode 100644 rcmodels/tracks/config/values.scad delete mode 100644 rcmodels/tracks/parts/accessories/bent-mast.scad delete mode 100644 rcmodels/tracks/parts/accessories/cable-clip.scad delete mode 100644 rcmodels/tracks/parts/accessories/straight-flag.scad delete mode 100644 rcmodels/tracks/parts/accessories/straight-mast.scad delete mode 100644 rcmodels/tracks/parts/accessories/wavy-flag.scad delete mode 100644 rcmodels/tracks/parts/elements/curved/curved-inner.scad delete mode 100644 rcmodels/tracks/parts/elements/curved/curved-outer.scad delete mode 100644 rcmodels/tracks/parts/elements/curved/curved-short.scad delete mode 100644 rcmodels/tracks/parts/elements/curved/curved-small.scad delete mode 100644 rcmodels/tracks/parts/elements/curved/curved-uturn.scad delete mode 100644 rcmodels/tracks/parts/elements/straight/arch-tower.scad delete mode 100644 rcmodels/tracks/parts/elements/straight/body-curved.scad delete mode 100644 rcmodels/tracks/parts/elements/straight/body-straight.scad delete mode 100644 rcmodels/tracks/parts/elements/straight/body-uturn.scad delete mode 100644 rcmodels/tracks/parts/elements/straight/straight-double.scad delete mode 100644 rcmodels/tracks/parts/elements/straight/straight-simple.scad delete mode 100644 rcmodels/tracks/parts/elements/straight/straight-uturn.scad delete mode 100644 rcmodels/tracks/parts/samples/curved/curved-inner-full.scad delete mode 100644 rcmodels/tracks/parts/samples/curved/curved-inner.scad delete mode 100644 rcmodels/tracks/parts/samples/curved/curved-outer-full.scad delete mode 100644 rcmodels/tracks/parts/samples/curved/curved-outer.scad delete mode 100644 rcmodels/tracks/parts/samples/curved/curved-short.scad delete mode 100644 rcmodels/tracks/parts/samples/curved/curved-small.scad delete mode 100644 rcmodels/tracks/parts/samples/curved/curved-uturn.scad delete mode 100644 rcmodels/tracks/parts/samples/straight/arch-sample.scad delete mode 100644 rcmodels/tracks/parts/samples/straight/straight-double.scad delete mode 100644 rcmodels/tracks/parts/samples/straight/straight-long.scad delete mode 100644 rcmodels/tracks/parts/samples/straight/straight-simple.scad delete mode 100644 rcmodels/tracks/parts/samples/straight/straight-uturn.scad delete mode 100644 rcmodels/tracks/parts/unibody/curved/curved-inner.scad delete mode 100644 rcmodels/tracks/parts/unibody/curved/curved-outer.scad delete mode 100644 rcmodels/tracks/parts/unibody/curved/curved-short.scad delete mode 100644 rcmodels/tracks/parts/unibody/curved/curved-small.scad delete mode 100644 rcmodels/tracks/parts/unibody/curved/curved-uturn.scad delete mode 100644 rcmodels/tracks/parts/unibody/straight/straight-connector.scad delete mode 100644 rcmodels/tracks/parts/unibody/straight/straight-double.scad delete mode 100644 rcmodels/tracks/parts/unibody/straight/straight-simple.scad delete mode 100644 rcmodels/tracks/parts/unibody/straight/straight-uturn.scad delete mode 100644 rcmodels/tracks/plates/accessories/bent-mast.scad delete mode 100644 rcmodels/tracks/plates/accessories/cable-clip.scad delete mode 100644 rcmodels/tracks/plates/accessories/straight-flag.scad delete mode 100644 rcmodels/tracks/plates/accessories/straight-mast.scad delete mode 100644 rcmodels/tracks/plates/accessories/wavy-flag.scad delete mode 100644 rcmodels/tracks/plates/elements/curved/curved-inner.scad delete mode 100644 rcmodels/tracks/plates/elements/curved/curved-outer.scad delete mode 100644 rcmodels/tracks/plates/elements/curved/curved-short.scad delete mode 100644 rcmodels/tracks/plates/elements/curved/curved-small.scad delete mode 100644 rcmodels/tracks/plates/elements/curved/curved-uturn.scad delete mode 100644 rcmodels/tracks/plates/elements/straight/arch-tower.scad delete mode 100644 rcmodels/tracks/plates/elements/straight/body-curved.scad delete mode 100644 rcmodels/tracks/plates/elements/straight/body-straight.scad delete mode 100644 rcmodels/tracks/plates/elements/straight/body-uturn.scad delete mode 100644 rcmodels/tracks/plates/elements/straight/straight-double.scad delete mode 100644 rcmodels/tracks/plates/elements/straight/straight-simple.scad delete mode 100644 rcmodels/tracks/plates/elements/straight/straight-uturn.scad delete mode 100644 rcmodels/tracks/plates/samples/curved/curved-inner-full.scad delete mode 100644 rcmodels/tracks/plates/samples/curved/curved-inner.scad delete mode 100644 rcmodels/tracks/plates/samples/curved/curved-outer-full.scad delete mode 100644 rcmodels/tracks/plates/samples/curved/curved-outer.scad delete mode 100644 rcmodels/tracks/plates/samples/curved/curved-short.scad delete mode 100644 rcmodels/tracks/plates/samples/curved/curved-small.scad delete mode 100644 rcmodels/tracks/plates/samples/curved/curved-uturn.scad delete mode 100644 rcmodels/tracks/plates/samples/straight/arch-sample.scad delete mode 100644 rcmodels/tracks/plates/samples/straight/straight-double.scad delete mode 100644 rcmodels/tracks/plates/samples/straight/straight-long.scad delete mode 100644 rcmodels/tracks/plates/samples/straight/straight-simple.scad delete mode 100644 rcmodels/tracks/plates/samples/straight/straight-uturn.scad delete mode 100644 rcmodels/tracks/plates/unibody/curved/curved-inner.scad delete mode 100644 rcmodels/tracks/plates/unibody/curved/curved-outer.scad delete mode 100644 rcmodels/tracks/plates/unibody/curved/curved-short.scad delete mode 100644 rcmodels/tracks/plates/unibody/curved/curved-small.scad delete mode 100644 rcmodels/tracks/plates/unibody/curved/curved-uturn.scad delete mode 100644 rcmodels/tracks/plates/unibody/straight/straight-connector.scad delete mode 100644 rcmodels/tracks/plates/unibody/straight/straight-double.scad delete mode 100644 rcmodels/tracks/plates/unibody/straight/straight-simple.scad delete mode 100644 rcmodels/tracks/plates/unibody/straight/straight-uturn.scad delete mode 100755 rcmodels/tracks/render.sh delete mode 100644 rcmodels/tracks/shapes/accessories.scad delete mode 100644 rcmodels/tracks/shapes/arch.scad delete mode 100644 rcmodels/tracks/shapes/connector.scad delete mode 100644 rcmodels/tracks/shapes/curved.scad delete mode 100644 rcmodels/tracks/shapes/fragments.scad delete mode 100644 rcmodels/tracks/shapes/profiles.scad delete mode 100644 rcmodels/tracks/shapes/straight.scad delete mode 100644 rcmodels/tracks/shapes/uturn.scad delete mode 100755 rcmodels/tracks/slice.sh delete mode 100644 rcmodels/tracks/test/accessories.scad delete mode 100644 rcmodels/tracks/test/curved.scad delete mode 100644 rcmodels/tracks/test/fragments.scad delete mode 100644 rcmodels/tracks/test/profiles.scad delete mode 100644 rcmodels/tracks/test/setup.scad delete mode 100644 rcmodels/tracks/test/special.scad delete mode 100644 rcmodels/tracks/test/straight.scad delete mode 100644 rcmodels/tracks/test/uturn.scad diff --git a/rcmodels/tracks/.gitignore b/rcmodels/tracks/.gitignore deleted file mode 100644 index e4a80ae..0000000 --- a/rcmodels/tracks/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/output -/dist -/config/config.ini diff --git a/rcmodels/tracks/config/config-dist.ini b/rcmodels/tracks/config/config-dist.ini deleted file mode 100644 index 52e5457..0000000 --- a/rcmodels/tracks/config/config-dist.ini +++ /dev/null @@ -1,242 +0,0 @@ -# generated by PrusaSlicer 2.2.0+ on 2020-04-10 at 09:30:48 UTC -avoid_crossing_perimeters = 0 -bed_custom_model = -bed_custom_texture = -bed_shape = 0x0,250x0,250x210,0x210 -bed_temperature = 60 -before_layer_gcode = ;BEFORE_LAYER_CHANGE\nG92 E0.0\n;[layer_z]\n\n -between_objects_gcode = -bottom_fill_pattern = rectilinear -bottom_solid_layers = 4 -bottom_solid_min_thickness = 0.5 -bridge_acceleration = 1000 -bridge_angle = 0 -bridge_fan_speed = 100 -bridge_flow_ratio = 0.95 -bridge_speed = 30 -brim_width = 0 -clip_multipart_objects = 1 -colorprint_heights = -compatible_printers_condition_cummulative = "printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK3.*/ and nozzle_diameter[0]==0.4";"! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK(2.5|3).*/ and single_extruder_multi_material)" -complete_objects = 0 -cooling = 1 -cooling_tube_length = 5 -cooling_tube_retraction = 91.5 -default_acceleration = 1000 -default_filament_profile = "Prusament PLA" -default_print_profile = 0.15mm QUALITY @MK3 -deretract_speed = 0 -disable_fan_first_layers = 1 -dont_support_bridges = 1 -draft_shield = 0 -duplicate_distance = 6 -elefant_foot_compensation = 0.2 -end_filament_gcode = "; Filament-specific end gcode" -end_gcode = G4 ; wait\nM221 S100\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+30, max_print_height)}{endif} ; Move print head up\nG1 X0 Y200 F3000 ; home X axis\nM84 ; disable motors -ensure_vertical_shell_thickness = 1 -external_perimeter_extrusion_width = 0.5 -external_perimeter_speed = 70 -external_perimeters_first = 0 -extra_loading_move = -2 -extra_perimeters = 1 -extruder_clearance_height = 20 -extruder_clearance_radius = 45 -extruder_colour = "" -extruder_offset = 0x0 -extrusion_axis = E -extrusion_multiplier = 1 -extrusion_width = 0.45 -fan_always_on = 1 -fan_below_layer_time = 100 -filament_colour = #FF8000 -filament_cooling_final_speed = 3.4 -filament_cooling_initial_speed = 2.2 -filament_cooling_moves = 4 -filament_cost = 24.99 -filament_density = 1.24 -filament_deretract_speed = nil -filament_diameter = 1.75 -filament_load_time = 0 -filament_loading_speed = 28 -filament_loading_speed_start = 3 -filament_max_volumetric_speed = 15 -filament_minimal_purge_on_wipe_tower = 15 -filament_notes = "Affordable filament for everyday printing in premium quality manufactured in-house by Josef Prusa" -filament_ramming_parameters = "120 100 6.6 6.8 7.2 7.6 7.9 8.2 8.7 9.4 9.9 10.0| 0.05 6.6 0.45 6.8 0.95 7.8 1.45 8.3 1.95 9.7 2.45 10 2.95 7.6 3.45 7.6 3.95 7.6 4.45 7.6 4.95 7.6" -filament_retract_before_travel = nil -filament_retract_before_wipe = nil -filament_retract_layer_change = nil -filament_retract_length = nil -filament_retract_lift = nil -filament_retract_lift_above = nil -filament_retract_lift_below = nil -filament_retract_restart_extra = nil -filament_retract_speed = nil -filament_settings_id = "Prusament PLA" -filament_soluble = 0 -filament_toolchange_delay = 0 -filament_type = PLA -filament_unload_time = 0 -filament_unloading_speed = 90 -filament_unloading_speed_start = 100 -filament_vendor = Prusa Polymers -filament_wipe = nil -fill_angle = 45 -fill_density = 0% -fill_pattern = grid -first_layer_acceleration = 1000 -first_layer_bed_temperature = 60 -first_layer_extrusion_width = 0.42 -first_layer_height = 0.2 -first_layer_speed = 20 -first_layer_temperature = 215 -gap_fill_speed = 40 -gcode_comments = 0 -gcode_flavor = marlin -gcode_label_objects = 0 -high_current_on_filament_swap = 0 -host_type = octoprint -infill_acceleration = 1000 -infill_every_layers = 1 -infill_extruder = 1 -infill_extrusion_width = 0.45 -infill_first = 0 -infill_only_where_needed = 0 -infill_overlap = 25% -infill_speed = 200 -inherits_cummulative = "0.20mm SPEED @MK3";; -interface_shells = 0 -layer_gcode = ;AFTER_LAYER_CHANGE\n;[layer_z] -layer_height = 0.2 -machine_max_acceleration_e = 5000,5000 -machine_max_acceleration_extruding = 1250,1250 -machine_max_acceleration_retracting = 1250,1250 -machine_max_acceleration_x = 1000,960 -machine_max_acceleration_y = 1000,960 -machine_max_acceleration_z = 1000,1000 -machine_max_feedrate_e = 120,120 -machine_max_feedrate_x = 200,100 -machine_max_feedrate_y = 200,100 -machine_max_feedrate_z = 12,12 -machine_max_jerk_e = 4.5,4.5 -machine_max_jerk_x = 8,8 -machine_max_jerk_y = 8,8 -machine_max_jerk_z = 0.4,0.4 -machine_min_extruding_rate = 0,0 -machine_min_travel_rate = 0,0 -max_fan_speed = 100 -max_layer_height = 0.25 -max_print_height = 210 -max_print_speed = 200 -max_volumetric_speed = 0 -min_fan_speed = 100 -min_layer_height = 0.07 -min_print_speed = 15 -min_skirt_length = 4 -notes = -nozzle_diameter = 0.4 -only_retract_when_crossing_perimeters = 1 -ooze_prevention = 0 -output_filename_format = {input_filename_base}_{layer_height}mm_{filament_type[0]}_{printer_model}_{print_time}.gcode -overhangs = 0 -parking_pos_retraction = 92 -perimeter_acceleration = 800 -perimeter_extruder = 1 -perimeter_extrusion_width = 0.6 -perimeter_speed = 120 -perimeters = 2 -post_process = -print_host = -print_settings_id = 0.20mm FAST & EMPTY @MK3 -printer_model = MK3 -printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_MK3\n -printer_settings_id = Original Prusa i3 MK3 -printer_technology = FFF -printer_variant = 0.4 -printer_vendor = -printhost_apikey = -printhost_cafile = -raft_layers = 0 -remaining_times = 1 -resolution = 0 -retract_before_travel = 1 -retract_before_wipe = 0% -retract_layer_change = 1 -retract_length = 0.8 -retract_length_toolchange = 4 -retract_lift = 0.6 -retract_lift_above = 0 -retract_lift_below = 209 -retract_restart_extra = 0 -retract_restart_extra_toolchange = 0 -retract_speed = 35 -seam_position = nearest -serial_port = -serial_speed = 250000 -silent_mode = 1 -single_extruder_multi_material = 0 -single_extruder_multi_material_priming = 0 -skirt_distance = 2 -skirt_height = 3 -skirts = 1 -slice_closing_radius = 0.049 -slowdown_below_layer_time = 20 -small_perimeter_speed = 50 -solid_infill_below_area = 0 -solid_infill_every_layers = 0 -solid_infill_extruder = 1 -solid_infill_extrusion_width = 0.45 -solid_infill_speed = 200 -spiral_vase = 0 -standby_temperature_delta = -5 -start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_MODEL_MINI.*/ and nozzle_diameter[0]==0.6}0.12{elsif printer_notes=~/.*PRINTER_MODEL_MINI.*/}0.2{elsif printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}200{elsif nozzle_diameter[0]==0.6}18{else}30{endif} ; Filament gcode" -start_gcode = M862.3 P "[printer_model]" ; printer model check\nM862.1 P[nozzle_diameter] ; nozzle diameter check\nM115 U3.8.1 ; tell printer latest fw version\nG90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\nG28 W ; home all without mesh bed level\nG80 ; mesh bed leveling\nG1 Y-3.0 F1000.0 ; go outside print area\nG92 E0.0\nG1 X60.0 E9.0 F1000.0 ; intro line\nG1 X100.0 E12.5 F1000.0 ; intro line\nG92 E0.0\nM221 S{if layer_height<0.075}100{else}95{endif} -support_material = 0 -support_material_angle = 0 -support_material_auto = 1 -support_material_buildplate_only = 0 -support_material_contact_distance = 0.1 -support_material_enforce_layers = 0 -support_material_extruder = 0 -support_material_extrusion_width = 0.35 -support_material_interface_contact_loops = 0 -support_material_interface_extruder = 0 -support_material_interface_layers = 2 -support_material_interface_spacing = 0.2 -support_material_interface_speed = 100% -support_material_pattern = rectilinear -support_material_spacing = 2 -support_material_speed = 50 -support_material_synchronize_layers = 0 -support_material_threshold = 55 -support_material_with_sheath = 0 -support_material_xy_spacing = 50% -temperature = 215 -thin_walls = 1 -threads = 8 -thumbnails = -toolchange_gcode = -top_fill_pattern = rectilinear -top_infill_extrusion_width = 0.4 -top_solid_infill_speed = 50 -top_solid_layers = 5 -top_solid_min_thickness = 0.6 -travel_speed = 180 -use_firmware_retraction = 0 -use_relative_e_distances = 1 -use_volumetric_e = 0 -variable_layer_height = 1 -wipe = 1 -wipe_into_infill = 0 -wipe_into_objects = 0 -wipe_tower = 1 -wipe_tower_bridging = 10 -wipe_tower_no_sparse_layers = 0 -wipe_tower_rotation_angle = 0 -wipe_tower_width = 60 -wipe_tower_x = 170 -wipe_tower_y = 125 -wiping_volumes_extruders = 70,70 -wiping_volumes_matrix = 0 -xy_size_compensation = 0 -z_offset = 0 diff --git a/rcmodels/tracks/config/config.scad b/rcmodels/tracks/config/config.scad deleted file mode 100644 index 3ab24c7..0000000 --- a/rcmodels/tracks/config/config.scad +++ /dev/null @@ -1,63 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Configures the project. - * - * @author jsconan - */ - - projectVersion = "0.4.2"; - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the printer. -printResolution = 0.2; // The target layer height -nozzleWidth = 0.4; // The size of the printer's nozzle -printTolerance = 0.1; // The print tolerance when pieces need to be assembled -printerLength = 250; // The length of the printer's build plate -printerWidth = 210; // The width of the printer's build plate - -// The dimensions and constraints of a track element -trackSectionLength = 100; // The nominal length of a track element: the length for straight element, or the radius for a curved element -trackSectionWidth = 400; // The virtual width of a track lane: this will condition the outer radius for a curved element (i.e. the width used to compute the outer radius) -trackLaneWidth = 600; // The actual width of a track lane: the distance between the barriers (i.e. the width of the physical track lanes) -trackRadius = 200; // The radius of the track inner curve -barrierHeight = 30; // The height of the barrier, including the holders -barrierHolderBase = 2; // The base unit value used to design the barrier holder -barrierBodyThickness = 0.6; // The thickness of the barrier body -sampleSize = 10; // The size for the sample track elements -sampleBase = 1; // The base unit value used to design the samples -archTowerThickness = 1.6; // The thickness of the arch tower clip -accessoryClipThickness = 0.8; // The thickness of the cable clip -cableClipWidth = 2; // The width of the cable clip -mastWidth = 3; // The width of the accessory mast -mastHeight = 70; // The length of the accessory mast -mastFacets = 8; // The number of facets the accessory mast have -flagWidth = 40; // The width of the accessory flag -flagHeight = 20; // The height of the accessory flag -flagThickness = 0.8; // The thickness of the accessory flag -rightOriented = false; // The orientation of the curved elements -printInterval = 5; // Interval between 2 pieces when presented together diff --git a/rcmodels/tracks/config/print.scad b/rcmodels/tracks/config/print.scad deleted file mode 100644 index 1f884d5..0000000 --- a/rcmodels/tracks/config/print.scad +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Show the config values. - * - * @author jsconan - */ - -// Import the project's setup. -include - -// Show the values -printConfig( - length = trackSectionLength, - width = trackSectionWidth, - lane = trackLaneWidth, - height = barrierHeight, - radius = trackRadius, - base = barrierHolderBase -); diff --git a/rcmodels/tracks/config/setup.scad b/rcmodels/tracks/config/setup.scad deleted file mode 100644 index 7f8f47b..0000000 --- a/rcmodels/tracks/config/setup.scad +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Setup the context. - * - * @author jsconan - */ - -// As we need to use some shapes, use the right entry point of the library. -include <../../../lib/camelSCAD/shapes.scad> - -// Then we need the config for the project, as well as the related functions -include -include - -// Finally, include the shapes -include <../shapes/profiles.scad> -include <../shapes/fragments.scad> -include <../shapes/straight.scad> -include <../shapes/curved.scad> -include <../shapes/uturn.scad> -include <../shapes/arch.scad> -include <../shapes/connector.scad> -include <../shapes/accessories.scad> - -// Validate the config against the constraints -validateConfig( - length = trackSectionLength, - width = trackSectionWidth, - lane = trackLaneWidth, - height = barrierHeight, - radius = trackRadius, - base = barrierHolderBase -); diff --git a/rcmodels/tracks/config/values.scad b/rcmodels/tracks/config/values.scad deleted file mode 100644 index c069f02..0000000 --- a/rcmodels/tracks/config/values.scad +++ /dev/null @@ -1,377 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Refines values and defines functions. - * - * @author jsconan - */ - -/** - * Aligns a value with respect to the target layer height. - * @param Number value - * @returns Number - */ -function layerAligned(value) = roundBy(value, printResolution); - -/** - * Aligns a value with respect to the target nozzle size. - * @param Number value - * @returns Number - */ -function nozzleAligned(value) = roundBy(value, nozzleWidth); - -/** - * Gets the thickness of N layers. - * @param Number N - * @returns Number - */ -function layers(N) = N * printResolution; - -/** - * Gets the width of N times the nozzle width. - * @param Number N - * @returns Number - */ -function shells(N) = N * nozzleWidth; - -/** - * Computes the height of the barrier body part that will be inserted in the holder. - * @param Number base - The base unit value used to design the barrier holder. - * @returns Number - */ -function getBarrierStripHeight(base) = base * stripHeightRatio; - -/** - * Computes the indent of the barrier body strip. - * @param Number base - The base unit value used to design the barrier holder. - * @returns Number - */ -function getBarrierStripIndent(base) = base * stripIndentRatio; - -/** - * Computes the outer length of a barrier link. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [distance] - An additional distance added to the outline of the barrier link. - * @returns Number - */ -function getBarrierLinkLength(base, distance = 0) = base * 1.5 + distance; - -/** - * Computes the outer width of a barrier link. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [distance] - An additional distance added to the outline of the barrier link. - * @returns Number - */ -function getBarrierLinkWidth(base, distance = 0) = (base + distance) * 2; - -/** - * Computes the outer width of a barrier holder notch. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [distance] - An additional distance added to the outline of the barrier link. - * @returns Number - */ -function getBarrierNotchWidth(base, distance = 0) = (getBarrierLinkWidth(base, distance) + getBarrierStripIndent(base) + minWidth) * 2; - -/** - * Computes the inner width of a barrier holder notch. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [distance] - An additional distance added to the outline of the barrier link. - * @returns Number - */ -function getBarrierNotchDistance(base, distance = 0) = (getBarrierLinkWidth(base, distance) + minWidth) * 2; - -/** - * Computes the outer width of a barrier holder. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [distance] - An additional distance added to the outline of the barrier holder. - * @returns Number - */ -function getBarrierHolderWidth(base, distance = 0) = getBarrierLinkWidth(base, printTolerance) + minWidth * 4 + distance * 2; - -/** - * Computes the top width of a barrier holder. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number thickness - The thickness of the barrier body. - * @returns Number - */ -function getBarrierHolderTopWidth(base, thickness) = nozzleAligned((getBarrierLinkWidth(base, printTolerance) - thickness) / 2) * 2 + thickness; - -/** - * Computes the outer height of a barrier holder. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [distance] - An additional distance added to the outline of the barrier holder. - * @returns Number - */ -function getBarrierHolderHeight(base, distance = 0) = getBarrierStripHeight(base) + minThickness + printResolution + distance * 2; - -/** - * Computes the height of the link for a barrier holder. - * @param Number base - The base unit value used to design the barrier holder. - * @returns Number - */ -function getBarrierHolderLinkHeight(base) = getBarrierHolderHeight(base) - base; - -/** - * Computes the outer width of a unibody barrier. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [distance] - An additional distance added to the outline of the barrier. - * @returns Number - */ -function getBarrierUnibodyWidth(base, distance = 0) = getBarrierHolderWidth(base) + base + distance * 2; - -/** - * Computes the height of the link for a unibody barrier. - * @param Number height - The height of the barrier. - * @param Number base - The base unit value used to design the barrier holder. - * @returns Number - */ -function getBarrierUnibodyLinkHeight(height, base) = height - getBarrierHolderHeight(base) - base; - -/** - * Computes the inner height of the barrier body, between the barrier holders. - * @param Number height - The height of the barrier. - * @param Number base - The base unit value used to design the barrier holder. - * @returns Number - */ -function getBarrierBodyInnerHeight(height, base) = height - (getBarrierStripHeight(base) + minThickness) * 2; - -/** - * Computes the outer height of the barrier body, taking care of the barrier holders. - * @param Number height - The height of the barrier. - * @returns Number - */ -function getBarrierBodyHeight(height) = height - (minThickness + printResolution) * 2; - -/** - * Gets the length of a curved ctrack elementhunk (the length of the arc of the curve). - * @param Number length - The length of the track element. - * @returns Number - */ -function getCurveLength(length) = getArcLength(radius = length, angle = 90); - -/** - * Gets the difference between the length of a curved track element chunk and a straight track element. - * @param Number length - The length of the track element. - * @returns Number - */ -function getCurveRemainingLength(length) = getCurveLength(length) - length; - -/** - * Computes the minimal length of a track element. - * @param Number base - The base unit value used to design the barrier holder. - * @returns Number - */ -function getMinLength(base) = getBarrierNotchWidth(base, printTolerance) * 4; - -/** - * Computes the minimal height of a track barrier. - * @param Number base - The base unit value used to design the barrier holder. - * @returns Number - */ -function getMinHeight(base) = getBarrierStripHeight(base) * 3; - -/** - * Computes the ratio of the inner curve with respect to the track section size. - * @param Number length - The nominal size of a track element. - * @param Number radius - The radius of the track inner curve. - * @returns Number - */ -function getInnerCurveRatio(length, radius) = radius / length; - -/** - * Computes the ratio of the outer curve with respect to the track width. - * @param Number length - The nominal size of a track element. - * @param Number width - The width of a track lane. - * @param Number radius - The radius of the track inner curve. - * @returns Number - */ -function getOuterCurveRatio(length, width, radius) = (width + radius) / length; - -/** - * Computes the radius of a curve with respect to the ratio. - * @param Number length - The nominal size of a track element. - * @param Number ratio - The ratio of the curve. - * @returns Number - */ -function getCurveRadius(length, ratio) = length * ratio; - -/** - * Computes the angle of a curve with respect to the ratio. - * @param Number ratio - The ratio of the curve. - * @returns Number - */ -function getCurveAngle(ratio) = curveAngle / ratio; - -/** - * Computes the rotation angle used to place a curve. - * @param Number angle - The angle of the curve. - * @returns Number - */ -function getCurveRotationAngle(angle) = 45 + (curveAngle - angle) / 2; - -/** - * Computes the radius of the accessory mast. - * @param Number width - The width of the mast. - * @returns Number - */ -function getMastRadius(width) = circumradius(n = mastFacets, a = width / 2); - -/** - * Computes the print interval between the centers of 2 objects. - * @param Number size - The size of the shape. - * @returns Number - */ -function getPrintInterval(size) = size + printInterval; - -/** - * Centers the children elements to te printer's build plate. - */ -module centerBuildPlate(moveOrigin = false) { - buildPlate([printerLength, printerWidth], center=!moveOrigin); - translate(moveOrigin ? [printerLength, printerWidth, 0] / 2 : [0, 0, 0]) { - children(); - } -}; - -/** - * Validates the config values, checking if it match the critical constraints. - * @param Number length - The nominal size of a track element. - * @param Number width - The virtual width of a track lane (i.e. the width used to compute the outer radius). - * @param Number lane - The actual width of a track lane (i.e. the width of the physical track lanes). - * @param Number height - The height of the barrier. - * @param Number radius - The radius of the track inner curve. - * @param Number base - The base unit value used to design the barrier holder. - */ -module validateConfig(length, width, lane, height, radius, base) { - assert( - length >= getMinLength(base), - str( - "The size for a track element is too small! The minimum length is ", - getMinLength(base), - ". The current value is ", - length - ) - ); - assert( - barrierHeight >= getMinHeight(base), - str( - "The height for a track barrier is too small! The minimum height is ", - getMinHeight(base), - ". The current value is ", - barrierHeight - ) - ); - assert( - width >= length, - "The virtual width of the track must be greater or equal than the length of one element!" - ); - assert( - lane >= length && lane >= width, - "The actual width of the track must be greater or equal than the length of one element and than the virtual width as well!" - ); - assert( - radius >= length, - "The radius of the track inner curve must be greater or equal than the length of one element!" - ); - assert( - width % length == 0, - "The virtual width of the track must be a multiple of the length of one element!" - ); - assert( - lane % length == 0, - "The actual width of the track must be a multiple of the length of one element!" - ); - assert( - radius % length == 0, - "The radius of the track inner curve must be a multiple of the length of one element!" - ); -} - -/** - * Prints the config values. - * @param Number length - The nominal size of a track element. - * @param Number width - The virtual width of a track lane (i.e. the width used to compute the outer radius). - * @param Number lane - The actual width of a track lane (i.e. the width of the physical track lanes). - * @param Number height - The height of the barrier. - * @param Number radius - The radius of the track inner curve. - * @param Number base - The base unit value used to design the barrier holder. - */ -module printConfig(length, width, lane, height, radius, base) { - innerCurveRatio = getInnerCurveRatio(length, radius); - outerCurveRatio = getOuterCurveRatio(length, width, radius); - echo(join([ - "", - str("-- RC Track System ------------"), - str("Version: ", projectVersion), - str("-- Track elements -------------"), - str("Track section length: ", length / 10, "cm"), - str("Curve section length: ", getCurveLength(length) / 10, "cm"), - str("Virtual lane width: ", width / 10, "cm"), - str("Actual lane width: ", lane / 10, "cm"), - str("Track inner radius: ", radius / 10, "cm"), - str("Inner curve ratio: ", innerCurveRatio), - str("Inner curve angle: ", getCurveAngle(innerCurveRatio), "°"), - str("Outer curve ratio: ", outerCurveRatio), - str("Outer curve angle: ", getCurveAngle(outerCurveRatio), "°"), - str("Barrier height: ", height, "mm"), - str("Barrier thickness: ", barrierBodyThickness, "mm"), - str("Barrier base value: ", base, "mm"), - str("Barrier holder width: ", getBarrierHolderWidth(base), "mm"), - str("Barrier holder height: ", getBarrierHolderHeight(base), "mm"), - str("Unibody barrier width: ", getBarrierUnibodyWidth(base), "mm"), - str("Unibody barrier height:", height, "mm"), - str("-- Track samples --------------"), - str("Size of samples: ", sampleSize, "mm"), - str("Base of samples: ", sampleBase, "mm"), - str("-- Track accessories ----------"), - str("Mast height: ", mastHeight, "mm"), - str("Mast width: ", mastWidth, "mm"), - str("Mast radius: ", getMastRadius(mastWidth), "mm"), - str("Flag height: ", flagHeight, "mm"), - str("Flag width: ", flagWidth, "mm"), - str("Flag thickness: ", flagThickness, "mm"), - str("-- Printer settings -----------"), - str("Nozzle diameter: ", nozzleWidth, "mm"), - str("Print layer: ", printResolution, "mm"), - str("Print tolerance: ", printTolerance, "mm"), - str("Printer's length: ", printerLength / 10, "cm"), - str("Printer's width: ", printerWidth / 10, "cm"), - str("Print interval: ", printInterval, "mm"), - "" - ], str(chr(13), chr(10)))); -} - -// The minimal thickness of a part -minThickness = layers(2); - -// The minimal width of a part -minWidth = shells(2); - -// The ratios applied to the base unit value used to design the barrier holder -stripHeightRatio = 3; -stripIndentRatio = 0.5; - -// The angle of a typical curve -curveAngle = 90; diff --git a/rcmodels/tracks/parts/accessories/bent-mast.scad b/rcmodels/tracks/parts/accessories/bent-mast.scad deleted file mode 100644 index 1eb35eb..0000000 --- a/rcmodels/tracks/parts/accessories/bent-mast.scad +++ /dev/null @@ -1,98 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A bent mast to clip accessories onto the barrier holders. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../config/setup.scad> - -/** - * Gets the length of the final shape for a bent mast. - * @returns Number - */ -function finalBentMastLength() = - getAccessoryBentMastLength( - width = mastWidth, - height = [mastWidth, mastHeight], - wall = accessoryClipThickness, - base = barrierHolderBase - ) -; - -/** - * Gets the width of the final shape for a bent mast. - * @returns Number - */ -function finalBentMastWidth() = - getAccessoryBentMastWidth( - width = mastWidth, - height = [mastWidth, mastHeight], - wall = accessoryClipThickness, - base = barrierHolderBase - ) -; - -/** - * Gets the horizontal interval of the final shape for a bent mast. - * @returns Number - */ -function finalBentMastIntervalX() = - getPrintInterval( - finalBentMastLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a bent mast. - * @returns Number - */ -function finalBentMastIntervalY() = - getPrintInterval( - finalBentMastWidth() - ) -; - -/** - * Defines the final shape for a bent mast. - */ -module finalBentMast() { - accessoryBentMast( - width = mastWidth, - height = [mastWidth, mastHeight], - wall = accessoryClipThickness, - base = barrierHolderBase, - thickness = barrierBodyThickness - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalBentMast(); -} diff --git a/rcmodels/tracks/parts/accessories/cable-clip.scad b/rcmodels/tracks/parts/accessories/cable-clip.scad deleted file mode 100644 index 2398151..0000000 --- a/rcmodels/tracks/parts/accessories/cable-clip.scad +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A LED cable clip for the barrier holders. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../config/setup.scad> - -/** - * Gets the length of the final shape for a cable clip. - * @returns Number - */ -function finalCableClipLength() = - getCableClipLength( - wall = accessoryClipThickness, - base = barrierHolderBase - ) -; - -/** - * Gets the width of the final shape for a cable clip. - * @returns Number - */ -function finalCableClipWidth() = - getCableClipWidth( - wall = accessoryClipThickness, - base = barrierHolderBase - ) -; - -/** - * Gets the horizontal interval of the final shape for a cable clip. - * @returns Number - */ -function finalCableClipIntervalX() = - getPrintInterval( - finalCableClipLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a cable clip. - * @returns Number - */ -function finalCableClipIntervalY() = - getPrintInterval( - finalCableClipWidth() - ) -; - -/** - * Defines the final shape for a cable clip. - */ -module finalCableClip() { - cableClip( - height = cableClipWidth, - wall = accessoryClipThickness, - base = barrierHolderBase, - thickness = barrierBodyThickness - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalCableClip(); -} diff --git a/rcmodels/tracks/parts/accessories/straight-flag.scad b/rcmodels/tracks/parts/accessories/straight-flag.scad deleted file mode 100644 index 2870725..0000000 --- a/rcmodels/tracks/parts/accessories/straight-flag.scad +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A straight flag to clip onto the barrier holders. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../config/setup.scad> - -/** - * Gets the length of the final shape for a straight flag. - * @returns Number - */ -function finalStraightFlagLength() = - getAccessoryFlagLength( - width = flagWidth, - thickness = flagThickness, - mast = mastWidth - ) -; - -/** - * Gets the width of the final shape for a straight flag. - * @returns Number - */ -function finalStraightFlagWidth() = - getAccessoryFlagWidth( - height = flagHeight, - wave = 0 - ) -; - -/** - * Gets the horizontal interval of the final shape for a straight flag. - * @returns Number - */ -function finalStraightFlagIntervalX() = - getPrintInterval( - finalStraightFlagLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a straight flag. - * @returns Number - */ -function finalStraightFlagIntervalY() = - getPrintInterval( - finalStraightFlagWidth() - ) -; - -/** - * Defines the final shape for a straight flag. - */ -module finalStraightFlag() { - accessoryFlag( - width = flagWidth, - height = flagHeight, - thickness = flagThickness, - mast = mastWidth, - wave = 0 - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalStraightFlag(); -} diff --git a/rcmodels/tracks/parts/accessories/straight-mast.scad b/rcmodels/tracks/parts/accessories/straight-mast.scad deleted file mode 100644 index dc761dc..0000000 --- a/rcmodels/tracks/parts/accessories/straight-mast.scad +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A mast to clip accessories onto the barrier holders. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../config/setup.scad> - -/** - * Gets the length of the final shape for a straight mast. - * @returns Number - */ -function finalStraightMastLength() = - getAccessoryStraightMastLength( - height = mastHeight, - wall = accessoryClipThickness, - base = barrierHolderBase - ) -; - -/** - * Gets the width of the final shape for a straight mast. - * @returns Number - */ -function finalStraightMastWidth() = - getAccessoryStraightMastWidth( - wall = accessoryClipThickness, - base = barrierHolderBase - ) -; - -/** - * Gets the horizontal interval of the final shape for a straight mast. - * @returns Number - */ -function finalStraightMastIntervalX() = - getPrintInterval( - finalStraightMastLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a straight mast. - * @returns Number - */ -function finalStraightMastIntervalY() = - getPrintInterval( - finalStraightMastWidth() - ) -; - -/** - * Defines the final shape for a straight mast. - */ -module finalStraightMast() { - accessoryStraightMast( - width = mastWidth, - height = mastHeight, - wall = accessoryClipThickness, - base = barrierHolderBase, - thickness = barrierBodyThickness - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalStraightMast(); -} diff --git a/rcmodels/tracks/parts/accessories/wavy-flag.scad b/rcmodels/tracks/parts/accessories/wavy-flag.scad deleted file mode 100644 index 757cb13..0000000 --- a/rcmodels/tracks/parts/accessories/wavy-flag.scad +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A wavy flag to clip onto the barrier holders. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../config/setup.scad> - -/** - * Gets the length of the final shape for a wavy flag. - * @returns Number - */ -function finalWavyFlagLength() = - getAccessoryFlagLength( - width = flagWidth, - thickness = flagThickness, - mast = mastWidth - ) -; - -/** - * Gets the width of the final shape for a wavy flag. - * @returns Number - */ -function finalWavyFlagWidth() = - getAccessoryFlagWidth( - height = flagHeight, - wave = 2 - ) -; - -/** - * Gets the horizontal interval of the final shape for a wavy flag. - * @returns Number - */ -function finalWavyFlagIntervalX() = - getPrintInterval( - finalWavyFlagLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a wavy flag. - * @returns Number - */ -function finalWavyFlagIntervalY() = - getPrintInterval( - finalWavyFlagWidth() - ) -; - -/** - * Defines the final shape for a wavy flag. - */ -module finalWavyFlag() { - accessoryFlag( - width = flagWidth, - height = flagHeight, - thickness = flagThickness, - mast = mastWidth, - wave = 2 - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalWavyFlag(); -} diff --git a/rcmodels/tracks/parts/elements/curved/curved-inner.scad b/rcmodels/tracks/parts/elements/curved/curved-inner.scad deleted file mode 100644 index a24b371..0000000 --- a/rcmodels/tracks/parts/elements/curved/curved-inner.scad +++ /dev/null @@ -1,104 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A barrier holder for an inner curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the curve ratio of the final shape for an inner curve. - * @returns Number - */ -function finalInnerCurvedBarrierHolderRatio() = getInnerCurveRatio(trackSectionLength, trackRadius); - -/** - * Gets the length of the final shape for an inner curve. - * @returns Number - */ -function finalInnerCurvedBarrierHolderLength() = - getCurvedBarrierLength( - length = trackSectionLength, - width = getBarrierHolderWidth(barrierHolderBase), - base = barrierHolderBase, - ratio = finalInnerCurvedBarrierHolderRatio() - ) -; - -/** - * Gets the width of the final shape for an inner curve. - * @returns Number - */ -function finalInnerCurvedBarrierHolderWidth() = - getCurvedBarrierWidth( - length = trackSectionLength, - width = getBarrierHolderWidth(barrierHolderBase), - base = barrierHolderBase, - ratio = finalInnerCurvedBarrierHolderRatio() - ) -; - -/** - * Gets the horizontal interval of the final shape for an inner curve. - * @returns Number - */ -function finalInnerCurvedBarrierHolderIntervalX() = - getPrintInterval( - finalInnerCurvedBarrierHolderLength() - ) -; - -/** - * Gets the vertical interval of the final shape for an inner curve. - * @returns Number - */ -function finalInnerCurvedBarrierHolderIntervalY() = - getPrintInterval( - getBarrierHolderWidth(barrierHolderBase) - ) -; - -/** - * Defines the final shape for an inner curve. - */ -module finalInnerCurvedBarrierHolder() { - curvedBarrierHolder( - length = trackSectionLength, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = finalInnerCurvedBarrierHolderRatio(), - right = rightOriented - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalInnerCurvedBarrierHolder(); -} diff --git a/rcmodels/tracks/parts/elements/curved/curved-outer.scad b/rcmodels/tracks/parts/elements/curved/curved-outer.scad deleted file mode 100644 index 52f3fa0..0000000 --- a/rcmodels/tracks/parts/elements/curved/curved-outer.scad +++ /dev/null @@ -1,104 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A barrier holder for an outer curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the curve ratio of the final shape for an outer curve. - * @returns Number - */ -function finalOuterCurvedBarrierHolderRatio() = getOuterCurveRatio(trackSectionLength, trackSectionWidth, trackRadius); - -/** - * Gets the length of the final shape for an outer curve. - * @returns Number - */ -function finalOuterCurvedBarrierHolderLength() = - getCurvedBarrierLength( - length = trackSectionLength, - width = getBarrierHolderWidth(barrierHolderBase), - base = barrierHolderBase, - ratio = finalOuterCurvedBarrierHolderRatio() - ) -; - -/** - * Gets the horizontal interval of the final shape for an outer curve. - * @returns Number - */ -function finalOuterCurvedBarrierHolderWidth() = - getCurvedBarrierWidth( - length = trackSectionLength, - width = getBarrierHolderWidth(barrierHolderBase), - base = barrierHolderBase, - ratio = finalOuterCurvedBarrierHolderRatio() - ) -; - -/** - * Gets the vertical interval of the final shape for an outer curve. - * @returns Number - */ -function finalOuterCurvedBarrierHolderIntervalX() = - getPrintInterval( - finalOuterCurvedBarrierHolderLength() - ) -; - -/** - * Gets the width of the final shape for an outer curve. - * @returns Number - */ -function finalOuterCurvedBarrierHolderIntervalY() = - getPrintInterval( - getBarrierHolderWidth(barrierHolderBase) - ) -; - -/** - * Defines the final shape for an outer curve. - */ -module finalOuterCurvedBarrierHolder() { - curvedBarrierHolder( - length = trackSectionLength, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = finalOuterCurvedBarrierHolderRatio(), - right = rightOriented - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalOuterCurvedBarrierHolder(); -} diff --git a/rcmodels/tracks/parts/elements/curved/curved-short.scad b/rcmodels/tracks/parts/elements/curved/curved-short.scad deleted file mode 100644 index 307f1fd..0000000 --- a/rcmodels/tracks/parts/elements/curved/curved-short.scad +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A barrier holder for a short curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the curve ratio of the final shape for an small curve. - * @returns Number - */ -function finalShortCurvedBarrierHolderRatio() = .5; - -/** - * Gets the length of the final shape for an small curve. - * @returns Number - */ -function finalShortCurvedBarrierHolderLength() = - getCurvedBarrierLength( - length = trackSectionLength, - width = getBarrierHolderWidth(barrierHolderBase), - base = barrierHolderBase, - ratio = finalShortCurvedBarrierHolderRatio() - ) -; - -/** - * Gets the width of the final shape for an small curve. - * @returns Number - */ -function finalShortCurvedBarrierHolderWidth() = - getCurvedBarrierWidth( - length = trackSectionLength, - width = getBarrierHolderWidth(barrierHolderBase), - base = barrierHolderBase, - ratio = finalShortCurvedBarrierHolderRatio() - ) -; - -/** - * Gets the horizontal interval of the final shape for an small curve. - * @returns Number - */ -function finalShortCurvedBarrierHolderIntervalX() = - getPrintInterval( - finalShortCurvedBarrierHolderLength() / 4 - ) -; - -/** - * Gets the vertical interval of the final shape for an small curve. - * @returns Number - */ -function finalShortCurvedBarrierHolderIntervalY() = - getPrintInterval( - getBarrierHolderWidth(barrierHolderBase) + - getBarrierLinkLength(barrierHolderBase) - ) -; - -/** - * Defines the final shape for a short curve. - */ -module finalShortCurvedBarrierHolder() { - curvedBarrierHolder( - length = trackSectionLength, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = finalShortCurvedBarrierHolderRatio(), - right = rightOriented - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalShortCurvedBarrierHolder(); -} diff --git a/rcmodels/tracks/parts/elements/curved/curved-small.scad b/rcmodels/tracks/parts/elements/curved/curved-small.scad deleted file mode 100644 index cb6d60e..0000000 --- a/rcmodels/tracks/parts/elements/curved/curved-small.scad +++ /dev/null @@ -1,106 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A barrier holder for a small curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the curve ratio of the final shape for an small curve. - * @returns Number - */ -function finalSmallCurvedBarrierHolderRatio() = 1; - -/** - * Gets the length of the final shape for an small curve. - * @returns Number - */ -function finalSmallCurvedBarrierHolderLength() = - getCurvedBarrierLength( - length = trackSectionLength, - width = getBarrierHolderWidth(barrierHolderBase), - width = getBarrierHolderWidth(barrierHolderBase), - base = barrierHolderBase, - ratio = finalSmallCurvedBarrierHolderRatio() - ) -; - -/** - * Gets the width of the final shape for an small curve. - * @returns Number - */ -function finalSmallCurvedBarrierHolderWidth() = - getCurvedBarrierWidth( - length = trackSectionLength, - width = getBarrierHolderWidth(barrierHolderBase), - base = barrierHolderBase, - ratio = finalSmallCurvedBarrierHolderRatio() - ) -; - -/** - * Gets the horizontal interval of the final shape for an small curve. - * @returns Number - */ -function finalSmallCurvedBarrierHolderIntervalX() = - getPrintInterval( - finalSmallCurvedBarrierHolderLength() - ) -; - -/** - * Gets the vertical interval of the final shape for an small curve. - * @returns Number - */ -function finalSmallCurvedBarrierHolderIntervalY() = - getPrintInterval( - getBarrierHolderWidth(barrierHolderBase) + - getBarrierLinkLength(barrierHolderBase) - ) -; - -/** - * Defines the final shape for a small curve. - */ -module finalSmallCurvedBarrierHolder() { - curvedBarrierHolder( - length = trackSectionLength, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = finalSmallCurvedBarrierHolderRatio(), - right = rightOriented - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalSmallCurvedBarrierHolder(); -} diff --git a/rcmodels/tracks/parts/elements/curved/curved-uturn.scad b/rcmodels/tracks/parts/elements/curved/curved-uturn.scad deleted file mode 100644 index 21856fd..0000000 --- a/rcmodels/tracks/parts/elements/curved/curved-uturn.scad +++ /dev/null @@ -1,104 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A barrier holder for a U-turn track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the size of the gap between the 2 sides of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnCurvedBarrierHolderGap() = archTowerThickness * 2; - -/** - * Gets the length of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnCurvedBarrierHolderLength() = - getUTurnBarrierLength( - length = trackSectionLength, - width = getBarrierHolderWidth(barrierHolderBase), - base = barrierHolderBase, - gap = finalUTurnCurvedBarrierHolderGap() - ) -; - -/** - * Gets the width of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnCurvedBarrierHolderWidth() = - getUTurnBarrierWidth( - width = getBarrierHolderWidth(barrierHolderBase), - base = barrierHolderBase, - gap = finalUTurnCurvedBarrierHolderGap() - ) -; - -/** - * Gets the horizontal interval of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnCurvedBarrierHolderIntervalX() = - getPrintInterval( - finalUTurnCurvedBarrierHolderLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnCurvedBarrierHolderIntervalY() = - getPrintInterval( - finalUTurnCurvedBarrierHolderWidth() - ) -; - -/** - * Defines the final shape for a U-turn curve. - */ -module finalUTurnCurvedBarrierHolder() { - uTurnBarrierHolder( - length = trackSectionLength, - height = barrierHeight, - thickness = barrierBodyThickness, - base = barrierHolderBase, - gap = finalUTurnCurvedBarrierHolderGap(), - right = rightOriented - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalUTurnCurvedBarrierHolder(); -} diff --git a/rcmodels/tracks/parts/elements/straight/arch-tower.scad b/rcmodels/tracks/parts/elements/straight/arch-tower.scad deleted file mode 100644 index fd2e33a..0000000 --- a/rcmodels/tracks/parts/elements/straight/arch-tower.scad +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * An arch tower that clamp the barrier holders. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the length of the final shape for a couple of arch towers (male and female) - * @returns Number - */ -function finalArchTowerLength() = - getArchTowerLengthMale( - length = trackSectionLength, - base = barrierHolderBase, - wall = archTowerThickness - ) -; - -/** - * Gets the width of the final shape for a couple of arch towers (male and female) - * @returns Number - */ -function finalArchTowerWidth() = - getArchTowerWidth( - base = barrierHolderBase, - wall = archTowerThickness - ) -; - -/** - * Gets the horizontal interval of the final shape for a couple of arch towers (male and female) - * @returns Number - */ -function finalArchTowerIntervalX() = - getPrintInterval( - finalArchTowerLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a couple of arch towers (male and female) - * @returns Number - */ -function finalArchTowerIntervalY() = - 2 * getPrintInterval( - finalArchTowerWidth() - ) -; - -/** - * Defines the final shapes for a couple of arch towers (male and female). - */ -module finalArchTower() { - distribute([0, finalArchTowerIntervalY() / 2, 0], center=true) { - archTowerMale( - length = trackSectionLength, - thickness = barrierBodyThickness, - base = barrierHolderBase, - wall = archTowerThickness - ); - archTowerFemale( - length = trackSectionLength, - thickness = barrierBodyThickness, - base = barrierHolderBase, - wall = archTowerThickness - ); - } -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalArchTower(); -} diff --git a/rcmodels/tracks/parts/elements/straight/body-curved.scad b/rcmodels/tracks/parts/elements/straight/body-curved.scad deleted file mode 100644 index 5b46bf8..0000000 --- a/rcmodels/tracks/parts/elements/straight/body-curved.scad +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * An additional barrier body for a curved track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the length of the final shape for the additional barrier body of a curve. - * @returns Number - */ -function finalCurvedBarrierBodyLength() = getCurveRemainingLength(trackSectionLength); - -/** - * Gets the width of the final shape for the additional barrier body of a curve. - * @returns Number - */ -function finalCurvedBarrierBodyWidth() = getBarrierBodyHeight(barrierHeight); - -/** - * Gets the width of the final shape for the additional barrier body of a curve. - * @returns Number - */ -function finalCurvedBarrierBodyIntervalX() = - getPrintInterval( - finalCurvedBarrierBodyLength() - ) -; - -/** - * Gets the width of the final shape for the additional barrier body of a curve. - * @returns Number - */ -function finalCurvedBarrierBodyIntervalY() = - getPrintInterval( - finalCurvedBarrierBodyWidth() - ) -; - -/** - * Defines the final shape for the additional barrier body of a curve. - */ -module finalCurvedBarrierBody() { - barrierBody( - length = finalCurvedBarrierBodyLength(), - height = finalCurvedBarrierBodyWidth(), - thickness = barrierBodyThickness, - base = barrierHolderBase, - notches = 1 - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalCurvedBarrierBody(); -} diff --git a/rcmodels/tracks/parts/elements/straight/body-straight.scad b/rcmodels/tracks/parts/elements/straight/body-straight.scad deleted file mode 100644 index 3c60439..0000000 --- a/rcmodels/tracks/parts/elements/straight/body-straight.scad +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A barrier body for a straight track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the length of the final shape for a barrier body. - * @returns Number - */ -function finalStraightBarrierBodyLength() = trackSectionLength; - -/** - * Gets the width of the final shape for a barrier body. - * @returns Number - */ -function finalStraightBarrierBodyWidth() = getBarrierBodyHeight(barrierHeight); - -/** - * Gets the horizontal interval of the final shape for a barrier body. - * @returns Number - */ -function finalStraightBarrierBodyIntervalX() = - getPrintInterval( - finalStraightBarrierBodyLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a barrier body. - * @returns Number - */ -function finalStraightBarrierBodyIntervalY() = - getPrintInterval( - finalStraightBarrierBodyWidth() - ) -; - -/** - * Defines the final shape for a barrier body. - */ -module finalStraightBarrierBody() { - barrierBody( - length = finalStraightBarrierBodyLength(), - height = finalStraightBarrierBodyWidth(), - thickness = barrierBodyThickness, - base = barrierHolderBase, - notches = 2 - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalStraightBarrierBody(); -} diff --git a/rcmodels/tracks/parts/elements/straight/body-uturn.scad b/rcmodels/tracks/parts/elements/straight/body-uturn.scad deleted file mode 100644 index d8409be..0000000 --- a/rcmodels/tracks/parts/elements/straight/body-uturn.scad +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * An additional barrier body for a U-turn compensation track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the size of the gap between the 2 sides of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnBarrierBodyGap() = archTowerThickness * 2; - -/** - * Gets the length of the final shape for the additional barrier body of a U-turn. - * @returns Number - */ -function finalUTurnBarrierBodyLength() = - getUTurnCompensationBarrierBodyLength( - length = trackSectionLength, - base = barrierHolderBase, - gap = finalUTurnBarrierBodyGap() - ) -; - -/** - * Gets the width of the final shape for the additional barrier body of a U-turn. - * @returns Number - */ -function finalUTurnBarrierBodyWidth() = getBarrierBodyHeight(barrierHeight); - -/** - * Gets the horizontal interval of the final shape for the additional barrier body of a U-turn. - * @returns Number - */ -function finalUTurnBarrierBodyIntervalX() = - getPrintInterval( - finalUTurnBarrierBodyLength() - ) -; - -/** - * Gets the vertical interval of the final shape for the additional barrier body of a U-turn. - * @returns Number - */ -function finalUTurnBarrierBodyIntervalY() = - getPrintInterval( - finalUTurnBarrierBodyWidth() - ) -; - -/** - * Defines the final shape for the additional barrier body of a U-turn. - */ -module finalUTurnBarrierBody() { - uTurnCompensationBarrierBody( - length = finalUTurnBarrierBodyLength(), - height = finalUTurnBarrierBodyWidth(), - thickness = barrierBodyThickness, - base = barrierHolderBase, - gap = finalUTurnBarrierBodyGap() - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalUTurnBarrierBody(); -} diff --git a/rcmodels/tracks/parts/elements/straight/straight-double.scad b/rcmodels/tracks/parts/elements/straight/straight-double.scad deleted file mode 100644 index 051c30e..0000000 --- a/rcmodels/tracks/parts/elements/straight/straight-double.scad +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A barrier holder for a straight track part, with a double length. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the length ratio of the final shape for a double length barrier holder. - * @returns Number - */ -function finalDoubleStraightBarrierHolderRatio() = 2; - -/** - * Gets the length of the final shape for a double length barrier holder. - * @returns Number - */ -function finalDoubleStraightBarrierHolderLength() = - getStraightBarrierLength( - length = trackSectionLength, - base = barrierHolderBase, - ratio = finalDoubleStraightBarrierHolderRatio() - ) -; - -/** - * Gets the width of the final shape for a double length barrier holder. - * @returns Number - */ -function finalDoubleStraightBarrierHolderWidth() = getBarrierHolderWidth(barrierHolderBase); - -/** - * Gets the horizontal interval of the final shape for a double length barrier holder. - * @returns Number - */ -function finalDoubleStraightBarrierHolderIntervalX() = - getPrintInterval( - finalDoubleStraightBarrierHolderLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a double length barrier holder. - * @returns Number - */ -function finalDoubleStraightBarrierHolderIntervalY() = - getPrintInterval( - finalDoubleStraightBarrierHolderWidth() - ) -; - -/** - * Defines the final shape for a double length barrier holder. - */ -module finalDoubleStraightBarrierHolder() { - straightBarrierHolder( - length = trackSectionLength, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = finalDoubleStraightBarrierHolderRatio() - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalDoubleStraightBarrierHolder(); -} diff --git a/rcmodels/tracks/parts/elements/straight/straight-simple.scad b/rcmodels/tracks/parts/elements/straight/straight-simple.scad deleted file mode 100644 index 8daa035..0000000 --- a/rcmodels/tracks/parts/elements/straight/straight-simple.scad +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A barrier holder for a straight track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the length ratio of the final shape for a simple length barrier holder. - * @returns Number - */ -function finalSimpleStraightBarrierHolderRatio() = 1; - -/** - * Gets the length of the final shape for a simple length barrier holder. - * @returns Number - */ -function finalSimpleStraightBarrierHolderLength() = - getStraightBarrierLength( - length = trackSectionLength, - base = barrierHolderBase, - ratio = finalSimpleStraightBarrierHolderRatio() - ) -; - -/** - * Gets the width of the final shape for a simple length barrier holder. - * @returns Number - */ -function finalSimpleStraightBarrierHolderWidth() = getBarrierHolderWidth(barrierHolderBase); - -/** - * Gets the horizontal interval of the final shape for a simple length barrier holder. - * @returns Number - */ -function finalSimpleStraightBarrierHolderIntervalX() = - getPrintInterval( - finalSimpleStraightBarrierHolderLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a simple length barrier holder. - * @returns Number - */ -function finalSimpleStraightBarrierHolderIntervalY() = - getPrintInterval( - finalSimpleStraightBarrierHolderWidth() - ) -; - -/** - * Defines the final shape for a simple length barrier holder. - */ -module finalSimpleStraightBarrierHolder() { - straightBarrierHolder( - length = trackSectionLength, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = finalSimpleStraightBarrierHolderRatio() - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalSimpleStraightBarrierHolder(); -} diff --git a/rcmodels/tracks/parts/elements/straight/straight-uturn.scad b/rcmodels/tracks/parts/elements/straight/straight-uturn.scad deleted file mode 100644 index f54a6c4..0000000 --- a/rcmodels/tracks/parts/elements/straight/straight-uturn.scad +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A barrier holder to compensate a U-turn track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the size of the gap between the 2 sides of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnCompensationBarrierHolderGap() = archTowerThickness * 2; - -/** - * Gets the length of the final shape for a U-turn compensation barrier holder. - * @returns Number - */ -function finalUTurnCompensationBarrierHolderLength() = - getUTurnCompensationBarrierLength( - width = getBarrierHolderWidth(barrierHolderBase), - base = barrierHolderBase, - gap = finalUTurnCompensationBarrierHolderGap() - ) -; - -/** - * Gets the width of the final shape for a U-turn compensation barrier holder. - * @returns Number - */ -function finalUTurnCompensationBarrierHolderWidth() = getBarrierHolderWidth(barrierHolderBase); - -/** - * Gets the horizontal interval of the final shape for a U-turn compensation barrier holder. - * @returns Number - */ -function finalUTurnCompensationBarrierHolderIntervalX() = - getPrintInterval( - finalUTurnCompensationBarrierHolderLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a U-turn compensation barrier holder. - * @returns Number - */ -function finalUTurnCompensationBarrierHolderIntervalY() = - getPrintInterval( - finalUTurnCompensationBarrierHolderWidth() - ) -; - -/** - * Defines the final shape for a U-turn compensation barrier holder. - */ -module finalUTurnCompensationBarrierHolder() { - uTurnCompensationBarrierHolder( - thickness = barrierBodyThickness, - base = barrierHolderBase, - gap = finalUTurnCompensationBarrierHolderGap() - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalUTurnCompensationBarrierHolder(); -} diff --git a/rcmodels/tracks/parts/samples/curved/curved-inner-full.scad b/rcmodels/tracks/parts/samples/curved/curved-inner-full.scad deleted file mode 100644 index cb43f2f..0000000 --- a/rcmodels/tracks/parts/samples/curved/curved-inner-full.scad +++ /dev/null @@ -1,104 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for an inner curve track part, full curve. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the curve ratio of the final shape for an inner curve. - * @returns Number - */ -function finalFullInnerCurvedBarrierSampleRatio() = getInnerCurveRatio(trackSectionLength, trackRadius); - -/** - * Gets the length of the final shape for an inner curve. - * @returns Number - */ -function finalFullInnerCurvedBarrierSampleLength() = - getCurvedBarrierLength( - length = sampleSize * finalFullInnerCurvedBarrierSampleRatio(), - width = getBarrierHolderWidth(sampleBase), - base = sampleBase, - ratio = 1 - ) -; - -/** - * Gets the width of the final shape for an inner curve. - * @returns Number - */ -function finalFullInnerCurvedBarrierSampleWidth() = - getCurvedBarrierWidth( - length = sampleSize * finalFullInnerCurvedBarrierSampleRatio(), - width = getBarrierHolderWidth(sampleBase), - base = sampleBase, - ratio = 1 - ) -; - -/** - * Gets the horizontal interval of the final shape for an inner curve. - * @returns Number - */ -function finalFullInnerCurvedBarrierSampleIntervalX() = - getPrintInterval( - finalFullInnerCurvedBarrierSampleLength() - ) -; - -/** - * Gets the vertical interval of the final shape for an inner curve. - * @returns Number - */ -function finalFullInnerCurvedBarrierSampleIntervalY() = - getPrintInterval( - getBarrierHolderWidth(sampleBase) - ) -; - -/** - * Defines the final shape for a full inner curve. - */ -module finalFullInnerCurvedBarrierSample() { - curvedBarrierMain( - length = sampleSize * finalFullInnerCurvedBarrierSampleRatio(), - thickness = barrierBodyThickness, - base = sampleBase, - ratio = 1, - right = rightOriented - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalFullInnerCurvedBarrierSample(); -} diff --git a/rcmodels/tracks/parts/samples/curved/curved-inner.scad b/rcmodels/tracks/parts/samples/curved/curved-inner.scad deleted file mode 100644 index 57abea2..0000000 --- a/rcmodels/tracks/parts/samples/curved/curved-inner.scad +++ /dev/null @@ -1,104 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for an inner curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the curve ratio of the final shape for an inner curve. - * @returns Number - */ -function finalInnerCurvedBarrierSampleRatio() = getInnerCurveRatio(trackSectionLength, trackRadius); - -/** - * Gets the length of the final shape for an inner curve. - * @returns Number - */ -function finalInnerCurvedBarrierSampleLength() = - getCurvedBarrierLength( - length = sampleSize, - width = getBarrierHolderWidth(sampleBase), - base = sampleBase, - ratio = finalInnerCurvedBarrierSampleRatio() - ) -; - -/** - * Gets the width of the final shape for an inner curve. - * @returns Number - */ -function finalInnerCurvedBarrierSampleWidth() = - getCurvedBarrierWidth( - length = sampleSize, - width = getBarrierHolderWidth(sampleBase), - base = sampleBase, - ratio = finalInnerCurvedBarrierSampleRatio() - ) -; - -/** - * Gets the horizontal interval of the final shape for an inner curve. - * @returns Number - */ -function finalInnerCurvedBarrierSampleIntervalX() = - getPrintInterval( - finalInnerCurvedBarrierSampleLength() - ) -; - -/** - * Gets the vertical interval of the final shape for an inner curve. - * @returns Number - */ -function finalInnerCurvedBarrierSampleIntervalY() = - getPrintInterval( - getBarrierHolderWidth(sampleBase) - ) -; - -/** - * Defines the final shape for an inner curve. - */ -module finalInnerCurvedBarrierSample() { - curvedBarrierMain( - length = sampleSize, - thickness = barrierBodyThickness, - base = sampleBase, - ratio = finalInnerCurvedBarrierSampleRatio(), - right = rightOriented - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalInnerCurvedBarrierSample(); -} diff --git a/rcmodels/tracks/parts/samples/curved/curved-outer-full.scad b/rcmodels/tracks/parts/samples/curved/curved-outer-full.scad deleted file mode 100644 index 1f822ab..0000000 --- a/rcmodels/tracks/parts/samples/curved/curved-outer-full.scad +++ /dev/null @@ -1,104 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for an outer curve track part, full curve. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the curve ratio of the final shape for an outer curve. - * @returns Number - */ -function finalFullOuterCurvedBarrierSampleRatio() = getOuterCurveRatio(trackSectionLength, trackSectionWidth, trackRadius); - -/** - * Gets the length of the final shape for an outer curve. - * @returns Number - */ -function finalFullOuterCurvedBarrierSampleLength() = - getCurvedBarrierLength( - length = sampleSize * finalFullOuterCurvedBarrierSampleRatio(), - width = getBarrierHolderWidth(sampleBase), - base = sampleBase, - ratio = 1 - ) -; - -/** - * Gets the width of the final shape for an outer curve. - * @returns Number - */ -function finalFullOuterCurvedBarrierSampleWidth() = - getCurvedBarrierWidth( - length = sampleSize * finalFullOuterCurvedBarrierSampleRatio(), - width = getBarrierHolderWidth(sampleBase), - base = sampleBase, - ratio = 1 - ) -; - -/** - * Gets the horizontal interval of the final shape for an outer curve. - * @returns Number - */ -function finalFullOuterCurvedBarrierSampleIntervalX() = - getPrintInterval( - finalFullOuterCurvedBarrierSampleLength() - ) -; - -/** - * Gets the vertical interval of the final shape for an outer curve. - * @returns Number - */ -function finalFullOuterCurvedBarrierSampleIntervalY() = - getPrintInterval( - getBarrierHolderWidth(sampleBase) - ) -; - -/** - * Defines the final shape for a full outer curve. - */ -module finalFullOuterCurvedBarrierSample() { - curvedBarrierMain( - length = sampleSize * finalFullOuterCurvedBarrierSampleRatio(), - thickness = barrierBodyThickness, - base = sampleBase, - ratio = 1, - right = rightOriented - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalFullOuterCurvedBarrierSample(); -} diff --git a/rcmodels/tracks/parts/samples/curved/curved-outer.scad b/rcmodels/tracks/parts/samples/curved/curved-outer.scad deleted file mode 100644 index c601d3b..0000000 --- a/rcmodels/tracks/parts/samples/curved/curved-outer.scad +++ /dev/null @@ -1,104 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for an outer curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the curve ratio of the final shape for an outer curve. - * @returns Number - */ -function finalOuterCurvedBarrierSampleRatio() = getOuterCurveRatio(trackSectionLength, trackSectionWidth, trackRadius); - -/** - * Gets the length of the final shape for an outer curve. - * @returns Number - */ -function finalOuterCurvedBarrierSampleLength() = - getCurvedBarrierLength( - length = sampleSize, - width = getBarrierHolderWidth(sampleBase), - base = sampleBase, - ratio = finalOuterCurvedBarrierSampleRatio() - ) -; - -/** - * Gets the width of the final shape for an outer curve. - * @returns Number - */ -function finalOuterCurvedBarrierSampleWidth() = - getCurvedBarrierWidth( - length = sampleSize, - width = getBarrierHolderWidth(sampleBase), - base = sampleBase, - ratio = finalOuterCurvedBarrierSampleRatio() - ) -; - -/** - * Gets the horizontal interval of the final shape for an outer curve. - * @returns Number - */ -function finalOuterCurvedBarrierSampleIntervalX() = - getPrintInterval( - finalOuterCurvedBarrierSampleLength() - ) -; - -/** - * Gets the vertical interval of the final shape for an outer curve. - * @returns Number - */ -function finalOuterCurvedBarrierSampleIntervalY() = - getPrintInterval( - getBarrierHolderWidth(sampleBase) - ) -; - -/** - * Defines the final shape for an outer curve. - */ -module finalOuterCurvedBarrierSample() { - curvedBarrierMain( - length = sampleSize, - thickness = barrierBodyThickness, - base = sampleBase, - ratio = finalOuterCurvedBarrierSampleRatio(), - right = rightOriented - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalOuterCurvedBarrierSample(); -} diff --git a/rcmodels/tracks/parts/samples/curved/curved-short.scad b/rcmodels/tracks/parts/samples/curved/curved-short.scad deleted file mode 100644 index a54d894..0000000 --- a/rcmodels/tracks/parts/samples/curved/curved-short.scad +++ /dev/null @@ -1,104 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for a short curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the curve ratio of the final shape for an short curve. - * @returns Number - */ -function finalShortCurvedBarrierSampleRatio() = .5; - -/** - * Gets the length of the final shape for an short curve. - * @returns Number - */ -function finalShortCurvedBarrierSampleLength() = - getCurvedBarrierLength( - length = sampleSize, - width = getBarrierHolderWidth(sampleBase), - base = sampleBase, - ratio = finalShortCurvedBarrierSampleRatio() - ) -; - -/** - * Gets the width of the final shape for an short curve. - * @returns Number - */ -function finalShortCurvedBarrierSampleWidth() = - getCurvedBarrierWidth( - length = sampleSize, - width = getBarrierHolderWidth(sampleBase), - base = sampleBase, - ratio = finalShortCurvedBarrierSampleRatio() - ) -; - -/** - * Gets the horizontal interval of the final shape for an short curve. - * @returns Number - */ -function finalShortCurvedBarrierSampleIntervalX() = - getPrintInterval( - finalShortCurvedBarrierSampleLength() - ) -; - -/** - * Gets the vertical interval of the final shape for an short curve. - * @returns Number - */ -function finalShortCurvedBarrierSampleIntervalY() = - getPrintInterval( - finalShortCurvedBarrierSampleWidth() / 2 - ) -; - -/** - * Defines the final shape for a short curve. - */ -module finalShortCurvedBarrierSample() { - curvedBarrierMain( - length = sampleSize, - thickness = barrierBodyThickness, - base = sampleBase, - ratio = finalShortCurvedBarrierSampleRatio(), - right = rightOriented - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalShortCurvedBarrierSample(); -} diff --git a/rcmodels/tracks/parts/samples/curved/curved-small.scad b/rcmodels/tracks/parts/samples/curved/curved-small.scad deleted file mode 100644 index 07d55da..0000000 --- a/rcmodels/tracks/parts/samples/curved/curved-small.scad +++ /dev/null @@ -1,104 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for a small curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the curve ratio of the final shape for an small curve. - * @returns Number - */ -function finalSmallCurvedBarrierSampleRatio() = 1; - -/** - * Gets the length of the final shape for an small curve. - * @returns Number - */ -function finalSmallCurvedBarrierSampleLength() = - getCurvedBarrierLength( - length = sampleSize, - width = getBarrierHolderWidth(sampleBase), - base = sampleBase, - ratio = finalSmallCurvedBarrierSampleRatio() - ) -; - -/** - * Gets the width of the final shape for an small curve. - * @returns Number - */ -function finalSmallCurvedBarrierSampleWidth() = - getCurvedBarrierWidth( - length = sampleSize, - width = getBarrierHolderWidth(sampleBase), - base = sampleBase, - ratio = finalSmallCurvedBarrierSampleRatio() - ) -; - -/** - * Gets the horizontal interval of the final shape for an small curve. - * @returns Number - */ -function finalSmallCurvedBarrierSampleIntervalX() = - getPrintInterval( - finalSmallCurvedBarrierSampleLength() - ) -; - -/** - * Gets the vertical interval of the final shape for an small curve. - * @returns Number - */ -function finalSmallCurvedBarrierSampleIntervalY() = - getPrintInterval( - finalSmallCurvedBarrierSampleWidth() / 2 - ) -; - -/** - * Defines the final shape for a small curve. - */ -module finalSmallCurvedBarrierSample() { - curvedBarrierMain( - length = sampleSize, - thickness = barrierBodyThickness, - base = sampleBase, - ratio = finalSmallCurvedBarrierSampleRatio(), - right = rightOriented - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalSmallCurvedBarrierSample(); -} diff --git a/rcmodels/tracks/parts/samples/curved/curved-uturn.scad b/rcmodels/tracks/parts/samples/curved/curved-uturn.scad deleted file mode 100644 index b284924..0000000 --- a/rcmodels/tracks/parts/samples/curved/curved-uturn.scad +++ /dev/null @@ -1,151 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for a U-turn curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the size of the gap between the 2 sides of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnCurvedBarrierSampleGap() = minWidth * 2; - -/** - * Gets the length of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnCurvedBarrierSampleLength() = - getUTurnBarrierLength( - length = sampleSize, - width = getBarrierHolderWidth(sampleBase), - base = sampleBase, - gap = finalUTurnCurvedBarrierSampleGap() - ) -; - -/** - * Gets the width of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnCurvedBarrierSampleWidth() = - getUTurnBarrierWidth( - width = getBarrierHolderWidth(sampleBase), - base = sampleBase, - gap = finalUTurnCurvedBarrierSampleGap() - ) -; - -/** - * Gets the horizontal interval of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnCurvedBarrierSampleIntervalX() = - getPrintInterval( - finalUTurnCurvedBarrierSampleLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnCurvedBarrierSampleIntervalY() = - getPrintInterval( - finalUTurnCurvedBarrierSampleWidth() - ) -; - -/** - * Draws the shape of a barrier border for a U-Turn. - * @param Number length - The length of a track element. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number gap - The distance between the two side of the U-turn. - * @param Number right - Is it the right or the left part of the track element that is added first? - */ -module uTurnSample(length, thickness, base, gap, right = false) { - linkHeight = getBarrierHolderLinkHeight(base); - interval = (getBarrierHolderWidth(base) + gap) / 2; - dir = right ? -1 : 1; - length = length / 2; - - translateY(interval * dir) { - straightLinkMale(length=length, linkHeight=linkHeight, base=base) { - extrudeStraightProfile(length=length) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - } - } - } - translateY(-interval * dir) { - rotateZ(180) { - straightLinkFemale(length=length, linkHeight=linkHeight, base=base) { - extrudeStraightProfile(length=length) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - } - } - } - } - translateX(length / 2) { - rotateZ(270) { - extrudeCurvedProfile(radius=interval, angle=180) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - } - } - } -} - -/** - * Defines the final shape for a U-turn curve. - */ -module finalUTurnCurvedBarrierSample() { - uTurnSample( - length = sampleSize, - thickness = barrierBodyThickness, - base = sampleBase, - gap = finalUTurnCurvedBarrierSampleGap(), - right = rightOriented - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalUTurnCurvedBarrierSample(); -} diff --git a/rcmodels/tracks/parts/samples/straight/arch-sample.scad b/rcmodels/tracks/parts/samples/straight/arch-sample.scad deleted file mode 100644 index 3636d8e..0000000 --- a/rcmodels/tracks/parts/samples/straight/arch-sample.scad +++ /dev/null @@ -1,156 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * An arch sample scaled with respect to the size of the track samples. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the width of a lane with respect to the samples. - * @returns Number - */ -function getSampleLaneWidth() = trackLaneWidth / trackSectionLength * sampleSize; - -/** - * Gets the thickness of the clip outline.. - * @returns Number - */ -function getSampleWallWidth() = minWidth * 2; - -/** - * Gets the length of the final shape for an arch sample. - * @returns Number - */ -function finalArchSampleLength() = - getSampleLaneWidth() + - getBarrierHolderWidth(sampleBase) + - getSampleWallWidth() * 2 -; - -/** - * Gets the width of the final shape for an arch sample. - * @returns Number - */ -function finalArchSampleWidth() = - sampleSize * 1.5 + - getBarrierHolderHeight(sampleBase) + - getSampleWallWidth() * 2 -; - -/** - * Gets the horizontal interval of the final shape for an arch sample. - * @returns Number - */ -function finalArchSampleIntervalX() = - getPrintInterval( - finalArchSampleLength() - ) -; - -/** - * Gets the vertical interval of the final shape for an arch sample. - * @returns Number - */ -function finalArchSampleIntervalY() = - getPrintInterval( - finalArchSampleWidth() - ) -; - -/** - * Computes the points defining the profile of the arch sample. - * @param Number length - The length of a track element. - * @param Number width - The width of a track lane. - * @returns Vector[] - */ -function getArchSamplePoints(length, width) = - let( - start = width / 2, - radius = length, - tower = length / 2, - middle = width - 2 * radius - ) - path([ - ["P", -start, 0], - ["V", tower], - ["C", radius, 180, 90], - ["H", middle], - ["C", radius, 90, 0], - ["V", -tower] - ]) -; - -/** - * Draws the shape of the arch sample. - * @param Number length - The length of a track element. - * @param Number width - The width of a track lane. - * @param Number wall - The thickness of the outline. - */ -module archSampleProfile(length, width, wall) { - distance = wall / 2; - - difference() { - polygon(outline(getArchSamplePoints(length, width), -distance), convexity = 10); - polygon(outline(getArchSamplePoints(length, width), distance), convexity = 10); - rectangle([width - wall, wall]); - } -} - -/** - * Defines the final shape for an arch sample. - */ -module finalArchSample() { - laneWidth = getSampleLaneWidth(); - wallWidth = getSampleWallWidth(); - - linear_extrude(height=getBarrierHolderWidth(sampleBase), convexity=10) { - archSampleProfile(sampleSize, laneWidth, wallWidth); - repeat(count=2, intervalX=laneWidth, center=true) { - translateY(-getBarrierHolderHeight(sampleBase) - wallWidth * 2) { - difference() { - barrierHolderOutline( - wall = wallWidth, - base = sampleBase, - thickness = barrierBodyThickness, - distance = printTolerance - ); - rectangle([getBarrierHolderWidth(sampleBase) + wallWidth * 3, wallWidth * 2]); - rectangle([getBarrierHolderWidth(sampleBase) + printTolerance * 2, wallWidth * 3]); - } - } - } - } -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalArchSample(); -} diff --git a/rcmodels/tracks/parts/samples/straight/straight-double.scad b/rcmodels/tracks/parts/samples/straight/straight-double.scad deleted file mode 100644 index 790e898..0000000 --- a/rcmodels/tracks/parts/samples/straight/straight-double.scad +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for a straight track part, 2x the length. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the length ratio of the final shape for a double length barrier sample. - * @returns Number - */ -function finalDoubleStraightBarrierSampleRatio() = 2; - -/** - * Gets the length of the final shape for a double length barrier sample. - * @returns Number - */ -function finalDoubleStraightBarrierSampleLength() = - getStraightBarrierLength( - length = sampleSize, - base = sampleBase, - ratio = finalDoubleStraightBarrierSampleRatio() - ) -; - -/** - * Gets the width of the final shape for a double length barrier sample. - * @returns Number - */ -function finalDoubleStraightBarrierSampleWidth() = getBarrierHolderWidth(sampleBase); - -/** - * Gets the horizontal interval of the final shape for a double length barrier sample. - * @returns Number - */ -function finalDoubleStraightBarrierSampleIntervalX() = - getPrintInterval( - finalDoubleStraightBarrierSampleLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a double length barrier sample. - * @returns Number - */ -function finalDoubleStraightBarrierSampleIntervalY() = - getPrintInterval( - finalDoubleStraightBarrierSampleWidth() - ) -; - -/** - * Defines the final shape for a double length barrier sample. - */ -module finalDoubleStraightBarrierSample() { - straightBarrierMain( - length = sampleSize * finalDoubleStraightBarrierSampleRatio(), - thickness = barrierBodyThickness, - base = sampleBase - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalDoubleStraightBarrierSample(); -} diff --git a/rcmodels/tracks/parts/samples/straight/straight-long.scad b/rcmodels/tracks/parts/samples/straight/straight-long.scad deleted file mode 100644 index c1f29c7..0000000 --- a/rcmodels/tracks/parts/samples/straight/straight-long.scad +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for a straight track part, 10x the length. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the length ratio of the final shape for a long length barrier sample. - * @returns Number - */ -function finalLongStraightBarrierSampleRatio() = 10; - -/** - * Gets the length of the final shape for a long length barrier sample. - * @returns Number - */ -function finalLongStraightBarrierSampleLength() = - getStraightBarrierLength( - length = sampleSize, - base = sampleBase, - ratio = finalLongStraightBarrierSampleRatio() - ) -; - -/** - * Gets the width of the final shape for a long length barrier sample. - * @returns Number - */ -function finalLongStraightBarrierSampleWidth() = getBarrierHolderWidth(sampleBase); - -/** - * Gets the horizontal interval of the final shape for a long length barrier sample. - * @returns Number - */ -function finalLongStraightBarrierSampleIntervalX() = - getPrintInterval( - finalLongStraightBarrierSampleLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a long length barrier sample. - * @returns Number - */ -function finalLongStraightBarrierSampleIntervalY() = - getPrintInterval( - finalLongStraightBarrierSampleWidth() - ) -; - -/** - * Defines the final shape for a long length barrier sample. - */ -module finalLongStraightBarrierSample() { - straightBarrierMain( - length = sampleSize * finalLongStraightBarrierSampleRatio(), - thickness = barrierBodyThickness, - base = sampleBase - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalLongStraightBarrierSample(); -} diff --git a/rcmodels/tracks/parts/samples/straight/straight-simple.scad b/rcmodels/tracks/parts/samples/straight/straight-simple.scad deleted file mode 100644 index 23d7be4..0000000 --- a/rcmodels/tracks/parts/samples/straight/straight-simple.scad +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for a straight track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the length ratio of the final shape for a simple length barrier sample. - * @returns Number - */ -function finalSimpleStraightBarrierSampleRatio() = 1; - -/** - * Gets the length of the final shape for a simple length barrier sample. - * @returns Number - */ -function finalSimpleStraightBarrierSampleLength() = - getStraightBarrierLength( - length = sampleSize, - base = sampleBase, - ratio = finalSimpleStraightBarrierSampleRatio() - ) -; - -/** - * Gets the width of the final shape for a simple length barrier sample. - * @returns Number - */ -function finalSimpleStraightBarrierSampleWidth() = getBarrierHolderWidth(sampleBase); - -/** - * Gets the horizontal interval of the final shape for a simple length barrier sample. - * @returns Number - */ -function finalSimpleStraightBarrierSampleIntervalX() = - getPrintInterval( - finalSimpleStraightBarrierSampleLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a simple length barrier sample. - * @returns Number - */ -function finalSimpleStraightBarrierSampleIntervalY() = - getPrintInterval( - finalSimpleStraightBarrierSampleWidth() - ) -; - -/** - * Defines the final shape for a simple length barrier sample. - */ -module finalSimpleStraightBarrierSample() { - straightBarrierMain( - length = sampleSize * finalSimpleStraightBarrierSampleRatio(), - thickness = barrierBodyThickness, - base = sampleBase - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalSimpleStraightBarrierSample(); -} diff --git a/rcmodels/tracks/parts/samples/straight/straight-uturn.scad b/rcmodels/tracks/parts/samples/straight/straight-uturn.scad deleted file mode 100644 index 293155e..0000000 --- a/rcmodels/tracks/parts/samples/straight/straight-uturn.scad +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A sample for a U-turn compensation track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the size of the gap between the 2 sides of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnCompensationBarrierSampleGap() = minWidth * 2; - -/** - * Gets the length of the final shape for a U-turn compensation barrier sample. - * @returns Number - */ -function finalUTurnCompensationBarrierSampleLength() = - getUTurnCompensationBarrierLength( - width = getBarrierHolderWidth(sampleBase), - base = sampleBase, - gap = finalUTurnCompensationBarrierSampleGap() - ) -; - -/** - * Gets the width of the final shape for a U-turn compensation barrier sample. - * @returns Number - */ -function finalUTurnCompensationBarrierSampleWidth() = getBarrierHolderWidth(sampleBase); - -/** - * Gets the horizontal interval of the final shape for a U-turn compensation barrier sample. - * @returns Number - */ -function finalUTurnCompensationBarrierSampleIntervalX() = - getPrintInterval( - finalUTurnCompensationBarrierSampleLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a U-turn compensation barrier sample. - * @returns Number - */ -function finalUTurnCompensationBarrierSampleIntervalY() = - getPrintInterval( - finalUTurnCompensationBarrierSampleWidth() - ) -; - -/** - * Defines the final shape for a U-turn compensation barrier sample. - */ -module finalUTurnCompensationBarrierSample() { - straightBarrierMain( - length = getBarrierHolderWidth(sampleBase) + finalUTurnCompensationBarrierSampleGap(), - thickness = barrierBodyThickness, - base = sampleBase - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalUTurnCompensationBarrierSample(); -} diff --git a/rcmodels/tracks/parts/unibody/curved/curved-inner.scad b/rcmodels/tracks/parts/unibody/curved/curved-inner.scad deleted file mode 100644 index 4b9e66f..0000000 --- a/rcmodels/tracks/parts/unibody/curved/curved-inner.scad +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A unibody barrier for an inner curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the curve ratio of the final shape for an inner curve. - * @returns Number - */ -function finalInnerCurvedBarrierUnibodyRatio() = getInnerCurveRatio(trackSectionLength, trackRadius); - -/** - * Gets the length of the final shape for an inner curve. - * @returns Number - */ -function finalInnerCurvedBarrierUnibodyLength() = - getCurvedBarrierLength( - length = trackSectionLength, - width = getBarrierUnibodyWidth(barrierHolderBase), - base = barrierHolderBase, - ratio = finalInnerCurvedBarrierUnibodyRatio() - ) -; - -/** - * Gets the width of the final shape for an inner curve. - * @returns Number - */ -function finalInnerCurvedBarrierUnibodyWidth() = - getCurvedBarrierWidth( - length = trackSectionLength, - width = getBarrierUnibodyWidth(barrierHolderBase), - base = barrierHolderBase, - ratio = finalInnerCurvedBarrierUnibodyRatio() - ) -; - -/** - * Gets the horizontal interval of the final shape for an inner curve. - * @returns Number - */ -function finalInnerCurvedBarrierUnibodyIntervalX() = - getPrintInterval( - finalInnerCurvedBarrierUnibodyLength() - ) -; - -/** - * Gets the vertical interval of the final shape for an inner curve. - * @returns Number - */ -function finalInnerCurvedBarrierUnibodyIntervalY() = - getPrintInterval( - getBarrierUnibodyWidth(barrierHolderBase) - ) -; - -/** - * Defines the final shape for an inner curve. - */ -module finalInnerCurvedBarrierUnibody() { - curvedBarrierUnibody( - length = trackSectionLength, - height = barrierHeight, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = finalInnerCurvedBarrierUnibodyRatio(), - right = rightOriented - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalInnerCurvedBarrierUnibody(); -} diff --git a/rcmodels/tracks/parts/unibody/curved/curved-outer.scad b/rcmodels/tracks/parts/unibody/curved/curved-outer.scad deleted file mode 100644 index f1f5be5..0000000 --- a/rcmodels/tracks/parts/unibody/curved/curved-outer.scad +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A unibody barrier for an outer curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the curve ratio of the final shape for an outer curve. - * @returns Number - */ -function finalOuterCurvedBarrierUnibodyRatio() = getOuterCurveRatio(trackSectionLength, trackSectionWidth, trackRadius); - -/** - * Gets the length of the final shape for an outer curve. - * @returns Number - */ -function finalOuterCurvedBarrierUnibodyLength() = - getCurvedBarrierLength( - length = trackSectionLength, - width = getBarrierUnibodyWidth(barrierHolderBase), - base = barrierHolderBase, - ratio = finalOuterCurvedBarrierUnibodyRatio() - ) -; - -/** - * Gets the width of the final shape for an outer curve. - * @returns Number - */ -function finalOuterCurvedBarrierUnibodyWidth() = - getCurvedBarrierWidth( - length = trackSectionLength, - width = getBarrierUnibodyWidth(barrierHolderBase), - base = barrierHolderBase, - ratio = finalOuterCurvedBarrierUnibodyRatio() - ) -; - -/** - * Gets the horizontal interval of the final shape for an outer curve. - * @returns Number - */ -function finalOuterCurvedBarrierUnibodyIntervalX() = - getPrintInterval( - finalOuterCurvedBarrierUnibodyLength() - ) -; - -/** - * Gets the vertical interval of the final shape for an outer curve. - * @returns Number - */ -function finalOuterCurvedBarrierUnibodyIntervalY() = - getPrintInterval( - getBarrierUnibodyWidth(barrierHolderBase) - ) -; - -/** - * Defines the final shape for an outer curve. - */ -module finalOuterCurvedBarrierUnibody() { - curvedBarrierUnibody( - length = trackSectionLength, - height = barrierHeight, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = finalOuterCurvedBarrierUnibodyRatio(), - right = rightOriented - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalOuterCurvedBarrierUnibody(); -} diff --git a/rcmodels/tracks/parts/unibody/curved/curved-short.scad b/rcmodels/tracks/parts/unibody/curved/curved-short.scad deleted file mode 100644 index c168854..0000000 --- a/rcmodels/tracks/parts/unibody/curved/curved-short.scad +++ /dev/null @@ -1,106 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A unibody barrier for a short curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the curve ratio of the final shape for an small curve. - * @returns Number - */ -function finalShortCurvedBarrierUnibodyRatio() = .5; - -/** - * Gets the length of the final shape for an small curve. - * @returns Number - */ -function finalShortCurvedBarrierUnibodyLength() = - getCurvedBarrierLength( - length = trackSectionLength, - width = getBarrierUnibodyWidth(barrierHolderBase), - base = barrierHolderBase, - ratio = finalShortCurvedBarrierUnibodyRatio() - ) -; - -/** - * Gets the width of the final shape for an small curve. - * @returns Number - */ -function finalShortCurvedBarrierUnibodyWidth() = - getCurvedBarrierWidth( - length = trackSectionLength, - width = getBarrierUnibodyWidth(barrierHolderBase), - base = barrierHolderBase, - ratio = finalShortCurvedBarrierUnibodyRatio() - ) -; - -/** - * Gets the horizontal interval of the final shape for an small curve. - * @returns Number - */ -function finalShortCurvedBarrierUnibodyIntervalX() = - getPrintInterval( - finalShortCurvedBarrierUnibodyLength() / 4 - ) -; - -/** - * Gets the vertical interval of the final shape for an small curve. - * @returns Number - */ -function finalShortCurvedBarrierUnibodyIntervalY() = - getPrintInterval( - getBarrierUnibodyWidth(barrierHolderBase) + - getBarrierLinkLength(barrierHolderBase) - ) -; - -/** - * Defines the final shape for a short curve. - */ -module finalShortCurvedBarrierUnibody() { - curvedBarrierUnibody( - length = trackSectionLength, - height = barrierHeight, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = finalShortCurvedBarrierUnibodyRatio(), - right = rightOriented - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalShortCurvedBarrierUnibody(); -} diff --git a/rcmodels/tracks/parts/unibody/curved/curved-small.scad b/rcmodels/tracks/parts/unibody/curved/curved-small.scad deleted file mode 100644 index 785fab5..0000000 --- a/rcmodels/tracks/parts/unibody/curved/curved-small.scad +++ /dev/null @@ -1,106 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A unibody barrier for a small curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the curve ratio of the final shape for an small curve. - * @returns Number - */ -function finalSmallCurvedBarrierUnibodyRatio() = 1; - -/** - * Gets the length of the final shape for an small curve. - * @returns Number - */ -function finalSmallCurvedBarrierUnibodyLength() = - getCurvedBarrierLength( - length = trackSectionLength, - width = getBarrierUnibodyWidth(barrierHolderBase), - base = barrierHolderBase, - ratio = finalSmallCurvedBarrierUnibodyRatio() - ) -; - -/** - * Gets the width of the final shape for an small curve. - * @returns Number - */ -function finalSmallCurvedBarrierUnibodyWidth() = - getCurvedBarrierWidth( - length = trackSectionLength, - width = getBarrierUnibodyWidth(barrierHolderBase), - base = barrierHolderBase, - ratio = finalSmallCurvedBarrierUnibodyRatio() - ) -; - -/** - * Gets the horizontal interval of the final shape for an small curve. - * @returns Number - */ -function finalSmallCurvedBarrierUnibodyIntervalX() = - getPrintInterval( - finalSmallCurvedBarrierUnibodyLength() - ) -; - -/** - * Gets the vertical interval of the final shape for an small curve. - * @returns Number - */ -function finalSmallCurvedBarrierUnibodyIntervalY() = - getPrintInterval( - getBarrierUnibodyWidth(barrierHolderBase) + - getBarrierLinkLength(barrierHolderBase) - ) -; - -/** - * Defines the final shape for a small curve. - */ -module finalSmallCurvedBarrierUnibody() { - curvedBarrierUnibody( - length = trackSectionLength, - height = barrierHeight, - thickness = barrierBodyThickness, - base = barrierHolderBase, - ratio = finalSmallCurvedBarrierUnibodyRatio(), - right = rightOriented - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalSmallCurvedBarrierUnibody(); -} diff --git a/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad b/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad deleted file mode 100644 index a55c69a..0000000 --- a/rcmodels/tracks/parts/unibody/curved/curved-uturn.scad +++ /dev/null @@ -1,104 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A unibody barrier for a U-turn track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the size of the gap between the 2 sides of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnCurvedBarrierUnibodyGap() = archTowerThickness * 2; - -/** - * Gets the length of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnCurvedBarrierUnibodyLength() = - getUTurnBarrierLength( - length = trackSectionLength, - width = getBarrierUnibodyWidth(barrierHolderBase), - base = barrierHolderBase, - gap = finalUTurnCurvedBarrierUnibodyGap() - ) -; - -/** - * Gets the width of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnCurvedBarrierUnibodyWidth() = - getUTurnBarrierWidth( - width = getBarrierUnibodyWidth(barrierHolderBase), - base = barrierHolderBase, - gap = finalUTurnCurvedBarrierUnibodyGap() - ) -; - -/** - * Gets the horizontal interval of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnCurvedBarrierUnibodyIntervalX() = - getPrintInterval( - finalUTurnCurvedBarrierUnibodyLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnCurvedBarrierUnibodyIntervalY() = - getPrintInterval( - finalUTurnCurvedBarrierUnibodyWidth() - ) -; - -/** - * Defines the final shape for a U-turn curve. - */ -module finalUTurnCurvedBarrierUnibody() { - uTurnBarrierUnibody( - length = trackSectionLength, - height = barrierHeight, - thickness = barrierBodyThickness, - base = barrierHolderBase, - gap = finalUTurnCurvedBarrierUnibodyGap(), - right = rightOriented - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalUTurnCurvedBarrierUnibody(); -} diff --git a/rcmodels/tracks/parts/unibody/straight/straight-connector.scad b/rcmodels/tracks/parts/unibody/straight/straight-connector.scad deleted file mode 100644 index bb8967c..0000000 --- a/rcmodels/tracks/parts/unibody/straight/straight-connector.scad +++ /dev/null @@ -1,112 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A unibody barrier connector to connect track part made with barrier holder. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the length of the final shape for a unibody barrier connector. - * @returns Number - */ -function finalConnectorBarrierUnibodyLength() = - 2 * getStraightBarrierLength(trackSectionLength, barrierHolderBase, .5) + - getBarrierLinkLength(barrierHolderBase) + - printInterval -; - -/** - * Gets the width of the final shape for a unibody barrier connector. - * @returns Number - */ -function finalConnectorBarrierUnibodyWidth() = - 3 * getBarrierUnibodyWidth(barrierHolderBase) + - 2 * printInterval -; - -/** - * Gets the horizontal interval of the final shape for a unibody barrier connector. - * @returns Number - */ -function finalConnectorBarrierUnibodyIntervalX() = - getPrintInterval( - finalConnectorBarrierUnibodyLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a unibody barrier connector. - * @returns Number - */ -function finalConnectorBarrierUnibodyIntervalY() = - getPrintInterval( - finalConnectorBarrierUnibodyWidth() - ) -; - -/** - * Defines the final shape for a unibody barrier connector. - */ -module finalConnectorBarrierUnibody() { - intervalX = getPrintInterval(getStraightBarrierLength(trackSectionLength, barrierHolderBase, .5)); - intervalY = getPrintInterval(getBarrierUnibodyWidth(barrierHolderBase)); - distribute(intervalY=intervalY, center=true) { - barrierHolderToUnibodyMale( - length = trackSectionLength, - height = barrierHeight, - thickness = barrierBodyThickness, - base = barrierHolderBase - ); - distribute(intervalX=intervalX, center=true) { - barrierHolderConnectorFemale( - length = trackSectionLength, - thickness = barrierBodyThickness, - base = barrierHolderBase - ); - barrierHolderConnectorMale( - length = trackSectionLength, - thickness = barrierBodyThickness, - base = barrierHolderBase - ); - } - barrierHolderToUnibodyFemale( - length = trackSectionLength, - height = barrierHeight, - thickness = barrierBodyThickness, - base = barrierHolderBase - ); - } -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalConnectorBarrierUnibody(); -} diff --git a/rcmodels/tracks/parts/unibody/straight/straight-double.scad b/rcmodels/tracks/parts/unibody/straight/straight-double.scad deleted file mode 100644 index c355734..0000000 --- a/rcmodels/tracks/parts/unibody/straight/straight-double.scad +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A unibody barrier for a straight track part, with a double length. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the length ratio of the final shape for a double length unibody barrier. - * @returns Number - */ -function finalDoubleStraightBarrierUnibodyRatio() = 2; - -/** - * Gets the length of the final shape for a double length unibody barrier. - * @returns Number - */ -function finalDoubleStraightBarrierUnibodyLength() = - getStraightBarrierLength( - length = trackSectionLength, - base = barrierHolderBase, - ratio = finalDoubleStraightBarrierUnibodyRatio() - ) -; - -/** - * Gets the width of the final shape for a double length unibody barrier. - * @returns Number - */ -function finalDoubleStraightBarrierUnibodyWidth() = getBarrierUnibodyWidth(barrierHolderBase); - -/** - * Gets the horizontal interval of the final shape for a double length unibody barrier. - * @returns Number - */ -function finalDoubleStraightBarrierUnibodyIntervalX() = - getPrintInterval( - finalDoubleStraightBarrierUnibodyLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a double length unibody barrier. - * @returns Number - */ -function finalDoubleStraightBarrierUnibodyIntervalY() = - getPrintInterval( - finalDoubleStraightBarrierUnibodyWidth() - ) -; - -/** - * Defines the final shape for a double length unibody barrier. - */ -module finalDoubleStraightBarrierUnibody() { - straightBarrierUnibody( - length = trackSectionLength * finalDoubleStraightBarrierUnibodyRatio(), - height = barrierHeight, - thickness = barrierBodyThickness, - base = barrierHolderBase - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalDoubleStraightBarrierUnibody(); -} diff --git a/rcmodels/tracks/parts/unibody/straight/straight-simple.scad b/rcmodels/tracks/parts/unibody/straight/straight-simple.scad deleted file mode 100644 index ca2783f..0000000 --- a/rcmodels/tracks/parts/unibody/straight/straight-simple.scad +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A unibody barrier for a straight track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the length ratio of the final shape for a simple length unibody barrier. - * @returns Number - */ -function finalSimpleStraightBarrierUnibodyRatio() = 1; - -/** - * Gets the length of the final shape for a simple length unibody barrier. - * @returns Number - */ -function finalSimpleStraightBarrierUnibodyLength() = - getStraightBarrierLength( - length = trackSectionLength, - base = barrierHolderBase, - ratio = finalSimpleStraightBarrierUnibodyRatio() - ) -; - -/** - * Gets the width of the final shape for a simple length unibody barrier. - * @returns Number - */ -function finalSimpleStraightBarrierUnibodyWidth() = getBarrierUnibodyWidth(barrierHolderBase); - -/** - * Gets the horizontal interval of the final shape for a simple length unibody barrier. - * @returns Number - */ -function finalSimpleStraightBarrierUnibodyIntervalX() = - getPrintInterval( - finalSimpleStraightBarrierUnibodyLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a simple length unibody barrier. - * @returns Number - */ -function finalSimpleStraightBarrierUnibodyIntervalY() = - getPrintInterval( - finalSimpleStraightBarrierUnibodyWidth() - ) -; - -/** - * Defines the final shape for a simple length unibody barrier. - */ -module finalSimpleStraightBarrierUnibody() { - straightBarrierUnibody( - length = trackSectionLength * finalSimpleStraightBarrierUnibodyRatio(), - height = barrierHeight, - thickness = barrierBodyThickness, - base = barrierHolderBase - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalSimpleStraightBarrierUnibody(); -} diff --git a/rcmodels/tracks/parts/unibody/straight/straight-uturn.scad b/rcmodels/tracks/parts/unibody/straight/straight-uturn.scad deleted file mode 100644 index 6ba213f..0000000 --- a/rcmodels/tracks/parts/unibody/straight/straight-uturn.scad +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A unibody barrier to compensate a U-turn track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -/** - * Gets the size of the gap between the 2 sides of the final shape for a U-turn curve. - * @returns Number - */ -function finalUTurnCompensationBarrierUnibodyGap() = archTowerThickness * 2; - -/** - * Gets the length of the final shape for a U-turn compensation unibody barrier. - * @returns Number - */ -function finalUTurnCompensationBarrierUnibodyLength() = - getUTurnCompensationBarrierLength( - width = getBarrierUnibodyWidth(barrierHolderBase), - base = barrierHolderBase, - gap = finalUTurnCompensationBarrierUnibodyGap() - ) -; - -/** - * Gets the width of the final shape for a U-turn compensation unibody barrier. - * @returns Number - */ -function finalUTurnCompensationBarrierUnibodyWidth() = getBarrierUnibodyWidth(barrierHolderBase); - -/** - * Gets the horizontal interval of the final shape for a U-turn compensation unibody barrier. - * @returns Number - */ -function finalUTurnCompensationBarrierUnibodyIntervalX() = - getPrintInterval( - finalUTurnCompensationBarrierUnibodyLength() - ) -; - -/** - * Gets the vertical interval of the final shape for a U-turn compensation unibody barrier. - * @returns Number - */ -function finalUTurnCompensationBarrierUnibodyIntervalY() = - getPrintInterval( - finalUTurnCompensationBarrierUnibodyWidth() - ) -; - -/** - * Defines the final shape for a U-turn compensation unibody barrier. - */ -module finalUTurnCompensationBarrierUnibody() { - uTurnCompensationBarrierUnibody( - height = barrierHeight, - thickness = barrierBodyThickness, - base = barrierHolderBase, - gap = finalUTurnCompensationBarrierUnibodyGap() - ); -} - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - finalUTurnCompensationBarrierUnibody(); -} diff --git a/rcmodels/tracks/plates/accessories/bent-mast.scad b/rcmodels/tracks/plates/accessories/bent-mast.scad deleted file mode 100644 index 6cab11c..0000000 --- a/rcmodels/tracks/plates/accessories/bent-mast.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of bent masts to clip accessories onto the barrier holders. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../config/setup.scad> -use <../../parts/accessories/bent-mast.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 2, - countY = 5, - intervalX = [finalBentMastIntervalX(), 0, 0], - intervalY = [0, finalBentMastIntervalY(), 0], - center = true - ) { - finalBentMast(); - } - } -} diff --git a/rcmodels/tracks/plates/accessories/cable-clip.scad b/rcmodels/tracks/plates/accessories/cable-clip.scad deleted file mode 100644 index d61f10d..0000000 --- a/rcmodels/tracks/plates/accessories/cable-clip.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of LED cable clips for the barrier holders. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../config/setup.scad> -use <../../parts/accessories/cable-clip.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 15, - countY = 10, - intervalX = [finalCableClipIntervalX(), 0, 0], - intervalY = [0, finalCableClipIntervalY(), 0], - center = true - ) { - finalCableClip(); - } - } -} diff --git a/rcmodels/tracks/plates/accessories/straight-flag.scad b/rcmodels/tracks/plates/accessories/straight-flag.scad deleted file mode 100644 index e28f89a..0000000 --- a/rcmodels/tracks/plates/accessories/straight-flag.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of straight flags to clip onto the barrier holders. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../config/setup.scad> -use <../../parts/accessories/straight-flag.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 3, - countY = 4, - intervalX = [finalStraightFlagIntervalX(), 0, 0], - intervalY = [0, finalStraightFlagIntervalY(), 0], - center = true - ) { - finalStraightFlag(); - } - } -} diff --git a/rcmodels/tracks/plates/accessories/straight-mast.scad b/rcmodels/tracks/plates/accessories/straight-mast.scad deleted file mode 100644 index 8ba56dc..0000000 --- a/rcmodels/tracks/plates/accessories/straight-mast.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of masts to clip accessories onto the barrier holders. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../config/setup.scad> -use <../../parts/accessories/straight-mast.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 2, - countY = 10, - intervalX = [finalStraightMastIntervalX(), 0, 0], - intervalY = [0, finalStraightMastIntervalY(), 0], - center = true - ) { - finalStraightMast(); - } - } -} diff --git a/rcmodels/tracks/plates/accessories/wavy-flag.scad b/rcmodels/tracks/plates/accessories/wavy-flag.scad deleted file mode 100644 index 64be3c1..0000000 --- a/rcmodels/tracks/plates/accessories/wavy-flag.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of straight flags to clip onto the barrier holders. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../config/setup.scad> -use <../../parts/accessories/wavy-flag.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 3, - countY = 4, - intervalX = [finalWavyFlagIntervalX(), 0, 0], - intervalY = [0, finalWavyFlagIntervalY(), 0], - center = true - ) { - finalWavyFlag(); - } - } -} diff --git a/rcmodels/tracks/plates/elements/curved/curved-inner.scad b/rcmodels/tracks/plates/elements/curved/curved-inner.scad deleted file mode 100644 index 792abb9..0000000 --- a/rcmodels/tracks/plates/elements/curved/curved-inner.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of barrier holders for an inner curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/elements/curved/curved-inner.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat( - count = finalInnerCurvedBarrierHolderRatio() * 2, - intervalY = finalInnerCurvedBarrierHolderIntervalY(), - center = true - ) { - finalInnerCurvedBarrierHolder(); - } - } -} diff --git a/rcmodels/tracks/plates/elements/curved/curved-outer.scad b/rcmodels/tracks/plates/elements/curved/curved-outer.scad deleted file mode 100644 index efbc95a..0000000 --- a/rcmodels/tracks/plates/elements/curved/curved-outer.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of barrier holders for an outer curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/elements/curved/curved-outer.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat( - count = finalOuterCurvedBarrierHolderRatio() * 2, - intervalY = finalOuterCurvedBarrierHolderIntervalY(), - center = true - ) { - finalOuterCurvedBarrierHolder(); - } - } -} diff --git a/rcmodels/tracks/plates/elements/curved/curved-short.scad b/rcmodels/tracks/plates/elements/curved/curved-short.scad deleted file mode 100644 index f82ac97..0000000 --- a/rcmodels/tracks/plates/elements/curved/curved-short.scad +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of barrier holders for a short curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/elements/curved/curved-short.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat( - count = 2, - intervalY = finalShortCurvedBarrierHolderWidth() + finalShortCurvedBarrierHolderIntervalY(), - center = true - ) { - repeatRotate( - count = 2, - intervalX = finalShortCurvedBarrierHolderIntervalX(), - intervalY = -finalShortCurvedBarrierHolderIntervalY(), - center = true - ) { - finalShortCurvedBarrierHolder(); - } - } - } -} diff --git a/rcmodels/tracks/plates/elements/curved/curved-small.scad b/rcmodels/tracks/plates/elements/curved/curved-small.scad deleted file mode 100644 index 27d2e4d..0000000 --- a/rcmodels/tracks/plates/elements/curved/curved-small.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of barrier holders for a small curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/elements/curved/curved-small.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat( - count = 4, - intervalY = finalSmallCurvedBarrierHolderIntervalY(), - center = true - ) { - finalSmallCurvedBarrierHolder(); - } - } -} diff --git a/rcmodels/tracks/plates/elements/curved/curved-uturn.scad b/rcmodels/tracks/plates/elements/curved/curved-uturn.scad deleted file mode 100644 index 885489a..0000000 --- a/rcmodels/tracks/plates/elements/curved/curved-uturn.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of barrier holders for a U-turn track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/elements/curved/curved-uturn.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat( - count = 4, - intervalY = finalUTurnCurvedBarrierHolderIntervalY(), - center = true - ) { - finalUTurnCurvedBarrierHolder(); - } - } -} diff --git a/rcmodels/tracks/plates/elements/straight/arch-tower.scad b/rcmodels/tracks/plates/elements/straight/arch-tower.scad deleted file mode 100644 index e8fdd78..0000000 --- a/rcmodels/tracks/plates/elements/straight/arch-tower.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of couples of arch towers that clamp the barrier holders. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/elements/straight/arch-tower.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 2, - countY = 4, - intervalX = [finalArchTowerIntervalX(), 0, 0], - intervalY = [0, finalArchTowerIntervalY(), 0], - center = true - ) { - finalArchTower(); - } - } -} diff --git a/rcmodels/tracks/plates/elements/straight/body-curved.scad b/rcmodels/tracks/plates/elements/straight/body-curved.scad deleted file mode 100644 index f5adfd3..0000000 --- a/rcmodels/tracks/plates/elements/straight/body-curved.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of additional barrier bodies for curved track parts. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/elements/straight/body-curved.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 3, - countY = 5, - intervalX = [finalCurvedBarrierBodyIntervalX(), 0, 0], - intervalY = [0, finalCurvedBarrierBodyIntervalY(), 0], - center = true - ) { - finalCurvedBarrierBody(); - } - } -} diff --git a/rcmodels/tracks/plates/elements/straight/body-straight.scad b/rcmodels/tracks/plates/elements/straight/body-straight.scad deleted file mode 100644 index 16f6d0c..0000000 --- a/rcmodels/tracks/plates/elements/straight/body-straight.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of barrier bodies for straight track parts. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/elements/straight/body-straight.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 2, - countY = 5, - intervalX = [finalStraightBarrierBodyIntervalX(), 0, 0], - intervalY = [0, finalStraightBarrierBodyIntervalY(), 0], - center = true - ) { - finalStraightBarrierBody(); - } - } -} diff --git a/rcmodels/tracks/plates/elements/straight/body-uturn.scad b/rcmodels/tracks/plates/elements/straight/body-uturn.scad deleted file mode 100644 index 25fe2f4..0000000 --- a/rcmodels/tracks/plates/elements/straight/body-uturn.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of additional barrier bodies for U-turn compensation track parts. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/elements/straight/body-uturn.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat( - count = 5, - intervalY = finalUTurnBarrierBodyIntervalY(), - center = true - ) { - finalUTurnBarrierBody(); - } - } -} diff --git a/rcmodels/tracks/plates/elements/straight/straight-double.scad b/rcmodels/tracks/plates/elements/straight/straight-double.scad deleted file mode 100644 index c7d78e3..0000000 --- a/rcmodels/tracks/plates/elements/straight/straight-double.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of straight barrier holders with a double length. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/elements/straight/straight-double.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat( - count = 10, - intervalY = finalDoubleStraightBarrierHolderIntervalY(), - center = true - ) { - finalDoubleStraightBarrierHolder(); - } - } -} diff --git a/rcmodels/tracks/plates/elements/straight/straight-simple.scad b/rcmodels/tracks/plates/elements/straight/straight-simple.scad deleted file mode 100644 index b6f044e..0000000 --- a/rcmodels/tracks/plates/elements/straight/straight-simple.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of straight barrier holders with a simple length. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/elements/straight/straight-simple.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat( - count = 10, - intervalY = finalSimpleStraightBarrierHolderIntervalY(), - center = true - ) { - finalSimpleStraightBarrierHolder(); - } - } -} diff --git a/rcmodels/tracks/plates/elements/straight/straight-uturn.scad b/rcmodels/tracks/plates/elements/straight/straight-uturn.scad deleted file mode 100644 index 5175897..0000000 --- a/rcmodels/tracks/plates/elements/straight/straight-uturn.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of straight barrier holders to compensate a U-turn track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/elements/straight/straight-uturn.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 4, - countY = 5, - intervalX = [finalUTurnCompensationBarrierHolderIntervalX(), 0, 0], - intervalY = [0, finalUTurnCompensationBarrierHolderIntervalY(), 0], - center = true - ) { - finalUTurnCompensationBarrierHolder(); - } - } -} diff --git a/rcmodels/tracks/plates/samples/curved/curved-inner-full.scad b/rcmodels/tracks/plates/samples/curved/curved-inner-full.scad deleted file mode 100644 index 6b9c2ad..0000000 --- a/rcmodels/tracks/plates/samples/curved/curved-inner-full.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of barrier samples for a full inner curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/samples/curved/curved-inner-full.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 4, - countY = 4, - intervalX = [finalFullInnerCurvedBarrierSampleIntervalX(), 0, 0], - intervalY = [0, finalFullInnerCurvedBarrierSampleIntervalY(), 0], - center = true - ) { - finalFullInnerCurvedBarrierSample(); - } - } -} diff --git a/rcmodels/tracks/plates/samples/curved/curved-inner.scad b/rcmodels/tracks/plates/samples/curved/curved-inner.scad deleted file mode 100644 index 5ef15d1..0000000 --- a/rcmodels/tracks/plates/samples/curved/curved-inner.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of barrier samples for an inner curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/samples/curved/curved-inner.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 4, - countY = finalInnerCurvedBarrierSampleRatio() * 2, - intervalX = [finalInnerCurvedBarrierSampleIntervalX(), 0, 0], - intervalY = [0, finalInnerCurvedBarrierSampleIntervalY(), 0], - center = true - ) { - finalInnerCurvedBarrierSample(); - } - } -} diff --git a/rcmodels/tracks/plates/samples/curved/curved-outer-full.scad b/rcmodels/tracks/plates/samples/curved/curved-outer-full.scad deleted file mode 100644 index 1a9d007..0000000 --- a/rcmodels/tracks/plates/samples/curved/curved-outer-full.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of barrier samples for a full outer curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/samples/curved/curved-outer-full.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 2, - countY = 8, - intervalX = [finalFullOuterCurvedBarrierSampleIntervalX(), 0, 0], - intervalY = [0, finalFullOuterCurvedBarrierSampleIntervalY(), 0], - center = true - ) { - finalFullOuterCurvedBarrierSample(); - } - } -} diff --git a/rcmodels/tracks/plates/samples/curved/curved-outer.scad b/rcmodels/tracks/plates/samples/curved/curved-outer.scad deleted file mode 100644 index f2247fd..0000000 --- a/rcmodels/tracks/plates/samples/curved/curved-outer.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of barrier samples for an outer curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/samples/curved/curved-outer.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 4, - countY = finalOuterCurvedBarrierSampleRatio(), - intervalX = [finalOuterCurvedBarrierSampleIntervalX(), 0, 0], - intervalY = [0, finalOuterCurvedBarrierSampleIntervalY(), 0], - center = true - ) { - finalOuterCurvedBarrierSample(); - } - } -} diff --git a/rcmodels/tracks/plates/samples/curved/curved-short.scad b/rcmodels/tracks/plates/samples/curved/curved-short.scad deleted file mode 100644 index 5fe6de8..0000000 --- a/rcmodels/tracks/plates/samples/curved/curved-short.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of barrier samples for a short curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/samples/curved/curved-short.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 4, - countY = 4, - intervalX = [finalShortCurvedBarrierSampleIntervalX(), 0, 0], - intervalY = [0, finalShortCurvedBarrierSampleIntervalY(), 0], - center = true - ) { - finalShortCurvedBarrierSample(); - } - } -} diff --git a/rcmodels/tracks/plates/samples/curved/curved-small.scad b/rcmodels/tracks/plates/samples/curved/curved-small.scad deleted file mode 100644 index 9a2967a..0000000 --- a/rcmodels/tracks/plates/samples/curved/curved-small.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of barrier samples for a small curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/samples/curved/curved-small.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 4, - countY = 4, - intervalX = [finalSmallCurvedBarrierSampleIntervalX(), 0, 0], - intervalY = [0, finalSmallCurvedBarrierSampleIntervalY(), 0], - center = true - ) { - finalSmallCurvedBarrierSample(); - } - } -} diff --git a/rcmodels/tracks/plates/samples/curved/curved-uturn.scad b/rcmodels/tracks/plates/samples/curved/curved-uturn.scad deleted file mode 100644 index d3dbc65..0000000 --- a/rcmodels/tracks/plates/samples/curved/curved-uturn.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of barrier samples for a U-turn curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/samples/curved/curved-uturn.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 4, - countY = 4, - intervalX = [finalUTurnCurvedBarrierSampleIntervalX(), 0, 0], - intervalY = [0, finalUTurnCurvedBarrierSampleIntervalY(), 0], - center = true - ) { - finalUTurnCurvedBarrierSample(); - } - } -} diff --git a/rcmodels/tracks/plates/samples/straight/arch-sample.scad b/rcmodels/tracks/plates/samples/straight/arch-sample.scad deleted file mode 100644 index ec2ab10..0000000 --- a/rcmodels/tracks/plates/samples/straight/arch-sample.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of arch samples. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/samples/straight/arch-sample.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 3, - countY = 4, - intervalX = [finalArchSampleIntervalX(), 0, 0], - intervalY = [0, finalArchSampleIntervalY(), 0], - center = true - ) { - finalArchSample(); - } - } -} diff --git a/rcmodels/tracks/plates/samples/straight/straight-double.scad b/rcmodels/tracks/plates/samples/straight/straight-double.scad deleted file mode 100644 index 41e5956..0000000 --- a/rcmodels/tracks/plates/samples/straight/straight-double.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of straight barrier samples with a double length. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/samples/straight/straight-double.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 4, - countY = 5, - intervalX = [finalDoubleStraightBarrierSampleIntervalX(), 0, 0], - intervalY = [0, finalDoubleStraightBarrierSampleIntervalY(), 0], - center = true - ) { - finalDoubleStraightBarrierSample(); - } - } -} diff --git a/rcmodels/tracks/plates/samples/straight/straight-long.scad b/rcmodels/tracks/plates/samples/straight/straight-long.scad deleted file mode 100644 index ce4c595..0000000 --- a/rcmodels/tracks/plates/samples/straight/straight-long.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of straight barrier samples with 10x the length. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/samples/straight/straight-long.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat( - count = 10, - intervalY = finalLongStraightBarrierSampleIntervalY(), - center = true - ) { - finalLongStraightBarrierSample(); - } - } -} diff --git a/rcmodels/tracks/plates/samples/straight/straight-simple.scad b/rcmodels/tracks/plates/samples/straight/straight-simple.scad deleted file mode 100644 index 5a2aff8..0000000 --- a/rcmodels/tracks/plates/samples/straight/straight-simple.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of straight barrier samples with a simple length. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/samples/straight/straight-simple.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 4, - countY = 5, - intervalX = [finalSimpleStraightBarrierSampleIntervalX(), 0, 0], - intervalY = [0, finalSimpleStraightBarrierSampleIntervalY(), 0], - center = true - ) { - finalSimpleStraightBarrierSample(); - } - } -} diff --git a/rcmodels/tracks/plates/samples/straight/straight-uturn.scad b/rcmodels/tracks/plates/samples/straight/straight-uturn.scad deleted file mode 100644 index 9837ae2..0000000 --- a/rcmodels/tracks/plates/samples/straight/straight-uturn.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of straight barrier samples for a U-turn compensation track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/samples/straight/straight-uturn.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 4, - countY = 5, - intervalX = [finalUTurnCompensationBarrierSampleIntervalX(), 0, 0], - intervalY = [0, finalUTurnCompensationBarrierSampleIntervalY(), 0], - center = true - ) { - finalUTurnCompensationBarrierSample(); - } - } -} diff --git a/rcmodels/tracks/plates/unibody/curved/curved-inner.scad b/rcmodels/tracks/plates/unibody/curved/curved-inner.scad deleted file mode 100644 index b3c9ee5..0000000 --- a/rcmodels/tracks/plates/unibody/curved/curved-inner.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of unibody barriers for an inner curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/unibody/curved/curved-inner.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat( - count = finalInnerCurvedBarrierUnibodyRatio() * 2, - intervalY = finalInnerCurvedBarrierUnibodyIntervalY(), - center = true - ) { - finalInnerCurvedBarrierUnibody(); - } - } -} diff --git a/rcmodels/tracks/plates/unibody/curved/curved-outer.scad b/rcmodels/tracks/plates/unibody/curved/curved-outer.scad deleted file mode 100644 index 4816b80..0000000 --- a/rcmodels/tracks/plates/unibody/curved/curved-outer.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of unibody barriers for an outer curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/unibody/curved/curved-outer.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat( - count = finalOuterCurvedBarrierUnibodyRatio(), - intervalY = finalOuterCurvedBarrierUnibodyIntervalY(), - center = true - ) { - finalOuterCurvedBarrierUnibody(); - } - } -} diff --git a/rcmodels/tracks/plates/unibody/curved/curved-short.scad b/rcmodels/tracks/plates/unibody/curved/curved-short.scad deleted file mode 100644 index 6f177f9..0000000 --- a/rcmodels/tracks/plates/unibody/curved/curved-short.scad +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of unibody barriers for a short curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/unibody/curved/curved-short.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat( - count = 2, - intervalY = finalShortCurvedBarrierUnibodyWidth() + finalShortCurvedBarrierUnibodyIntervalY(), - center = true - ) { - repeatRotate( - count = 2, - intervalX = finalShortCurvedBarrierUnibodyIntervalX(), - intervalY = -finalShortCurvedBarrierUnibodyIntervalY(), - center = true - ) { - finalShortCurvedBarrierUnibody(); - } - } - } -} diff --git a/rcmodels/tracks/plates/unibody/curved/curved-small.scad b/rcmodels/tracks/plates/unibody/curved/curved-small.scad deleted file mode 100644 index f81e5d8..0000000 --- a/rcmodels/tracks/plates/unibody/curved/curved-small.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of unibody barriers for a small curve track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/unibody/curved/curved-small.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat( - count = 4, - intervalY = finalSmallCurvedBarrierUnibodyIntervalY(), - center = true - ) { - finalSmallCurvedBarrierUnibody(); - } - } -} diff --git a/rcmodels/tracks/plates/unibody/curved/curved-uturn.scad b/rcmodels/tracks/plates/unibody/curved/curved-uturn.scad deleted file mode 100644 index bb5d963..0000000 --- a/rcmodels/tracks/plates/unibody/curved/curved-uturn.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of unibody barriers for a U-turn track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/unibody/curved/curved-uturn.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat( - count = 4, - intervalY = finalUTurnCurvedBarrierUnibodyIntervalY(), - center = true - ) { - finalUTurnCurvedBarrierUnibody(); - } - } -} diff --git a/rcmodels/tracks/plates/unibody/straight/straight-connector.scad b/rcmodels/tracks/plates/unibody/straight/straight-connector.scad deleted file mode 100644 index 573186a..0000000 --- a/rcmodels/tracks/plates/unibody/straight/straight-connector.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of unibody barrier connectors to connect a track part made with barrier holder. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/unibody/straight/straight-connector.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 2, - countY = 2, - intervalX = [finalConnectorBarrierUnibodyIntervalX(), 0, 0], - intervalY = [0, finalConnectorBarrierUnibodyIntervalY(), 0], - center = true - ) { - finalConnectorBarrierUnibody(); - } - } -} diff --git a/rcmodels/tracks/plates/unibody/straight/straight-double.scad b/rcmodels/tracks/plates/unibody/straight/straight-double.scad deleted file mode 100644 index 37ff9d6..0000000 --- a/rcmodels/tracks/plates/unibody/straight/straight-double.scad +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of straight unibody barriers with a double length. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> - -use <../../../parts/unibody/straight/straight-double.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat( - count = 6, - intervalY = finalDoubleStraightBarrierUnibodyIntervalY(), - center = true - ) { - finalDoubleStraightBarrierUnibody(); - } - } -} diff --git a/rcmodels/tracks/plates/unibody/straight/straight-simple.scad b/rcmodels/tracks/plates/unibody/straight/straight-simple.scad deleted file mode 100644 index 3ff7bc3..0000000 --- a/rcmodels/tracks/plates/unibody/straight/straight-simple.scad +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of straight unibody barriers with a simple length. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/unibody/straight/straight-simple.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat( - count = 10, - intervalY = finalSimpleStraightBarrierUnibodyIntervalY(), - center = true - ) { - finalSimpleStraightBarrierUnibody(); - } - } -} diff --git a/rcmodels/tracks/plates/unibody/straight/straight-uturn.scad b/rcmodels/tracks/plates/unibody/straight/straight-uturn.scad deleted file mode 100644 index 175f7f9..0000000 --- a/rcmodels/tracks/plates/unibody/straight/straight-uturn.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * A print plate presenting a set of straight unibody barriers to compensate a U-turn track part. - * - * @author jsconan - */ - -// Import the project's setup. -include <../../../config/setup.scad> -use <../../../parts/unibody/straight/straight-uturn.scad> - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) - centerBuildPlate() { - repeat2D( - countX = 2, - countY = 5, - intervalX = [finalUTurnCompensationBarrierUnibodyIntervalX(), 0, 0], - intervalY = [0, finalUTurnCompensationBarrierUnibodyIntervalY(), 0], - center = true - ) { - finalUTurnCompensationBarrierUnibody(); - } - } -} diff --git a/rcmodels/tracks/render.sh b/rcmodels/tracks/render.sh deleted file mode 100755 index b9bd2f3..0000000 --- a/rcmodels/tracks/render.sh +++ /dev/null @@ -1,264 +0,0 @@ -#!/bin/bash -# -# GPLv3 License -# -# Copyright (c) 2020 Jean-Sebastien CONAN -# -# This file is part of jsconan/things. -# -# jsconan/things is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# jsconan/things is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with jsconan/things. If not, see . -# - -# -# A race track system for 1/24 to 1/32 scale RC cars. -# -# Generates the STL files for the project. -# -# @author jsconan -# - -# application params -trackSectionLength= -trackSectionWidth= -trackLaneWidth= -trackRadius= -barrierHeight= -sampleSize= - -# script config -scriptpath=$(dirname $0) -project=$(pwd) -srcpath=${project} -dstpath=${project}/output -configpath=${srcpath}/config -partpath=${srcpath}/parts -platepath=${srcpath}/plates -format= -parallel= -showConfig= -renderAccessories= -renderElements= -renderUnibody= -renderSamples= -renderPlates= -cleanUp= - -# include libs -source "${scriptpath}/../../lib/camelSCAD/scripts/utils.sh" - -# Renders the files from a path. -# -# @param sourcepath - The path of the folder containing the SCAD files to render. -# @param destpath - The path to the output folder. -# @param right - Right oriented or left oriented -# @param prefix - Optional prefix added to the output fil name -# @param suffix - Optional suffix added to the output fil name -renderpath() { - local rightOriented=$3 - scadrenderall "$1" "$2" "$4" "$5" \ - "$(varif "trackSectionLength" ${trackSectionLength})" \ - "$(varif "trackSectionWidth" ${trackSectionWidth})" \ - "$(varif "trackLaneWidth" ${trackLaneWidth})" \ - "$(varif "trackRadius" ${trackRadius})" \ - "$(varif "barrierHeight" ${barrierHeight})" \ - "$(varif "sampleSize" ${sampleSize})" \ - "$(varif "rightOriented" ${rightOriented})" -} - -# Renders the files from a path, taking care of the curves. -# -# @param sourcepath - The path of the folder containing the SCAD files to render. -# @param destpath - The path to the output folder. -renderpathall() { - printmessage "${C_MSG}- straight elements" - renderpath "$1/straight" "$2" - printmessage "${C_MSG}- left curved elements" - renderpath "$1/curved" "$2" "0" "left" - printmessage "${C_MSG}- right curved elements" - renderpath "$1/curved" "$2" "1" "right" -} - -# Display the render config -showconfig() { - local config="${dstpath}/config.txt" - createpath "${dstpath}" "output" - printmessage "${C_MSG}Will generates the track elements with respect to the following config:" - renderpath "${configpath}/print.scad" "${dstpath}" 2>&1 | sed -e '1,4d' | sed -e :a -e '$d;N;2,3ba' -e 'P;D' > "${config}" - cat "${config}" -} - -# load parameters -while (( "$#" )); do - case $1 in - "a"|"accessories") - renderAccessories=1 - showConfig=1 - ;; - "e"|"elements") - renderElements=1 - showConfig=1 - ;; - "u"|"unibody") - renderUnibody=1 - showConfig=1 - ;; - "s"|"samples") - renderSamples=1 - showConfig=1 - ;; - "p"|"plates") - renderPlates=1 - ;; - "c"|"config") - showConfig=1 - ;; - "-l"|"--length") - trackSectionLength=$2 - shift - ;; - "-w"|"--width") - trackSectionWidth=$2 - shift - ;; - "-b"|"--height") - barrierHeight=$2 - shift - ;; - "-r"|"--radius") - trackRadius=$2 - shift - ;; - "-t"|"--track") - trackLaneWidth=$2 - shift - ;; - "-s"|"--sample") - sampleSize=$2 - shift - ;; - "-f"|"--format") - format=$2 - shift - ;; - "-p"|"--parallel") - parallel=$2 - shift - ;; - "-c"|"--clean") - cleanUp=1 - ;; - "-h"|"--help") - echo -e "${C_INF}Renders OpenSCAD files${C_RST}" - echo -e " ${C_INF}Usage:${C_RST}" - echo -e "${C_CTX}\t$0 [command] [-h|--help] [-o|--option value] files${C_RST}" - echo - echo -e "${C_MSG} a, accessories ${C_RST}Render the accessories" - echo -e "${C_MSG} e, elements ${C_RST}Render the track separated elements" - echo -e "${C_MSG} u, unibody ${C_RST}Render the track unibody elements" - echo -e "${C_MSG} s, samples ${C_RST}Render the samples" - echo -e "${C_MSG} p, plates ${C_RST}Render the plates" - echo -e "${C_MSG} c, config ${C_RST}Show the config values" - echo -e "${C_MSG} -h, --help ${C_RST}Show this help" - echo -e "${C_MSG} -l, --length ${C_RST}Set the length of a track section" - echo -e "${C_MSG} -w, --width ${C_RST}Set the virtual width of a track lane (used to compute the radius)" - echo -e "${C_MSG} -t --track ${C_RST}Set the actual width of a track lane (physical width, used for the arches)" - echo -e "${C_MSG} -b --height ${C_RST}Set the height of the track barrier" - echo -e "${C_MSG} -r --radius ${C_RST}Set the radius of the track inner curve" - echo -e "${C_MSG} -s --sample ${C_RST}Set the size of sample element" - echo -e "${C_MSG} -f --format ${C_RST}Set the output format" - echo -e "${C_MSG} -p --parallel ${C_RST}Set the number of parallel processes" - echo -e "${C_MSG} -c --clean ${C_RST}Clean up the output folder before rendering" - echo - exit 0 - ;; - *) - ls $1 >/dev/null 2>&1 - if [ "$?" == "0" ]; then - srcpath=$1 - else - printerror "Unknown parameter ${1}" - fi - ;; - esac - shift -done - -# align values -if [ "${trackSectionLength}" != "" ]; then - if [ "${trackSectionWidth}" == "" ]; then - trackSectionWidth=$((${trackSectionLength} * 2)) - fi - if [ "${trackLaneWidth}" == "" ]; then - trackLaneWidth=$((${trackSectionLength} * 3)) - fi - if [ "${trackRadius}" == "" ]; then - trackRadius=${trackSectionLength} - fi -fi - -# default script config -if [ "${renderAccessories}" == "" ] && [ "${renderElements}" == "" ] && [ "${renderUnibody}" == "" ] && [ "${renderSamples}" == "" ] && [ "${showConfig}" == "" ]; then - renderAccessories=1 - renderElements=1 - renderUnibody=1 - renderSamples=1 - showConfig=1 -fi - -# check OpenSCAD -scadcheck - -# defines the output format -scadformat "${format}" - -# defines the number of parallel processes -scadprocesses "${parallel}" - -# clean up the output -if [ "${cleanUp}" != "" ]; then - printmessage "${C_CTX}Cleaning up the output folder" - rm -rf "${dstpath}" -fi - -# show the config -if [ "${showConfig}" != "" ]; then - showconfig -fi - -# render the plates -if [ "${renderPlates}" != "" ]; then - printmessage "${C_CTX}Will render the print plates" - partpath=${platepath} - dstpath=${dstpath}/plates -else - printmessage "${C_CTX}Will render the parts separately" -fi - -# render the files -if [ "${renderAccessories}" != "" ]; then - printmessage "${C_MSG}Rendering accessories" - renderpath "${partpath}/accessories" "${dstpath}/accessories" -fi -if [ "${renderElements}" != "" ]; then - printmessage "${C_MSG}Rendering track separated elements" - renderpathall "${partpath}/elements" "${dstpath}/elements" -fi -if [ "${renderUnibody}" != "" ]; then - printmessage "${C_MSG}Rendering track unibody elements" - renderpathall "${partpath}/unibody" "${dstpath}/unibody" -fi -if [ "${renderSamples}" != "" ]; then - printmessage "${C_MSG}Rendering track samples" - renderpathall "${partpath}/samples" "${dstpath}/samples" -fi diff --git a/rcmodels/tracks/shapes/accessories.scad b/rcmodels/tracks/shapes/accessories.scad deleted file mode 100644 index 214ccfb..0000000 --- a/rcmodels/tracks/shapes/accessories.scad +++ /dev/null @@ -1,370 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Defines the shapes for the track accessories. - * - * @author jsconan - */ - -/** - * Gets the approximated length of the shape of a cable clip. - * @param Number wall - The thickness of the cable clip lines. - * @param Number base - The base unit value used to design the barrier holder. - * @returns Number - */ -function getCableClipLength(wall, base) = - getBarrierHolderWidth(base, wall) -; - -/** - * Gets the approximated width of the shape of a cable clip. - * @param Number wall - The thickness of the cable clip lines. - * @param Number base - The base unit value used to design the barrier holder. - * @returns Number - */ -function getCableClipWidth(wall, base) = - getBarrierHolderHeight(base, wall) + - apothem(n=10, r=getCableClipLength(wall, base) / 2) -; - -/** - * Gets the approximated length of the shape of a bent accessory mast. - * @param Number width - The width of the mast. - * @param Number|Vector height - The height of the mast. The 2 sides can be defined separately using a vector. - * @param Number wall - The thickness of the accessory clip lines. - * @param Number base - The base unit value used to design the barrier holder. - * @returns Number - */ -function getAccessoryBentMastLength(width, height, wall, base) = - let( - height = vector2D(height) - ) - getBarrierHolderWidth(base, wall) / 2 + - width + height[1] -; - -/** - * Gets the approximated width of the shape of a bent accessory mast. - * @param Number width - The width of the mast. - * @param Number|Vector height - The height of the mast. The 2 sides can be defined separately using a vector. - * @param Number wall - The thickness of the accessory clip lines. - * @param Number base - The base unit value used to design the barrier holder. - * @returns Number - */ -function getAccessoryBentMastWidth(width, height, wall, base) = - let( - height = vector2D(height) - ) - getBarrierHolderHeight(base, wall) + - width * 1.5 + height[0] -; - -/** - * Gets the approximated length of the shape of an accessory mast. - * @param Number height - The height of the mast. - * @param Number wall - The thickness of the accessory clip lines. - * @param Number base - The base unit value used to design the barrier holder. - * @returns Number - */ -function getAccessoryStraightMastLength(height, wall, base) = - getBarrierHolderHeight(base, wall) + height -; - -/** - * Gets the approximated width of the shape of an accessory mast. - * @param Number wall - The thickness of the accessory clip lines. - * @param Number base - The base unit value used to design the barrier holder. - * @returns Number - */ -function getAccessoryStraightMastWidth(wall, base) = - getBarrierHolderWidth(base, wall) -; - -/** - * Gets the approximated length of the shape of an accessory flag. - * @param Number width - The width of the flag. - * @param Number thickness - The thickness of the flag. - * @param Number mast - The width of the mast. - * @returns Number - */ -function getAccessoryFlagLength(width, thickness, mast) = - width + mast / 2 + printResolution + thickness -; - -/** - * Gets the approximated length of the shape of an accessory flag. - * @param Number height - The height of the flag. - * @param Number wave - The height of the wave - * @returns Number - */ -function getAccessoryFlagWidth(height, wave = 0) = - height + wave * 2 -; - -/** - * Draws the shape of a cable clip. - * @param Number height - The thickness of the clip. - * @param Number wall - The thickness of the cable clip lines. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number thickness - The thickness of the barrier body. - * @param Boolean [center] - The shape is centered vertically. - */ -module cableClip(height, wall, base, thickness, center = false) { - clipWidth = getCableClipLength(wall, base); - - translateY((apothem(n=10, r=clipWidth) - getCableClipWidth(wall, base)) / 2) { - linear_extrude(height=height, center=center, convexity=10) { - clipProfile( - wall = wall, - base = base, - thickness = thickness + printTolerance - ); - repeat(intervalX = clipWidth - wall, center = true) { - translateY(base / 2) { - rectangle([wall, base]); - } - } - ringSegment( - r = [1, 1] * (clipWidth / 2), - w = wall, - a = -180, - $fn = 10 - ); - } - } -} - -/** - * Draws the profile shape of an accessory mast. - * @param Number width - The width of the mast. - * @param Number [distance] - An additional distance added to the outline. - */ -module mastProfile(width, distance = 0) { - radius = getMastRadius(width); - - polygon( - points = outline(drawEllipse(r=radius, $fn=mastFacets), distance), - convexity = 10 - ); -} - -/** - * Draws the shape of an accessory mast. - * @param Number width - The width of the mast. - * @param Number height - The height of the mast. - * @param Number [distance] - An additional distance added to the outline. - * @param Boolean [center] - The shape is centered vertically. - */ -module mast(width, height, distance = 0, center = false) { - linear_extrude(height=height, center=center, convexity=10) { - rotateZ(getPolygonAngle(1, mastFacets) / 2) { - mastProfile( - width = width, - distance = distance - ); - } - } -} - -/** - * Draws the shape of a bent accessory mast. - * @param Number width - The width of the mast. - * @param Number|Vector height - The height of the mast. The 2 sides can be defined separately using a vector. - * @param Number [distance] - An additional distance added to the outline. - */ -module bentMast(width, height, distance = 0) { - height = vector2D(height); - - mast( - width = width, - height = height[0], - distance = distance, - center = false - ); - translate([0, -width, height[0] + width]) { - rotateX(90) { - mast( - width = width, - height = height[1], - distance = distance, - center = false - ); - } - } - translate([0, -width, height[0]]) { - rotate([90, 0, 90]) { - rotate_extrude(angle=90, convexity=10) { - translateX(width) { - rotateZ(getPolygonAngle(1, mastFacets) / 2) { - mastProfile( - width = width, - distance = distance - ); - } - } - } - } - } -} - -/** - * Draws the shape of rings that will maintain an accessory onto a mast. - * @param Number width - The width of the mast. - * @param Number height - The height of the ring. - * @param Number wall - The thickness of the accessory ring. - * @param Number [interval] - The interval between 2 rings. - * @param Number [count] - The number of rings. - * @param Number [distance] - An additional distance added to the outline. - * @param Boolean [center] - The shape is centered. - */ -module mastRings(width, height, wall, interval = 0, count = 1, distance = 0, center = false) { - repeat(count=count, intervalX=interval, center=center) { - rotateY(90) { - difference() { - mast( - width = width, - height = height, - distance = wall + distance, - center = center - ); - mast( - width = width, - height = height * 2 + 1, - distance = distance, - center = true - ); - } - } - } -} - -/** - * Draws the shape of an accessory mast with a clip. - * @param Number width - The width of the mast. - * @param Number height - The height of the mast. - * @param Number wall - The thickness of the accessory clip lines. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number thickness - The thickness of the barrier body. - */ -module accessoryStraightMast(width, height, wall, base, thickness) { - clipHeight = getBarrierHolderHeight(base, wall); - - translateX((clipHeight - height) / 2) { - rotateY(90) { - mast( - width = width, - height = height, - distance = 0, - center = false - ); - } - rotateZ(90) { - clip( - wall = wall, - height = width, - base = base, - thickness = thickness + printTolerance, - center = true - ); - } - } -} - -/** - * Draws the shape of a bent accessory mast with a clip. - * @param Number width - The width of the mast. - * @param Number|Vector height - The height of the mast. The 2 sides can be defined separately using a vector. - * @param Number wall - The thickness of the accessory clip lines. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number thickness - The thickness of the barrier body. - */ -module accessoryBentMast(width, height, wall, base, thickness) { - height = vector2D(height); - clipWidth = getBarrierHolderWidth(base, wall); - clipHeight = getBarrierHolderHeight(base, wall); - bentMastLength = getAccessoryBentMastLength(width, height, wall, base); - bentMastWidth = getAccessoryBentMastWidth(width, height, wall, base); - - translate([ - (clipWidth - bentMastLength) / 2, - bentMastWidth / 2 - clipHeight, - 0 - ]) { - rotate([0, 270, 90]) { - bentMast( - width = width, - height = height, - distance = 0 - ); - } - clip( - wall = wall, - height = width, - base = base, - thickness = thickness + printTolerance, - center = true - ); - } -} - -/** - * Draws the shape of an accessory flag. - * @param Number width - The width of the flag. - * @param Number height - The height of the flag. - * @param Number thickness - The thickness of the flag. - * @param Number mast - The width of the mast. - * @param Number wave - The height of the wave - */ -module accessoryFlag(width, height, thickness, mast, wave = 0) { - distance = printResolution; - ringHeight = height / 4; - ringInterval = height - ringHeight; - ringOffset = apothem(n=mastFacets, r=getMastRadius(mast)) + distance + thickness; - type = wave ? "S" : "V"; - - rotateZ(270) { - translateY((mast - width) / 2 - printResolution) { - translateZ(ringOffset) { - mastRings( - width = mast, - height = ringHeight, - wall = thickness, - interval = ringInterval, - count = 2, - distance = distance, - center = true - ); - } - linear_extrude(height=thickness, convexity=10) { - polygon(path([ - ["P", height / 2, 0], - [type, width, width, wave, 0, 90], - ["H", -height], - [type, -width, width, wave, 0, 90] - ])); - } - } - } -} diff --git a/rcmodels/tracks/shapes/arch.scad b/rcmodels/tracks/shapes/arch.scad deleted file mode 100644 index 7f33fa9..0000000 --- a/rcmodels/tracks/shapes/arch.scad +++ /dev/null @@ -1,161 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Defines arch related track parts. - * - * @author jsconan - */ - -/** - * Gets the length of an arch tower. - * @param Number length - The length of a track element. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number wall - The thickness of the clip outline. - * @returns Number - */ -function getArchTowerLength(length, base, wall) = - getBarrierHolderHeight(base, wall + printTolerance) + - length / 2 -; - -/** - * Gets the length of an arch tower with a male connector. - * @param Number length - The length of a track element. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number wall - The thickness of the clip outline. - * @returns Number - */ -function getArchTowerLengthMale(length, base, wall) = - getArchTowerLength( - length = length, - base = base, - wall = wall - ) + getBarrierLinkLength(base) -; - -/** - * Gets the width of an arch tower. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number wall - The thickness of the clip outline. - * @returns Number - */ -function getArchTowerWidth(base, wall) = - getBarrierHolderWidth(base, wall + printTolerance) -; - -/** - * Draws the shape of an arch tower that will clamp a barrier border. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number wall - The thickness of the outline. - */ -module archTower(length, thickness, base, wall) { - thickness = thickness + printTolerance; - holderHeight = getBarrierHolderHeight(base); - clipHeight = getBarrierHolderHeight(base, wall + printTolerance); - indent = getBarrierStripIndent(base) + printResolution; - length = length / 2; - - translateX(-clipHeight / 2) { - translateX(length / 2) { - rotateZ(-90) { - difference() { - clip( - wall = wall, - height = holderHeight, - base = base, - thickness = thickness, - distance = printTolerance - ); - translate([0, wall / 2, holderHeight - indent]) { - box([thickness, wall * 2, indent * 2]); - } - } - } - } - carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { - extrudeStraightProfile(length=length) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - } - } - } -} - -/** - * Draws the shape of a male arch tower that will clamp a barrier border. - * @param Number length - The length of a track element. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number wall - The thickness of the outline. - */ -module archTowerMale(length, thickness, base, wall) { - linkHeight = getBarrierHolderLinkHeight(base); - archTowerLength = getArchTowerLength( - length = length, - base = base, - wall = wall - ); - - straightLinkMale(length=archTowerLength, linkHeight=linkHeight, base=base) { - archTower( - length = length, - thickness = thickness, - base = base, - wall = wall - ); - } -} - -/** - * Draws the shape of a female arch tower that will clamp a barrier border. - * @param Number length - The length of a track element. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number wall - The thickness of the outline. - */ -module archTowerFemale(length, thickness, base, wall) { - linkHeight = getBarrierHolderLinkHeight(base); - archTowerLength = getArchTowerLength( - length = length, - base = base, - wall = wall - ); - - rotateZ(180) { - straightLinkFemale(length=archTowerLength, linkHeight=linkHeight, base=base) { - rotateZ(180) { - archTower( - length = length, - thickness = thickness, - base = base, - wall = wall - ); - } - } - } -} diff --git a/rcmodels/tracks/shapes/connector.scad b/rcmodels/tracks/shapes/connector.scad deleted file mode 100644 index 6868a3a..0000000 --- a/rcmodels/tracks/shapes/connector.scad +++ /dev/null @@ -1,195 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Defines connector track parts. - * - * @author jsconan - */ - -/** - * Draws the shape of a connector between a barrier holder and a unibody barrier. - * @param Number length - The length of a track element. - * @param Number height - The height of the barrier. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - */ -module barrierHolderToUnibodyConnector(length, height, thickness, base) { - holderTopWidth = getBarrierHolderTopWidth(base, thickness); - holderWidth = getBarrierHolderWidth(base); - holderHeight = getBarrierHolderHeight(base); - holderLinkHeight = getBarrierHolderLinkHeight(base); - unibodyWidth = getBarrierUnibodyWidth(base); - unibodyLineX = (unibodyWidth - holderTopWidth) / 2 - base / 2; - unibodyLineY = height - holderHeight - base * 2; - holderLineY = holderHeight - base * 1.5; - unibodyTopWidth = unibodyWidth - base - holderLineY * (unibodyLineX / unibodyLineY) * 2; - indent = getBarrierStripIndent(base) + printResolution; - length = length / 2; - - distribute(intervalX=length, center=true) { - difference() { - extrudeStraightProfile(length=length) { - barrierUnibodyProfile( - height = height, - base = base, - thickness = thickness - ); - } - translate([length / 2, 0, height - holderLinkHeight]) { - barrierLink( - height = holderLinkHeight + printResolution + 1, - base = base, - distance = printTolerance - ); - } - translate([length / 2, 0, holderHeight - indent]) { - box([thickness, thickness, indent]); - } - } - carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { - translateX(-length / 2) { - rotate([90, 0, 90]) { - repeatMirror() { - simplePolyhedron( - bottom = reverse(getBarrierHolderProfilePoints( - base = base, - holderOffset = base / 2, - bottomWidth = unibodyWidth, - topWidth = unibodyTopWidth - )), - top = reverse(getBarrierHolderProfilePoints( - base = base, - holderOffset = base / 4, - bottomWidth = holderWidth, - topWidth = holderTopWidth - )), - z = length - ); - } - } - } - } - } -} - -/** - * Draws the shape of a male connector between a barrier holder and a unibody barrier. - * @param Number length - The length of a track element. - * @param Number height - The height of the barrier. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - */ -module barrierHolderToUnibodyMale(length, height, thickness, base) { - thickness = thickness + printTolerance; - holderLinkHeight = getBarrierHolderLinkHeight(base); - unibodyLinkHeight = getBarrierUnibodyLinkHeight(height, base); - - straightLinkMale(length=length, linkHeight=unibodyLinkHeight, base=base) { - straightLinkFemale(length=length, linkHeight=holderLinkHeight, base=base) { - barrierHolderToUnibodyConnector( - length = length, - height = height, - thickness = thickness, - base = base - ); - } - } -} - -/** - * Draws the shape of a female connector between a barrier holder and a unibody barrier. - * @param Number length - The length of a track element. - * @param Number height - The height of the barrier. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - */ -module barrierHolderToUnibodyFemale(length, height, thickness, base) { - thickness = thickness + printTolerance; - holderLinkHeight = getBarrierHolderLinkHeight(base); - unibodyLinkHeight = getBarrierUnibodyLinkHeight(height, base); - - straightLinkFemale(length=length, linkHeight=unibodyLinkHeight, base=base) { - straightLinkMale(length=length, linkHeight=holderLinkHeight, base=base) { - rotateZ(180) { - barrierHolderToUnibodyConnector( - length = length, - height = height, - thickness = thickness, - base = base - ); - } - } - } -} - -/** - * Draws the shape of a male connector for a barrier holder. - * @param Number length - The length of a track element. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - */ -module barrierHolderConnectorMale(length, thickness, base) { - thickness = thickness + printTolerance; - linkHeight = getBarrierHolderLinkHeight(base); - length = length / 2; - - carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { - straightLinkMale(length=length, linkHeight=linkHeight, base=base) { - rotateZ(180) { - straightLinkMale(length=length, linkHeight=linkHeight, base=base) { - extrudeStraightProfile(length=length) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - } - } - } - } - } -} - -/** - * Draws the shape of a female connector for a barrier holder. - * @param Number length - The length of a track element. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - */ -module barrierHolderConnectorFemale(length, thickness, base) { - thickness = thickness + printTolerance; - linkHeight = getBarrierHolderLinkHeight(base); - length = length / 2; - - carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { - straightLinks(length=length, linkHeight=linkHeight, base=base) { - extrudeStraightProfile(length=length) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - } - } - } -} diff --git a/rcmodels/tracks/shapes/curved.scad b/rcmodels/tracks/shapes/curved.scad deleted file mode 100644 index 7ba8738..0000000 --- a/rcmodels/tracks/shapes/curved.scad +++ /dev/null @@ -1,288 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Defines the curved track parts. - * - * @author jsconan - */ - -/** - * Gets the approximated length of the shape of a curved barrier. - * @param Number length - The length of the element. - * @param Number width - The width of the element. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number ratio - The ratio to apply on the radius - * @returns Number - */ -function getCurvedBarrierLength(length, width, base, ratio) = - let( - angle = getCurveAngle(ratio), - radius = getCurveRadius(length, ratio), - rotationAngle = getCurveRotationAngle(angle), - projectedWidth = width * cos(rotationAngle) / 2, - projectedLink = getBarrierLinkLength(base) * cos(curveAngle + rotationAngle) - ) - getChordLength(angle, radius) + - width / 2 + projectedWidth + max(0, projectedLink - projectedWidth) -; - -/** - * Gets the approximated width of the shape of a curved barrier. - * @param Number length - The length of the element. - * @param Number width - The width of the element. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number ratio - The ratio to apply on the radius - * @returns Number - */ -function getCurvedBarrierWidth(length, width, base, ratio) = - let( - angle = getCurveAngle(ratio), - radius = getCurveRadius(length, ratio), - rotationAngle = getCurveRotationAngle(angle), - projectedWidth = width * sin(rotationAngle) / 2, - projectedLink = getBarrierLinkLength(base) * sin(curveAngle + rotationAngle) - ) - getChordHeight(angle, radius) + - width / 2 + projectedWidth + max(0, projectedLink - projectedWidth) -; - -/** - * Draws the notch shape of a curved barrier holder. - * @param Number radius - The radius of the curve. - * @param Number thickness - The thickness of the shape. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [distance] - An additional distance added to the outline of the barrier link. - */ -module curvedBarrierNotch(radius, thickness, base, distance = 0) { - width = getBarrierNotchWidth(base, distance); - indent = getBarrierStripIndent(base); - height = getBarrierStripHeight(base) - indent; - angle = getArcAngle(radius = radius, length = width); - chord = getChordLength(radius = radius, angle = getArcAngle(radius = radius, length = indent)); - startAngle = angle / 2; - - difference() { - translateZ(-base) { - pipeSegment( - r = radius + thickness / 2, - h = height + base, - w = thickness, - a = angle, - a1 = -startAngle - ); - } - repeatMirror(axis = [0, 1, 0]) { - rotateZ(startAngle) { - translateX(radius) { - rotate([90, 0, 270]) { - linear_extrude(height=thickness + 1, center=true, convexity=10) { - polygon(path([ - ["P", 0, -base], - ["V", base], - ["L", chord, height], - ["V", base], - ["H", -base], - ["V", -height - base * 2] - ]), convexity = 10); - } - } - } - } - } - } -} - -/** - * Place a curved element with respect to the length and the ratio. - * @param Number length - The length of a track element. - * @param Number radius - The radius of the curve. - * @param Number angle - The angle of the curve. - * @param Number z - An option Z-axis translation - */ -module placeCurvedElement(length, radius, angle, z = 0) { - translate([0, getChordHeight(angle, radius) / 2 - radius, z]) { - rotateZ(getCurveRotationAngle(angle)) { - children(); - } - } -} - -/** - * Adds the links to a curved element. - * @param Number radius - The radius of the curve. - * @param Number angle - The angle of the curve. - * @param Number linkHeight - The height of the link. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number right - Is the curve oriented to the right? - */ -module curvedLinks(radius, angle, linkHeight, base, right = false) { - remainingAngle = curveAngle - angle; - maleLinkDirection = right ? 180 : 0; - maleLinkPosition = right ? 270 : -remainingAngle; - femaleLinkDirection = right ? 90 : -90; - femaleLinkPosition = right ? 90 - remainingAngle : 0; - - rotateZ(maleLinkPosition) { - translateY(radius) { - rotateZ(maleLinkDirection) { - barrierLink( - height = linkHeight - printResolution, - base = base - ); - } - } - } - difference() { - children(); - rotateZ(femaleLinkPosition) { - translate([radius, 0, -1]) { - rotateZ(femaleLinkDirection) { - barrierLink( - height = linkHeight + printResolution + 1, - base = base, - distance = printTolerance - ); - } - } - } - } -} - -/** - * Extrudes the profile on the expected circle path. - * @param Number radius - The radius of the curve. - * @param Number angle - The extrusion angle. - */ -module extrudeCurvedProfile(radius, angle) { - rotate_extrude(angle=angle, convexity=10) { - translateX(radius) { - children(); - } - } -} - -/** - * Draws the main shape of a curved barrier holder. - * @param Number length - The length of the element. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number ratio - The ratio to apply on the radius - * @param Number right - Is the curve oriented to the right? - */ -module curvedBarrierMain(length, thickness, base, ratio = 1, right = false) { - radius = getCurveRadius(length, ratio); - angle = getCurveAngle(ratio); - linkHeight = getBarrierHolderLinkHeight(base); - - placeCurvedElement(length=length, radius=radius, angle=angle) { - curvedLinks(radius=radius, angle=angle, linkHeight=linkHeight, base=base, right=right) { - extrudeCurvedProfile(radius=radius, angle=angle) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - } - } - } -} - -/** - * Draws the shape of a curved unibody barrier. - * @param Number length - The length of the element. - * @param Number height - The height of the barrier. - * @param Number thickness - The thickness of the barrier body for a barrier holder. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number ratio - The ratio to apply on the radius - * @param Number right - Is the curve oriented to the right? - */ -module curvedBarrierUnibody(length, height, thickness, base, ratio = 1, right = false) { - radius = getCurveRadius(length, ratio); - angle = getCurveAngle(ratio); - linkHeight = getBarrierUnibodyLinkHeight(height, base); - - placeCurvedElement(length=length, radius=radius, angle=angle) { - curvedLinks(radius=radius, angle=angle, linkHeight=linkHeight, base=base, right=right) { - extrudeCurvedProfile(radius=radius, angle=angle) { - barrierUnibodyProfile( - height = height, - base = base, - thickness = thickness + printTolerance - ); - } - } - } -} - -/** - * Draws the barrier holder for a curved track element. - * @param Number length - The length of the element. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number ratio - The ratio to apply on the radius - * @param Number right - Is the curve oriented to the right? - */ -module curvedBarrierHolder(length, thickness, base, ratio = 1, right = false) { - radius = getCurveRadius(length, ratio); - angle = getCurveAngle(ratio); - linkHeight = getBarrierHolderLinkHeight(base); - thickness = thickness + printTolerance; - - difference() { - curvedBarrierMain( - length = length, - thickness = thickness, - base = base, - ratio = ratio, - right = right - ); - placeCurvedElement(length=length, radius=radius, angle=angle, z=minThickness) { - difference() { - pipeSegment( - r = radius + thickness / 2, - h = linkHeight * 2, - w = thickness, - a = angle - ); - - arcAngle = getArcAngle(radius = radius, length = length / 2); - angles = [ - [0, 0, 0], - [0, 0, arcAngle], - [0, 0, angle - arcAngle], - [0, 0, angle] - ]; - - repeatRotateMap(angles) { - curvedBarrierNotch( - radius = radius, - thickness = thickness * 2, - base = base, - distance = printTolerance / 2 - ); - } - } - } - } -} diff --git a/rcmodels/tracks/shapes/fragments.scad b/rcmodels/tracks/shapes/fragments.scad deleted file mode 100644 index 9efd76b..0000000 --- a/rcmodels/tracks/shapes/fragments.scad +++ /dev/null @@ -1,135 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Defines the fragments shapes for the track elements. - * - * @author jsconan - */ - -/** - * Draws the shape of a barrier link. - * @param Number height - The height of the link. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [distance] - An additional distance added to the outline of the barrier link. - * @param Boolean [center] - The shape is centered vertically. - */ -module barrierLink(height, base, distance = 0, center = false) { - linear_extrude(height=height, center=center, convexity=10) { - barrierLinkProfile( - base = base, - distance = distance - ); - } -} - -/** - * Draws the shape of a barrier holder notch. - * @param Number thickness - The thickness of the shape. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [distance] - An additional distance added to the outline of the barrier link. - * @param Number [interval] - The distance between two notches. - * @param Number [count] - The number of notches. - * @param Boolean [center] - The shape is centered vertically. - */ -module barrierNotch(thickness, base, distance = 0, interval = 0, count = 1, center = false) { - repeat(count=count, interval=[interval, 0, 0], center=true) { - linear_extrude(height=thickness, center=center, convexity=10) { - barrierNotchProfile( - base = base, - distance = distance - ); - } - } -} - -/** - * Draws the negative shape of a barrier holder notch. - * @param Number length - The length of the shape. - * @param Number thickness - The thickness of the shape. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [notches] - The number of notches. - */ -module barrierNotchNegative(length, thickness, base, notches = 2) { - height = getBarrierHolderHeight(base) * 2; - notches = max(notches, 1); - interval = length / notches; - count = notches + 1; - - difference() { - box([length + 2, thickness, height]); - - rotateX(90) { - barrierNotch( - thickness = thickness * 2, - base = base, - distance = printTolerance / 2, - interval = interval, - count = count, - center = true - ); - } - } -} - -/** - * Carves the barrier notch in the child shape. - * @param Number length - The length of the element. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [notches] - The number of notches. - */ -module carveBarrierNotch(length, thickness, base, notches = 2) { - difference() { - children(); - translateZ(minThickness) { - barrierNotchNegative( - length = length, - thickness = thickness, - base = base, - notches = notches - ); - } - } -} - -/** - * Draws the shape of a clip. - * @param Number wall - The thickness of the clip lines. - * @param Number height - The thickness of the clip. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number thickness - The thickness of the barrier body. - * @param Number [distance] - An additional distance added to the outline of the profile. - * @param Boolean [center] - The shape is centered vertically. - */ -module clip(wall, height, base, thickness, distance = 0, center = false) { - linear_extrude(height=height, center=center, convexity=10) { - clipProfile( - wall = wall, - base = base, - thickness = thickness, - distance = distance - ); - } -} diff --git a/rcmodels/tracks/shapes/profiles.scad b/rcmodels/tracks/shapes/profiles.scad deleted file mode 100644 index 9c4cdd5..0000000 --- a/rcmodels/tracks/shapes/profiles.scad +++ /dev/null @@ -1,211 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Defines the profile shapes for the track elements. - * - * @author jsconan - */ - -/** - * Draws the profile of a barrier link. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [distance] - An additional distance added to the outline of the profile. - */ -module barrierLinkProfile(base, distance = 0) { - linkProfile( - neck = [base / 2, base], - bulb = base, - distance = distance - ); -} - -/** - * Draws the profile of a barrier holder notch. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [distance] - An additional distance added to the outline of the barrier link. - */ -module barrierNotchProfile(base, distance = 0) { - width = getBarrierNotchWidth(base, distance); - top = getBarrierNotchDistance(base, distance); - indent = getBarrierStripIndent(base); - height = getBarrierStripHeight(base) - indent; - - polygon(path([ - ["P", -width / 2, 0], - ["L", indent, height], - ["H", top], - ["L", indent, -height], - ["V", -base], - ["H", -width] - ]), convexity = 10); -} - -/** - * Draws the outline of a barrier holder profile. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number holderOffset - The offset of the shape edges. - * @param Number bottomWidth - The width of the bottom of the shape. - * @param Number topWidth - The width of the top of the shape. - * @returns Vector[] - */ -function getBarrierHolderProfilePoints(base, holderOffset, bottomWidth, topWidth) = - let( - holderHeight = getBarrierHolderHeight(base), - holderSide = base - holderOffset, - holderLineX = (bottomWidth - topWidth) / 2 - holderOffset, - holderLineY = holderHeight - holderSide - holderOffset * 2 - ) - path([ - ["P", holderOffset - bottomWidth / 2, 0], - ["L", -holderOffset, holderOffset], - ["V", holderSide], - ["L", holderLineX, holderLineY], - ["L", holderOffset, holderOffset], - ["H", topWidth], - ["L", holderOffset, -holderOffset], - ["L", holderLineX, -holderLineY], - ["V", -holderSide], - ["L", -holderOffset, -holderOffset] - ]) -; - -/** - * Draws the profile of a barrier holder. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number thickness - The thickness of the barrier body. - * @param Number [distance] - An additional distance added to the outline of the profile. - */ -module barrierHolderProfile(base, thickness, distance = 0) { - polygon(outline(getBarrierHolderProfilePoints( - base = base, - holderOffset = base / 4, - bottomWidth = getBarrierHolderWidth(base), - topWidth = getBarrierHolderTopWidth(base, thickness) - ), -distance), convexity = 10); -} - -/** - * Draws the profile of a unibody barrier. - * @param Number height - The height of the barrier. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number thickness - The thickness of the barrier body for a barrier holder. - * @param Number [distance] - An additional distance added to the outline of the profile. - */ -module barrierUnibodyProfile(height, base, thickness, distance = 0) { - holderTopWidth = getBarrierHolderTopWidth(base, thickness); - holderWidth = getBarrierHolderWidth(base); - holderHeight = getBarrierHolderHeight(base); - holderOffset = base / 4; - holderSide = base - holderOffset; - holderOffsetWidth = holderWidth - holderOffset * 2; - holderLineX = (holderWidth - holderTopWidth) / 2 - holderOffset; - holderLineY = holderHeight - base - holderOffset; - - unibodyOffset = base / 2; - unibodyNeck = base / 2; - unibodySide = base - unibodyOffset; - unibodyWidth = getBarrierUnibodyWidth(base); - unibodyOffsetWidth = unibodyWidth - unibodyOffset * 2; - unibodyLineX = (unibodyWidth - holderTopWidth) / 2 - unibodyOffset; - unibodyLineY = height - holderHeight - unibodyNeck - base - unibodyOffset; - - startX = holderTopWidth / 2; - startY = holderSide + unibodyLineY + unibodyOffset + unibodyNeck + holderOffset; - - polygon(outline(path([ - ["P", -startX, startY], - // barrier holder profile - ["L", -holderOffset, holderOffset], - ["L", -holderLineX, holderLineY], - ["V", holderSide], - ["L", holderOffset, holderOffset], - ["H", holderOffsetWidth], - ["L", holderOffset, -holderOffset], - ["V", -holderSide], - ["L", -holderLineX, -holderLineY], - ["L", -holderOffset, -holderOffset], - // unibody profile - ["V", -unibodyNeck], - ["L", unibodyOffset, -unibodyOffset], - ["L", unibodyLineX, -unibodyLineY], - ["V", -unibodySide], - ["L", -unibodyOffset, -unibodyOffset], - ["H", -unibodyOffsetWidth], - ["L", -unibodyOffset, unibodyOffset], - ["V", unibodySide], - ["L", unibodyLineX, unibodyLineY], - ["L", unibodyOffset, unibodyOffset], - ["V", unibodyNeck] - ]), -distance), convexity = 10); -} - -/** - * Draws the outline of a barrier holder. - * @param Number wall - The thickness of the outline. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number thickness - The thickness of the barrier body. - * @param Number [distance] - An additional distance added to the outline of the profile. - */ -module barrierHolderOutline(wall, base, thickness, distance = 0) { - translateY(wall) { - difference() { - barrierHolderProfile( - base = base, - thickness = thickness, - distance = wall + distance - ); - barrierHolderProfile( - base = base, - thickness = thickness, - distance = distance - ); - } - } -} - -/** - * Draws the profile of a clip for a barrier holder. - * @param Number wall - The thickness of the outline. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number thickness - The thickness of the barrier body. - * @param Number [distance] - An additional distance added to the outline of the profile. - */ -module clipProfile(wall, base, thickness, distance = 0) { - holderHeight = getBarrierHolderHeight(base); - - difference() { - translateY(distance) { - barrierHolderOutline( - wall = wall, - base = base, - thickness = thickness, - distance = distance - ); - } - translateY(holderHeight + wall * 1.5 + distance * 2) { - rectangle([getBarrierHolderTopWidth(base, thickness), wall * 2] + vector2D(distance)); - } - } -} diff --git a/rcmodels/tracks/shapes/straight.scad b/rcmodels/tracks/shapes/straight.scad deleted file mode 100644 index ed9ed15..0000000 --- a/rcmodels/tracks/shapes/straight.scad +++ /dev/null @@ -1,192 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Defines the straight track parts. - * - * @author jsconan - */ - -/** - * Gets the approximated length of the shape of a straight barrier. - * @param Number length - The length of the element. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number ratio - The ratio to apply on the length - * @returns Number - */ -function getStraightBarrierLength(length, base, ratio) = - length * ratio + getBarrierLinkLength(base) -; - -/** - * Draws the shape of a barrier body. - * @param Number length - The length of the track element. - * @param Number height - The height of the barrier. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number [notches] - The number of notches. - */ -module barrierBody(length, height, thickness, base, notches = 1) { - count = notches + 1; - interval = length / notches; - - difference() { - box( - size = [length, height, thickness], - center = true - ); - repeatMirror(interval=[0, height, 0], axis=[0, 1, 0], center=true) { - barrierNotch( - thickness = thickness * 2, - base = base, - distance = printTolerance, - interval = interval, - count = count, - center = true - ); - } - } -} - -/** - * Adds the male link to a straight element. - * @param Number length - The length of the element. - * @param Number linkHeight - The height of the link. - * @param Number base - The base unit value used to design the barrier holder. - */ -module straightLinkMale(length, linkHeight, base) { - translateX(-length / 2) { - barrierLink( - height = linkHeight - printResolution, - base = base - ); - } - children(); -} - -/** - * Adds the female link to a straight element. - * @param Number length - The length of the element. - * @param Number linkHeight - The height of the link. - * @param Number base - The base unit value used to design the barrier holder. - */ -module straightLinkFemale(length, linkHeight, base) { - difference() { - children(); - translate([length / 2, 0, -1]) { - barrierLink( - height = linkHeight + printResolution + 1, - base = base, - distance = printTolerance - ); - } - } -} - -/** - * Adds the links to a straight element. - * @param Number length - The length of the element. - * @param Number linkHeight - The height of the link. - * @param Number base - The base unit value used to design the barrier holder. - */ -module straightLinks(length, linkHeight, base) { - straightLinkMale(length=length, linkHeight=linkHeight, base=base) { - straightLinkFemale(length=length, linkHeight=linkHeight, base=base) { - children(); - } - } -} - -/** - * Extrudes the profile on the expected linear length. - * @param Number length - The length of the element. - */ -module extrudeStraightProfile(length) { - rotate([90, 0, 90]) { - linear_extrude(height=length, center=true, convexity=10) { - children(); - } - } -} - -/** - * Draws the main shape of a straight barrier holder. - * @param Number length - The length of the element. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - */ -module straightBarrierMain(length, thickness, base) { - linkHeight = getBarrierHolderLinkHeight(base); - - straightLinks(length=length, linkHeight=linkHeight, base=base) { - extrudeStraightProfile(length=length) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - } - } -} - -/** - * Draws the shape of a straight unibody barrier. - * @param Number length - The length of the element. - * @param Number height - The height of the barrier. - * @param Number thickness - The thickness of the barrier body for a barrier holder. - * @param Number base - The base unit value used to design the barrier holder. - */ -module straightBarrierUnibody(length, height, thickness, base) { - linkHeight = getBarrierUnibodyLinkHeight(height, base); - - straightLinks(length=length, linkHeight=linkHeight, base=base) { - extrudeStraightProfile(length=length) { - barrierUnibodyProfile( - height = height, - base = base, - thickness = thickness + printTolerance - ); - } - } -} - -/** - * Draws the barrier holder for a straight track element. - * @param Number length - The length of the element. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number ratio - The ratio to apply on the length - */ -module straightBarrierHolder(length, thickness, base, ratio = 1) { - thickness = thickness + printTolerance; - length = length * ratio; - notches = ratio * 2; - - carveBarrierNotch(length=length, thickness=thickness, base=base, notches=notches) { - straightBarrierMain( - length = length, - thickness = thickness, - base = base - ); - } -} diff --git a/rcmodels/tracks/shapes/uturn.scad b/rcmodels/tracks/shapes/uturn.scad deleted file mode 100644 index 82cb8fb..0000000 --- a/rcmodels/tracks/shapes/uturn.scad +++ /dev/null @@ -1,274 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Defines the U-turn track parts. - * - * @author jsconan - */ - -/** - * Gets the length of the final shape for a U-turn curve. - * @param Number length - The length of a track element. - * @param Number width - The width of a track element. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number gap - The distance between the two side of the U-turn. - * @returns Number - */ -function getUTurnBarrierLength(length, width, base, gap) = - getStraightBarrierLength(length, base, .5) + width + gap / 2 -; - -/** - * Gets the width of the final shape for a U-turn curve. - * @param Number width - The width of a track element. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number gap - The distance between the two side of the U-turn. - * @returns Number - */ -function getUTurnBarrierWidth(width, base, gap) = gap + width * 2; - -/** - * Gets the length of a U-turn compensation barrier. - * @param Number width - The width of a track element. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number gap - The distance between the two side of the U-turn. - * @returns Number - */ -function getUTurnCompensationBarrierLength(width, base, gap) = - width + gap + getBarrierLinkLength(base) -; - -/** - * Gets the length of a U-turn compensation barrier body. - * @param Number length - The length of a track element. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number gap - The distance between the two side of the U-turn. - * @returns Number - */ -function getUTurnCompensationBarrierBodyLength(length, base, gap) = - length + getBarrierHolderWidth(base) + gap -; - -/** - * Draws the shape of a barrier border for a U-Turn. - * @param Number length - The length of a track element. - * @param Number height - The height of the barrier. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number gap - The distance between the two side of the U-turn. - * @param Number right - Is it the right or the left part of the track element that is added first? - */ -module uTurnBarrierHolder(length, height, thickness, base, gap, right = false) { - thickness = thickness + printTolerance; - holderHeight = getBarrierHolderHeight(base); - linkHeight = getBarrierHolderLinkHeight(base); - towerWidth = nozzleAligned(thickness + minWidth); - towerHeight = getBarrierBodyInnerHeight(height, base) / 2; - interval = (getBarrierHolderWidth(base) + gap) / 2; - indent = getBarrierStripIndent(base) + printResolution; - dir = right ? -1 : 1; - length = length / 2; - - translate([-interval, interval * dir, 0]) { - carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { - straightLinkMale(length=length, linkHeight=linkHeight, base=base) { - extrudeStraightProfile(length=length) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - } - } - } - } - translate([-interval, -interval * dir, 0]) { - rotateZ(180) { - carveBarrierNotch(length=length, thickness=thickness, base=base, notches=1) { - straightLinkFemale(length=length, linkHeight=linkHeight, base=base) { - extrudeStraightProfile(length=length) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - } - } - } - } - } - translateX(length / 2 - interval) { - rotateZ(270) { - difference() { - extrudeCurvedProfile(radius=interval, angle=180) { - barrierHolderProfile( - base = base, - thickness = thickness - ); - translate([-thickness / 2, holderHeight + towerHeight / 2]) { - rectangle([towerWidth, towerHeight]); - } - } - repeat(count=2, intervalX=interval * 2, center=true) { - translateZ(holderHeight - indent) { - box([thickness, thickness, indent]); - } - } - } - } - } -} - -/** - * Draws the shape of a unibody barrier for a U-Turn. - * @param Number length - The length of a track element. - * @param Number height - The height of the barrier. - * @param Number thickness - The thickness of the barrier body for a barrier holder. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number gap - The distance between the two side of the U-turn. - * @param Number right - Is it the right or the left part of the track element that is added first? - */ -module uTurnBarrierUnibody(length, height, thickness, base, gap, right = false) { - thickness = thickness + printTolerance; - linkHeight = getBarrierUnibodyLinkHeight(height, base); - interval = (getBarrierUnibodyWidth(base) + gap) / 2; - dir = right ? -1 : 1; - length = length / 2; - - translate([-interval, interval * dir, 0]) { - straightLinkMale(length=length, linkHeight=linkHeight, base=base) { - extrudeStraightProfile(length=length) { - barrierUnibodyProfile( - height = height, - base = base, - thickness = thickness - ); - } - } - } - translate([-interval, -interval * dir, 0]) { - rotateZ(180) { - straightLinkFemale(length=length, linkHeight=linkHeight, base=base) { - extrudeStraightProfile(length=length) { - barrierUnibodyProfile( - height = height, - base = base, - thickness = thickness - ); - } - } - } - } - translateX(length / 2 - interval) { - rotateZ(270) { - extrudeCurvedProfile(radius=interval, angle=180) { - barrierUnibodyProfile( - height = height, - base = base, - thickness = thickness - ); - } - } - } -} - -/** - * Draws the shape of a barrier border for a U-Turn. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number gap - The distance between the two side of the U-turn. - */ -module uTurnCompensationBarrierHolder(thickness, base, gap) { - length = getBarrierHolderWidth(base) + gap; - indent = getBarrierStripIndent(base); - height = getBarrierHolderHeight(base) - indent; - thickness = thickness + printTolerance; - - difference() { - straightBarrierMain( - length = length, - thickness = thickness, - base = base - ); - translateZ(height) { - box([length + 2, thickness, indent * 2]); - } - } -} - -/** - * Draws the shape of a barrier border for a U-Turn. - * @param Number height - The height of the barrier. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number gap - The distance between the two side of the U-turn. - */ -module uTurnCompensationBarrierUnibody(height, thickness, base, gap) { - length = getBarrierUnibodyWidth(base) + gap; - - straightBarrierUnibody( - length = length, - height = height, - thickness = thickness, - base = base - ); -} - -/** - * Draws the shape of a body for a U-turn compensation barrier. - * @param Number length - The length of the track element. - * @param Number height - The height of the barrier. - * @param Number thickness - The thickness of the barrier body. - * @param Number base - The base unit value used to design the barrier holder. - * @param Number gap - The distance between the two side of the U-turn. - */ -module uTurnCompensationBarrierBody(length, height, thickness, base, gap) { - stripHeight = getBarrierStripHeight(base) - getBarrierStripIndent(base); - compensation = getBarrierHolderWidth(base) + gap; - interval = (length - compensation) / 2; - - difference() { - box( - size = [length, height, thickness], - center = true - ); - repeatMirror(interval=[0, height, 0], axis=[0, 1, 0], center=true) { - repeatMirror() { - translateX((length - interval) / 2) { - barrierNotch( - thickness = thickness * 2, - base = base, - distance = printTolerance, - interval = interval, - count = 2, - center = true - ); - } - } - box( - size = [compensation, stripHeight * 2, thickness + 1], - center = true - ); - } - } -} diff --git a/rcmodels/tracks/slice.sh b/rcmodels/tracks/slice.sh deleted file mode 100755 index 2a2f3ed..0000000 --- a/rcmodels/tracks/slice.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# -# GPLv3 License -# -# Copyright (c) 2020 Jean-Sebastien CONAN -# -# This file is part of jsconan/things. -# -# jsconan/things is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# jsconan/things is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with jsconan/things. If not, see . -# - -# -# A race track system for 1/24 to 1/32 scale RC cars. -# -# Slices the STL files for the project. -# -# @author jsconan -# - -# script config -configpath="config/config.ini" -configdefault="config/config-dist.ini" - -# defines the config path -if [ "${configpath}" != "" ] && [ ! -f "${configpath}" ]; then - printmessage "${C_ERR}Warning! The config for Slic3r does not exist.\nWill use the default one" - cp "${configdefault}" "${configpath}" -fi - -# redirect to the lib utils -"$(dirname $0)/../../lib/camelSCAD/scripts/slice.sh" \ - --input "output" \ - --output "dist" \ - --config "${configpath}" \ - --prusaslicer \ - --recurse \ - "$@" diff --git a/rcmodels/tracks/test/accessories.scad b/rcmodels/tracks/test/accessories.scad deleted file mode 100644 index b630c4c..0000000 --- a/rcmodels/tracks/test/accessories.scad +++ /dev/null @@ -1,109 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Test the accessories shapes. - * - * @author jsconan - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=mode) { - - distributeGrid(intervalX=[length + printInterval, 0, 0], intervalY=[0, height, 0], line=2, center=true) { - - // test the cable clip shape - cableClip( - height = clip, - wall = wall, - base = base, - thickness = thickness - ); - - // test the accessory mast shape - mast( - width = base, - height = height, - distance = 0 - ); - - // test the accessory bent mast shape - bentMast( - width = base, - height = [base, height / 2], - distance = 0 - ); - - // test the accessory rings shape - mastRings( - width = base, - height = base, - wall = base, - interval = height / 2, - count = 2, - distance = printTolerance, - center = true - ); - - // test the accessory clip shape - accessoryStraightMast( - width = base, - height = height, - wall = wall, - base = base, - thickness = thickness - ); - - // test the bent accessory clip shape - accessoryBentMast( - width = base, - height = [base, height / 2], - wall = wall, - base = base, - thickness = thickness - ); - - // test the accessory flag shape, straight - accessoryFlag( - width = width, - height = height, - thickness = thickness, - mast = base, - wave = 0 - ); - - // test the accessory flag shape, wavy - accessoryFlag( - width = width, - height = height, - thickness = thickness, - mast = base, - wave = base - ); - - } -} diff --git a/rcmodels/tracks/test/curved.scad b/rcmodels/tracks/test/curved.scad deleted file mode 100644 index f3bdcad..0000000 --- a/rcmodels/tracks/test/curved.scad +++ /dev/null @@ -1,101 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Test the curved elements shapes. - * - * @author jsconan - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=mode) { - - distributeGrid( - intervalX = [length * 2, 0, 0], - intervalY = [0, length * 2, 0], - line = 2, - center = true - ) { - - // test the main shape of a curved barrier holder, left turned - curvedBarrierMain( - length = length, - thickness = thickness, - base = base, - ratio = 1, - right = false - ); - - // test the main shape of a curved barrier holder, right turned - curvedBarrierMain( - length = length, - thickness = thickness, - base = base, - ratio = 1, - right = true - ); - - // test the shape of the curved barrier holder, left turned - curvedBarrierHolder( - length = length, - thickness = thickness, - base = base, - ratio = 1, - right = false - ); - - // test the shape of the curved barrier holder, right turned - curvedBarrierHolder( - length = length, - thickness = thickness, - base = base, - ratio = 1, - right = true - ); - - // test the shape of a curved unibody barrier, left turned - curvedBarrierUnibody( - length = length, - height = height, - thickness = thickness, - base = base, - ratio = 1, - right = false - ); - - // test the shape of a curved unibody barrier, right turned - curvedBarrierUnibody( - length = length, - height = height, - thickness = thickness, - base = base, - ratio = 1, - right = true - ); - - } -} diff --git a/rcmodels/tracks/test/fragments.scad b/rcmodels/tracks/test/fragments.scad deleted file mode 100644 index e27390d..0000000 --- a/rcmodels/tracks/test/fragments.scad +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Test the fragments shapes. - * - * @author jsconan - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=mode) { - - distributeGrid(intervalX=[length, 0, 0], intervalY=[0, height, 0], line=2, center=true) { - - // test the clip profile - clip( - wall = wall, - height = clip, - base = base, - thickness = thickness, - distance = 0 - ); - - // test the barrier notch negative shape for a straight track element - barrierNotchNegative( - length = length, - thickness = thickness, - base = base, - notches = 2 - ); - - // test the barrier link shape - barrierLink( - height = 5, - base = base, - distance = printTolerance, - center = false - ); - - // test the barrier notch shape for a straight track element - barrierNotch( - thickness = thickness, - base = base, - distance = printTolerance, - interval = length, - count = 2, - center = true - ); - - // test the barrier notch shape for a curved track element - curvedBarrierNotch( - radius = length, - thickness = thickness, - base = base, - distance = printTolerance - ); - - } -} diff --git a/rcmodels/tracks/test/profiles.scad b/rcmodels/tracks/test/profiles.scad deleted file mode 100644 index 2aee7c6..0000000 --- a/rcmodels/tracks/test/profiles.scad +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Test the profile shapes. - * - * @author jsconan - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=mode) { - - distributeGrid(intervalX=[length, 0, 0], intervalY=[0, height, 0], line=2, center=true) { - - // test the barrier link profile - barrierLinkProfile( - base = base, - distance = printTolerance - ); - - // test the barrier notch profile - barrierNotchProfile( - base = base, - distance = printTolerance - ); - - // test the barrier holder profile - barrierHolderProfile( - base = base, - thickness = thickness, - distance = 0 - ); - - // test the barrier holder outline - barrierHolderOutline( - wall = wall, - base = base, - thickness = thickness, - distance = 0 - ); - - // test the barrier clip profile - clipProfile( - wall = wall, - base = base, - thickness = thickness, - distance = 0 - ); - - // test the unibody barrier profile - barrierUnibodyProfile( - height = height, - base = base, - thickness = thickness, - distance = 0 - ); - - } -} diff --git a/rcmodels/tracks/test/setup.scad b/rcmodels/tracks/test/setup.scad deleted file mode 100644 index 27bd1ad..0000000 --- a/rcmodels/tracks/test/setup.scad +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Setup the context and define the config for the tests. - * - * @author jsconan - */ - -// Import the project's setup. -include <../config/setup.scad> - -// Defines the test config -mode = MODE_DEV; // The render quality to apply -length = 50; // The nominal size of a track element -width = 50; // The virtual width of a track lane -lane = 100; // The actual width of a track lane -radius = 50; // The radius of the track inner curve -height = 30; // The height of the barrier, including the holders -base = 2; // The base unit value used to design the barrier holder -thickness = 0.6; // The thickness of the barrier body -wall = 0.8; // The thickness of the walls -clip = 2; // The thickness of the cable clips - -// Validate the config against the constraints -validateConfig( - length = length, - width = width, - lane = lane, - height = height, - radius = radius, - base = base -); - -// Show the values -printConfig( - length = length, - width = width, - lane = lane, - height = height, - radius = radius, - base = base -); diff --git a/rcmodels/tracks/test/special.scad b/rcmodels/tracks/test/special.scad deleted file mode 100644 index 3760dff..0000000 --- a/rcmodels/tracks/test/special.scad +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Test the special elements shapes. - * - * @author jsconan - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=mode) { - - distributeGrid(intervalX=[length * 1.5, 0, 0], intervalY=[0, height * 1.5, 0], line=2, center=true) { - - // test the shape of an arch tower clip - archTower( - length = length, - thickness = thickness, - base = base, - wall = wall * 2 - ); - - // test the shape of a connector between a barrier holder and a unibody barrier - barrierHolderToUnibodyConnector( - length = length, - height = height, - thickness = thickness, - base = base - ); - - // test the shape of an arch tower, male version - archTowerMale( - length = length, - thickness = thickness, - base = base, - wall = wall * 2 - ); - - // test the shape of an arch tower, female version - archTowerFemale( - length = length, - thickness = thickness, - base = base, - wall = wall * 2 - ); - - // test the shape of a connector between a barrier holder and a unibody barrier, male version - barrierHolderToUnibodyMale( - length = length, - height = height, - thickness = thickness, - base = base - ); - - // test the shape of a connector between a barrier holder and a unibody barrier, female version - barrierHolderToUnibodyFemale( - length = length, - height = height, - thickness = thickness, - base = base - ); - - // test the shape of the additional connector between a barrier holder and a unibody barrier, male version - barrierHolderConnectorMale( - length = length, - thickness = thickness, - base = base - ); - - // test the shape of the additional connector between a barrier holder and a unibody barrier, female version - barrierHolderConnectorFemale( - length = length, - thickness = thickness, - base = base - ); - - } -} diff --git a/rcmodels/tracks/test/straight.scad b/rcmodels/tracks/test/straight.scad deleted file mode 100644 index e43950b..0000000 --- a/rcmodels/tracks/test/straight.scad +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Test the straight elements shapes. - * - * @author jsconan - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=mode) { - - distributeGrid(intervalX=[length * 1.5, 0, 0], intervalY=[0, height * 1.5, 0], line=3, center=true) { - - // test the shape of a barrier body - barrierBody( - length = length, - height = height, - thickness = thickness, - base = base, - notches = 2 - ); - - // test the main shape of a straight barrier holder - straightBarrierMain( - length = length, - thickness = thickness, - base = base - ); - - // test the shape of a barrier body for the remaing of a curve - barrierBody( - length = getCurveRemainingLength(length), - height = height, - thickness = thickness, - base = base, - notches = 1 - ); - - // test the shape of a straight barrier holder - straightBarrierHolder( - length = length, - thickness = thickness, - base = base, - ratio = 1 - ); - - // test the shape of a straight unibody barrier - straightBarrierUnibody( - length = length, - height = height, - thickness = thickness, - base = base - ); - - } -} diff --git a/rcmodels/tracks/test/uturn.scad b/rcmodels/tracks/test/uturn.scad deleted file mode 100644 index 9514b18..0000000 --- a/rcmodels/tracks/test/uturn.scad +++ /dev/null @@ -1,104 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A race track system for 1/24 to 1/32 scale RC cars. - * - * Test the U-turn elements shapes. - * - * @author jsconan - */ - -// Import the project's setup. -include - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=mode) { - - distribute(intervalY=length, center=true) { - - // test the U-turn holder shape, left side - uTurnBarrierHolder( - length = length, - height = height, - thickness = thickness, - base = base, - gap = wall, - right = false - ); - - // test the U-turn holder shape, right side - uTurnBarrierHolder( - length = length, - height = height, - thickness = thickness, - base = base, - gap = wall, - right = true - ); - - // test the U-turn unibody shape, left side - uTurnBarrierUnibody( - length = length, - height = height, - thickness = thickness, - base = base, - gap = wall, - right = false - ); - - // test the U-turn unibody shape, right side - uTurnBarrierUnibody( - length = length, - height = height, - thickness = thickness, - base = base, - gap = wall, - right = true - ); - - // test the U-turn compensation shape - uTurnCompensationBarrierUnibody( - height = height, - thickness = thickness, - base = base, - gap = wall - ); - - // test the U-turn compensation shape - uTurnCompensationBarrierHolder( - thickness = thickness, - base = base, - gap = wall - ); - - // test the U-turn compensation body shape - uTurnCompensationBarrierBody( - length = length, - height = height, - thickness = thickness, - base = base, - gap = wall - ); - - } -} From 82e6297bd6abc8848b1aec150eb742d1b6f80e43 Mon Sep 17 00:00:00 2001 From: jsconan Date: Fri, 7 Jan 2022 18:45:45 +0100 Subject: [PATCH 174/191] chore: update camelSCAD to v1.0.1 --- lib/camelSCAD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/camelSCAD b/lib/camelSCAD index 294a382..8bb739d 160000 --- a/lib/camelSCAD +++ b/lib/camelSCAD @@ -1 +1 @@ -Subproject commit 294a382625217bef0e095d21c4e5dc77c4c22781 +Subproject commit 8bb739d1ee3ced929d330febb5a00c36d18f6617 From fe588c515b51cb011d91bfb0da6438ce5ff75a25 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 9 Jul 2022 22:31:48 +0200 Subject: [PATCH 175/191] chore: move the whoop-box project to another repo --- rcmodels/whoop-box/angled-box.scad | 50 ----- rcmodels/whoop-box/config/config.scad | 89 -------- rcmodels/whoop-box/container.scad | 51 ----- rcmodels/whoop-box/cupboard.scad | 54 ----- rcmodels/whoop-box/drawer.scad | 51 ----- rcmodels/whoop-box/render.sh | 131 ------------ rcmodels/whoop-box/rounded-box.scad | 50 ----- rcmodels/whoop-box/shapes/angled-box.scad | 105 ---------- rcmodels/whoop-box/shapes/box-util.scad | 96 --------- rcmodels/whoop-box/shapes/container.scad | 125 ------------ rcmodels/whoop-box/shapes/cupboard.scad | 98 --------- rcmodels/whoop-box/shapes/drawer.scad | 84 -------- rcmodels/whoop-box/shapes/rounded-box.scad | 94 --------- rcmodels/whoop-box/test/all-box.scad | 69 ------- rcmodels/whoop-box/util/functions.scad | 225 --------------------- rcmodels/whoop-box/util/setup.scad | 45 ----- 16 files changed, 1417 deletions(-) delete mode 100644 rcmodels/whoop-box/angled-box.scad delete mode 100644 rcmodels/whoop-box/config/config.scad delete mode 100644 rcmodels/whoop-box/container.scad delete mode 100644 rcmodels/whoop-box/cupboard.scad delete mode 100644 rcmodels/whoop-box/drawer.scad delete mode 100755 rcmodels/whoop-box/render.sh delete mode 100644 rcmodels/whoop-box/rounded-box.scad delete mode 100644 rcmodels/whoop-box/shapes/angled-box.scad delete mode 100644 rcmodels/whoop-box/shapes/box-util.scad delete mode 100644 rcmodels/whoop-box/shapes/container.scad delete mode 100644 rcmodels/whoop-box/shapes/cupboard.scad delete mode 100644 rcmodels/whoop-box/shapes/drawer.scad delete mode 100644 rcmodels/whoop-box/shapes/rounded-box.scad delete mode 100644 rcmodels/whoop-box/test/all-box.scad delete mode 100644 rcmodels/whoop-box/util/functions.scad delete mode 100644 rcmodels/whoop-box/util/setup.scad diff --git a/rcmodels/whoop-box/angled-box.scad b/rcmodels/whoop-box/angled-box.scad deleted file mode 100644 index d055d3c..0000000 --- a/rcmodels/whoop-box/angled-box.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A box to store tiny-whoops. - * - * Angled box that will contain a tiny-whoop and its surrounding protection box. - * This should be printed in rigid material, like PLA. - * - * @author jsconan - * @version 0.1.0 - */ - -// Import the project's setup. -include - -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 5]) - whoopAngledBox( - whoopType = whoopType, - wallThickness = getBoxWallThickness(ANGLED_BOX), - groundThickness = getBoxGroundThickness(ANGLED_BOX), - boxHeight = getBoxHeight(ANGLED_BOX, whoopType), - ductDistance = getBoxWhoopDistance(ANGLED_BOX) - ); -} diff --git a/rcmodels/whoop-box/config/config.scad b/rcmodels/whoop-box/config/config.scad deleted file mode 100644 index 27bb59e..0000000 --- a/rcmodels/whoop-box/config/config.scad +++ /dev/null @@ -1,89 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2019 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A box to store tiny-whoops. - * - * Defines the config. - * - * @author jsconan - * @version 0.1.0 - */ - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print. -printResolution = 0.2; // the target layer height -nozzle = 0.4; // the size of the print nozzle -wallDistance = 0.1; // the distance between the walls of two objects - -// Defines the indexes in the datasets -IDX_ID = 0; // index of the identifier -// - Tiny Whoop data -IDX_WHOOP_DUCT = 1; // index of the duct diameter in whoop data -IDX_WHOOP_FRAME = 2; // index of the frame diagonal in whoop data -IDX_WHOOP_HEIGHT = 3; // index of the height in whoop data -// - Box data -IDX_BOX_WALL = 1; // index of the wall thickness in box data -IDX_BOX_GROUND = 2; // index of the ground thickness in box data -IDX_BOX_HEIGHT = 3; // index of the height addition in box data -IDX_BOX_DISTANCE = 4; // index of the distance to walls factor in box data - -// Defines the types of data -TINY_WHOOP_65_BL = "tiny65bl"; -TINY_WHOOP_75_BL = "tiny75bl"; -ROUNDED_BOX = "rounded"; -ANGLED_BOX = "angled"; -CONTAINER = "drawer"; -DRAWER = "drawer"; -CUPBOARD = "cupboard"; - -// Defines the size for each types of tiny-whoops -whoopData = [ - // id, duct, frame, height - [TINY_WHOOP_65_BL, 37, 65, 48], - [TINY_WHOOP_75_BL, 48, 76, 48], -]; - -// Defines the constraints for the tiny-whoops boxes -boxData = [ - // id, wall, ground, height addition, distance factor - [ROUNDED_BOX, 0.8, 1, -1, 1], - [ANGLED_BOX, 1.0, 1, 0, 1], - [DRAWER, 1.6, 1, 1, 4], - [CUPBOARD, 2.0, 2, 0, 4], -]; - -// Defines the size of a box indentation -boxIndentation = [30, 10]; - -// Defines the size of a handle hole -boxHandleHole = 20; - -// Defines the target tiny-whoop type -whoopType = TINY_WHOOP_65_BL; - -// Sets the count of tiny-whoops in each kind of box -whoopCountBox = 2; -whoopCountDrawer = 2; -drawerCountCupboard = 2; diff --git a/rcmodels/whoop-box/container.scad b/rcmodels/whoop-box/container.scad deleted file mode 100644 index 67ec9f6..0000000 --- a/rcmodels/whoop-box/container.scad +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A box to store tiny-whoops. - * - * Container box that will contain several tiny-whoops and their surrounding - * protection boxes. This should be printed in rigid material, like PLA or PETG. - * - * @author jsconan - * @version 0.1.0 - */ - -// Import the project's setup. -include - -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 5]) - whoopContainer( - whoopType = whoopType, - wallThickness = getBoxWallThickness(CONTAINER), - groundThickness = getBoxGroundThickness(CONTAINER), - boxHeight = getBoxHeight(CONTAINER, whoopType), - ductDistance = getBoxWhoopDistance(CONTAINER), - whoopCount = whoopCountBox - ); -} diff --git a/rcmodels/whoop-box/cupboard.scad b/rcmodels/whoop-box/cupboard.scad deleted file mode 100644 index 2fc46cd..0000000 --- a/rcmodels/whoop-box/cupboard.scad +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A box to store tiny-whoops. - * - * Cupboard that will contain several tiny-whoops and their surrounding - * protection boxes. This should be printed in rigid a material, like PLA - * or PETG. - * - * @author jsconan - * @version 0.1.0 - */ - -// Import the project's setup. -include - -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 20]) - whoopCupboard( - whoopType = whoopType, - whoopCount = whoopCountDrawer, - drawerWallThickness = getBoxWallThickness(DRAWER), - drawerHeight = getBoxHeight(CUPBOARD, whoopType), - drawerCount = drawerCountCupboard, - drawerDistance = getBoxWallDistance(CUPBOARD), - ductDistance = getBoxWhoopDistance(DRAWER), - wallThickness = getBoxWallThickness(CUPBOARD) - ); -} diff --git a/rcmodels/whoop-box/drawer.scad b/rcmodels/whoop-box/drawer.scad deleted file mode 100644 index e9f8629..0000000 --- a/rcmodels/whoop-box/drawer.scad +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A box to store tiny-whoops. - * - * Drawer that will contain several tiny-whoops and their surrounding protection - * boxes. This should be printed in rigid a material, like PLA or PETG. - * - * @author jsconan - * @version 0.1.0 - */ - -// Import the project's setup. -include - -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 5]) - whoopDrawer( - whoopType = whoopType, - wallThickness = getBoxWallThickness(DRAWER), - groundThickness = getBoxGroundThickness(DRAWER), - boxHeight = getBoxHeight(DRAWER, whoopType), - ductDistance = getBoxWhoopDistance(DRAWER), - whoopCount = whoopCountDrawer - ); -} diff --git a/rcmodels/whoop-box/render.sh b/rcmodels/whoop-box/render.sh deleted file mode 100755 index 33a4b83..0000000 --- a/rcmodels/whoop-box/render.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/bin/bash -# -# GPLv3 License -# -# Copyright (c) 2019 Jean-Sebastien CONAN -# -# This file is part of jsconan/things. -# -# jsconan/things is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# jsconan/things is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with jsconan/things. If not, see . -# - -# -# Generates the STL files for the tiny-whoops boxes. -# -# @author jsconan -# - -# application params -whoop="tiny65bl" -boxX= -boxY= -drawerX= -drawerY= -drawers= - -# script config -scriptpath=$(dirname $0) -project=$(pwd) -srcpath=${project} -dstpath=${project}/output - -source "${scriptpath}/../../lib/camelSCAD/scripts/utils.sh" - -# load parameters -while (( "$#" )); do - case $1 in - "-t"|"--whoop") - whoop=$2 - shift - ;; - "-x") - boxX=$2 - drawerX=$2 - shift - ;; - "-y") - boxY=$2 - drawerY=$2 - shift - ;; - "-b"|"--box") - boxX=$2 - boxY=$2 - shift - ;; - "-bx"|"--boxX") - boxX=$2 - shift - ;; - "-by"|"--boxY") - boxY=$2 - shift - ;; - "-d"|"--drawer") - drawerX=$2 - drawerY=$2 - shift - ;; - "-dx"|"--drawerX") - drawerX=$2 - shift - ;; - "-dy"|"--drawerY") - drawerY=$2 - shift - ;; - "-ds"|"--drawers") - drawers=$2 - shift - ;; - "-h"|"--help") - echo -e "${C_INF}Renders OpenSCAD files${C_RST}" - echo -e " ${C_INF}Usage:${C_RST}" - echo -e "${C_CTX}\t$0 [-h|--help] [-o|--option value] files${C_RST}" - echo - echo -e "${C_MSG} -h, --help ${C_RST}Show this help" - echo -e "${C_MSG} -t, --whoop ${C_RST}Set the type of tiny-whoop (tiny65bl, tiny75bl)" - echo -e "${C_MSG} -x ${C_RST}Set the number of tiny-whoops in the length of a box and a drawer" - echo -e "${C_MSG} -y ${C_RST}Set the number of tiny-whoops in the width of a box and a drawer" - echo -e "${C_MSG} -b, --box ${C_RST}Set the number of tiny-whoops in both directions for a box" - echo -e "${C_MSG} -bx, --boxX ${C_RST}Set the number of tiny-whoops in the length of a box" - echo -e "${C_MSG} -by, --boxY ${C_RST}Set the number of tiny-whoops in the width of a box" - echo -e "${C_MSG} -d, --drawer ${C_RST}Set the number of tiny-whoops in both directions for a drawer" - echo -e "${C_MSG} -dx, --drawerX ${C_RST}Set the number of tiny-whoops in the length of a drawer" - echo -e "${C_MSG} -dy, --drawerY ${C_RST}Set the number of tiny-whoops in the width of a drawer" - echo -e "${C_MSG} -ds, --drawers ${C_RST}Set the number of drawers" - echo - exit 0 - ;; - *) - ls $1 >/dev/null 2>&1 - if [ "$?" == "0" ]; then - srcpath=$1 - else - printerror "Unknown parameter ${1}" - fi - ;; - esac - shift -done - -# check OpenSCAD -scadcheck - -# render the files, if exist -scadrenderall "${srcpath}" "${dstpath}" "${whoop}" "" \ - "whoopType=\"${whoop}\"" \ - "$(vectorif "whoopCountBox" ${boxX} ${boxY})" \ - "$(vectorif "whoopCountDrawer" ${drawerX} ${drawerY})" \ - "$(varif "drawerCountCupboard" ${drawers})" diff --git a/rcmodels/whoop-box/rounded-box.scad b/rcmodels/whoop-box/rounded-box.scad deleted file mode 100644 index 7f25972..0000000 --- a/rcmodels/whoop-box/rounded-box.scad +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A box to store tiny-whoops. - * - * Rounded box that will directly contain a tiny-whoop. - * This should be printed in a soft and rubber material, like TPU. - * - * @author jsconan - * @version 0.1.0 - */ - -// Import the project's setup. -include - -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 10], offset=[0, 0, 5]) - whoopRoundedBox( - whoopType = whoopType, - wallThickness = getBoxWallThickness(ROUNDED_BOX), - groundThickness = getBoxGroundThickness(ROUNDED_BOX), - boxHeight = getBoxHeight(ROUNDED_BOX, whoopType), - ductDistance = getBoxWhoopDistance(ROUNDED_BOX) - ); -} diff --git a/rcmodels/whoop-box/shapes/angled-box.scad b/rcmodels/whoop-box/shapes/angled-box.scad deleted file mode 100644 index f087107..0000000 --- a/rcmodels/whoop-box/shapes/angled-box.scad +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2019 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A box to store tiny-whoops. - * - * Defines angled box shapes. - * - * @author jsconan - * @version 0.1.0 - */ - -/** - * Computes the points defining a duct outline. - * Angled version. - * @param Vector point - The center of the duct - * @param Number duct - The duct diameter - * @param Number start - The start sector - * @param Number end - The end sector - * @param Number m - The number of sectors for the intermediate points - * @param Number n - The number of sectors for the surrounding points - * @returns Vector[] - */ -function drawWhoopAngledBoxDuct(point, duct, start, end, m = 8, n = 12) = - let( - point = vector2D(point), - angleM = getPolygonAngle(1, m), - angleN = getPolygonAngle(1, n), - radiusM = getDuctRadius(m, duct), - radiusN = getDuctRadius(n, duct), - start = float(start), - end = float(end), - startInternal = round(start * m / n), - endInternal = round(end * m / n) - 1 - ) - concat([ - point + arcp(radiusN, start * angleN) - ], [ - for (i = [startInternal : endInternal]) - point + arcp(radiusM, (i + 0.5) * angleM) - ], [ - point + arcp(radiusN, end * angleN) - ]) -; - -/** - * Computes the points defining the polygon shape surrounding a tiny-whoop. - * Angled version. - * @param Number duct - The duct diameter - * @param Number interval - The distance between ducts - * @returns Vector[] - */ -function drawWhoopAngledBoxShape(duct, interval) = - let( - m = 8, - n = 12, - points = getDuctPoints(interval, duct) - ) - concat( - drawWhoopAngledBoxDuct(point=points[0], duct=duct, start=10.5, end=16.5, m=m, n=n), - drawWhoopAngledBoxDuct(point=points[1], duct=duct, start= 1.5, end= 7.5, m=m, n=n), - drawWhoopAngledBoxDuct(point=points[2], duct=duct, start= 4.5, end=10.0, m=m, n=n), - drawWhoopAngledBoxDuct(point=points[3], duct=duct, start= 8.0, end=13.5, m=m, n=n) - ) -; - -/** - * Builds a box that will contain a tiny-whoop. - * Angled version. - * @param String whoopType - The type of tiny-whoop - * @param Number wallThickness - The thickness of the walls - * @param Number groundThickness - The thickness of the ground - * @param Number boxHeight - The height of the box - * @param Number [ductDistance] - The distance between a duct and the wall - */ -module whoopAngledBox(whoopType, wallThickness, groundThickness, boxHeight, ductDistance = 0) { - duct = getWhoopDuctDiameter(whoopType) + ductDistance * 2; - interval = getWhoopMotorInterval(whoopType); - boxWidth = interval + duct + wallThickness * 2; - points = drawWhoopAngledBoxShape(duct=duct, interval=interval); - - boxShape(size=apply3D(boxWidth, z=boxHeight), ground=groundThickness) { - extrudeShape(points=points, height=boxHeight, distance=wallThickness); - extrudeShape(points=points, height=boxHeight); - } -} diff --git a/rcmodels/whoop-box/shapes/box-util.scad b/rcmodels/whoop-box/shapes/box-util.scad deleted file mode 100644 index 0dca0f9..0000000 --- a/rcmodels/whoop-box/shapes/box-util.scad +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2019 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A box to store tiny-whoops. - * - * Defines box util shapes. - * - * @author jsconan - * @version 0.1.0 - */ - -/** - * Draws the shape of a box handle indentation. - * @param Vector size - The size of the box - * @param Vector indentation - The size of the indentation - */ -module boxIndentationShape(size, indentation) { - size = vector3D(size); - indentation = vector2D(indentation); - translateZ(size[2] - indentation[1] / 2) { - simplePolyhedron( - bottom = drawCross(vadd(size, ALIGN2), indentation[1]), - top = drawCross(vadd(size, ALIGN2), indentation[0]), - z = indentation[1] - ); - } -} - -/** - * Draws the shape of a box handle holes. - * @param Vector size - The size of the box - * @param Vector hole - The size of the hole - */ -module boxHoleShape(size, hole) { - size = vector3D(size); - hole = vector2D(hole); - - translateZ(size[2] / 2) { - rotateY(90) { - shaft(d=flip(hole), h=size[0] + ALIGN2, center=true); - } - rotateX(90) { - shaft(d=hole, h=size[1] + ALIGN2, center=true); - } - } -} - -/** - * Builds a box shape, with the cut for the handle (indentation). - * @param Vector size - The size of the box - * @param Number ground - The thickness of the box floor - * @param Vector [count] - The number of tiny-whoops on each axis - */ -module boxShape(size, ground, count = 1) { - difference() { - children(0); - translateZ(ground) { - children(1); - } - repeatShape2D(size, count, center=true) { - boxIndentationShape(size, boxIndentation); - } - } -} - -/** - * Extrudes a shape polygon, taking care of the outline. - * @param Vector[] points - The points that define the shape - * @param Number height - The height of the shape - * @param Number [distance] - The distance to the shape's outline - */ -module extrudeShape(points, height, distance = 0) { - linear_extrude(height=height, convexity=10) { - polygon(distance ? outline(points=points, distance=distance) : points); - } -} diff --git a/rcmodels/whoop-box/shapes/container.scad b/rcmodels/whoop-box/shapes/container.scad deleted file mode 100644 index 609bcac..0000000 --- a/rcmodels/whoop-box/shapes/container.scad +++ /dev/null @@ -1,125 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2019 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A box to store tiny-whoops. - * - * Defines box container shapes. - * - * @author jsconan - * @version 0.1.0 - */ - -/** - * Computes the points defining the polygon shape of a box that will - * contain several tiny-whoops. - * @param Number duct - The duct diameter - * @param Number interval - The distance between ducts - * @param Number [wall] - The thickness of walls between each tiny-whoops - * @param Vector [count] - The number of whoops on each axis - * @returns Vector[] - */ -function drawWhoopContainerShape(duct, interval, wall = 0, count = 1) = - let( - n = 8, - angle = getPolygonAngle(1, n), - radius = getDuctRadius(n, duct), - count = vector2D(count), - width = interval + duct + wall, - stepX = [width, 0], - stepY = [0, width], - point = width * (count - [1, 1]) / 2, - points = [ for (i = [0:3]) quadrant(point, i) ], - ducts = [ for (i = [0:3]) quadrant(interval, i) / 2 ], - length = count * 4 - [2, 2] - ) - concat( - // point 1 - [ - for (c = [1 : length[0]]) - let( - i = floor(c / 4), - j = c % 4 - ) - points[0] - stepX * i + ducts[floor(j / 2) % 4] + arcp(radius, angle * (j + 0.5)) - ], - // point 2 - [ - for (c = [1 : length[1]]) - let( - i = floor(c / 4), - j = c % 4 - ) - points[1] - stepY * i + ducts[floor((2 + j) / 2) % 4] + arcp(radius, angle * (j + 2.5)) - ], - // point 3 - [ - for (c = [1 : length[0]]) - let( - i = floor(c / 4), - j = c % 4 - ) - points[2] + stepX * i + ducts[floor((4 + j) / 2) % 4] + arcp(radius, angle * (j + 4.5)) - ], - // point 4 - [ - for (c = [1 : length[1]]) - let( - i = floor(c / 4), - j = c % 4 - ) - points[3] + stepY * i + ducts[floor((6 + j) / 2) % 4] + arcp(radius, angle * (j + 6.5)) - ] - ) -; - -/** - * Builds a box that will contain several tiny-whoops. - * @param String whoopType - The type of tiny-whoop - * @param Number wallThickness - The thickness of the walls - * @param Number groundThickness - The thickness of the ground - * @param Number boxHeight - The height of the box - * @param Number [ductDistance] - The distance between a duct and the wall - * @param Vector [whoopCount] - The number of tiny-whoops on each axis - */ -module whoopContainer(whoopType, wallThickness, groundThickness, boxHeight, ductDistance = 0, whoopCount = 1) { - duct = getWhoopDuctDiameter(whoopType) + ductDistance * 2; - interval = getWhoopMotorInterval(whoopType); - boxWidth = interval + duct + wallThickness * 2; - innerWidth = boxWidth - wallThickness; - - boxShape(size=apply3D(boxWidth, z=boxHeight), ground=groundThickness, count=whoopCount) { - extrudeShape(points=drawWhoopContainerShape( - duct = duct, - interval = interval, - wall = wallThickness, - count = whoopCount - ), height=boxHeight, distance=wallThickness); - - repeatShape2D(innerWidth, whoopCount, center=true) { - extrudeShape(points=drawWhoopContainerShape( - duct = duct, - interval = interval - ), height=boxHeight); - } - } -} diff --git a/rcmodels/whoop-box/shapes/cupboard.scad b/rcmodels/whoop-box/shapes/cupboard.scad deleted file mode 100644 index 558f3e4..0000000 --- a/rcmodels/whoop-box/shapes/cupboard.scad +++ /dev/null @@ -1,98 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2019 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A box to store tiny-whoops. - * - * Defines cupboard shapes. - * - * @author jsconan - * @version 0.1.0 - */ - -/** - * Computes the points defining the polygon shape of a cupboatd that will - * contain drawers for several tiny-whoops. - * @param Number duct - The duct diameter - * @param Number interval - The distance between ducts - * @param Number [wall] - The thickness of walls between each tiny-whoops - * @param Number [offset] - The offset for the bottom side - * @param Vector [count] - The number of whoops on each axis - * @returns Vector[] - */ -function drawWhoopCupboardShape(duct, interval, wall = 0, offset = 0, count = 1) = - let( - n = 8, - count = vector2D(count), - radius = getDuctRadius(n, duct), - points = getDuctPoints(interval, duct, count, wall), - offset = [0, offset] - ) - [ - for (i = [0 : n - 1]) - points[floor(i / 2)] + arcp(radius, getPolygonAngle(i + 0.5, n)) + [0, offset[floor(i / 4)]] - ] -; - -/** - * Builds a cupboatd that will contain drawers for several tiny-whoops. - * @param String whoopType - The type of tiny-whoop - * @param Number drawerWallThickness - The thickness of the internal walls - * @param Number wallThickness - The thickness of the walls - * @param Number drawerHeight - The height of a drawer - * @param Number [ductDistance] - The distance between a duct and a drawer's wall - * @param Number [drawerDistance] - The distance between a drawer and the wall - * @param Number [drawerCount] - The number of drawers - * @param Vector [whoopCount] - The number of tiny-whoops on each axis - */ -module whoopCupboard(whoopType, drawerWallThickness, wallThickness, drawerHeight, ductDistance = 0, drawerDistance = 0, drawerCount = 1, whoopCount = 1) { - duct = getWhoopDuctDiameter(whoopType) + ductDistance * 2; - interval = getWhoopMotorInterval(whoopType); - cupboardWidth = getDuctDistance(interval, duct, whoopCount, drawerWallThickness)[0] + duct + (drawerWallThickness + drawerDistance + wallThickness) * 2; - fullHeight = (drawerHeight + wallThickness) * drawerCount + wallThickness; - - rotateX(270) { - translate(-[0, cupboardWidth, fullHeight] / 2) { - difference() { - extrudeShape(points=drawWhoopCupboardShape( - duct = duct, - interval = interval, - wall = drawerWallThickness, - offset = drawerDistance + wallThickness, - count = whoopCount - ), height=fullHeight, distance=drawerWallThickness + drawerDistance + wallThickness); - - translateZ(wallThickness) { - repeat(count=drawerCount, interval = [0, 0, drawerHeight + wallThickness]) { - extrudeShape(points=drawWhoopCupboardShape( - duct = duct, - interval = interval, - wall = drawerWallThickness, - offset = -wallThickness, - count = whoopCount - ), height=drawerHeight, distance=drawerWallThickness + drawerDistance); - } - } - } - } - } -} diff --git a/rcmodels/whoop-box/shapes/drawer.scad b/rcmodels/whoop-box/shapes/drawer.scad deleted file mode 100644 index be27b2c..0000000 --- a/rcmodels/whoop-box/shapes/drawer.scad +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2019 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A box to store tiny-whoops. - * - * Defines drawer shapes. - * - * @author jsconan - * @version 0.1.0 - */ - -/** - * Computes the points defining the polygon shape of a drawer that will contain - * several tiny-whoops. - * @param Number duct - The duct diameter - * @param Number interval - The distance between ducts - * @param Number [wall] - The thickness of walls between each tiny-whoops - * @param Vector [count] - The number of whoops on each axis - * @returns Vector[] - */ -function drawWhoopDrawerShape(duct, interval, wall = 0, count = 1) = - let( - n = 8, - count = vector2D(count), - radius = getDuctRadius(n, duct), - points = getDuctPoints(interval, duct, count, wall) - ) - [ - for (i = [0 : n - 1]) - points[floor(i / 2)] + arcp(radius, getPolygonAngle(i + 0.5, n)) - ] -; - -/** - * Builds a drawer that will contain several tiny-whoops. - * @param String whoopType - The type of tiny-whoop - * @param Number wallThickness - The thickness of the walls - * @param Number groundThickness - The thickness of the ground - * @param Number boxHeight - The height of the box - * @param Number [ductDistance] - The distance between a duct and the wall - * @param Vector [whoopCount] - The number of tiny-whoops on each axis - */ -module whoopDrawer(whoopType, wallThickness, groundThickness, boxHeight, ductDistance = 0, whoopCount = 1) { - duct = getWhoopDuctDiameter(whoopType) + ductDistance * 2; - interval = getWhoopMotorInterval(whoopType); - boxWidth = interval + duct + wallThickness * 2; - innerWidth = boxWidth - wallThickness; - - boxShape(size=apply3D(boxWidth, z=boxHeight), ground=groundThickness, count=whoopCount) { - extrudeShape(points=drawWhoopDrawerShape( - duct = duct, - interval = interval, - wall = wallThickness, - count = whoopCount - ), height=boxHeight, distance=wallThickness); - - repeatShape2D(innerWidth, whoopCount, center=true) { - extrudeShape(points=drawWhoopDrawerShape( - duct = duct, - interval = interval - ), height=boxHeight); - } - } -} diff --git a/rcmodels/whoop-box/shapes/rounded-box.scad b/rcmodels/whoop-box/shapes/rounded-box.scad deleted file mode 100644 index 1e3e433..0000000 --- a/rcmodels/whoop-box/shapes/rounded-box.scad +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2019 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A box to store tiny-whoops. - * - * Defines rounded box shapes. - * - * @author jsconan - * @version 0.1.0 - */ - -/** - * Computes the points defining a duct outline. - * Rounded version. - * @param Vector point - The center of the duct - * @param Number duct - The duct diameter - * @param Number start - The start sector - * @param Number end - The end sector - * @param Number n - The number of sectors - * @returns Vector[] - */ -function drawWhoopRoundedBoxDuct(point, duct, start, end, n = 12) = - let( - point = vector2D(point), - radius = float(duct) / 2, - angle = getPolygonAngle(1, n), - start = float(start) * angle, - end = float(end) * angle - ) - arc(r=radius, o=point, a1=start, a2=end) -; - -/** - * Computes the points defining the polygon shape surrounding a tiny-whoop. - * Rounded version. - * @param Number duct - The duct diameter - * @param Number interval - The distance between ducts - * @returns Vector[] - */ -function drawWhoopRoundedBoxShape(duct, interval) = - let( - n = 12, - radius = duct / 2, - angle = getPolygonAngle(1, n), - points = getDuctPoints(interval, duct) - ) - concat( - drawWhoopRoundedBoxDuct(point=points[0], duct=duct, start=-1.5, end= 4.5, n=n), - drawWhoopRoundedBoxDuct(point=points[1], duct=duct, start= 1.5, end= 7.5, n=n), - drawWhoopRoundedBoxDuct(point=points[2], duct=duct, start= 4.5, end=10.0, n=n), - drawWhoopRoundedBoxDuct(point=points[3], duct=duct, start=-4.0, end= 1.5, n=n) - ) -; - -/** - * Builds a box that will contain a tiny-whoop. - * Rounded version. - * @param String whoopType - The type of tiny-whoop - * @param Number wallThickness - The thickness of the walls - * @param Number groundThickness - The thickness of the ground - * @param Number boxHeight - The height of the box - * @param Number [ductDistance] - The distance between a duct and the wall - */ -module whoopRoundedBox(whoopType, wallThickness, groundThickness, boxHeight, ductDistance = 0) { - duct = getWhoopDuctDiameter(whoopType) + ductDistance * 2; - interval = getWhoopMotorInterval(whoopType); - boxWidth = interval + duct + wallThickness * 2; - points = drawWhoopRoundedBoxShape(duct=duct, interval=interval); - - boxShape(size=apply3D(boxWidth, z=boxHeight), ground=groundThickness) { - extrudeShape(points=points, height=boxHeight, distance=wallThickness); - extrudeShape(points=points, height=boxHeight); - } -} diff --git a/rcmodels/whoop-box/test/all-box.scad b/rcmodels/whoop-box/test/all-box.scad deleted file mode 100644 index 8c06ad6..0000000 --- a/rcmodels/whoop-box/test/all-box.scad +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A box to store tiny-whoops. - * - * Draws a box following the outline shape of a tiny-whoop. - * - * @author jsconan - * @version 0.1.0 - */ - -// Import the project's setup. -include <../util/setup.scad> - -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - -// Sets the minimum facet angle and size using the defined render mode. -applyMode(mode=renderMode) { - // Uncomment the next line to cut a sample from the object - //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 5]) - union() { - whoopContainer( - whoopType = whoopType, - wallThickness = getBoxWallThickness(CONTAINER), - groundThickness = getBoxGroundThickness(CONTAINER), - boxHeight = getBoxHeight(CONTAINER, whoopType), - ductDistance = getBoxWhoopDistance(CONTAINER) - ); - translateZ(getBoxGroundThickness(CONTAINER)) { - whoopAngledBox( - whoopType = whoopType, - wallThickness = getBoxWallThickness(ANGLED_BOX), - groundThickness = getBoxGroundThickness(ANGLED_BOX), - boxHeight = getBoxHeight(ANGLED_BOX, whoopType), - ductDistance = getBoxWhoopDistance(ANGLED_BOX) - ); - translateZ(getBoxGroundThickness(ANGLED_BOX)) { - whoopRoundedBox( - whoopType = whoopType, - wallThickness = getBoxWallThickness(ROUNDED_BOX), - groundThickness = getBoxGroundThickness(ROUNDED_BOX), - boxHeight = getBoxHeight(ROUNDED_BOX, whoopType), - ductDistance = getBoxWhoopDistance(ROUNDED_BOX) - ); - } - } - } -} diff --git a/rcmodels/whoop-box/util/functions.scad b/rcmodels/whoop-box/util/functions.scad deleted file mode 100644 index 938a4bb..0000000 --- a/rcmodels/whoop-box/util/functions.scad +++ /dev/null @@ -1,225 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2019 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A box to store tiny-whoops. - * - * Defines some functions. - * - * @author jsconan - * @version 0.1.0 - */ - -/** - * Ajust a height with respect to the target layer height - * @param Number height - * @returns Number - */ -function adjustToLayer(height) = roundBy(height, printResolution); - -/** - * Ajust a width with respect to the target nozzle size - * @param Number width - * @returns Number - */ -function adjustToNozzle(width) = roundBy(width, nozzle); - -/** - * Gets the data defined for a particular tiny-whoop type - * @param String whoopType - The type of tiny-whoop - * @param Number [index] - The index of the data to get - * @returns Array|Number - The tiny-whoop data - */ -function getWhoopData(whoopType, index) = - let( - data = fetch(whoopData, whoopType) - ) - index ? data[index] : data -; - -/** - * Gets the data defined for a particular box type - * @param String boxType - The type of box - * @param Number [index] - The index of the data to get - * @returns Array|Number - The box data - */ -function getBoxData(boxType, index) = - let( - data = fetch(boxData, boxType) - ) - index ? data[index] : data -; - -/** - * Gets the cumulative data defined for a particular box type - * @param String boxType - The type of box - * @param Number index - The index of the data to sum - * @returns Number - The box cumulative data - */ -function getBoxCumulativeData(boxType, index) = - let( - dataIndex = find(boxData, boxType) - ) - vsum([ - for (boxIndex = [0:dataIndex]) - boxData[boxIndex][index] - ]) -; - -/** - * Gets the list of box types till the provided one - * @param String boxType - The type of box - * @returns Array - The box cumulative data - */ -function getBoxTypeList(boxType) = - let( - dataIndex = find(boxData, boxType) - ) - [ - for (boxIndex = [0:dataIndex]) - boxData[boxIndex][IDX_ID] - ] -; - -/** - * Gets the diameter of the propeller duct - * @param String whoopType - The type of tiny-whoop for which compute the size - * @returns Number - The diameter of the propeller duct - */ -function getWhoopDuctDiameter(whoopType) = getWhoopData(whoopType, IDX_WHOOP_DUCT); - -/** - * Computes the distance between motors based on the diagonal size of a tiny-whoop frame - * @param String whoopType - The type of tiny-whoop for which compute the size - * @returns Number - The distance between motors - */ -function getWhoopMotorInterval(whoopType) = - sqrt(pow(getWhoopData(whoopType, IDX_WHOOP_FRAME), 2) / 2) -; - -/** - * Gets the height of a tiny-whoop - * @param String whoopType - The type of tiny-whoop - * @returns Number - The height of the tiny-whoop - */ -function getWhoopHeight(whoopType) = adjustToLayer( - getWhoopData(whoopType, IDX_WHOOP_HEIGHT) -); - -/** - * Gets the ground thickness - * @param String boxType - The type of box - * @returns Number - The ground thickness for the given box - */ -function getBoxGroundThickness(boxType) = adjustToLayer( - getBoxData(boxType, IDX_BOX_GROUND) -); - -/** - * Gets the wall thickness - * @param String boxType - The type of box - * @returns Number - The wall thickness for the given box - */ -function getBoxWallThickness(boxType) = adjustToNozzle( - getBoxData(boxType, IDX_BOX_WALL) -); - -/** - * Gets the distance from the internal space to walls - * @param String boxType - The type of box - * @returns Number - The distance to walls for the given box - */ -function getBoxWallDistance(boxType) = wallDistance * getBoxData(boxType, IDX_BOX_DISTANCE); - -/** - * Gets the distance from the tiny-whoop ducts to walls - * @param String boxType - The type of box - * @returns Number - The distance to walls for the given box - */ -function getBoxWhoopDistance(boxType) = - wallDistance * getBoxCumulativeData(boxType, IDX_BOX_DISTANCE) + - vsum([ - for (type = pop(getBoxTypeList(boxType))) - getBoxWallThickness(type) - ]) -; - -/** - * Gets the height of a box with respect to the given tiny-whoop - * @param String boxType - The type of box - * @param String whoopType - The type of tiny-whoop - * @returns Number - The height of the box - */ -function getBoxHeight(boxType, whoopType) = - getWhoopHeight(whoopType) + - adjustToLayer(getBoxData(boxType, IDX_BOX_HEIGHT)) + - vsum([ - for (type = getBoxTypeList(boxType)) - getBoxGroundThickness(type) - ]) -; - -/** - * Gets the radius of a tiny-whoop duct. - * @param Number sides - The number of sides of the duct - * @param Number diameter - The diameter of the duct - * @returns Vector - The radius of the duct, as a 2D vector - */ -function getDuctRadius(sides, diameter) = - vector2D( - circumradius(n=sides, a=float(diameter) / 2) - ) -; - -/** - * Gets the distance between external ducts, for one or more tiny-whoops. - * @param Number interval - The interval between ducts - * @param Number diameter - The diameter of a duct - * @param Vector count - The count of tiny-whoops in each direction - * @param Number wall - The thickness of a wall - * @returns Vector - The distance betwenn external ducts - */ -function getDuctDistance(interval, diameter, count = 1, wall = 0) = - let( - count = vector2D(count), - interval = float(interval), - width = interval + float(diameter) + float(wall) - ) - vadd(width * (count - [1, 1]), interval) -; - -/** - * Gets the points for each duct of a tiny-whoop. - * @param Number interval - The interval between ducts - * @param Number diameter - The diameter of a duct - * @param Vector count - The count of tiny-whoops in each direction - * @param Number wall - The thickness of a wall - * @returns Vector - The distance betwenn external ducts - */ -function getDuctPoints(interval, diameter, count = 1, wall = 0) = - let( - point = getDuctDistance(interval, diameter, count, wall) / 2 - ) - [ for (i = [0:3]) - quadrant(point, i) - ] -; diff --git a/rcmodels/whoop-box/util/setup.scad b/rcmodels/whoop-box/util/setup.scad deleted file mode 100644 index 0c1ed56..0000000 --- a/rcmodels/whoop-box/util/setup.scad +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @license - * GPLv3 License - * - * Copyright (c) 2019 Jean-Sebastien CONAN - * - * This file is part of jsconan/things. - * - * jsconan/things is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * jsconan/things is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with jsconan/things. If not, see . - */ - -/** - * A box to store a tiny whoop. - * - * Setup the context. - * - * @author jsconan - * @version 0.1.0 - */ - -// As we need to use some shapes, use the right entry point of the library. -include <../../../lib/camelSCAD/shapes.scad> - -// Then we need the config for the project, as well as the related functions -include <../config/config.scad> -include - -// Finally, include the shapes -include <../shapes/box-util.scad> -include <../shapes/rounded-box.scad> -include <../shapes/angled-box.scad> -include <../shapes/container.scad> -include <../shapes/drawer.scad> -include <../shapes/cupboard.scad> From 9ceae1eb7e3113fe9f12e7cfb57c0efe472107e6 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 10 Jul 2022 15:48:58 +0200 Subject: [PATCH 176/191] feat: add a bootstrap file, with global config and helpers --- config/config.scad | 38 +++++++++++++ config/helpers.scad | 133 ++++++++++++++++++++++++++++++++++++++++++++ config/setup.scad | 37 ++++++++++++ config/version.scad | 29 ++++++++++ skeleton.scad | 25 +++------ 5 files changed, 244 insertions(+), 18 deletions(-) create mode 100644 config/config.scad create mode 100644 config/helpers.scad create mode 100644 config/setup.scad create mode 100644 config/version.scad diff --git a/config/config.scad b/config/config.scad new file mode 100644 index 0000000..c8c564d --- /dev/null +++ b/config/config.scad @@ -0,0 +1,38 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2022 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * Global configuration. + * + * @author jsconan + */ + +// We will render the object using the specifications of this mode +renderMode = MODE_PROD; + +// Defines the characteristics of the printer +layerHeight = 0.2; // The height of the printed layers. +nozzleWidth = 0.4; // The size of the printer's nozzle. +printTolerance = 0.1; // The print tolerance when pieces need to be assembled. +printInterval = 5; // The interval between 2 pieces when presented together. +printerLength = 250; // The length of the printer's build plate. +printerWidth = 210; // The width of the printer's build plate. diff --git a/config/helpers.scad b/config/helpers.scad new file mode 100644 index 0000000..c91473d --- /dev/null +++ b/config/helpers.scad @@ -0,0 +1,133 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2022 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * Global functions. + * + * @author jsconan + */ + +/** + * Aligns a value with respect to the target layer height. + * @param Number value + * @returns Number + */ +function layerAligned(value) = roundBy(value, layerHeight); + +/** + * Aligns a value with respect to the target nozzle size. + * @param Number value + * @returns Number + */ +function nozzleAligned(value) = roundBy(value, nozzleWidth); + +/** + * Gets the thickness of N layers. + * @param Number N + * @returns Number + */ +function layers(N) = N * layerHeight; + +/** + * Gets the width of N times the nozzle width. + * @param Number N + * @returns Number + */ +function shells(N) = N * nozzleWidth; + +/** + * Computes the print interval between the centers of 2 objects. + * @param Number size - The size of the shape. + * @returns Number + */ +function getPrintInterval(size) = size + printInterval; + +/** + * Gets the adjusted quantity of shapes to place on a grid with respect to the size of one shape. + * @param Number length - The length of the shape. + * @param Number width - The width of the shape. + * @param Number [quantity] - The number of shapes to place. + * @returns Number + */ +function getMaxQuantity(length, width, quantity=1) = + let( + maxLine = floor(printerLength / length), + maxCol = floor(printerWidth / width) + ) + min(maxLine * maxCol, quantity) +; + +/** + * Gets the maximal number of shapes that can be placed on a line with respect the size of one shape. + * @param Number length - The length of the shape. + * @param Number width - The width of the shape. + * @param Number [quantity] - The number of shapes to place. + * @param Number [line] - The expected number of shapes per line. + * @returns Number + */ +function getMaxLine(length, width, quantity=1, line=undef) = + let( + maxLine = floor(printerLength / length) + ) + min(uor(line, ceil(sqrt(quantity))), maxLine) +; + +/** + * Gets the overall length of the area taken to place the repeated shapes on a grid with respect to the expected quantity. + * @param Number length - The length of the shape. + * @param Number width - The width of the shape. + * @param Number [quantity] - The number of shapes to place. + * @param Number [line] - The expected number of shapes per line. + * @returns Number + */ +function getGridLength(length, width, quantity=1, line=undef) = + let( + length = getPrintInterval(length), + width = getPrintInterval(width), + quantity = getMaxQuantity(length, width, quantity) + ) + min(quantity, getMaxLine(length, width, quantity, line)) * length +; + +/** + * Gets the overall width of the area taken to place the repeated shapes on a grid with respect to the expected quantity. + * @param Number length - The length of the shape. + * @param Number width - The width of the shape. + * @param Number [quantity] - The number of shapes to place. + * @param Number [line] - The expected number of shapes per line. + * @returns Number + */ +function getGridWidth(length, width, quantity=1, line=undef) = + let( + length = getPrintInterval(length), + width = getPrintInterval(width), + quantity = getMaxQuantity(length, width, quantity), + line = getMaxLine(length, width, quantity, line) + ) + ceil(quantity / line) * width +; + +/** + * Prints the project version, including the package version. + * @returns String + */ +function printVersion() = str(PROJECT_VERSION); diff --git a/config/setup.scad b/config/setup.scad new file mode 100644 index 0000000..4405d21 --- /dev/null +++ b/config/setup.scad @@ -0,0 +1,37 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2022 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * Project's bootstrap. + * + * @author jsconan + */ + +// As we need to use some shapes, use the right entry point of the library. +include <../lib/camelSCAD/shapes.scad> + +// Defines the project's version +include + +// Then we need the config for the project, as well as the related functions +include +include diff --git a/config/version.scad b/config/version.scad new file mode 100644 index 0000000..5509e40 --- /dev/null +++ b/config/version.scad @@ -0,0 +1,29 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2022 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * Version of the project. + * + * @author jsconan + */ + +PROJECT_VERSION = "1.0.0"; diff --git a/skeleton.scad b/skeleton.scad index 882a60b..9771c5b 100644 --- a/skeleton.scad +++ b/skeleton.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017-2020 Jean-Sebastien CONAN + * Copyright (c) 2017-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -27,27 +27,16 @@ * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library. -use - -// To be able to use the library shared constants we import the definition file. -include - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print. -printResolution = 0.2; // the target layer height -nozzle = 0.4; // the size of the print nozzle -printTolerance = 0.1; // The print tolerance when pieces need to be assembled +// Import the project's setup. +include // Defines the constraints of the object. -//count = 2; +count = 2; // Defines the dimensions of the object. -//length = 10; -//width = 10; -//height = 10; +length = 10; +width = 10; +height = 10; // Displays a build box visualization to preview the printer area. buildBox(center=true); From d8eafdc257167d260c13f920bfd3f44e29c0ee37 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 10 Jul 2022 15:55:42 +0200 Subject: [PATCH 177/191] refactor: move tools to parts/tools --- {tools => parts/tools}/angle-guide.scad | 22 ++++--------------- {tools => parts/tools}/handle-helper.scad | 13 +++-------- .../tools}/magimix-screw-driver.scad | 11 +++------- {tools => parts/tools}/spatula.scad | 21 ++++-------------- 4 files changed, 14 insertions(+), 53 deletions(-) rename {tools => parts/tools}/angle-guide.scad (76%) rename {tools => parts/tools}/handle-helper.scad (81%) rename {tools => parts/tools}/magimix-screw-driver.scad (80%) rename {tools => parts/tools}/spatula.scad (71%) diff --git a/tools/angle-guide.scad b/parts/tools/angle-guide.scad similarity index 76% rename from tools/angle-guide.scad rename to parts/tools/angle-guide.scad index 1080661..e1aa2de 100644 --- a/tools/angle-guide.scad +++ b/parts/tools/angle-guide.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN + * Copyright (c) 2019-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,20 +24,10 @@ * A guide to align on a particular angle * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library. -use <../lib/camelSCAD/shapes.scad> - -// To be able to use the library shared constants we import the definition file. -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print. -printResolution = 0.2; +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints of the object. step = 10; @@ -46,7 +36,7 @@ angle = 60; radius = 150; // Defines the dimensions of the object. -thickness = printResolution * 3; +thickness = layers(3); shift = arcp(r=vector2D(step), a=angle / 2); /** @@ -64,9 +54,6 @@ module holeLine(length, interval, diameter) { } } -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { translate(-[radius / 2, radius / 2 * sin(angle), 0]) { @@ -86,7 +73,6 @@ applyMode(mode=renderMode) { pie(r=r - step, a=angle); } } - } } } diff --git a/tools/handle-helper.scad b/parts/tools/handle-helper.scad similarity index 81% rename from tools/handle-helper.scad rename to parts/tools/handle-helper.scad index 8bb87f1..5d104fc 100644 --- a/tools/handle-helper.scad +++ b/parts/tools/handle-helper.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2021 Jean-Sebastien CONAN + * Copyright (c) 2021-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,17 +24,10 @@ * A helper to place an ikea handle. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library. -use <../lib/camelSCAD/shapes.scad> - -// To be able to use the library shared constants we import the definition file. -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints of the object. pencilLeadSize = 0.7; diff --git a/tools/magimix-screw-driver.scad b/parts/tools/magimix-screw-driver.scad similarity index 80% rename from tools/magimix-screw-driver.scad rename to parts/tools/magimix-screw-driver.scad index 4fe59e9..381cdfb 100644 --- a/tools/magimix-screw-driver.scad +++ b/parts/tools/magimix-screw-driver.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017 Jean-Sebastien CONAN + * Copyright (c) 2017-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,15 +24,10 @@ * A screw driver designed to fit the Magimix Nespresso screws. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library -use <../lib/camelSCAD/shapes.scad> -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; +// Import the project's setup. +include <../../config/setup.scad> // Defines the dimensions of the object outerDiameter = 8.00; diff --git a/tools/spatula.scad b/parts/tools/spatula.scad similarity index 71% rename from tools/spatula.scad rename to parts/tools/spatula.scad index de12b43..cc4e299 100644 --- a/tools/spatula.scad +++ b/parts/tools/spatula.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017-2020 Jean-Sebastien CONAN + * Copyright (c) 2017-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,20 +24,10 @@ * A simple spatula. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library. -use <../lib/camelSCAD/shapes.scad> - -// To be able to use the library shared constants we import the definition file. -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print. -printResolution = 0.2; +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints of the object. thickness = 1; @@ -48,14 +38,11 @@ handleLength = 100; handleWidth = 3; // Defines the dimensions of the object. -bladeThickness = roundBy(thickness, printResolution); +bladeThickness = layerAligned(thickness); bladeSize = [bladeLength, bladeWidth, bladeThickness]; handleSize = [handleLength, handleWidth, bladeThickness]; handleRound = handleWidth; -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { cushion(size=bladeSize, r=bladeRound); From 6f3ce7f0a6c155aa13e309d9222a1c1e866156d8 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 10 Jul 2022 16:12:03 +0200 Subject: [PATCH 178/191] refactor: move printer to parts/printer --- .../printer}/bearing-spool-holder.scad | 22 ++++----------- .../printer}/dehydratator-feet.scad | 21 +++----------- .../dehydratator-spool-holder-v2.scad | 21 +++----------- .../printer}/dehydratator-spool-holder.scad | 21 +++----------- .../enclosure-filament-passage-groove.scad | 28 ++++++------------- .../printer}/sleeve-spool-holder.scad | 18 ++---------- .../printer}/wheel-spool-holder.scad | 21 ++------------ 7 files changed, 31 insertions(+), 121 deletions(-) rename {printer => parts/printer}/bearing-spool-holder.scad (75%) rename {printer => parts/printer}/dehydratator-feet.scad (79%) rename {printer => parts/printer}/dehydratator-spool-holder-v2.scad (85%) rename {printer => parts/printer}/dehydratator-spool-holder.scad (83%) rename {printer => parts/printer}/enclosure-filament-passage-groove.scad (75%) rename {printer => parts/printer}/sleeve-spool-holder.scad (76%) rename {printer => parts/printer}/wheel-spool-holder.scad (88%) diff --git a/printer/bearing-spool-holder.scad b/parts/printer/bearing-spool-holder.scad similarity index 75% rename from printer/bearing-spool-holder.scad rename to parts/printer/bearing-spool-holder.scad index 2385057..5e426b6 100644 --- a/printer/bearing-spool-holder.scad +++ b/parts/printer/bearing-spool-holder.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2020 Jean-Sebastien CONAN + * Copyright (c) 2020-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,22 +24,10 @@ * A sleeve to adapt on a ball bearing axle for a spool holder. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library. -use <../lib/camelSCAD/shapes.scad> - -// To be able to use the library shared constants we import the definition file. -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print. -printResolution = 0.2; // The target layer height -nozzleWidth = 0.4; // The size of the printer's nozzle -printTolerance = 0.1; // The print tolerance when pieces need to be assembled +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints of the object. spoolDiameter = 50; @@ -72,9 +60,9 @@ applyMode(mode=renderMode) { points=path([ ["P", startX, startY], ["H", -startX], - ["V", printResolution], + ["V", layerHeight], ["H", bearingAxle / 2], - ["V", innerAxle - printResolution], + ["V", innerAxle - layerHeight], ["L", chamfer, chamfer], ["H", topBrim], ["L", chamfer, -chamfer], diff --git a/printer/dehydratator-feet.scad b/parts/printer/dehydratator-feet.scad similarity index 79% rename from printer/dehydratator-feet.scad rename to parts/printer/dehydratator-feet.scad index 90ce248..d84cee8 100644 --- a/printer/dehydratator-feet.scad +++ b/parts/printer/dehydratator-feet.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN + * Copyright (c) 2019-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,20 +24,10 @@ * A feet set to put under a cylindric food dehydratator. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library. -use <../lib/camelSCAD/shapes.scad> - -// To be able to use the library shared constants we import the definition file. -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print. -printResolution = 0.2; +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints of the object. dehydratatorFootWidth = 14; @@ -52,7 +42,7 @@ count = 4; additionalThickness = wallThickness * 2; footWidth = dehydratatorFootWidth + additionalThickness; footThickness = dehydratatorFootThickness + additionalThickness; -footHeight = roundBy(dehydratatorFootHeight + wallThickness, printResolution); +footHeight = layerAligned(dehydratatorFootHeight + wallThickness); intervalX = footThickness + wallThickness; /** @@ -69,9 +59,6 @@ module foot(bottom, top, height) { } } -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { translateX(-((count - 1) * intervalX) / 2) { diff --git a/printer/dehydratator-spool-holder-v2.scad b/parts/printer/dehydratator-spool-holder-v2.scad similarity index 85% rename from printer/dehydratator-spool-holder-v2.scad rename to parts/printer/dehydratator-spool-holder-v2.scad index 5ffad14..3c25174 100644 --- a/printer/dehydratator-spool-holder-v2.scad +++ b/parts/printer/dehydratator-spool-holder-v2.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN + * Copyright (c) 2019-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,20 +24,10 @@ * A spool holder that mounts on a cylindric food dehydratator. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library. -use <../lib/camelSCAD/shapes.scad> - -// To be able to use the library shared constants we import the definition file. -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print. -printResolution = 0.2; +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints of the object. holeDiameter = 62.7; // the diameter of the hole in the dehydratator plate @@ -62,7 +52,7 @@ diameters = unshift([ for (i = [0 : len(spoolDiameters) - 1]) spoolDiameters[i] count = len(diameters); heights = [ for (i = [0 : count - 1]) i * height + holeDepth + flange + edge ]; brims = [ for (i = [1 : count - 1]) (diameters[i - 1] - diameters[i]) / 2 ]; -intervalX = [ for (i = [0 : count - 1]) brims[i] / plateRidgeCount - plateRidgeWidth ]; +intervalX = [ for (i = [0 : count - 2]) brims[i] / plateRidgeCount - plateRidgeWidth ]; intervalY = height / wallRidgeCount - wallRidgeWidth; plateRidgeX = plateRidgeWidth / 2 * cos(60); @@ -70,9 +60,6 @@ plateRidgeY = plateRidgeHeight; wallRidgeX = wallRidgeHeight; wallRidgeY = wallRidgeWidth / 2 * cos(60); -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { rotate_extrude() { diff --git a/printer/dehydratator-spool-holder.scad b/parts/printer/dehydratator-spool-holder.scad similarity index 83% rename from printer/dehydratator-spool-holder.scad rename to parts/printer/dehydratator-spool-holder.scad index b001ed1..71ceb0c 100644 --- a/printer/dehydratator-spool-holder.scad +++ b/parts/printer/dehydratator-spool-holder.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN + * Copyright (c) 2019-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,20 +24,10 @@ * A spool holder that mounts on a cylindric food dehydratator. * * @author jsconan - * @version 0.2.0 */ -// As we need to use some shapes, use the right entry point of the library. -use <../lib/camelSCAD/shapes.scad> - -// To be able to use the library shared constants we import the definition file. -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print. -printResolution = 0.2; +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints of the object. mountDiameter = 79; @@ -57,7 +47,7 @@ spoolHoleRidgeHeight = .5; spoolHoleRidgeCount = 6; // Defines the dimensions of the object. -plateHeight = roundBy(plateThickness + mountDepth - plateRidgeHeight, printResolution); +plateHeight = layerAligned(plateThickness + mountDepth - plateRidgeHeight); plateDiameter = mountDiameter + mountWall * 2; plateBrim = (plateDiameter - spoolHoleDiameter) / 2; plateRidgeInterval = plateBrim / plateRidgeCount - plateRidgeWidth; @@ -69,9 +59,6 @@ spoolHoleRidgeInterval = (spoolHoleHeight - spoolHoleRidgeWidth) / spoolHoleRidg spoolHoleRidgeX = spoolHoleRidgeHeight; spoolHoleRidgeY = spoolHoleRidgeWidth / 2 * cos(60); -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { //sample(size=vadd([plateDiameter, plateDiameter, 8], ALIGN2), offset=[0, 0, -ALIGN]) diff --git a/printer/enclosure-filament-passage-groove.scad b/parts/printer/enclosure-filament-passage-groove.scad similarity index 75% rename from printer/enclosure-filament-passage-groove.scad rename to parts/printer/enclosure-filament-passage-groove.scad index 5eebf70..a245921 100644 --- a/printer/enclosure-filament-passage-groove.scad +++ b/parts/printer/enclosure-filament-passage-groove.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN + * Copyright (c) 2019-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,31 +24,19 @@ * A filament passage groove for the LACK enclosure. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library. -use <../lib/camelSCAD/shapes.scad> - -// To be able to use the library shared constants we import the definition file. -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print. -printResolution = 0.2; // the target layer height -nozzle = 0.4; // the size of the print nozzle -wallDistance = 0.1; // the distance between the walls of two objects +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints of the object. grooveLength = 200; grooveWidth = 12; -mainWallThickness = nozzle * 3; -capWallThickness = nozzle * 2; +mainWallThickness = shells(3); +capWallThickness = shells(2); boardHeight = 50; flangeWidth = 20; -flangeThickness = printResolution * 8; +flangeThickness = layers(8); capFlange = 8; capHeight = 15; @@ -70,10 +58,10 @@ module passageGroove(size, flange, thickness, wall, distance=0) { negativeExtrude(height=thickness, scale=vector2D(vdiv(hole, holeBevel))) { stadium(holeBevel); } - negativeExtrude(height=printResolution) { + negativeExtrude(height=layerHeight) { difference() { stadium(outer); - stadium(vsub(outerBevel, 2 * nozzle)); + stadium(vsub(outerBevel, shells(2))); } } negativeExtrude(height=height) { diff --git a/printer/sleeve-spool-holder.scad b/parts/printer/sleeve-spool-holder.scad similarity index 76% rename from printer/sleeve-spool-holder.scad rename to parts/printer/sleeve-spool-holder.scad index 9ed4b4f..1b2a6fe 100644 --- a/printer/sleeve-spool-holder.scad +++ b/parts/printer/sleeve-spool-holder.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2020 Jean-Sebastien CONAN + * Copyright (c) 2020-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,22 +24,10 @@ * A sleeve to adapt on a printed axle for a spool holder. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library. -use <../lib/camelSCAD/shapes.scad> - -// To be able to use the library shared constants we import the definition file. -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print. -printResolution = 0.2; // The target layer height -nozzleWidth = 0.4; // The size of the printer's nozzle -printTolerance = 0.1; // The print tolerance when pieces need to be assembled +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints of the object. spoolDiameter = 50; diff --git a/printer/wheel-spool-holder.scad b/parts/printer/wheel-spool-holder.scad similarity index 88% rename from printer/wheel-spool-holder.scad rename to parts/printer/wheel-spool-holder.scad index b001c6e..fba8f3d 100644 --- a/printer/wheel-spool-holder.scad +++ b/parts/printer/wheel-spool-holder.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN + * Copyright (c) 2019-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -25,22 +25,10 @@ * spool holder from the LACK enclosure cabinet. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library. -use <../lib/camelSCAD/shapes.scad> - -// To be able to use the library shared constants we import the definition file. -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print. -printResolution = 0.2; // the target layer height -nozzle = 0.4; // the size of the print nozzle -wallDistance = 0.1; // the distance between the walls of two objects +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints of the object. wheelWidth = 4.4; @@ -158,9 +146,6 @@ module spoolHolderLeg(wheelDiameter, wheelDistance, axleDiameter, axleDistance, } } -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object From 944b6fa35723f4e513f94040f4f8e7d40fa35905 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 10 Jul 2022 16:56:39 +0200 Subject: [PATCH 179/191] refactor: move rcmodels to parts/rcmodels --- .../betafpv-beta85x-needle.scad | 16 ++------ .../betafpv-beta85x-stand.scad | 16 ++------ .../tiny-whoop-camera-holder.scad | 14 ++----- .../blade-torrent-battery-spacer.scad | 23 +++-------- .../blade-torrent-landing-gear.scad | 23 +++-------- .../blade-torrent-stand.scad | 17 ++------ {rcmodels => parts/rcmodels}/fc-case.scad | 32 +++++---------- .../rcmodels}/utils/batteries-organizer.scad | 39 +++++-------------- 8 files changed, 43 insertions(+), 137 deletions(-) rename {rcmodels => parts/rcmodels}/betafpv-beta85x/betafpv-beta85x-needle.scad (79%) rename {rcmodels => parts/rcmodels}/betafpv-beta85x/betafpv-beta85x-stand.scad (82%) rename {rcmodels => parts/rcmodels}/blade-inductrix/tiny-whoop-camera-holder.scad (89%) rename {rcmodels => parts/rcmodels}/blade-torrent-110/blade-torrent-battery-spacer.scad (87%) rename {rcmodels => parts/rcmodels}/blade-torrent-110/blade-torrent-landing-gear.scad (87%) rename {rcmodels => parts/rcmodels}/blade-torrent-110/blade-torrent-stand.scad (89%) rename {rcmodels => parts/rcmodels}/fc-case.scad (85%) rename {rcmodels => parts/rcmodels}/utils/batteries-organizer.scad (59%) diff --git a/rcmodels/betafpv-beta85x/betafpv-beta85x-needle.scad b/parts/rcmodels/betafpv-beta85x/betafpv-beta85x-needle.scad similarity index 79% rename from rcmodels/betafpv-beta85x/betafpv-beta85x-needle.scad rename to parts/rcmodels/betafpv-beta85x/betafpv-beta85x-needle.scad index 3425fd8..0729f31 100644 --- a/rcmodels/betafpv-beta85x/betafpv-beta85x-needle.scad +++ b/parts/rcmodels/betafpv-beta85x/betafpv-beta85x-needle.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN + * Copyright (c) 2019-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -26,17 +26,10 @@ * to remove the SD card. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library -include <../../lib/camelSCAD/shapes.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print -printResolution = 0.2; +// Import the project's setup. +include <../../../config/setup.scad> // Defines the constraints of the object needleWidth = 2; @@ -48,9 +41,6 @@ handleLength = 60; // Defines the dimensions of the object needleSide = (handleWidth - needleWidth) / 2; -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 2], offset=[0, 0, 2]) diff --git a/rcmodels/betafpv-beta85x/betafpv-beta85x-stand.scad b/parts/rcmodels/betafpv-beta85x/betafpv-beta85x-stand.scad similarity index 82% rename from rcmodels/betafpv-beta85x/betafpv-beta85x-stand.scad rename to parts/rcmodels/betafpv-beta85x/betafpv-beta85x-stand.scad index dad76f0..d3c33e2 100644 --- a/rcmodels/betafpv-beta85x/betafpv-beta85x-stand.scad +++ b/parts/rcmodels/betafpv-beta85x/betafpv-beta85x-stand.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN + * Copyright (c) 2019-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,17 +24,10 @@ * A stand for the BetaFPV Beta85X. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library -include <../../lib/camelSCAD/shapes.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print -printResolution = 0.2; +// Import the project's setup. +include <../../../config/setup.scad> // Defines the constraints of the object motorDistance = 85; @@ -49,9 +42,6 @@ armLength = (motorDistance - plateDiameter) / 2 + pillarDiameter; platformHeight = platformDiameter - pillarDiameter; pillarBottom = pillarHeight - platformHeight; -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 2], offset=[0, 0, 2]) applyMode(mode=renderMode) { diff --git a/rcmodels/blade-inductrix/tiny-whoop-camera-holder.scad b/parts/rcmodels/blade-inductrix/tiny-whoop-camera-holder.scad similarity index 89% rename from rcmodels/blade-inductrix/tiny-whoop-camera-holder.scad rename to parts/rcmodels/blade-inductrix/tiny-whoop-camera-holder.scad index f245ee0..7859713 100644 --- a/rcmodels/blade-inductrix/tiny-whoop-camera-holder.scad +++ b/parts/rcmodels/blade-inductrix/tiny-whoop-camera-holder.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017-2020 Jean-Sebastien CONAN + * Copyright (c) 2017-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -25,15 +25,10 @@ * Default dimensions are for a Blade Inductrix and a CM275T/VM2751 camera. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library -use <../../lib/camelSCAD/shapes.scad> -include <../../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; +// Import the project's setup. +include <../../../config/setup.scad> // Defines the dimensions of the object screwInterval = 25.5; @@ -85,9 +80,6 @@ module triangle(side) { } } -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { difference() { diff --git a/rcmodels/blade-torrent-110/blade-torrent-battery-spacer.scad b/parts/rcmodels/blade-torrent-110/blade-torrent-battery-spacer.scad similarity index 87% rename from rcmodels/blade-torrent-110/blade-torrent-battery-spacer.scad rename to parts/rcmodels/blade-torrent-110/blade-torrent-battery-spacer.scad index 9d6906d..6821dfe 100644 --- a/rcmodels/blade-torrent-110/blade-torrent-battery-spacer.scad +++ b/parts/rcmodels/blade-torrent-110/blade-torrent-battery-spacer.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017-2020 Jean-Sebastien CONAN + * Copyright (c) 2017-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,18 +24,10 @@ * A battery spacer for the Blade Torrent 110 FPV. * * @author jsconan - * @version 0.2.0 */ -// As we need to use some shapes, use the right entry point of the library -use <../../lib/camelSCAD/shapes.scad> -include <../../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print -printResolution = 0.2; +// Import the project's setup. +include <../../../config/setup.scad> // Defines the constraints of the object coreWidth = 30; @@ -56,10 +48,10 @@ beltHoleLength = 16; beltHoleWidth = 3; // Defines the dimensions of the object -velcroPlateSupport = printResolution; +velcroPlateSupport = layerHeight; velcroPlateThickness = velcroThickness + (velcroPassthrough ? 0 : velcroPlateSupport); plateOuterRound = armWidth / 2; -plateThickness = roundBy(max(screwHeadThickness, velcroInUse ? velcroPlateThickness : 0), printResolution); +plateThickness = layerAligned(max(screwHeadThickness, velcroInUse ? velcroPlateThickness : 0)); plateOuterWidth = coreWidth + plateOuterRound; plateInnerWidth = coreWidth; @@ -72,7 +64,7 @@ screwHoleDiameter = screwHeadDiameter + 1; screwHoleIntervalX = screwInterval; screwHoleIntervalY = screwInterval; -beltGrooveDepth = roundBy(beltThickness, printResolution); +beltGrooveDepth = layerAligned(beltThickness); beltGrooveLength = beltWidth; beltGrooveWidth = (plateInnerWidth - beltHoleInterval) / 2; @@ -87,9 +79,6 @@ velcroWidth = floor(beltHoleInterval - beltHoleWidth - 2 * screwHeadThickness); echo("Plate thickness:", plateThickness); echo("Velcro place:", [velcroLength, velcroWidth]); -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { // build the plate diff --git a/rcmodels/blade-torrent-110/blade-torrent-landing-gear.scad b/parts/rcmodels/blade-torrent-110/blade-torrent-landing-gear.scad similarity index 87% rename from rcmodels/blade-torrent-110/blade-torrent-landing-gear.scad rename to parts/rcmodels/blade-torrent-110/blade-torrent-landing-gear.scad index f57065d..32d1859 100644 --- a/rcmodels/blade-torrent-110/blade-torrent-landing-gear.scad +++ b/parts/rcmodels/blade-torrent-110/blade-torrent-landing-gear.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017-2020 Jean-Sebastien CONAN + * Copyright (c) 2017-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -26,18 +26,10 @@ * For now the legs break each time the quad is landing or just flying too close to the ground... * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library -use <../../lib/camelSCAD/shapes.scad> -include <../../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print -printResolution = 0.2; +// Import the project's setup. +include <../../../config/setup.scad> // Defines the constraints of the object coreWidth = 30; @@ -60,12 +52,12 @@ beltHoleWidth = 3; // Defines the dimensions of the object legSkew = sin(gearAngle); -legHeight = roundBy(batteryHeight + screwHeadThickness + 10, printResolution); +legHeight = layerAligned(batteryHeight + screwHeadThickness + 10); legDiameterBase = armWidth / 2; legDiameterEdge = legDiameterBase / 2; legInterval = max(batteryWidth, coreWidth) + armWidth; -plateThickness = roundBy(screwHeadThickness, printResolution); +plateThickness = layerAligned(screwHeadThickness); plateOuterWidth = legInterval + legDiameterBase; plateInnerWidth = coreWidth; plateArmWidth = armWidth; @@ -75,7 +67,7 @@ screwHoleDiameter = screwHeadDiameter + 1; screwHoleIntervalX = screwInterval; screwHoleIntervalY = screwInterval; -beltGrooveDepth = roundBy(beltThickness, printResolution); +beltGrooveDepth = layerAligned(beltThickness); beltGrooveLength = beltWidth; beltGrooveWidth = (plateInnerWidth - beltHoleInterval) / 2; @@ -85,9 +77,6 @@ meshCountY = 3; meshLength = floor(plateInnerWidth - 2 * plateThickness); meshWidth = floor(beltHoleInterval - beltHoleWidth - 2 * plateThickness); -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { // build the plate diff --git a/rcmodels/blade-torrent-110/blade-torrent-stand.scad b/parts/rcmodels/blade-torrent-110/blade-torrent-stand.scad similarity index 89% rename from rcmodels/blade-torrent-110/blade-torrent-stand.scad rename to parts/rcmodels/blade-torrent-110/blade-torrent-stand.scad index 0a9138c..9d12628 100644 --- a/rcmodels/blade-torrent-110/blade-torrent-stand.scad +++ b/parts/rcmodels/blade-torrent-110/blade-torrent-stand.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017-2020 Jean-Sebastien CONAN + * Copyright (c) 2017-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,18 +24,10 @@ * A stand for the Blade Torrent 110 FPV. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library -use <../../lib/camelSCAD/shapes.scad> -include <../../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print -printResolution = 0.2; +// Import the project's setup. +include <../../../config/setup.scad> // Defines the constraints of the object batteryWidth = 35; @@ -65,9 +57,6 @@ armOffset = pillarThickness; armSize = [(armLength - coreWidth) / 2 + armOffset, pillarWidth]; armX = coreWidth / 2 - armOffset; -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { difference() { diff --git a/rcmodels/fc-case.scad b/parts/rcmodels/fc-case.scad similarity index 85% rename from rcmodels/fc-case.scad rename to parts/rcmodels/fc-case.scad index 35e0275..4ba033b 100644 --- a/rcmodels/fc-case.scad +++ b/parts/rcmodels/fc-case.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN + * Copyright (c) 2019-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,21 +24,10 @@ * A case to enclose a flight controller in order to use it for simulator connection. * * @author jsconan - * @version 0.2.0 */ -// As we need to use some shapes, use the right entry point of the library. -use <../lib/camelSCAD/shapes.scad> - -// To be able to use the library shared constants we import the definition file. -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print. -printResolution = 0.2; // the target layer height -nozzle = 0.4; // the size of the print nozzle +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints of the object. frameWidth = 30; @@ -59,7 +48,7 @@ bindHeight = 3; bindAngle = 45; bindSwitchLength = 6; bindSwitchWidth = 9; -bindSwitchDistance = nozzle; +bindSwitchDistance = nozzleWidth; ventThickness = 1; // Defines the dimensions of the object. @@ -127,7 +116,7 @@ module fcCaseRim(width, height, corner, rim, distance = 0) { * @param Number height */ module circleVents(diameter, thickness, height) { - interval = thickness + roundBy(thickness, nozzle); + interval = thickness + nozzleAligned(thickness); radius = diameter / 2; count = floor(radius / interval); rotateZ(-45) { @@ -142,9 +131,6 @@ module circleVents(diameter, thickness, height) { } } -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { translateY(-placementDistribution / 2) { @@ -154,8 +140,8 @@ applyMode(mode=renderMode) { // box ouline fcCase(width=frameWidth, height=topHeight + thickness, corner=boxCorner, distance=thickness); // elephant feet counter measure - translateZ(-printResolution) { - fcCaseRim(width=frameWidth, height=printResolution * 2, corner=boxCorner, rim=nozzle / 2, distance=thickness); + translateZ(-layerHeight) { + fcCaseRim(width=frameWidth, height=layers(2), corner=boxCorner, rim=shells(.5), distance=thickness); } translateZ(thickness) { // box hollow @@ -191,8 +177,8 @@ applyMode(mode=renderMode) { // box outline fcCase(width=frameWidth, height=bottomHeight + thickness, corner=boxCorner, distance=thickness); // elephant feet counter measure - translateZ(-printResolution) { - fcCaseRim(width=frameWidth, height=printResolution * 2, corner=boxCorner, rim=nozzle / 2, distance=thickness); + translateZ(-layerHeight) { + fcCaseRim(width=frameWidth, height=layers(2), corner=boxCorner, rim=shells(.5), distance=thickness); } // lower box hollow, will be under the FC translateZ(thickness) { diff --git a/rcmodels/utils/batteries-organizer.scad b/parts/rcmodels/utils/batteries-organizer.scad similarity index 59% rename from rcmodels/utils/batteries-organizer.scad rename to parts/rcmodels/utils/batteries-organizer.scad index f0299a6..a8a1321 100644 --- a/rcmodels/utils/batteries-organizer.scad +++ b/parts/rcmodels/utils/batteries-organizer.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017-2020 Jean-Sebastien CONAN + * Copyright (c) 2017-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,19 +24,10 @@ * A simple batteries organizer * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library -use <../../lib/camelSCAD/shapes.scad> -include <../../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print -printResolution = 0.2; -printWidth = 0.4; +// Import the project's setup. +include <../../../config/setup.scad> // Defines the constraints of the object batteryCountX = 6; @@ -52,13 +43,11 @@ batteries = [ ["YM-1S-220", 11.5, 6.2], // YukiModel 1S 220mAh ["YM-2S-600", 31, 13.5], // YukiModel 2S 600mAh ["YM-2S-900", 29, 12.5], // YukiModel 2S 900mAh - ["YM-2S-1000", 34.5, 12.5] // YukiModel 2S 1000mAh + ["YM-2S-1000", 34.5, 12.5], // YukiModel 2S 1000mAh ]; // Defines the dimensions of the object -thickness = 2 * printWidth; -innerRound = .5; -outerRound = 1; +thickness = shells(2); battery = fetch(batteries, batteryType); batteryWidth = battery[1]; batteryThickness = battery[2]; @@ -66,22 +55,14 @@ overallLength = thickness + (batteryThickness + thickness) * batteryCountX; overallWidth = thickness + (batteryWidth + thickness) * batteryCountY; overallHeight = thickness + batteryDepth; -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { - //sample(size=[overallLength, overallWidth, 5], offset=[0,0,batteryDepth-5]) + // sample(size=[overallLength, overallWidth, 5], offset=[0, 0, batteryDepth - 5]) difference() { - cushion([overallLength, overallWidth, overallHeight], d=outerRound); - translate(-[(overallLength - batteryThickness) / 2 - thickness, - (overallWidth - batteryWidth) / 2 - thickness, - -thickness]) { - repeat2D(countX=batteryCountX, - countY=batteryCountY, - intervalX=[batteryThickness + thickness, 0, 0], - intervalY=[0, batteryWidth + thickness, 0]) { - cushion([batteryThickness, batteryWidth, batteryDepth + ALIGN], d=innerRound); + box([overallLength, overallWidth, overallHeight]); + translateZ(thickness) { + repeatShape2D(size=[batteryThickness + thickness, batteryWidth + thickness], count=[batteryCountX, batteryCountY], center=true) { + box([batteryThickness, batteryWidth, overallHeight]); } } } From d2d92e36475e891d3ca7abf83fcacfbd47cb6554 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 10 Jul 2022 22:48:36 +0200 Subject: [PATCH 180/191] refactor: move misc to parts/misc --- .../config => config/misc/rod}/config.scad | 12 ++----- .../rod/config => config/misc/rod}/setup.scad | 12 +++---- misc/rod/.gitignore | 3 -- misc/rod/render.sh | 32 ------------------- {misc => parts/misc}/card-holder.scad | 13 +++----- {misc => parts/misc}/dart-target.scad | 14 ++------ {misc => parts/misc}/eyelet.scad | 14 ++------ .../misc}/fridge-door-fastener.scad | 18 ++--------- {misc => parts/misc}/hanging-star.scad | 25 ++++++--------- {misc => parts/misc}/honeycomb-box.scad | 22 +++---------- {misc => parts/misc}/hook.scad | 16 +++------- {misc => parts/misc}/label.scad | 13 ++------ {misc => parts/misc}/led-strip-holder.scad | 23 +++---------- {misc => parts/misc}/mesh-grid.scad | 14 ++------ .../misc}/rod/curtain-rod-bracket.scad | 4 +-- .../misc}/rod/curtain-rod-sleeve.scad | 4 +-- .../misc}/rod/curtain-rod-stoppers.scad | 4 +-- {misc => parts/misc}/rod/curtain-rod.scad | 4 +-- {misc => parts/misc}/simple-box.scad | 11 ++----- {misc => parts/misc}/simple-storage-rack.scad | 11 ++----- {misc => parts/misc}/spacer.scad | 20 +++--------- {misc => parts/misc}/triominos-holder.scad | 29 ++++------------- {misc => parts/misc}/wires-separator.scad | 13 +++----- .../shapes => shapes/misc/rod}/bracket.scad | 2 +- {misc/rod/shapes => shapes/misc/rod}/rod.scad | 2 +- .../shapes => shapes/misc/rod}/stopper.scad | 2 +- 26 files changed, 83 insertions(+), 254 deletions(-) rename {misc/rod/config => config/misc/rod}/config.scad (81%) rename {misc/rod/config => config/misc/rod}/setup.scad (76%) delete mode 100644 misc/rod/.gitignore delete mode 100755 misc/rod/render.sh rename {misc => parts/misc}/card-holder.scad (86%) rename {misc => parts/misc}/dart-target.scad (83%) rename {misc => parts/misc}/eyelet.scad (74%) rename {misc => parts/misc}/fridge-door-fastener.scad (89%) rename {misc => parts/misc}/hanging-star.scad (84%) rename {misc => parts/misc}/honeycomb-box.scad (78%) rename {misc => parts/misc}/hook.scad (87%) rename {misc => parts/misc}/label.scad (84%) rename {misc => parts/misc}/led-strip-holder.scad (71%) rename {misc => parts/misc}/mesh-grid.scad (82%) rename {misc => parts/misc}/rod/curtain-rod-bracket.scad (94%) rename {misc => parts/misc}/rod/curtain-rod-sleeve.scad (91%) rename {misc => parts/misc}/rod/curtain-rod-stoppers.scad (92%) rename {misc => parts/misc}/rod/curtain-rod.scad (90%) rename {misc => parts/misc}/simple-box.scad (88%) rename {misc => parts/misc}/simple-storage-rack.scad (86%) rename {misc => parts/misc}/spacer.scad (65%) rename {misc => parts/misc}/triominos-holder.scad (84%) rename {misc => parts/misc}/wires-separator.scad (91%) rename {misc/rod/shapes => shapes/misc/rod}/bracket.scad (96%) rename {misc/rod/shapes => shapes/misc/rod}/rod.scad (95%) rename {misc/rod/shapes => shapes/misc/rod}/stopper.scad (95%) diff --git a/misc/rod/config/config.scad b/config/misc/rod/config.scad similarity index 81% rename from misc/rod/config/config.scad rename to config/misc/rod/config.scad index 4afefd1..2de3476 100644 --- a/misc/rod/config/config.scad +++ b/config/misc/rod/config.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2020 Jean-Sebastien CONAN + * Copyright (c) 2020-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -28,15 +28,7 @@ * @author jsconan */ - projectVersion = "0.1.0"; - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the printer. -printResolution = 0.2; // The target layer height -nozzleWidth = 0.4; // The size of the printer's nozzle -printTolerance = 0.1; // The print tolerance when pieces need to be assembled +projectVersion = "0.1.0"; // The dimensions and constraints of the elements panelThickness = 23; // The thickness of the panel the bracket must fit diff --git a/misc/rod/config/setup.scad b/config/misc/rod/setup.scad similarity index 76% rename from misc/rod/config/setup.scad rename to config/misc/rod/setup.scad index 1baeb19..9723cc0 100644 --- a/misc/rod/config/setup.scad +++ b/config/misc/rod/setup.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2020 Jean-Sebastien CONAN + * Copyright (c) 2020-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -28,13 +28,13 @@ * @author jsconan */ -// As we need to use some shapes, use the right entry point of the library. -include <../../../lib/camelSCAD/shapes.scad> +// Import the project's setup. +include <../../setup.scad> // Then we need the config for the project, as well as the related functions include // Finally, include the shapes -include <../shapes/rod.scad> -include <../shapes/stopper.scad> -include <../shapes/bracket.scad> +include <../../../shapes/misc/rod/rod.scad> +include <../../../shapes/misc/rod/stopper.scad> +include <../../../shapes/misc/rod/bracket.scad> diff --git a/misc/rod/.gitignore b/misc/rod/.gitignore deleted file mode 100644 index e4a80ae..0000000 --- a/misc/rod/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/output -/dist -/config/config.ini diff --git a/misc/rod/render.sh b/misc/rod/render.sh deleted file mode 100755 index 38694e4..0000000 --- a/misc/rod/render.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# -# GPLv3 License -# -# Copyright (c) 2020 Jean-Sebastien CONAN -# -# This file is part of jsconan/things. -# -# jsconan/things is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# jsconan/things is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with jsconan/things. If not, see . -# - -# -# A curtain rod system. -# -# Generates the STL files for the project. -# -# @author jsconan -# - -# redirect to the lib utils -"$(dirname $0)/../../lib/camelSCAD/scripts/render.sh" "$@" diff --git a/misc/card-holder.scad b/parts/misc/card-holder.scad similarity index 86% rename from misc/card-holder.scad rename to parts/misc/card-holder.scad index 53e29fa..2ba3253 100644 --- a/misc/card-holder.scad +++ b/parts/misc/card-holder.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017 Jean-Sebastien CONAN + * Copyright (c) 2017-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,18 +24,16 @@ * A parametric card holder, that can also be utilized as a target for darts gun. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library -use <../lib/camelSCAD/shapes.scad> -include <../lib/camelSCAD/core/constants.scad> +// Import the project's setup. +include <../../config/setup.scad> // Defines the dimensions of the object length = 60; width = 20; thickness = 1; -slotWidth = 1.2; +slotWidth = 1.2; // Computes additional dimensions, especially the size of the mount body cornerRadius = width / 4; @@ -46,9 +44,6 @@ mountHeight = mountWidth; // Computes the size of the wedge that will drill the card slot in the card mount wedgeAngle = atan2(slotWidth / 2, mountHeight) * 2; -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - // Sets the minimum facet angle and size using the defined render mode. applyMode(renderMode) { // First draw the socle diff --git a/misc/dart-target.scad b/parts/misc/dart-target.scad similarity index 83% rename from misc/dart-target.scad rename to parts/misc/dart-target.scad index 0f47319..adab972 100644 --- a/misc/dart-target.scad +++ b/parts/misc/dart-target.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017-2020 Jean-Sebastien CONAN + * Copyright (c) 2017-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,15 +24,10 @@ * A parametric target for darts gun. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library -use <../lib/camelSCAD/shapes.scad> -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; +// Import the project's setup. +include <../../config/setup.scad> // Defines the dimensions of the object targetDiameter = 50; @@ -49,9 +44,6 @@ armWidth = ringWidth / 2; armLength = targetDiameter * 1.1; cornerRadius = socleWidth / 4; -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { // First draw the rings diff --git a/misc/eyelet.scad b/parts/misc/eyelet.scad similarity index 74% rename from misc/eyelet.scad rename to parts/misc/eyelet.scad index f3c6656..01e6faa 100644 --- a/misc/eyelet.scad +++ b/parts/misc/eyelet.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017-2020 Jean-Sebastien CONAN + * Copyright (c) 2017-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,15 +24,10 @@ * A parametric eyelet tube. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library -use <../lib/camelSCAD/shapes.scad> -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; +// Import the project's setup. +include <../../config/setup.scad> // Defines the dimensions of the object thickness = 1; @@ -41,9 +36,6 @@ holeDiameter = 30; tubeDiameter = holeDiameter + 2 * thickness; tubeDepth = 5; -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { difference() { diff --git a/misc/fridge-door-fastener.scad b/parts/misc/fridge-door-fastener.scad similarity index 89% rename from misc/fridge-door-fastener.scad rename to parts/misc/fridge-door-fastener.scad index 48cd334..e27f130 100644 --- a/misc/fridge-door-fastener.scad +++ b/parts/misc/fridge-door-fastener.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN + * Copyright (c) 2019-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,22 +24,10 @@ * A fastener to attach a cover door to a fridge * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library. -use <../lib/camelSCAD/shapes.scad> - -// To be able to use the library shared constants we import the definition file. -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print. -printResolution = 0.2; // the target layer height -nozzle = 0.4; // the size of the print nozzle -wallDistance = 0.1; // the distance between the walls of two objects +// Import the project's setup. +include <../../config/setup.scad> /** * Draws the shape of a fastener to attach a cover door to a fridge. diff --git a/misc/hanging-star.scad b/parts/misc/hanging-star.scad similarity index 84% rename from misc/hanging-star.scad rename to parts/misc/hanging-star.scad index 1f65c33..6b6ee03 100644 --- a/misc/hanging-star.scad +++ b/parts/misc/hanging-star.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017 Jean-Sebastien CONAN + * Copyright (c) 2017-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,24 +24,19 @@ * A parametric hanging star. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library -use <../lib/camelSCAD/shapes.scad> -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; +// Import the project's setup. +include <../../config/setup.scad> // Defines the dimensions of the star -radius = 40; -thickness = 3; -holeDiameter = 4; -ringThickness = 2; -ringDiameter = holeDiameter + ringThickness * 2; -coreRadius = (radius * 2) * (1 - 3 / 5); - +radius = 40; +thickness = 3; +holeDiameter = 4; +ringThickness = 2; +ringDiameter = holeDiameter + ringThickness * 2; +coreRadius = (radius * 2) * (1 - 3 / 5); + // Sets the minimum facet angle and size using the defined render mode. applyMode(renderMode) { // This is the frame of the star diff --git a/misc/honeycomb-box.scad b/parts/misc/honeycomb-box.scad similarity index 78% rename from misc/honeycomb-box.scad rename to parts/misc/honeycomb-box.scad index 0c46518..5f5cd05 100644 --- a/misc/honeycomb-box.scad +++ b/parts/misc/honeycomb-box.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017-2020 Jean-Sebastien CONAN + * Copyright (c) 2017-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,19 +24,10 @@ * A parametric honeycomb box * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library -use <../lib/camelSCAD/shapes.scad> -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print -printResolution = 0.2; -printWidth = 0.4; +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints of the object cellCountX = 6; @@ -46,8 +37,8 @@ cellLength = 13; cellWidth = 13; // Defines the dimensions of the object -wall = roundBy(.5, printWidth); -base = roundBy(.7, printResolution); +wall = nozzleAligned(.5); +base = layerAligned(.7); count = divisor2D([cellCountX, cellCountY]); innerCell = [cellLength, cellWidth] / cos(30); outerCell = vadd(innerCell, wall); @@ -58,9 +49,6 @@ even = true; offset = offsetHexGrid(size=outerCell, count=count, pointy=pointy, linear=linear, even=even); size = sizeHexGrid(size=outerCell, count=count, pointy=pointy, linear=linear, even=even); -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { //sample(size=apply3D(size, z=5), offset=[0,0,outerHeight-5]) diff --git a/misc/hook.scad b/parts/misc/hook.scad similarity index 87% rename from misc/hook.scad rename to parts/misc/hook.scad index dea29e0..fd76969 100644 --- a/misc/hook.scad +++ b/parts/misc/hook.scad @@ -24,17 +24,10 @@ * A hook that fits onto a cabinet door. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library. -use <../lib/camelSCAD/shapes.scad> - -// To be able to use the library shared constants we import the definition file. -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints of the object. doorThickness = 16; @@ -53,7 +46,6 @@ flangeOuterHeight = flangeInnerHeight + thickness - radius; doorInnerThickness = doorThickness; doorOuterThickness = doorInnerThickness + (thickness - radius) * 2; hookInnerHeight = hookHeight - radius; -hookOuterHeight = hookOuterHeight; hookInnerRadius = hookDepth / 2; hookOuterRadius = hookInnerRadius + thickness; innerLength = length - hookOuterRadius - thickness; @@ -81,7 +73,7 @@ applyMode(mode=renderMode) { ["C", hookInnerRadius, 180, 360], ]), convexity = 10); } - + translate([thickness, 0, width] / 2) { rotateY(90) { translateX(-width / 2) { @@ -92,5 +84,5 @@ applyMode(mode=renderMode) { } } } - } + } } diff --git a/misc/label.scad b/parts/misc/label.scad similarity index 84% rename from misc/label.scad rename to parts/misc/label.scad index fecd648..8ea8d5b 100644 --- a/misc/label.scad +++ b/parts/misc/label.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2021 Jean-Sebastien CONAN + * Copyright (c) 2021-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,17 +24,10 @@ * A label holder. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library. -use <../lib/camelSCAD/shapes.scad> - -// To be able to use the library shared constants we import the definition file. -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints of the object. holeDiameter = 6; diff --git a/misc/led-strip-holder.scad b/parts/misc/led-strip-holder.scad similarity index 71% rename from misc/led-strip-holder.scad rename to parts/misc/led-strip-holder.scad index 1ea8a97..1a26059 100644 --- a/misc/led-strip-holder.scad +++ b/parts/misc/led-strip-holder.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN + * Copyright (c) 2019-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,20 +24,10 @@ * A small bracket that will hold a LED strip. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library. -use <../lib/camelSCAD/shapes.scad> - -// To be able to use the library shared constants we import the definition file. -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print. -printResolution = 0.2; +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints of the object. ledStripWidth = 8.5; @@ -48,13 +38,10 @@ ledStripPadding = 1; screwPadding = 1.5; // Defines the dimensions of the object. -groove = ceilBy(ledStripThickness, printResolution); +groove = ceilBy(ledStripThickness, layerHeight); length = ledStripWidth + screwDiameter + 2 * screwPadding + ledStripPadding; width = screwDiameter + 2 * screwPadding; -height = ceilBy(thickness - ledStripThickness, printResolution) + groove; - -// Displays a build box visualization to preview the printer area. -buildBox(center=true); +height = ceilBy(thickness - ledStripThickness, layerHeight) + groove; // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { diff --git a/misc/mesh-grid.scad b/parts/misc/mesh-grid.scad similarity index 82% rename from misc/mesh-grid.scad rename to parts/misc/mesh-grid.scad index 9d0cca4..7050627 100644 --- a/misc/mesh-grid.scad +++ b/parts/misc/mesh-grid.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017-2020 Jean-Sebastien CONAN + * Copyright (c) 2017-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,15 +24,10 @@ * A parametric mesh grid * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library -use <../lib/camelSCAD/shapes.scad> -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; +// Import the project's setup. +include <../../config/setup.scad> // Defines the dimensions of the object length = 120; @@ -52,9 +47,6 @@ cellSpaceY = 1; meshLength = length - 2 * paddingX; meshWidth = width - 2 * paddingY; -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { difference() { diff --git a/misc/rod/curtain-rod-bracket.scad b/parts/misc/rod/curtain-rod-bracket.scad similarity index 94% rename from misc/rod/curtain-rod-bracket.scad rename to parts/misc/rod/curtain-rod-bracket.scad index e4b1594..800cd04 100644 --- a/misc/rod/curtain-rod-bracket.scad +++ b/parts/misc/rod/curtain-rod-bracket.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2020 Jean-Sebastien CONAN + * Copyright (c) 2020-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -29,7 +29,7 @@ */ // Import the project's setup. -include +include <../../../config/misc/rod/setup.scad> // Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. diff --git a/misc/rod/curtain-rod-sleeve.scad b/parts/misc/rod/curtain-rod-sleeve.scad similarity index 91% rename from misc/rod/curtain-rod-sleeve.scad rename to parts/misc/rod/curtain-rod-sleeve.scad index 02cd3dc..26b31b5 100644 --- a/misc/rod/curtain-rod-sleeve.scad +++ b/parts/misc/rod/curtain-rod-sleeve.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2020 Jean-Sebastien CONAN + * Copyright (c) 2020-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -29,7 +29,7 @@ */ // Import the project's setup. -include +include <../../../config/misc/rod/setup.scad> // Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. diff --git a/misc/rod/curtain-rod-stoppers.scad b/parts/misc/rod/curtain-rod-stoppers.scad similarity index 92% rename from misc/rod/curtain-rod-stoppers.scad rename to parts/misc/rod/curtain-rod-stoppers.scad index 70ef24c..fcde220 100644 --- a/misc/rod/curtain-rod-stoppers.scad +++ b/parts/misc/rod/curtain-rod-stoppers.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2020 Jean-Sebastien CONAN + * Copyright (c) 2020-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -29,7 +29,7 @@ */ // Import the project's setup. -include +include <../../../config/misc/rod/setup.scad> // Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. diff --git a/misc/rod/curtain-rod.scad b/parts/misc/rod/curtain-rod.scad similarity index 90% rename from misc/rod/curtain-rod.scad rename to parts/misc/rod/curtain-rod.scad index e717fd7..53b5d35 100644 --- a/misc/rod/curtain-rod.scad +++ b/parts/misc/rod/curtain-rod.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2020 Jean-Sebastien CONAN + * Copyright (c) 2020-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -29,7 +29,7 @@ */ // Import the project's setup. -include +include <../../../config/misc/rod/setup.scad> // Sets the minimum facet angle and size using the defined render mode. // Displays a build box visualization to preview the printer area. diff --git a/misc/simple-box.scad b/parts/misc/simple-box.scad similarity index 88% rename from misc/simple-box.scad rename to parts/misc/simple-box.scad index 60d23fd..ba179d5 100644 --- a/misc/simple-box.scad +++ b/parts/misc/simple-box.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2017 Jean-Sebastien CONAN + * Copyright (c) 2017-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,12 +24,10 @@ * A simple parametric box with rounded corners. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library -use <../lib/camelSCAD/shapes.scad> -include <../lib/camelSCAD/core/constants.scad> +// Import the project's setup. +include <../../config/setup.scad> /** * Renders a rounded box at the origin. @@ -73,9 +71,6 @@ module simpleBox(size, thickness, radius) { } -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - // Defines the dimensions of the box length = 100; width = 70; diff --git a/misc/simple-storage-rack.scad b/parts/misc/simple-storage-rack.scad similarity index 86% rename from misc/simple-storage-rack.scad rename to parts/misc/simple-storage-rack.scad index 0f1895d..1232383 100644 --- a/misc/simple-storage-rack.scad +++ b/parts/misc/simple-storage-rack.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2018 Jean-Sebastien CONAN + * Copyright (c) 2018-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,15 +24,10 @@ * A simple parametric storage rack. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library -use <../lib/camelSCAD/shapes.scad> -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints of the object fixingHoleCount = 3; diff --git a/misc/spacer.scad b/parts/misc/spacer.scad similarity index 65% rename from misc/spacer.scad rename to parts/misc/spacer.scad index 89a9b4e..da7f87b 100644 --- a/misc/spacer.scad +++ b/parts/misc/spacer.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN + * Copyright (c) 2019-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,22 +24,10 @@ * A spacer with a truncated pyramid shape. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library. -use <../lib/camelSCAD/shapes.scad> - -// To be able to use the library shared constants we import the definition file. -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print. -printResolution = 0.2; // the target layer height -nozzle = 0.4; // the size of the print nozzle -wallDistance = 0.1; // the distance between the walls of two objects +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints of the object. bottomLength = 80; @@ -57,7 +45,7 @@ applyMode(mode=renderMode) { //sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0]) difference() { hull() { - cushion(size=[bottomLength, bottomWidth, printResolution], r=fillet); + cushion(size=[bottomLength, bottomWidth, layerHeight], r=fillet); cushion(size=[topLength, topWidth, height], r=fillet); } translateZ(-1) { diff --git a/misc/triominos-holder.scad b/parts/misc/triominos-holder.scad similarity index 84% rename from misc/triominos-holder.scad rename to parts/misc/triominos-holder.scad index d5c642d..9ff90d3 100644 --- a/misc/triominos-holder.scad +++ b/parts/misc/triominos-holder.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2019-2020 Jean-Sebastien CONAN + * Copyright (c) 2019-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -24,22 +24,10 @@ * A parametric holder for triominos. * * @author jsconan - * @version 0.2.0 */ -// As we need to use some shapes, use the right entry point of the library. -use <../lib/camelSCAD/shapes.scad> - -// To be able to use the library shared constants we import the definition file. -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; - -// Defines the constraints of the print. -printResolution = 0.2; // the target layer height -nozzle = 0.4; // the size of the print nozzle -wallDistance = 0.1; // the distance between the walls of two objects +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints of the object. // - size of a piece @@ -51,7 +39,7 @@ pieceInterval = 1; piecesByBoard = 5; boardThickness = 2; // size of the groove in which the board will be plugged -grooveWall = 3 * nozzle; +grooveWall = shells(3); grooveDepth = 2; // - constraints of the holder boardCount = 2; @@ -152,12 +140,12 @@ module standBoardSide(width, height, thickness, wall, depth, angle, count) { module standBoard(pieceSize, count, thickness, padding) { pieceSize = vector3D(pieceSize); half = thickness / 2; - depth = roundBy(half, printResolution); + depth = layerAligned(half); - grooveDepth = depth + printResolution; + grooveDepth = depth + layerHeight; grooveWidth = half; - ridgeHeight = depth - printResolution; + ridgeHeight = depth - layerHeight; ridgeWidth = half; outerLength = pieceSize[0] * count + padding * 2; @@ -183,9 +171,6 @@ module standBoard(pieceSize, count, thickness, padding) { } } -// Displays a build box visualization to preview the printer area. -buildBox(center=true); - // Sets the minimum facet angle and size using the defined render mode. applyMode(mode=renderMode) { // Uncomment the next line to cut a sample from the object diff --git a/misc/wires-separator.scad b/parts/misc/wires-separator.scad similarity index 91% rename from misc/wires-separator.scad rename to parts/misc/wires-separator.scad index a453473..3ccad94 100644 --- a/misc/wires-separator.scad +++ b/parts/misc/wires-separator.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2018-2019 Jean-Sebastien CONAN + * Copyright (c) 2018-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * @@ -21,18 +21,13 @@ */ /** - * A wires separaror. + * A wires separator. * * @author jsconan - * @version 0.1.0 */ -// As we need to use some shapes, use the right entry point of the library -use <../lib/camelSCAD/shapes.scad> -include <../lib/camelSCAD/core/constants.scad> - -// We will render the object using the specifications of this mode -renderMode = MODE_PROD; +// Import the project's setup. +include <../../config/setup.scad> // Defines the constraints and the dimensions of the object width = 10; diff --git a/misc/rod/shapes/bracket.scad b/shapes/misc/rod/bracket.scad similarity index 96% rename from misc/rod/shapes/bracket.scad rename to shapes/misc/rod/bracket.scad index 5f42d0e..6b280c9 100644 --- a/misc/rod/shapes/bracket.scad +++ b/shapes/misc/rod/bracket.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2020 Jean-Sebastien CONAN + * Copyright (c) 2020-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * diff --git a/misc/rod/shapes/rod.scad b/shapes/misc/rod/rod.scad similarity index 95% rename from misc/rod/shapes/rod.scad rename to shapes/misc/rod/rod.scad index 1c1615a..9e6a6bc 100644 --- a/misc/rod/shapes/rod.scad +++ b/shapes/misc/rod/rod.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2020 Jean-Sebastien CONAN + * Copyright (c) 2020-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * diff --git a/misc/rod/shapes/stopper.scad b/shapes/misc/rod/stopper.scad similarity index 95% rename from misc/rod/shapes/stopper.scad rename to shapes/misc/rod/stopper.scad index f98e8a2..162229f 100644 --- a/misc/rod/shapes/stopper.scad +++ b/shapes/misc/rod/stopper.scad @@ -2,7 +2,7 @@ * @license * GPLv3 License * - * Copyright (c) 2020 Jean-Sebastien CONAN + * Copyright (c) 2020-2022 Jean-Sebastien CONAN * * This file is part of jsconan/things. * From 5c2e70facf9b9c3a92153702fbf11bc8804c0833 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 10 Jul 2022 23:15:22 +0200 Subject: [PATCH 181/191] feat: add a render script --- .gitignore | 3 +- render.sh | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100755 render.sh diff --git a/.gitignore b/.gitignore index b9f144a..b687249 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,8 @@ *.log # Results -scripts/output +output +dist *.csg *.csv diff --git a/render.sh b/render.sh new file mode 100755 index 0000000..ebf4c11 --- /dev/null +++ b/render.sh @@ -0,0 +1,94 @@ +#!/bin/bash +# +# GPLv3 License +# +# Copyright (c) 2022 Jean-Sebastien CONAN +# +# This file is part of jsconan/things. +# +# jsconan/things is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# jsconan/things is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with jsconan/things. If not, see . +# + +# +# Generates the STL files for the project. +# +# @author jsconan +# + +# script config +scriptpath=$(dirname $0) +project=$(pwd) +srcpath=${project}/parts +dstpath=${project}/dist +format= +parallel= +cleanUp= + +# include libs +source "${scriptpath}/lib/camelSCAD/scripts/utils.sh" + +# load parameters +while (( "$#" )); do + case $1 in + "-f"|"--format") + format=$2 + shift + ;; + "-p"|"--parallel") + parallel=$2 + shift + ;; + "-c"|"--clean") + cleanUp=1 + ;; + "-h"|"--help") + echo -e "${C_INF}Renders OpenSCAD files${C_RST}" + echo -e " ${C_INF}Usage:${C_RST}" + echo -e "${C_CTX}\t$0 [command] [-h|--help] [-o|--option value] files${C_RST}" + echo + echo -e "${C_MSG} -h, --help ${C_RST}Show this help" + echo -e "${C_MSG} -f --format ${C_RST}Set the output format" + echo -e "${C_MSG} -p --parallel ${C_RST}Set the number of parallel processes" + echo -e "${C_MSG} -c --clean ${C_RST}Clean up the output folder before rendering" + echo + exit 0 + ;; + *) + ls $1 >/dev/null 2>&1 + if [ "$?" == "0" ]; then + srcpath=$1 + else + printerror "Unknown parameter ${1}" + fi + ;; + esac + shift +done + +# check OpenSCAD +scadcheck + +# defines the output format +scadformat "${format}" + +# defines the number of parallel processes +scadprocesses "${parallel}" + +# clean up the output +if [ "${cleanUp}" != "" ]; then + printmessage "${C_CTX}Cleaning up the output folder" + rm -rf "${dstpath}" +fi + +scadrenderallrecurse "${srcpath}" "${dstpath}" From 7caced3db8c763b07ac483260926f322e4485478 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 10 Jul 2022 23:23:32 +0200 Subject: [PATCH 182/191] chore: update the library camelSCAD to v1.10.0 --- lib/camelSCAD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/camelSCAD b/lib/camelSCAD index 8bb739d..42856b7 160000 --- a/lib/camelSCAD +++ b/lib/camelSCAD @@ -1 +1 @@ -Subproject commit 8bb739d1ee3ced929d330febb5a00c36d18f6617 +Subproject commit 42856b71052b457c9b9c3d0e1bc68cc846e7be97 From c1d0811384b831f02246bdf87d8edfba3a409606 Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 10 Jul 2022 23:31:30 +0200 Subject: [PATCH 183/191] feat: add an initialize script --- init.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 init.sh diff --git a/init.sh b/init.sh new file mode 100755 index 0000000..cc58243 --- /dev/null +++ b/init.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# GPLv3 License +# +# Copyright (c) 2022 Jean-Sebastien CONAN +# +# This file is part of jsconan/things. +# +# jsconan/things is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# jsconan/things is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with jsconan/things. If not, see . +# + +# +# Initialize the project +# +# @author jsconan +# + +# script config +scriptpath=$(dirname $0) +configpath=${scriptpath}/config + +# make sure to get the library +if [ ! -d "${scriptpath}/lib/camelSCAD" ]; then + if [ -d "${scriptpath}/.git" ] && [ -x "$(command -v git)" ]; then + echo "Install camelSCAD using Git" + git submodule init + git submodule update + else + echo "Install camelSCAD from an archive" + mkdir "${scriptpath}/lib" + cd "${scriptpath}/lib" + curl -LJO https://github.com/jsconan/camelSCAD/archive/refs/heads/main.zip + unzip camelSCAD-main.zip + rm camelSCAD-main.zip + mv camelSCAD-main camelSCAD + fi +fi From b3700e4387dc6ef8ed57a3dfeec36a1a51722d1f Mon Sep 17 00:00:00 2001 From: jsconan Date: Sun, 10 Jul 2022 23:36:03 +0200 Subject: [PATCH 184/191] doc: update the readme file with install information --- README.md | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/README.md b/README.md index 170d86a..501c2c5 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,93 @@ # things + Some 3D printing purpose things + + + +- [At a glance](#Ataglance) +- [Install and requirements](#Installandrequirements) + - [OpenSCAD](#OpenSCAD) + - [Source code](#Sourcecode) + - [Download the zip file](#Downloadthezipfile) + - [Get the code from the repository](#Getthecodefromtherepository) +- [Render the parts](#Rendertheparts) + + + + +## At a glance + +The project contains designs for various purposes. The parts are designed using a scripting language, processed by [OpenSCAD](https://openscad.org/about.html). There is no ready to use 3D model files in the source code. If you are interested in such files, please look at the [released versions](https://github.com/jsconan/things/releases) which contains 3D model files built with default parameters. However, if you want to customize these parts, tailoring them with your measures, you should rather download the source code and then tweak the configuration files before generating your own 3D model files. + +## Install and requirements + +To properly use the project you first need to do some installations steps. + +### OpenSCAD + +First of all you need [OpenSCAD](https://openscad.org/) to be installed. To do so, please go to the [OpenSCAD download page](https://openscad.org/downloads.html), an get the version suitable for your operating system. + +### Source code + +The source code is hosted on a [Git](https://git-scm.com/) repository. To get it you can either download a [zip file](https://github.com/jsconan/things/archive/refs/heads/main.zip), or clone the repository locally. + +Note: the easiest way is to call the `init.sh` script, that will take care of this for you. + +#### Download the zip file + +The source code can be downloaded from the [GitHub repository](https://github.com/jsconan/things). + +You can download it as zip file from this [link](https://github.com/jsconan/things/archive/refs/heads/main.zip). + +As the project is using a shared library, that is not supplied with the package, you will need to also download it. + +Download the zip file from this [link](https://github.com/jsconan/camelSCAD/archive/refs/heads/main.zip). + +Then extract its content inside the folder `lib/camelSCAD`. Please make sure the folder directly contains the library and not an intermediate folder like `lib/camelSCAD/camelSCAD-master`. If this is the case, please move the content one folder up and delete the extra folder. + +#### Get the code from the repository + +A git tool is needed if you intend to get the source code from the git repository. You can download one either from the [main git website](https://git-scm.com/downloads), or from [GitHub](https://docs.github.com/en/github-cli). + +Once you have your git tool installed, open a console window, select a project folder (create it if needed), then run the following commands: + +``` +git clone https://github.com/jsconan/things.git +cd things +git submodule init +git submodule update +``` + +The source code should have been downloaded, as well as the libraries. + +Note: you can also use a graphical interface tool. In this case, please make it can also install the submodules. + +## Render the parts + +The parts are all located into the `parts` folder. They can all be opened separately in [OpenSCAD](https://openscad.org/) and rendered. + +However, it is possible to render all parts in batch. The script `render.sh` takes care of this. + +This is a command-line tool, which accept several parameters. By default, it will render the preset selected in the config. + +It is possible to select another preset, as well as set a different number of cells for the containers. + +The parameter `-h` make it show the help. + +Running the command `render.sh -h` will show this message: + +``` +Renders OpenSCAD files + Usage: + ./render.sh [command] [-h|--help] [-o|--option value] files + + -h, --help Show this help + -f --format Set the output format + -p --parallel Set the number of parallel processes + -c --clean Clean up the output folder before rendering +``` + +The STL files are rendered to the `dist` folder. From fe1c7b8c1cd3cc17548d80a78acdf4b5fe5cbaf0 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 13 Jul 2022 22:20:20 +0200 Subject: [PATCH 185/191] chore: update the library camelSCAD to v1.10.1 --- lib/camelSCAD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/camelSCAD b/lib/camelSCAD index 42856b7..15a17c6 160000 --- a/lib/camelSCAD +++ b/lib/camelSCAD @@ -1 +1 @@ -Subproject commit 42856b71052b457c9b9c3d0e1bc68cc846e7be97 +Subproject commit 15a17c60c44192e4f364b795aeb446e0736965db From 97ebb1955b2e26ca0e2714120fdb07c052fba44e Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 13 Jul 2022 22:21:11 +0200 Subject: [PATCH 186/191] feat: add an option to render a particular folder instead of the full set --- render.sh | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/render.sh b/render.sh index ebf4c11..52ef37d 100755 --- a/render.sh +++ b/render.sh @@ -27,10 +27,11 @@ # # script config -scriptpath=$(dirname $0) -project=$(pwd) -srcpath=${project}/parts -dstpath=${project}/dist +scriptpath="$(dirname $0)" +project="$(pwd)" +srcpath="${project}/parts" +dstpath="${project}/dist" +partsdir= format= parallel= cleanUp= @@ -41,6 +42,10 @@ source "${scriptpath}/lib/camelSCAD/scripts/utils.sh" # load parameters while (( "$#" )); do case $1 in + "-d"|"--dir") + partsdir=$2 + shift + ;; "-f"|"--format") format=$2 shift @@ -58,6 +63,7 @@ while (( "$#" )); do echo -e "${C_CTX}\t$0 [command] [-h|--help] [-o|--option value] files${C_RST}" echo echo -e "${C_MSG} -h, --help ${C_RST}Show this help" + echo -e "${C_MSG} -d --dir ${C_RST}Select a particular parts directory to render" echo -e "${C_MSG} -f --format ${C_RST}Set the output format" echo -e "${C_MSG} -p --parallel ${C_RST}Set the number of parallel processes" echo -e "${C_MSG} -c --clean ${C_RST}Clean up the output folder before rendering" @@ -85,10 +91,22 @@ scadformat "${format}" # defines the number of parallel processes scadprocesses "${parallel}" +# select a parts directory if needed +if [ "${partsdir}" != "" ]; then + srcpath="${srcpath}/${partsdir}" + dstpath="${dstpath}/${partsdir}" + if [ ! -d "${srcpath}" ]; then + printerror "There is no parts directory ${C_SEL}${srcpath}" E_NOTFOUND + fi +fi + +# makes sure the destination path exists +createpath "${dstpath}" "output" > /dev/null + # clean up the output if [ "${cleanUp}" != "" ]; then printmessage "${C_CTX}Cleaning up the output folder" rm -rf "${dstpath}" fi -scadrenderallrecurse "${srcpath}" "${dstpath}" +scadrenderallrecurse "${srcpath}" "${dstpath}" "" "" --quiet From e5f8c7b005237b7288789476e6d26a0885daae5f Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 13 Jul 2022 22:23:39 +0200 Subject: [PATCH 187/191] doc: update the readme file with the new render parameter --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 501c2c5..e9ec713 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ Renders OpenSCAD files ./render.sh [command] [-h|--help] [-o|--option value] files -h, --help Show this help + -d --dir Select a particular parts directory to render -f --format Set the output format -p --parallel Set the number of parallel processes -c --clean Clean up the output folder before rendering From 1ba4a4f030e44b294fc0e84d7ba385dc9d2aa31b Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 13 Jul 2022 22:27:58 +0200 Subject: [PATCH 188/191] feat: add more batteries specs (BetaFPV 1S 300mAh, BetaFPV 3S 300mAh, Tattu 1S 300mAh) --- parts/rcmodels/utils/batteries-organizer.scad | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/parts/rcmodels/utils/batteries-organizer.scad b/parts/rcmodels/utils/batteries-organizer.scad index a8a1321..3d6e7c8 100644 --- a/parts/rcmodels/utils/batteries-organizer.scad +++ b/parts/rcmodels/utils/batteries-organizer.scad @@ -30,13 +30,16 @@ include <../../../config/setup.scad> // Defines the constraints of the object -batteryCountX = 6; +batteryCountX = 5; batteryCountY = 1; batteryDepth = 20; -batteryType = "DY-2S-600"; +batteryType = "TA-1S-300"; batteries = [ ["BF-1S-260", 12.0, 6.3], // BetaFPV 1S HV 260mAh + ["BF-1S-300", 11.6, 6.4], // BetaFPV 1S HV 300mAh ["BF-1S-550", 18.0, 7.4], // BetaFPV 1S HV 550mAh + ["BF-3S-300", 16.5, 12.2], // BetaFPV 3S 300mAh + ["TA-1S-300", 10.4, 6.7], // Tattu 1S HV 300mAh ["HM-1S-450", 18.5, 6.8], // Happymodel 1S HV 450mAh ["DY-2S-600", 24.5, 12.5], // DYS 2S 600mAh ["XT-1S-220", 10.5, 6.2], // xTron 1S 220mAh From 8b487fa1c94ca5440009c5c89b859213f718f33c Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 13 Jul 2022 22:28:50 +0200 Subject: [PATCH 189/191] feat: add a battery sleeve to better fit goggles strap --- parts/rcmodels/utils/battery-sleeve.scad | 50 ++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 parts/rcmodels/utils/battery-sleeve.scad diff --git a/parts/rcmodels/utils/battery-sleeve.scad b/parts/rcmodels/utils/battery-sleeve.scad new file mode 100644 index 0000000..616fbd9 --- /dev/null +++ b/parts/rcmodels/utils/battery-sleeve.scad @@ -0,0 +1,50 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2022 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A battery sleeve that ease the use of thin batteries with FPV goggles. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Defines the constraints of the object +batteryThickness = 16.5; +batteryWidth = 34.5; +sleeveThickness = 23; +sleeveWidth = 45; +sleeveHeight = 50; +sleeveRound = 5; + + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + // sample(size=[DEFAULT_BUILD_PLATE_SIZE, DEFAULT_BUILD_PLATE_SIZE, 5], offset=[0, 0, 0], center=true) + difference() { + cushion(size=[sleeveWidth, sleeveThickness, sleeveHeight], r=sleeveRound); + translateZ(-1) { + box([batteryWidth, batteryThickness, sleeveHeight + 2]); + } + } +} From 7a9e12fd596b6501cfacbe2624da7312206b35fc Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 13 Jul 2022 22:29:35 +0200 Subject: [PATCH 190/191] feat: add a hex knob for SMA connectors --- parts/rcmodels/utils/hex-knob.scad | 67 ++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 parts/rcmodels/utils/hex-knob.scad diff --git a/parts/rcmodels/utils/hex-knob.scad b/parts/rcmodels/utils/hex-knob.scad new file mode 100644 index 0000000..dc117a6 --- /dev/null +++ b/parts/rcmodels/utils/hex-knob.scad @@ -0,0 +1,67 @@ +/** + * @license + * GPLv3 License + * + * Copyright (c) 2022 Jean-Sebastien CONAN + * + * This file is part of jsconan/things. + * + * jsconan/things is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * jsconan/things is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with jsconan/things. If not, see . + */ + +/** + * A simple knob for SMA connectors. + * + * @author jsconan + */ + +// Import the project's setup. +include <../../../config/setup.scad> + +// Defines the dimensions of the object +knobSize = 8; +knobThickness = 3; + +/** + * Renders a hex knob with respect to the given size of the hex nut. + * @param Number hex - The size of the hex nut across opposite flats. + * @param Number thickness - The thickness of the knob. + */ +module hexKnob(hex, thickness) { + hexSide = hex / (2 * cos(30)); + edgeRadius = hexSide; + sideRadius = hexSide; + offsetX = -edgeRadius; + offsetY = -(edgeRadius + sideRadius) / (2 * cos(30)); + + negativeExtrude(height=thickness) { + difference() { + polygon(points=path([ + ["P", offsetX, offsetY], + ["C", edgeRadius, 180, 360], + ["C", sideRadius, 180, 120], + ["C", edgeRadius, -60, 120], + ["C", sideRadius, -60, -120], + ["C", edgeRadius, 60, 240], + ["C", sideRadius, 60, 0], + ]), convexity=10); + hexagon(s=hexSide); + } + } +} + +// Sets the minimum facet angle and size using the defined render mode. +applyMode(mode=renderMode) { + hexKnob(hex=knobSize, thickness=knobThickness); +} From 45c65b446e543fbc8e0a90d6c395eff8dc8593df Mon Sep 17 00:00:00 2001 From: jsconan Date: Sat, 6 Aug 2022 16:27:12 +0200 Subject: [PATCH 191/191] chore: add an history file --- HISTORY.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 HISTORY.md diff --git a/HISTORY.md b/HISTORY.md new file mode 100644 index 0000000..d8ee0e6 --- /dev/null +++ b/HISTORY.md @@ -0,0 +1,48 @@ +# things history + +## [Version 1.0.0](https://github.com/jsconan/things/releases/tag/1.0.0) + +First release of the project. + +Added models: + +- [eyelet](parts/misc/eyelet.scad) +- [triominos holder](parts/misc/triominos-holder.scad) +- [spacer](parts/misc/spacer.scad) +- [dart target](parts/misc/dart-target.scad) +- [hook](parts/misc/hook.scad) +- [simple box](parts/misc/simple-box.scad) +- [hanging star](parts/misc/hanging-star.scad) +- [curtain rod](parts/misc/rod/curtain-rod.scad) +- [curtain rod bracket](parts/misc/rod/curtain-rod-bracket.scad) +- [curtain rod sleeve](parts/misc/rod/curtain-rod-sleeve.scad) +- [curtain rod stoppers](parts/misc/rod/curtain-rod-stoppers.scad) +- [honeycomb box](parts/misc/honeycomb-box.scad) +- [label](parts/misc/label.scad) +- [wires separator](parts/misc/wires-separator.scad) +- [mesh grid](parts/misc/mesh-grid.scad) +- [card holder](parts/misc/card-holder.scad) +- [fridge door fastener](parts/misc/fridge-door-fastener.scad) +- [led strip holder](parts/misc/led-strip-holder.scad) +- [simple storage rack](parts/misc/simple-storage-rack.scad) +- [spatula](parts/tools/spatula.scad) +- [angle guide](parts/tools/angle-guide.scad) +- [magimix screw driver](parts/tools/magimix-screw-driver.scad) +- [handle helper](parts/tools/handle-helper.scad) +- [enclosure filament passage groove](parts/printer/enclosure-filament-passage-groove.scad) +- [wheel spool holder](parts/printer/wheel-spool-holder.scad) +- [dehydratator feet](parts/printer/dehydratator-feet.scad) +- [dehydratator spool holder](parts/printer/dehydratator-spool-holder.scad) +- [dehydratator spool holder v2](parts/printer/dehydratator-spool-holder-v2.scad) +- [sleeve spool holder](parts/printer/sleeve-spool-holder.scad) +- [bearing spool holder](parts/printer/bearing-spool-holder.scad) +- [betafpv beta85x needle](parts/rcmodels/betafpv-beta85x/betafpv-beta85x-needle.scad) +- [betafpv beta85x stand](parts/rcmodels/betafpv-beta85x/betafpv-beta85x-stand.scad) +- [FC case](parts/rcmodels/fc-case.scad) +- [battery sleeve](parts/rcmodels/utils/battery-sleeve.scad) +- [batteries organizer](parts/rcmodels/utils/batteries-organizer.scad) +- [hex knob](parts/rcmodels/utils/hex-knob.scad) +- [blade torrent battery spacer](parts/rcmodels/blade-torrent-110/blade-torrent-battery-spacer.scad) +- [blade torrent stand](parts/rcmodels/blade-torrent-110/blade-torrent-stand.scad) +- [blade torrent landing gear](parts/rcmodels/blade-torrent-110/blade-torrent-landing-gear.scad) +- [tiny whoop camera holder](parts/rcmodels/blade-inductrix/tiny-whoop-camera-holder.scad)