1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-07-31 20:10:36 +02:00
This commit is contained in:
Justin Lin
2020-03-26 13:38:55 +08:00
parent 72d2b8657f
commit 39d1af8919
5 changed files with 53 additions and 6 deletions

View File

@@ -147,7 +147,7 @@ See [examples](examples).
- Point Transformation (2.3 Preview)
- [ptf/ptf_rotate](https://openhome.cc/eGossip/OpenSCAD/lib2x-ptf_rotate.html)
- [ptf/ptf_x_twist](https://openhome.cc/eGossip/OpenSCAD/lib2x-ptf_x_twist.html)
- ptf/ptf_y_twist
- [ptf/ptf_y_twist](https://openhome.cc/eGossip/OpenSCAD/lib2x-ptf_y_twist.html)
- ptf/ptf_circle
- ptf/ptf_bend
- ptf/ptf_ring

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

42
docs/lib2x-ptf_y_twist.md Normal file
View File

@@ -0,0 +1,42 @@
# ptf_y_twist
Twist a point along the y-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).
![ptf_y_twist](images/lib2x-ptf_y_twist-2.JPG)
**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_y_twist.scad>;
size = [10, 20];
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_y_twist(size, p, 90)];
hull_polyline3d(twisted, thickness = .1);
}
for(line = columns) {
twisted = [for(p = line) ptf_y_twist(size, p, 90)];
hull_polyline3d(twisted, thickness = .1);
}
![ptf_y_twist](images/lib2x-ptf_y_twist-1.JPG)

View File

@@ -1,10 +1,15 @@
/**
* ptf_y_twist.scad
*
* @copyright Justin Lin, 2020
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-ptf_y_twist.html
*
**/
use <ptf/ptf_rotate.scad>;
/*
size: The size of a rectangle.
point: A point in the rectangle.
angle: twisted angle.
*/
function ptf_y_twist(size, point, angle) =
let(
xlen = size[0],