Skip to content

Commit

Permalink
Merge pull request #21 from jsconan/release-1.1.0
Browse files Browse the repository at this point in the history
Release 1.1.0
  • Loading branch information
jsconan authored Aug 14, 2022
2 parents f30cd92 + 447ebd6 commit 77aac15
Show file tree
Hide file tree
Showing 78 changed files with 1,938 additions and 576 deletions.
11 changes: 11 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# rc-tracks history

## [Version 1.1.0](https://github.com/jsconan/rc-tracks/releases/tag/1.1.0)

**For the 1/64 scale variant.**

Add a low-level config option to render large-curve tiles full size instead of a split in halves, and add parts for both modes.
Add larger curves with ratios 3 and 4.

Move config options that were low-level to the constants.
Also, refactor the way curves are placed, unify the way sets of elements are built, and improve naming consistency.
Rework a bit the animated pictures.

## [Version 1.0.0](https://github.com/jsconan/rc-tracks/releases/tag/1.0.0)

Add a variant of the race track system for 1/64 to 1/76 scale RC cars.
Expand Down
2 changes: 1 addition & 1 deletion config/version.scad
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
* @author jsconan
*/

PACKAGE_VERSION = "1.0.0";
PACKAGE_VERSION = "1.1.0";
PROJECT_VERSION = "0.0.0";
PROJECT_SCALE = "various";
25 changes: 0 additions & 25 deletions scale-64/config/config-dist.scad
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,3 @@ shiftStartPositions = false; // Tells if the positions on a same starting lin
// Options for the ready to print models
printGroundUpsideDown = true; // Flip the ground tiles to print them upside down
printQuantity = 1; // Quantity of elements to print per set
showConfig = 0; // Show the config when rendering a model. The render script uses it to extract the config

// Colors applied to the elements when previewed.
// This will be used for the animations and other pictures, but this won't have effect on the ready to print elements.
colorGround = "#444"; // Color of the ground tiles
colorTile = "#468"; // Color of the full tiles
colorDecoration = "#eed"; // Color of the ground tiles decoration
colorPeg = "#aaa"; // Color of the barrier pegs
colorBarrier = "#88a"; // Color of the barriers, no matter the coordinate
colorEven = "#eec"; // Color of the barriers, when placed at an even coordinate
colorOdd = "#c24"; // Color of the barriers, when placed at an odd coordinate

// Options for the animations
defaultScaleFrom = vector3D(.1); // Origin scale factor for the models when animating
defaultScaleTo = vector3D(1); // Target scale factor for the models when animating
defaultRotateFrom = [-RIGHT, -RIGHT, RIGHT]; // Origin rotation angles for the models when animating
defaultRotateTo = vector3D(0); // Target rotation angles for the models when animating
defaultTranslateFrom = [-200, 150, 150]; // Origin position for the models when animating
defaultTranslateTo = ORIGIN_3D; // Target position for the models when animating
defaultPresentation = ORIGIN_3D; // Position to present the models
defaultSlideTo = [200, 150, 150]; // Target position for the models when sliding
presentationSteps = 2; // Number of steps applied to present a model
animateSteps = 1; // Number of steps applied for one animation move
slideSteps = 1; // Number of steps applied to slide a model
showSteps = 0; // Show the expected number of steps for the whole animation
28 changes: 28 additions & 0 deletions scale-64/config/constants.scad
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,31 @@

// The number of fastener holes per barrier chunks
FASTENER_HOLES = 1;

// Colors applied to the elements when previewed.
// This will be used for the animations and other pictures, but this won't have effect on the ready to print elements.
COLOR_GROUND = "#444"; // Color of the ground tiles
COLOR_TILE = "#468"; // Color of the full tiles
COLOR_DECORATION = "#eed"; // Color of the ground tiles decoration
COLOR_PEG = "#aaa"; // Color of the barrier pegs
COLOR_BARRIER = "#88a"; // Color of the barriers, no matter the coordinate
COLOR_BARRIER_EVEN = "#eec"; // Color of the barriers, when placed at an even coordinate
COLOR_BARRIER_ODD = "#c24"; // Color of the barriers, when placed at an odd coordinate

