1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 22:28:16 +01:00
dotSCAD/docs/lib-line2d.md

31 lines
1.1 KiB
Markdown
Raw Normal View History

2017-03-30 14:42:47 +08:00
line2d
2017-03-11 17:40:10 +08:00
2017-03-23 10:14:55 +08:00
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.
2017-03-11 17:40:10 +08:00
2017-03-30 14:42:47 +08:00
# Parameters
2017-03-11 17:40:10 +08:00
- `p1` : 2 element vector `[x, y]`.
- `p2` : 2 element vector `[x, y]`.
- `width` : The line width.
2017-03-19 08:09:07 +08:00
- `p1Style` : The end-cap style of the point `p1`. The value must be `"CAP_BUTT"`, `"CAP_SQUARE"` or `"CAP_ROUND"`. The default value is `"CAP_SQUARE"`.
- `p2Style` : The end-cap style of the point `p2`. 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
2017-03-30 14:42:47 +08:00
# Examples
2017-03-11 17:40:10 +08:00
2017-03-30 14:22:48 +08:00
include <line2d.scad>;
2017-03-23 09:52:23 +08:00
$fn = 24;
2017-03-11 17:40:10 +08:00
line2d(p1 = [0, 0], p2 = [5, 0], width = 1);
translate([0, -2, 0])
line2d(p1 = [0, 0], p2 = [5, 0], width = 1,
2017-03-19 08:09:07 +08:00
p1Style = "CAP_ROUND", p2Style = "CAP_ROUND");
2017-03-11 17:40:10 +08:00
translate([0, -4, 0])
line2d(p1 = [0, 0], p2 = [5, 0], width = 1,
2017-03-19 08:09:07 +08:00
p1Style = "CAP_BUTT", p2Style = "CAP_BUTT");
2017-03-11 17:40:10 +08:00
2017-03-11 17:51:28 +08:00
![line2d](images/lib-line2d-1.JPG)