1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
dotSCAD/docs/lib3x-rails2sections.md

70 lines
1.5 KiB
Markdown
Raw Normal View History

2021-08-14 08:34:41 +08:00
# rails2sections
2021-11-17 11:05:38 +08:00
Create sections along rails. Combined with the `sweep` module, you can describe a more complex model.
2021-08-14 08:34:41 +08:00
Rails should be indexed count-clockwisely.
2021-08-14 09:09:47 +08:00
**Since:** 3.2
2021-08-14 08:34:41 +08:00
## Parameters
- `rails` : A list of rails used to describe the surface of the model.
## Examples
2022-06-06 13:11:46 +08:00
use <rails2sections.scad>
use <polyline_join.scad>
use <sweep.scad>
2021-08-14 08:34:41 +08:00
rails = [
[[5, 0, 5], [15, 10, 10], [25, 20, 5]],
[[-5, 0, 5], [-15, 10, 10], [-25, 20, 5]],
[[-5, 0, -5], [-15, 10, -10], [-25, 20, -5]],
[[5, 0, -5], [15, 10, -10], [25, 20, -5]]
];
sections = rails2sections(rails);
sweep(sections);
#for(path = rails) {
2021-12-04 10:57:29 +08:00
polyline_join(path)
sphere(.25);
2021-08-14 08:34:41 +08:00
}
![rails2sections](images/lib3x-rails2sections-1.JPG)
2022-06-06 13:11:46 +08:00
use <bezier_curve.scad>
use <rails2sections.scad>
use <polyline_join.scad>
use <sweep.scad>
2021-08-14 08:34:41 +08:00
t_step = 0.05;
rails = [
bezier_curve(t_step,
[[1.25, 0, 5], [5, 20, 5], [16, 20, -2], [18, 20, 10], [30, 15, 8]]
),
bezier_curve(t_step,
[[-1.25, 0, 5], [0, 20, 5], [16, 22, -2], [18, 20, 10], [30, 25, 8]]
),
bezier_curve(t_step,
[[-1.25, 0, -5], [0, 20, -5], [16, 20, 1], [18, 27, -3], [20, 27, -5]]
),
bezier_curve(t_step,
[[1.25, 0, -5], [5, 20, -5], [16, 20, 1], [18, 17.5, -3], [20, 17.5, -5]]
)
];
sections = rails2sections(rails);
sweep(sections);
#for(path = rails) {
2021-12-04 10:57:29 +08:00
polyline_join(path)
sphere(.25);
2021-08-14 08:34:41 +08:00
}
![rails2sections](images/lib3x-rails2sections-2.JPG)