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

first commit

This commit is contained in:
Justin Lin
2017-03-11 17:40:10 +08:00
parent b582175412
commit f5adcb46d9
9 changed files with 121 additions and 2 deletions

BIN
docs/images/line2d-1.JPG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

26
docs/line2d.md Normal file
View File

@@ -0,0 +1,26 @@
# line2d
Creates a line from two points.
## Parameters
- `p1` : 2 element vector `[x, y]`.
- `p2` : 2 element vector `[x, y]`.
- `width` : The line width.
- `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`.
- `round_fn` : When the end-cap style is `CAP_ROUND`, it controlls the `$fn` value used by the `circle` module. The default value is `24`.
## Examples
line2d(p1 = [0, 0], p2 = [5, 0], width = 1);
translate([0, -2, 0])
line2d(p1 = [0, 0], p2 = [5, 0], width = 1,
p1Style = CAP_ROUND, p2Style = CAP_ROUND);
translate([0, -4, 0])
line2d(p1 = [0, 0], p2 = [5, 0], width = 1,
p1Style = CAP_BUTT, p2Style = CAP_BUTT);
![line2d](images/line2d-1.JPG)

27
docs/polyline2d.md Normal file
View File

@@ -0,0 +1,27 @@
# polyline2d
Creates a polyline from a list of `x`, `y` coordinates. It depends on the `line2d` module so you have to `include` line2d.scad.
## 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.
- `startingStyle` : The end-cap style of the starting point. The value must be `CAP_BUTT`, `CAP_SQUARE` or `CAP_ROUND` (defined in line2d.scad). 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` (defined in line2d.scad). The default value is `CAP_SQUARE`.
- `round_fn` = When the end-cap style is `CAP_ROUND`, it controlls the `$fn` value used by the `circle` module. The default value is `24`.
## Examples
polyline2d(points = [[1, 2], [-5, -4], [-5, 3], [5, 5]], width = 1);
![polyline2d](images/polyline2d-1.JPG)
polyline2d(points = [[1, 2], [-5, -4], [-5, 3], [5, 5]], width = 1,
endingStyle = CAP_ROUND);
![polyline2d](images/polyline2d-2.JPG)
polyline2d(points = [[1, 2], [-5, -4], [-5, 3], [5, 5]], width = 1,
startingStyle = CAP_ROUND, endingStyle = CAP_ROUND);
![polyline2d](images/polyline2d-3.JPG)