2020-04-05 11:07:07 +08:00
# loft
2021-02-22 07:52:37 +08:00
When having uniform cross sections, you can use [sweep ](https://openhome.cc/eGossip/OpenSCAD/lib3x-sweep.html ) to create a model. The `loft` here is best when you have a body with multiple crosssections with different geometries.
2020-04-05 11:07:07 +08:00
**Since:** 2.3
## Parameters
- `sections` : A list of cross-sections, The points must be count-clockwise indexes.
- `slices` : Defines the number of intermediate points between two sections. Default to 1.
## Examples
2022-06-06 13:11:46 +08:00
use < shape_star.scad >
use < shape_circle.scad >
use < ptf / ptf_rotate . scad >
use < loft.scad >
2020-04-05 11:07:07 +08:00
sects = [
for(i = 10; i >= 4; i = i - 1)
[
2021-12-04 12:16:20 +08:00
for(p = shape_star(15, 12, i % 2 == 1 ? i : i - 1)) ptf_rotate([p.x, p.y, 5 * (i - 4)], i * 10)
2020-04-05 11:07:07 +08:00
]
];
loft(sects, slices = 3);
translate([30, 0, 0])
difference() {
loft(
[
2021-12-04 12:16:20 +08:00
[for(p = shape_circle(10, $fn = 3)) [p.x, p.y, 15]],
[for(p = shape_circle(15, $fn = 24)) [p.x, p.y, 0]]
2020-04-05 11:07:07 +08:00
],
slices = 4
);
loft(
[
2021-12-04 12:16:20 +08:00
[for(p = shape_circle(8, $fn = 3)) [p.x, p.y, 15.1]],
[for(p = shape_circle(13, $fn = 24)) [p.x, p.y, -0.1]]
2020-04-05 11:07:07 +08:00
],
slices = 4
);
}
2021-02-19 11:24:34 +08:00
![loft ](images/lib3x-loft-1.JPG )
2020-04-05 11:07:07 +08:00