mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-29 09:19:59 +02:00
add doc
This commit is contained in:
@@ -152,8 +152,8 @@ See [examples](examples).
|
|||||||
- [ptf/ptf_bend](https://openhome.cc/eGossip/OpenSCAD/lib2x-ptf_bend.html)
|
- [ptf/ptf_bend](https://openhome.cc/eGossip/OpenSCAD/lib2x-ptf_bend.html)
|
||||||
- [ptf/ptf_ring](https://openhome.cc/eGossip/OpenSCAD/lib2x-ptf_ring.html)
|
- [ptf/ptf_ring](https://openhome.cc/eGossip/OpenSCAD/lib2x-ptf_ring.html)
|
||||||
- [ptf/ptf_sphere](https://openhome.cc/eGossip/OpenSCAD/lib2x-ptf_sphere.html)
|
- [ptf/ptf_sphere](https://openhome.cc/eGossip/OpenSCAD/lib2x-ptf_sphere.html)
|
||||||
- ptf/ptf_torus
|
- [ptf/ptf_torus](https://openhome.cc/eGossip/OpenSCAD/lib2x-ptf_torus.html)
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
- Turtle
|
- Turtle
|
||||||
|
BIN
docs/images/lib2x-ptf_torus-1.JPG
Normal file
BIN
docs/images/lib2x-ptf_torus-1.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 70 KiB |
BIN
docs/images/lib2x-ptf_torus-2.JPG
Normal file
BIN
docs/images/lib2x-ptf_torus-2.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 64 KiB |
47
docs/lib2x-ptf_torus.md
Normal file
47
docs/lib2x-ptf_torus.md
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
# ptf_torus
|
||||||
|
|
||||||
|
Transforms a point inside a rectangle to a point of a torus. It can create things such as [torus maze](https://github.com/JustinSDK/dotSCAD/blob/master/examples/maze/torus_maze.scad).
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**Since:** 2.3
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
- `size` : 2 value array `[x, y]`, rectangle with dimensions `x` and `y`.
|
||||||
|
- `point` : The point to be transformed.
|
||||||
|
- `radius` : Torus `[R, r]`.
|
||||||
|
- `angle` : Torus `[A, a]`.
|
||||||
|
- `twist` : The number of degrees of through which the rectangle is twisted.
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
use <hull_polyline3d.scad>;
|
||||||
|
use <ptf/ptf_torus.scad>;
|
||||||
|
|
||||||
|
size = [20, 10];
|
||||||
|
radius = [10, 5];
|
||||||
|
angle = [180, 180];
|
||||||
|
twist = 90;
|
||||||
|
|
||||||
|
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_torus(size, p, radius, angle, twist)];
|
||||||
|
hull_polyline3d(twisted, thickness = .5);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(line = columns) {
|
||||||
|
twisted = [for(p = line) ptf_torus(size, p, radius, angle, twist)];
|
||||||
|
hull_polyline3d(twisted, thickness = .5);
|
||||||
|
}
|
||||||
|
|
||||||
|

|
Reference in New Issue
Block a user