mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-12 09:44:16 +02:00
add doc
This commit is contained in:
@@ -148,7 +148,7 @@ See [examples](examples).
|
|||||||
- [ptf/ptf_rotate](https://openhome.cc/eGossip/OpenSCAD/lib2x-ptf_rotate.html)
|
- [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_x_twist](https://openhome.cc/eGossip/OpenSCAD/lib2x-ptf_x_twist.html)
|
||||||
- [ptf/ptf_y_twist](https://openhome.cc/eGossip/OpenSCAD/lib2x-ptf_y_twist.html)
|
- [ptf/ptf_y_twist](https://openhome.cc/eGossip/OpenSCAD/lib2x-ptf_y_twist.html)
|
||||||
- ptf/ptf_circle
|
- [ptf/ptf_circle](https://openhome.cc/eGossip/OpenSCAD/lib2x-ptf_circle.html)
|
||||||
- ptf/ptf_bend
|
- ptf/ptf_bend
|
||||||
- ptf/ptf_ring
|
- ptf/ptf_ring
|
||||||
- ptf/ptf_sphere
|
- ptf/ptf_sphere
|
||||||
|
BIN
docs/images/lib2x-ptf_circle-1.JPG
Normal file
BIN
docs/images/lib2x-ptf_circle-1.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 59 KiB |
BIN
docs/images/lib2x-ptf_circle-2.JPG
Normal file
BIN
docs/images/lib2x-ptf_circle-2.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
41
docs/lib2x-ptf_circle.md
Normal file
41
docs/lib2x-ptf_circle.md
Normal 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).
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**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);
|
||||||
|
}
|
||||||
|
|
||||||
|

|
@@ -1,3 +1,13 @@
|
|||||||
|
/**
|
||||||
|
* ptf_circle.scad
|
||||||
|
*
|
||||||
|
* @copyright Justin Lin, 2020
|
||||||
|
* @license https://opensource.org/licenses/lgpl-3.0.html
|
||||||
|
*
|
||||||
|
* @see https://openhome.cc/eGossip/OpenSCAD/lib2x-ptf_circle.html
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
|
||||||
function ptf_circle(size, point) =
|
function ptf_circle(size, point) =
|
||||||
let(
|
let(
|
||||||
p_offset = -size / 2,
|
p_offset = -size / 2,
|
||||||
|
Reference in New Issue
Block a user