2017-03-19 09:10:15 +08:00
|
|
|
# bend
|
|
|
|
|
2017-03-30 14:22:48 +08:00
|
|
|
Bends a 3D object into an arc shape.
|
2017-03-19 09:10:15 +08:00
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
- `size` : The size of a cube which can contain the target object.
|
|
|
|
- `angle` : The central angle of the arc shape. The radius of the arc is calculated automatically.
|
2017-03-19 09:13:28 +08:00
|
|
|
- `frags` : Number of fragments. The target object will be cut into `frags` fragments and recombined into an arc shape. The default value is 24.
|
2017-03-19 09:10:15 +08:00
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
2017-03-31 13:16:00 +08:00
|
|
|
The containing cube of the target object should be laid down on the x-y plane. For example.
|
2017-03-19 09:10:15 +08:00
|
|
|
|
2022-06-06 13:11:46 +08:00
|
|
|
use <bend.scad>
|
2017-03-30 14:22:48 +08:00
|
|
|
|
2017-03-19 09:10:15 +08:00
|
|
|
x = 9.25;
|
|
|
|
y = 9.55;
|
|
|
|
z = 1;
|
|
|
|
|
|
|
|
%cube(size = [x, y, z]);
|
|
|
|
linear_extrude(z) text("A");
|
|
|
|
|
2021-02-21 22:47:09 +08:00
|
|
|
![bend](images/lib3x-bend-1.JPG)
|
2017-03-19 09:10:15 +08:00
|
|
|
|
|
|
|
Once you have the size of the containing cube, you can use it as the `size` argument of the `bend` module.
|
|
|
|
|
2022-06-06 13:11:46 +08:00
|
|
|
use <bend.scad>
|
2017-03-30 14:22:48 +08:00
|
|
|
|
2017-03-19 09:10:15 +08:00
|
|
|
x = 9.25;
|
|
|
|
y = 9.55;
|
|
|
|
z = 1;
|
|
|
|
|
|
|
|
*cube(size = [x, y, z]);
|
|
|
|
|
|
|
|
bend(size = [x, y, z], angle = 270)
|
2022-03-30 09:39:11 +08:00
|
|
|
linear_extrude(z)
|
|
|
|
text("A");
|
2017-03-19 09:10:15 +08:00
|
|
|
|
2021-02-21 22:47:09 +08:00
|
|
|
![bend](images/lib3x-bend-2.JPG)
|
2017-03-19 09:10:15 +08:00
|
|
|
|
2017-03-19 09:14:31 +08:00
|
|
|
The arc shape is smoother if the `frags` value is larger.
|
2017-03-30 14:22:48 +08:00
|
|
|
|
2022-06-06 13:11:46 +08:00
|
|
|
use <bend.scad>
|
2017-03-19 09:10:15 +08:00
|
|
|
|
|
|
|
x = 9.25;
|
|
|
|
y = 9.55;
|
|
|
|
z = 1;
|
|
|
|
|
|
|
|
bend(size = [x, y, z], angle = 270, frags = 360)
|
2022-03-30 09:39:11 +08:00
|
|
|
linear_extrude(z)
|
|
|
|
text("A");
|
2017-03-19 09:10:15 +08:00
|
|
|
|
2021-02-21 22:47:09 +08:00
|
|
|
![bend](images/lib3x-bend-3.JPG)
|
2017-03-19 09:10:15 +08:00
|
|
|
|
2019-06-01 16:00:14 +08:00
|
|
|
This module is especially useful when you want to create things such as [PNG to pen holder](https://www.thingiverse.com/thing:1589493).
|