// Options for the animations
ANIMATION_SCALE_FROM = vector3D(.1); // Origin scale factor for the models when animating
ANIMATION_SCALE_TO = vector3D(1); // Target scale factor for the models when animating
ANIMATION_ROTATE_FROM = [-RIGHT, -RIGHT, RIGHT]; // Origin rotation angles for the models when animating
ANIMATION_ROTATE_TO = vector3D(0); // Target rotation angles for the models when animating
ANIMATION_TRANSLATE_FROM = [-200, 150, 150]; // Origin position for the models when animating
ANIMATION_TRANSLATE_TO = ORIGIN_3D; // Target position for the models when animating
ANIMATION_SLIDE_FROM = ORIGIN_3D; // Position to present the models
ANIMATION_SLIDE_TO = [200, 150, 150]; // Target position for the models when sliding
ANIMATION_PRESENTATION_STEPS = 2; // Number of steps applied to present a model
ANIMATION_ANIMATE_STEPS = 1; // Number of steps applied for one animation move
ANIMATION_SLIDE_STEPS = 1; // Number of steps applied to slide a model

// Low level configuration entries. These values will be managed internally
showConfig = 0; // Show the config when rendering a model. The render script uses it to extract the config
showSteps = 0; // Show the expected number of steps for the whole animation
forceFullTile = false; // When activated, make sure all tiles are full size, otherwise tiles with ratio greater or equal to 2 are split
73 changes: 70 additions & 3 deletions scale-64/config/helpers.scad
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ function getBarrierLength(laneWidth, barrierWidth, barrierChunks) = getTrackSect
*/
function getCurveAngle(ratio) =
let(
ratio = abs(ratio)
ratio = abs(ratio),
angleDivider = ratio < 1 ? 1 / ratio
: ratio > 1 && !forceFullTile ? ratio * 2
: ratio
)
CURVE_ANGLE / (ratio < 1 ? 1 / ratio : ratio > 1 ? ratio * 2 : 1)
CURVE_ANGLE / angleDivider
;

/**
Expand All @@ -80,7 +83,7 @@ function getCurveAngle(ratio) =
* @param Number [ratio] - The size factor.
* @returns Number
*/
function getCurveInnerRadius(length, width, ratio=1) = length * (ratio - 1) + (length - width) / 2;
function getCurveInnerRadius(length, width, ratio=1) = length * (abs(ratio) - 1) + (length - width) / 2;

/**
* Computes the outer radius of a curve given the ratio.
Expand All @@ -90,3 +93,67 @@ function getCurveInnerRadius(length, width, ratio=1) = length * (ratio - 1) + (
* @returns Number
*/
function getCurveOuterRadius(length, width, ratio=1) = width + getCurveInnerRadius(length=length, width=width, ratio=ratio);

/**
* Computes the length of the outer side of an enlarged curved track.
* @param Number length - The length of a track section.
* @param Number width - The width of a track section.
* @param Number [ratio] - The size factor.
* @returns Number
*/
function getEnlargedCurveSide(length, width, ratio=1) = length * abs(ratio) / 2;

/**
* Computes the inner radius of a curve given the ratio.
* @param Number length - The length of a track section.
* @param Number width - The width of a track section.
* @param Number [ratio] - The size factor.
* @returns Number
*/
function getEnlargedCurveInnerRadius(length, width, ratio=1) = getCurveInnerRadius(length=length, width=width, ratio=ratio);

/**
* Computes the outer radius of an enlarged curved track.
* @param Number length - The length of a track section.
* @param Number width - The width of a track section.
* @param Number [ratio] - The size factor.
* @returns Number
*/
function getEnlargedCurveOuterRadius(length, width, ratio=1) = getCurveOuterRadius(length=length, width=width, ratio=ratio) - getEnlargedCurveSide(length=length, width=width, ratio=ratio);

/**
* Computes the coordinates of the center for a raw curve given the ratio.
* This is useful for translating the tile to its final position.
* @param Number length - The length of a track section.
* @param Number width - The width of a track section.
* @param Number [ratio] - The size factor.
* @returns Vector
*/
function getRawCurveCenter(length, width, ratio=1) =
let(
sizeRatio = max(1, ratio),
angle = getCurveAngle(ratio) / 2,
minRadius = getCurveInnerRadius(length=length, width=width, ratio=1),
innerRadius = getCurveInnerRadius(length=length, width=width, ratio=sizeRatio),
middleRadius = innerRadius + minRadius + width / 2
)
[
cos(angle) * middleRadius,
sin(angle) * middleRadius
]
;

