mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-01-17 22:28:16 +01:00
refactored
This commit is contained in:
parent
cccba1515b
commit
f511c281a5
20
src/__private__/__polytransversals.scad
Normal file
20
src/__private__/__polytransversals.scad
Normal file
@ -0,0 +1,20 @@
|
||||
function __polytransversals(transversals) =
|
||||
let(
|
||||
leng_trs = len(transversals),
|
||||
leng_tr = len(transversals[0]),
|
||||
lefts = [
|
||||
for(i = [1:leng_trs - 2])
|
||||
let(tr = transversals[leng_trs - i])
|
||||
tr[0]
|
||||
],
|
||||
rights = [
|
||||
for(i = [1:leng_trs - 2])
|
||||
let(tr = transversals[i])
|
||||
tr[leng_tr - 1]
|
||||
]
|
||||
) concat(
|
||||
transversals[0],
|
||||
rights,
|
||||
__reverse(transversals[leng_trs - 1]),
|
||||
lefts
|
||||
);
|
@ -12,29 +12,10 @@
|
||||
**/
|
||||
|
||||
include <__private__/__reverse.scad>;
|
||||
include <__private__/__polytransversals.scad>;
|
||||
|
||||
module polytransversals(transversals) {
|
||||
leng_trs = len(transversals);
|
||||
leng_tr = len(transversals[0]);
|
||||
|
||||
lefts = [
|
||||
for(i = [1:leng_trs - 2])
|
||||
let(tr = transversals[leng_trs - i])
|
||||
tr[0]
|
||||
];
|
||||
|
||||
rights = [
|
||||
for(i = [1:leng_trs - 2])
|
||||
let(tr = transversals[i])
|
||||
tr[leng_tr - 1]
|
||||
];
|
||||
|
||||
polygon(
|
||||
concat(
|
||||
transversals[0],
|
||||
rights,
|
||||
__reverse(transversals[leng_trs - 1]),
|
||||
lefts
|
||||
)
|
||||
__polytransversals(transversals)
|
||||
);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user