1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-09-02 03:02:34 +02:00
This commit is contained in:
Justin Lin
2020-03-26 17:33:35 +08:00
parent 39d1af8919
commit ce8783ce65
5 changed files with 52 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

41
docs/lib2x-ptf_circle.md Normal file
View File

@@ -0,0 +1,41 @@
# ptf_circle
Transform a point inside a rectangle to a point inside a circle. You can use it to create something such as a [noisy circle maze](https://github.com/JustinSDK/dotSCAD/blob/master/examples/maze/noisy_circle_maze.scad).
![ptf_circle](images/lib2x-ptf_circle-1.JPG)
**Since:** 2.3.
## Parameters
- `size` : 2 value array `[x, y]`, rectangle with dimensions `x` and `y`.
- `point` : The point to be transformed.
## Examples
use <hull_polyline3d.scad>;
use <ptf/ptf_circle.scad>;
size = [10, 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_circle(size, p)];
hull_polyline3d(twisted, thickness = .1);
}
for(line = columns) {
twisted = [for(p = line) ptf_circle(size, p)];
hull_polyline3d(twisted, thickness = .1);
}
![ptf_circle](images/lib2x-ptf_circle-2.JPG)