/**
* Computes the coordinates of the center for a raw enlarged curve given the ratio.
* This is useful for translating the tile to its final position.
* @param Number length - The length of a track section.
* @param Number width - The width of a track section.
* @param Number [ratio] - The size factor.
* @returns Vector
*/
function getRawEnlargedCurveCenter(length, width, ratio=1) =
let(
center = getCurveOuterRadius(length=length, width=width, ratio=ratio) / 2
)
[center, center]
;
2 changes: 1 addition & 1 deletion scale-64/config/setup.scad
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ include <../../config/setup.scad>
include <version.scad>

// Include the config for the project
include <config.scad>
include <constants.scad>
include <config.scad>
include <helpers.scad>

// Include the shapes for the barriers
Expand Down
2 changes: 1 addition & 1 deletion scale-64/config/version.scad
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
* @author jsconan
*/

PROJECT_VERSION = "1.0.0";
PROJECT_VERSION = "1.1.0";
PROJECT_SCALE = "1/64 to 1/76";
Binary file modified scale-64/doc/full-tiles.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified scale-64/doc/track-sections.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 1 addition & 28 deletions scale-64/parts/barriers/barrier-curve-1-enlarged.scad
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,7 @@ include <../../config/setup.scad>
// Sets the minimum facet angle and size using the defined render mode.
applyMode(mode=renderMode) {

ratio = 1;
innerCurveLength = getCurvedBarrierLength(
getCurveInnerBarrierPosition(trackSectionLength, trackSectionWidth, barrierWidth, ratio),
getCurveAngle(ratio) / getCurveInnerBarrierChunks(barrierChunks, ratio),
barrierWidth, barrierHeight
);
outerCurveLength = getCurvedBarrierLength(
getEnlargedCurveOuterBarrierPosition(trackSectionLength, trackSectionWidth, barrierWidth, ratio),
getCurveAngle(ratio) / getEnlargedCurveOuterBarrierChunks(barrierChunks, ratio),
barrierWidth, barrierHeight
);
straightLength = getStraightBarrierLength(barrierLength, barrierWidth, barrierHeight);

innerCurveChunks = getEnlargedCurveInnerBarrierChunks(barrierChunks, ratio) * printQuantity;
outerCurveChunks = getEnlargedCurveOuterBarrierChunks(barrierChunks, ratio) * printQuantity;
straightChunks = getEnlargedCurveSideBarrierChunks(barrierChunks, ratio) * 2 * printQuantity;

innerCurveInterval = getGridWidth(innerCurveLength, barrierWidth, quantity=innerCurveChunks, line=printQuantity);
outerCurveInterval = getGridWidth(outerCurveLength, barrierWidth, quantity=outerCurveChunks, line=printQuantity);
straightInterval = getGridWidth(straightLength, barrierWidth, quantity=straightChunks, line=printQuantity);

// Draws the ready to print model
translateY((straightInterval + outerCurveInterval) / 2) {
straightBarrierSet(quantity=straightChunks, line=printQuantity);
}
enlargedCurveBarrierSet(ratio=ratio, quantity=outerCurveChunks, line=printQuantity);
translateY(-(innerCurveInterval + outerCurveInterval) / 2) {
innerCurveBarrierSet(ratio=ratio, quantity=innerCurveChunks, line=printQuantity);
}
enlargedCurveTrackSectionBarrierSet(ratio=1);

}
40 changes: 40 additions & 0 deletions scale-64/parts/barriers/barrier-curve-1-half.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* @license
* GPLv3 License
*
* Copyright (c) 2022 Jean-Sebastien CONAN
*
* This file is part of jsconan/rc-tracks.
*
* jsconan/rc-tracks is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* jsconan/rc-tracks is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with jsconan/rc-tracks. If not, see <http://www.gnu.org/licenses/>.
*/

