1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
dotSCAD/docs/lib-polyline2d.md

40 lines
1.6 KiB
Markdown
Raw Normal View History

2017-03-11 17:40:10 +08:00
# polyline2d
2017-03-23 09:58:00 +08:00
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.
2017-03-11 17:40:10 +08:00
## Parameters
- `points` : The list of `x`, `y` points of the polyline. : A vector of 2 element vectors. The points are indexed from 0 to n-1.
- `width` : The line width.
2017-03-19 08:09:07 +08:00
- `startingStyle` : The end-cap style of the starting point. The value must be `"CAP_BUTT"`, `"CAP_SQUARE"` or `"CAP_ROUND"`. The default value is `"CAP_SQUARE"`.
- endingStyle : The end-cap style of the ending point. The value must be `"CAP_BUTT"`, `"CAP_SQUARE"` or `"CAP_ROUND"`. The default value is `"CAP_SQUARE"`.
2017-03-23 10:14:55 +08:00
- `$fa`, `$fs`, `$fn` : Check [the circle module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#circle) for more details.
2017-03-11 17:40:10 +08:00
## Examples
2017-04-07 09:05:57 +08:00
include <line2d.scad>;
2017-03-30 14:22:48 +08:00
include <polyline2d.scad>;
2017-03-23 09:58:00 +08:00
$fn = 24;
2017-03-11 17:40:10 +08:00
polyline2d(points = [[1, 2], [-5, -4], [-5, 3], [5, 5]], width = 1);
2017-03-11 17:53:40 +08:00
![polyline2d](images/lib-polyline2d-1.JPG)
2017-03-11 17:40:10 +08:00
2017-04-07 09:05:57 +08:00
include <line2d.scad>;
2017-03-30 14:22:48 +08:00
include <polyline2d.scad>;
2017-03-23 09:58:00 +08:00
$fn = 24;
2017-03-11 17:40:10 +08:00
polyline2d(points = [[1, 2], [-5, -4], [-5, 3], [5, 5]], width = 1,
2017-03-19 08:09:07 +08:00
endingStyle = "CAP_ROUND");
2017-03-11 17:40:10 +08:00
2017-03-11 17:53:40 +08:00
![polyline2d](images/lib-polyline2d-2.JPG)
2017-03-11 17:40:10 +08:00
2017-04-07 09:05:57 +08:00
include <line2d.scad>;
2017-03-30 14:22:48 +08:00
include <polyline2d.scad>;
2017-03-23 09:58:00 +08:00
$fn = 24;
2017-03-11 17:40:10 +08:00
polyline2d(points = [[1, 2], [-5, -4], [-5, 3], [5, 5]], width = 1,
2017-03-19 08:09:07 +08:00
startingStyle = "CAP_ROUND", endingStyle = "CAP_ROUND");
2017-03-11 17:40:10 +08:00
2017-03-11 17:51:28 +08:00
![polyline2d](images/lib-polyline2d-3.JPG)