mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-09-25 05:51:41 +02:00
32 lines
624 B
Markdown
32 lines
624 B
Markdown
# px_line
|
|
|
|
Given two points. `px_line` returns points that can be used to draw a pixel-style line.
|
|
|
|
**Since:** 2.0
|
|
|
|
## Parameters
|
|
|
|
- `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.
|
|
|
|
## Examples
|
|
|
|
include <pixel/px_line.scad>;
|
|
|
|
for(pt = px_line([-10, 0], [20, 50])) {
|
|
translate(pt)
|
|
square(1, center = true);
|
|
}
|
|
|
|

|
|
|
|
include <pixel/px_line.scad>;
|
|
|
|
for(pt = px_line([-10, 0, -10], [20, 50, 10])) {
|
|
translate(pt)
|
|
cube(1, center = true);
|
|
}
|
|
|
|

|
|
|