mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-07 07:16:36 +02:00
add closed param
This commit is contained in:
@@ -46,5 +46,5 @@ module hollow_out_torus_knot(shape, p, q, phi_step, thickness, line_style) {
|
|||||||
pts = torus_knot(p, q, phi_step);
|
pts = torus_knot(p, q, phi_step);
|
||||||
sects = sects_by_path(shape, pts);
|
sects = sects_by_path(shape, pts);
|
||||||
|
|
||||||
hollow_out_sweep(concat(sects, [sects[0]]), thickness, line_style);
|
hollow_out_sweep(sects, thickness, closed = true, style = line_style);
|
||||||
}
|
}
|
@@ -4,11 +4,11 @@ use <hull_polyline3d.scad>;
|
|||||||
use <experimental/tri_bisectors.scad>;
|
use <experimental/tri_bisectors.scad>;
|
||||||
|
|
||||||
// style: LINES or HULL_LINES
|
// style: LINES or HULL_LINES
|
||||||
module hollow_out_sweep(sections, thickness, style = "LINES") {
|
module hollow_out_sweep(sections, thickness, closed = false, style = "LINES") {
|
||||||
function rects(sects) =
|
function rects(sects) =
|
||||||
let(
|
let(
|
||||||
sects_leng = len(sections),
|
sects_leng = len(sects),
|
||||||
shape_pt_leng = len(sections[0])
|
shape_pt_leng = len(sects[0])
|
||||||
)
|
)
|
||||||
[
|
[
|
||||||
for(i = [0:sects_leng - 2])
|
for(i = [0:sects_leng - 2])
|
||||||
@@ -29,8 +29,9 @@ module hollow_out_sweep(sections, thickness, style = "LINES") {
|
|||||||
[[rect[0], rect[1], rect[2]], [rect[0], rect[2], rect[3]]] :
|
[[rect[0], rect[1], rect[2]], [rect[0], rect[2], rect[3]]] :
|
||||||
[[rect[1], rect[2], rect[3]], [rect[1], rect[3], rect[0]]];
|
[[rect[1], rect[2], rect[3]], [rect[1], rect[3], rect[0]]];
|
||||||
|
|
||||||
|
sects = closed ? concat(sections, [sections[0]]) : sections;
|
||||||
lines = [
|
lines = [
|
||||||
for(rect = rects(sections))
|
for(rect = rects(sects))
|
||||||
for(tri = rand_tris(rect))
|
for(tri = rand_tris(rect))
|
||||||
each tri_bisectors(tri)
|
each tri_bisectors(tri)
|
||||||
];
|
];
|
||||||
|
Reference in New Issue
Block a user