diff --git a/docs/images/lib3x-rotate_p-1.JPG b/docs/images/lib3x-ptf_rotate-1.JPG similarity index 100% rename from docs/images/lib3x-rotate_p-1.JPG rename to docs/images/lib3x-ptf_rotate-1.JPG diff --git a/docs/images/lib3x-rotate_p-2.JPG b/docs/images/lib3x-ptf_rotate-2.JPG similarity index 100% rename from docs/images/lib3x-rotate_p-2.JPG rename to docs/images/lib3x-ptf_rotate-2.JPG diff --git a/docs/images/lib3x-rotate_p-3.JPG b/docs/images/lib3x-ptf_rotate-3.JPG similarity index 100% rename from docs/images/lib3x-rotate_p-3.JPG rename to docs/images/lib3x-ptf_rotate-3.JPG diff --git a/docs/lib3x-ptf_rotate.md b/docs/lib3x-ptf_rotate.md index ee71edf8..6784e8da 100644 --- a/docs/lib3x-ptf_rotate.md +++ b/docs/lib3x-ptf_rotate.md @@ -26,7 +26,7 @@ Rotates a point `a` degrees around the axis of the coordinate system or an arbit sphere(1); } -![ptf_rotate](images/lib3x-rotate_p-1.JPG) +![ptf_rotate](images/lib3x-ptf_rotate-1.JPG) use ; @@ -48,7 +48,7 @@ Rotates a point `a` degrees around the axis of the coordinate system or an arbit %sphere(radius); -![ptf_rotate](images/lib3x-rotate_p-2.JPG) +![ptf_rotate](images/lib3x-ptf_rotate-2.JPG) use ; @@ -66,4 +66,4 @@ Rotates a point `a` degrees around the axis of the coordinate system or an arbit sphere(1); } -![ptf_rotate](images/lib3x-rotate_p-3.JPG) \ No newline at end of file +![ptf_rotate](images/lib3x-ptf_rotate-3.JPG) \ No newline at end of file diff --git a/docs/lib3x-rails2sections.md b/docs/lib3x-rails2sections.md index ca9aec95..52675bd8 100644 --- a/docs/lib3x-rails2sections.md +++ b/docs/lib3x-rails2sections.md @@ -4,6 +4,8 @@ It returns all cross-sections described by rails. Combined with the `sweep` modu Rails should be indexed count-clockwisely. +**Since:** 3.2 + ## Parameters - `rails` : A list of rails used to describe the surface of the model. diff --git a/docs/lib3x-rotate_p.md b/docs/lib3x-rotate_p.md deleted file mode 100644 index dfbd32f1..00000000 --- a/docs/lib3x-rotate_p.md +++ /dev/null @@ -1,82 +0,0 @@ -# rotate_p - -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 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. **Since:** 1.1. - -## Examples - -You can use the code below to create a line. - - use ; - - hull() { - sphere(1); - rotate([0, -45, 45]) - translate([20, 0, 0]) - sphere(1); - } - -The following code has the same effect. - - use ; - - point = [20, 0, 0]; - a = [0, -45, 45]; - - hull() { - sphere(1); - translate(rotate_p(point, a)) - rotate(a) - sphere(1); - } - -![rotate_p](images/lib3x-rotate_p-1.JPG) - -The `rotate_p` function is useful in some situations. For example, you probably want to get all points on the path of a spiral around a sphere. - - use ; - - radius = 40; - step_angle = 10; - z_circles = 20; - - points = [for(a = [0:step_angle:90 * z_circles]) - rotate_p( - [radius, 0, 0], - [0, -90 + 2 * a / z_circles, a] - ) - ]; - - // Once you get all points on the path, you can place anything at each point. - // I just place a sphere as a simple demonstration. - for(p = points) { - translate(p) - sphere(1); - } - - %sphere(radius); - -![rotate_p](images/lib3x-rotate_p-2.JPG) - - use ; - - 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); - } - -![rotate_p](images/lib3x-rotate_p-3.JPG) \ No newline at end of file diff --git a/docs/lib3x-sweep.md b/docs/lib3x-sweep.md index 33ce428f..53831fa2 100644 --- a/docs/lib3x-sweep.md +++ b/docs/lib3x-sweep.md @@ -40,7 +40,7 @@ The indexes of the above triangles is: ## Examples - use ; + use ; use ; section1 = [ @@ -55,7 +55,7 @@ The indexes of the above triangles is: for(i = [0:55]) [ for(p = section1) - let(pt = rotate_p(p, [90, 0, 10 * i])) + let(pt = ptf_rotate(p, [90, 0, 10 * i])) [pt[0], pt[1] , pt[2] + i] ] ]; @@ -64,7 +64,7 @@ The indexes of the above triangles is: ![sweep](images/lib3x-sweep-7.JPG) - use ; + use ; use ; section1 = [ @@ -85,7 +85,7 @@ The indexes of the above triangles is: for(i = [0:55]) [ for(p = section1) - let(pt = rotate_p(p, [90, 0, 10 * i])) + let(pt = ptf_rotate(p, [90, 0, 10 * i])) [pt[0], pt[1] , pt[2] + i] ] ]; @@ -94,7 +94,7 @@ The indexes of the above triangles is: ![sweep](images/lib3x-sweep-8.JPG) - use ; + use ; use ; section1 = [ @@ -113,7 +113,7 @@ The indexes of the above triangles is: for(i = [0:55]) [ for(p = section1) - let(pt = rotate_p(p, [90, 0, 10 * i])) + let(pt = ptf_rotate(p, [90, 0, 10 * i])) [pt[0], pt[1] , pt[2] + i] ] ];