1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 22:28:16 +01:00
dotSCAD/docs/lib-hull_polyline3d.md

46 lines
1.2 KiB
Markdown
Raw Normal View History

2017-03-17 10:29:50 +08:00
# hull_polyline3d
2017-03-23 10:09:08 +08:00
Creates a 3D polyline from a list of `[x, y, z]` coordinates. As the name says, it uses the built-in hull operation for each pair of points (created by the `sphere` module). It's slow. However, it can be used to create metallic effects for a small `$fn`, large `$fa` or `$fs`.
2017-03-17 10:29:50 +08:00
## Parameters
2017-04-24 17:34:40 +08:00
- `points` : The list of `[x, y, z]` points of the polyline. The points are indexed from 0 to n-1.
2017-03-17 10:29:50 +08:00
- `thickness` : The line thickness.
2017-04-26 17:37:06 +08:00
- `$fa`, `$fs`, `$fn` : Check [the sphere module](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#sphere) for more details.
2017-03-17 10:29:50 +08:00
## Examples
2017-03-30 14:22:48 +08:00
include <hull_polyline3d.scad>;
2017-03-17 10:29:50 +08:00
hull_polyline3d(
points = [
[1, 2, 3],
[4, -5, -6],
[-1, -3, -5],
[0, 0, 0]
],
thickness = 1,
2017-03-23 10:09:08 +08:00
$fn = 3
2017-03-17 10:29:50 +08:00
);
![polyline3d](images/lib-hull_polyline3d-1.JPG)
2017-03-30 14:22:48 +08:00
include <hull_polyline3d.scad>;
2017-03-17 10:29:50 +08:00
r = 50;
points = [
for(a = [0:180])
[
r * cos(-90 + a) * cos(a),
r * cos(-90 + a) * sin(a),
r * sin(-90 + a)
]
];
for(i = [0:7]) {
rotate(45 * i)
2017-03-23 10:09:08 +08:00
hull_polyline3d(points, 2, $fn = 3);
2017-03-17 10:29:50 +08:00
}
![polyline3d](images/lib-hull_polyline3d-2.JPG)