mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-23 23:03:23 +02:00
refactor
This commit is contained in:
@@ -76,13 +76,12 @@ module sweep(sections, triangles = "SOLID") {
|
|||||||
// hook for testing
|
// hook for testing
|
||||||
test_sweep_solid(v_pts, f_idxes, triangles);
|
test_sweep_solid(v_pts, f_idxes, triangles);
|
||||||
} else {
|
} else {
|
||||||
range_i = [0:leng_pts_sect - 1];
|
first_idxes = [for(i = leng_pts_sect - 1; i >= 0; i = i - 1) i];
|
||||||
first_idxes = [for(i = range_i) leng_pts_sect - 1 - i];
|
|
||||||
last_idxes = [
|
|
||||||
for(i = range_i)
|
|
||||||
i + leng_pts_sect * (leng_sects - 1)
|
|
||||||
];
|
|
||||||
|
|
||||||
|
from = leng_pts_sect * (leng_sects - 1);
|
||||||
|
to = from + leng_pts_sect - 1;
|
||||||
|
|
||||||
|
last_idxes = [each [from:to]];
|
||||||
f_idxes = [first_idxes, each side_indexes(sects), last_idxes];
|
f_idxes = [first_idxes, each side_indexes(sects), last_idxes];
|
||||||
|
|
||||||
polyhedron(
|
polyhedron(
|
||||||
@@ -188,7 +187,7 @@ module sweep(sections, triangles = "SOLID") {
|
|||||||
|
|
||||||
module triangles_defined_sections() {
|
module triangles_defined_sections() {
|
||||||
module tri_sections(tri1, tri2) {
|
module tri_sections(tri1, tri2) {
|
||||||
hull() polyhedron(
|
polyhedron(
|
||||||
points = concat(tri1, tri2),
|
points = concat(tri1, tri2),
|
||||||
faces = [
|
faces = [
|
||||||
[0, 1, 2],
|
[0, 1, 2],
|
||||||
|
Reference in New Issue
Block a user