mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-02-23 00:52:30 +01:00
43 lines
1.0 KiB
Markdown
43 lines
1.0 KiB
Markdown
# ptf_x_twist
|
|
|
|
Twist a point along the x-axis. You can use it to create something such as a [twisted maze](https://github.com/JustinSDK/dotSCAD/blob/master/examples/maze/twisted_maze.scad).
|
|
|
|

|
|
|
|
**Since:** 2.3
|
|
|
|
## Parameters
|
|
|
|
- `size` : 2 value array `[x, y]`, rectangle with dimensions `x` and `y`.
|
|
- `point` : The point to be twisted.
|
|
- `angle` : The number of degrees.
|
|
|
|
## Examples
|
|
|
|
use <hull_polyline3d.scad>;
|
|
use <ptf/ptf_x_twist.scad>;
|
|
|
|
size = [20, 10];
|
|
|
|
rows = [
|
|
for(y = [0:size[1]])
|
|
[for(x = [0:size[0]]) [x, y]]
|
|
];
|
|
|
|
columns = [
|
|
for(x = [0:size[0]])
|
|
[for(y = [0:size[1]]) [x, y]]
|
|
];
|
|
|
|
for(line = rows) {
|
|
twisted = [for(p = line) ptf_x_twist(size, p, 90)];
|
|
hull_polyline3d(twisted, thickness = .1);
|
|
}
|
|
|
|
for(line = columns) {
|
|
twisted = [for(p = line) ptf_x_twist(size, p, 90)];
|
|
hull_polyline3d(twisted, thickness = .1);
|
|
}
|
|
|
|

|