1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-14 02:34:12 +02:00

provided supports for $fa, $fs, $fn

This commit is contained in:
Justin Lin
2017-03-23 09:56:03 +08:00
parent ad986ee515
commit e03e5bc8d3
2 changed files with 6 additions and 6 deletions

View File

@@ -1,8 +1,7 @@
/** /**
* line2d.scad * line2d.scad
* *
* Creates a line from two points. When the end points are CAP_ROUND, * Creates a line from two points.
* you can use $fa, $fs or $fn to controll the circle module used internally.
* *
* @copyright Justin Lin, 2017 * @copyright Justin Lin, 2017
* @license https://opensource.org/licenses/lgpl-3.0.html * @license https://opensource.org/licenses/lgpl-3.0.html

View File

@@ -1,7 +1,9 @@
/** /**
* polyline2d.scad * polyline2d.scad
* *
* Creates a polyline from a list of x, y coordinates. It depends on the line2d module so you have to include line2d.scad. * Creates a polyline from a list of x, y coordinates. When the end points are CAP_ROUND,
* you can use $fa, $fs or $fn to controll the circle module used internally.
* It depends on the line2d module so you have to include line2d.scad.
* *
* @copyright Justin Lin, 2017 * @copyright Justin Lin, 2017
* @license https://opensource.org/licenses/lgpl-3.0.html * @license https://opensource.org/licenses/lgpl-3.0.html
@@ -10,7 +12,7 @@
* *
**/ **/
module polyline2d(points, width, startingStyle = "CAP_SQUARE", endingStyle = "CAP_SQUARE", round_fn = 24) { module polyline2d(points, width, startingStyle = "CAP_SQUARE", endingStyle = "CAP_SQUARE") {
module line_segment(index) { module line_segment(index) {
styles = index == 1 ? [startingStyle, "CAP_ROUND"] : ( styles = index == 1 ? [startingStyle, "CAP_ROUND"] : (
index == len(points) - 1 ? ["CAP_ROUND", endingStyle] : [ index == len(points) - 1 ? ["CAP_ROUND", endingStyle] : [
@@ -19,8 +21,7 @@ module polyline2d(points, width, startingStyle = "CAP_SQUARE", endingStyle = "CA
); );
line2d(points[index - 1], points[index], width, line2d(points[index - 1], points[index], width,
p1Style = styles[0], p2Style = styles[1], p1Style = styles[0], p2Style = styles[1]);
round_fn = round_fn);
} }
module polyline2d_inner(points, index) { module polyline2d_inner(points, index) {