2019-06-30 18:28:01 +08:00
|
|
|
# px_line
|
|
|
|
|
|
|
|
Given two points. `px_line` returns points that can be used to draw a pixel-style line.
|
|
|
|
|
|
|
|
**Since:** 2.0
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
2019-06-30 20:22:03 +08:00
|
|
|
- `p1` : The start point `[x, y]` or `[x, y, z]`. x, y, z must be integer.
|
|
|
|
- `p2` : The end point `[x, y]` or `[x, y, z]`. x, y, z must be integer.
|
2019-06-30 18:28:01 +08:00
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
2020-01-28 17:51:20 +08:00
|
|
|
use <pixel/px_line.scad>;
|
2019-06-30 18:28:01 +08:00
|
|
|
|
|
|
|
for(pt = px_line([-10, 0], [20, 50])) {
|
|
|
|
translate(pt)
|
|
|
|
square(1, center = true);
|
|
|
|
}
|
|
|
|
|
|
|
|

|
|
|
|
|
2020-01-28 17:51:20 +08:00
|
|
|
use <pixel/px_line.scad>;
|
2019-06-30 18:28:01 +08:00
|
|
|
|
|
|
|
for(pt = px_line([-10, 0, -10], [20, 50, 10])) {
|
|
|
|
translate(pt)
|
|
|
|
cube(1, center = true);
|
|
|
|
}
|
|
|
|
|
|
|
|

|
|
|
|
|