1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-11 01:04:07 +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
*
* Creates a line from two points. When the end points are CAP_ROUND,
* you can use $fa, $fs or $fn to controll the circle module used internally.
* Creates a line from two points.
*
* @copyright Justin Lin, 2017
* @license https://opensource.org/licenses/lgpl-3.0.html

View File

@@ -1,7 +1,9 @@
/**
* 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
* @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) {
styles = index == 1 ? [startingStyle, "CAP_ROUND"] : (
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,
p1Style = styles[0], p2Style = styles[1],
round_fn = round_fn);
p1Style = styles[0], p2Style = styles[1]);
}
module polyline2d_inner(points, index) {