/**
* A race track system for 1/64 to 1/76 scale RC cars.
*
* Ready to print track parts: a set of barrier chunks for a tight curved track section with a half size.
*
* @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) {

// Draws the ready to print model
curvedTrackSectionBarrierSet(ratio=.5);

}
23 changes: 1 addition & 22 deletions scale-64/parts/barriers/barrier-curve-1.scad
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,7 @@ include <../../config/setup.scad>
// Sets the minimum facet angle and size using the defined render mode.
applyMode(mode=renderMode) {

ratio = 1;
innerCurveLength = getCurvedBarrierLength(
getCurveInnerBarrierPosition(trackSectionLength, trackSectionWidth, barrierWidth, ratio),
getCurveAngle(ratio) / getCurveInnerBarrierChunks(barrierChunks, ratio),
barrierWidth, barrierHeight
);
outerCurveLength = getCurvedBarrierLength(
getCurveOuterBarrierPosition(trackSectionLength, trackSectionWidth, barrierWidth, ratio),
getCurveAngle(ratio) / getCurveOuterBarrierChunks(barrierChunks, ratio),
barrierWidth, barrierHeight
);

innerCurveChunks = getCurveInnerBarrierChunks(barrierChunks, ratio) * printQuantity;
outerCurveChunks = getCurveOuterBarrierChunks(barrierChunks, ratio) * printQuantity;

innerCurveInterval = getGridWidth(innerCurveLength, barrierWidth, quantity=innerCurveChunks, line=printQuantity);
outerCurveInterval = getGridWidth(outerCurveLength, barrierWidth, quantity=outerCurveChunks, line=printQuantity);

// Draws the ready to print model
outerCurveBarrierSet(ratio=ratio, quantity=outerCurveChunks, line=printQuantity);
translateY(-(innerCurveInterval + outerCurveInterval) / 2) {
innerCurveBarrierSet(ratio=ratio, quantity=innerCurveChunks, line=printQuantity);
}
curvedTrackSectionBarrierSet(ratio=1);

}
43 changes: 43 additions & 0 deletions scale-64/parts/barriers/barrier-curve-2-half.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* @license
* GPLv3 License
*
* Copyright (c) 2022 Jean-Sebastien CONAN
*
* This file is part of jsconan/rc-tracks.
*
* jsconan/rc-tracks is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* jsconan/rc-tracks is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with jsconan/rc-tracks. If not, see <http://www.gnu.org/licenses/>.
*/

/**
* A race track system for 1/64 to 1/76 scale RC cars.
*
* Ready to print track parts: a set of barrier chunks for a large curved track section with a half size.
*
* @author jsconan
*/

// Import the project's setup.
include <../../config/setup.scad>

// Override the default config
forceFullTile = false;

// Sets the minimum facet angle and size using the defined render mode.
applyMode(mode=renderMode) {

// Draws the ready to print model
curvedTrackSectionBarrierSet(ratio=2);

}
26 changes: 4 additions & 22 deletions scale-64/parts/barriers/barrier-curve-2.scad
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,13 @@
// Import the project's setup.
include <../../config/setup.scad>

// Override the default config
forceFullTile = true;

// Sets the minimum facet angle and size using the defined render mode.
applyMode(mode=renderMode) {

ratio = 2;
innerCurveLength = getCurvedBarrierLength(
getCurveInnerBarrierPosition(trackSectionLength, trackSectionWidth, barrierWidth, ratio),
getCurveAngle(ratio) / getCurveInnerBarrierChunks(barrierChunks, ratio),
barrierWidth, barrierHeight
);
outerCurveLength = getCurvedBarrierLength(
getCurveOuterBarrierPosition(trackSectionLength, trackSectionWidth, barrierWidth, ratio),
getCurveAngle(ratio) / getCurveOuterBarrierChunks(barrierChunks, ratio),
barrierWidth, barrierHeight
);

innerCurveChunks = getCurveInnerBarrierChunks(barrierChunks, ratio) * printQuantity;
outerCurveChunks = getCurveOuterBarrierChunks(barrierChunks, ratio) * printQuantity;

innerCurveInterval = getGridWidth(innerCurveLength, barrierWidth, quantity=innerCurveChunks, line=printQuantity);
outerCurveInterval = getGridWidth(outerCurveLength, barrierWidth, quantity=outerCurveChunks, line=printQuantity);

// Draws the ready to print model
outerCurveBarrierSet(ratio=ratio, quantity=outerCurveChunks, line=printQuantity);
translateY(-(innerCurveInterval + outerCurveInterval) / 2) {
innerCurveBarrierSet(ratio=ratio, quantity=innerCurveChunks, line=printQuantity);
}
curvedTrackSectionBarrierSet(ratio=2);

}
Loading

0 comments on commit 77aac15

Please sign in to comment.