mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-08 07:46:39 +02:00
update rotate_p doc
This commit is contained in:
BIN
docs/images/lib-rotate_p-3.JPG
Normal file
BIN
docs/images/lib-rotate_p-3.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
@@ -1,11 +1,12 @@
|
||||
# rotate_p
|
||||
|
||||
Rotates a point `a` degrees around an arbitrary axis. It behaves as the built-in `rotate` module
|
||||
Rotates a point `a` degrees about the axis of the coordinate system or around an arbitrary axis. It behaves as the built-in `rotate` module
|
||||
|
||||
## Parameters
|
||||
|
||||
- `point` : A 3D point `[x, y, z]` or a 2D point `[x, y]`.
|
||||
- `a` : If it's `[deg_x, deg_y, deg_z]`, the rotation is applied in the order `x`, `y`, `z`. If it's `[deg_x, deg_y]`, the rotation is applied in the order `x`, `y`. If it's`[deg_x]`, the rotation is only applied to the `x` axis. If it's an number, the rotation is only applied to the `z` axis.
|
||||
- `a` : If it's `[deg_x, deg_y, deg_z]`, the rotation is applied in the order `x`, `y`, `z`. If it's `[deg_x, deg_y]`, the rotation is applied in the order `x`, `y`. If it's`[deg_x]`, the rotation is only applied to the `x` axis. If it's an number, the rotation is only applied to the `z` axis or an arbitrary axis.
|
||||
- `v`: A vector allows you to set an arbitrary axis about which the object will be rotated. When `a` is an array, the `v` argument is ignored.
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -61,3 +62,21 @@ The `rotate_p` function is useful in some situations. For example, you probably
|
||||
%sphere(radius);
|
||||
|
||||

|
||||
|
||||
include <rotate_p.scad>;
|
||||
|
||||
v = [10, 10, 10];
|
||||
|
||||
hull() {
|
||||
sphere(1);
|
||||
translate(v)
|
||||
sphere(1);
|
||||
}
|
||||
|
||||
p = [10, 10, 0];
|
||||
for(i = [0:20:340]) {
|
||||
translate(rotate_p(p, a = i, v = v))
|
||||
sphere(1);
|
||||
}
|
||||
|
||||

|
Reference in New Issue
Block a user