1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-13 18:24:28 +02:00
This commit is contained in:
Justin Lin
2021-01-07 15:57:29 +08:00
parent 5411a012ea
commit f71b151e96

View File

@@ -50,8 +50,8 @@ function _case4_isolines(cell_pts, threshold) = [
]; ];
function _case5_isolines(cell_pts, threshold) = function _case5_isolines(cell_pts, threshold) =
let(mdpz = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4) let(center_p_z = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4)
mdpz >= threshold ? center_p_z >= threshold ?
[ [
[interpolated_pt(cell_pts[0], cell_pts[1], threshold), interpolated_pt(cell_pts[1], cell_pts[2], threshold)], [interpolated_pt(cell_pts[0], cell_pts[1], threshold), interpolated_pt(cell_pts[1], cell_pts[2], threshold)],
[interpolated_pt(cell_pts[0], cell_pts[3], threshold), interpolated_pt(cell_pts[2], cell_pts[3], threshold)] [interpolated_pt(cell_pts[0], cell_pts[3], threshold), interpolated_pt(cell_pts[2], cell_pts[3], threshold)]
@@ -75,8 +75,8 @@ function _case8_isolines(cell_pts, threshold) = _case7_isolines(cell_pts, thresh
function _case9_isolines(cell_pts, threshold) = _case6_isolines(cell_pts, threshold); function _case9_isolines(cell_pts, threshold) = _case6_isolines(cell_pts, threshold);
function _case10_isolines(cell_pts, threshold) = function _case10_isolines(cell_pts, threshold) =
let(mdpz = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4) let(center_p_z = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4)
mdpz >= threshold ? center_p_z >= threshold ?
[ [
[interpolated_pt(cell_pts[0], cell_pts[1], threshold), interpolated_pt(cell_pts[0], cell_pts[3], threshold)], [interpolated_pt(cell_pts[0], cell_pts[1], threshold), interpolated_pt(cell_pts[0], cell_pts[3], threshold)],
[interpolated_pt(cell_pts[1], cell_pts[2], threshold), interpolated_pt(cell_pts[2], cell_pts[3], threshold)] [interpolated_pt(cell_pts[1], cell_pts[2], threshold), interpolated_pt(cell_pts[2], cell_pts[3], threshold)]
@@ -565,8 +565,8 @@ function _case2201_isobands(cell_pts, lower, upper) =
// Saddles // Saddles
function _case2020_isobands(cell_pts, lower, upper) = function _case2020_isobands(cell_pts, lower, upper) =
let(mdpz = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4) let(center_p_z = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4)
mdpz < lower ? [ center_p_z < lower ? [
[ [
interpolated_pt(cell_pts[0], cell_pts[1], lower), interpolated_pt(cell_pts[0], cell_pts[1], lower),
interpolated_pt(cell_pts[1], cell_pts[2], lower), interpolated_pt(cell_pts[1], cell_pts[2], lower),
@@ -579,7 +579,7 @@ function _case2020_isobands(cell_pts, lower, upper) =
interpolated_pt(cell_pts[2], cell_pts[3], upper), interpolated_pt(cell_pts[2], cell_pts[3], lower) interpolated_pt(cell_pts[2], cell_pts[3], upper), interpolated_pt(cell_pts[2], cell_pts[3], lower)
] ]
] : ] :
mdpz >= lower && mdpz < upper ? [ center_p_z >= lower && center_p_z < upper ? [
[ [
interpolated_pt(cell_pts[0], cell_pts[1], lower), interpolated_pt(cell_pts[0], cell_pts[1], lower),
interpolated_pt(cell_pts[0], cell_pts[3], lower), interpolated_pt(cell_pts[0], cell_pts[3], lower),
@@ -606,8 +606,8 @@ function _case2020_isobands(cell_pts, lower, upper) =
]; ];
function _case0202_isobands(cell_pts, lower, upper) = function _case0202_isobands(cell_pts, lower, upper) =
let(mdpz = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4) let(center_p_z = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4)
mdpz < lower ? [ center_p_z < lower ? [
[ [
interpolated_pt(cell_pts[0], cell_pts[1], upper), interpolated_pt(cell_pts[0], cell_pts[1], upper),
interpolated_pt(cell_pts[0], cell_pts[3], upper), interpolated_pt(cell_pts[0], cell_pts[3], upper),
@@ -621,7 +621,7 @@ function _case0202_isobands(cell_pts, lower, upper) =
interpolated_pt(cell_pts[1], cell_pts[2], upper) interpolated_pt(cell_pts[1], cell_pts[2], upper)
] ]
] : ] :
mdpz >= lower && mdpz < upper ? [ center_p_z >= lower && center_p_z < upper ? [
[ [
interpolated_pt(cell_pts[0], cell_pts[1], upper), interpolated_pt(cell_pts[0], cell_pts[1], upper),
interpolated_pt(cell_pts[0], cell_pts[3], upper), interpolated_pt(cell_pts[0], cell_pts[3], upper),
@@ -648,8 +648,8 @@ function _case0202_isobands(cell_pts, lower, upper) =
]; ];
function _case0101_isobands(cell_pts, threshold) = function _case0101_isobands(cell_pts, threshold) =
let(mdpz = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4) let(center_p_z = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4)
mdpz < threshold ? [ center_p_z < threshold ? [
[ [
[cell_pts[0][0], cell_pts[0][1], cell_pts[0][2]], [cell_pts[0][0], cell_pts[0][1], cell_pts[0][2]],
interpolated_pt(cell_pts[0], cell_pts[3], threshold), interpolated_pt(cell_pts[0], cell_pts[3], threshold),
@@ -672,8 +672,8 @@ function _case0101_isobands(cell_pts, threshold) =
]; ];
function _case1010_isobands(cell_pts, threshold) = function _case1010_isobands(cell_pts, threshold) =
let(mdpz = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4) let(center_p_z = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4)
mdpz < threshold ? [ center_p_z < threshold ? [
[ [
interpolated_pt(cell_pts[0], cell_pts[1], threshold), interpolated_pt(cell_pts[0], cell_pts[1], threshold),
interpolated_pt(cell_pts[1], cell_pts[2], threshold), interpolated_pt(cell_pts[1], cell_pts[2], threshold),
@@ -696,8 +696,8 @@ function _case1010_isobands(cell_pts, threshold) =
]; ];
function _case2121_isobands(cell_pts, threshold) = function _case2121_isobands(cell_pts, threshold) =
let(mdpz = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4) let(center_p_z = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4)
mdpz < threshold ? [ center_p_z < threshold ? [
[ [
[cell_pts[0][0], cell_pts[0][1], cell_pts[0][2]], [cell_pts[0][0], cell_pts[0][1], cell_pts[0][2]],
interpolated_pt(cell_pts[0], cell_pts[3], threshold), interpolated_pt(cell_pts[0], cell_pts[3], threshold),
@@ -720,8 +720,8 @@ function _case2121_isobands(cell_pts, threshold) =
]; ];
function _case1212_isobands(cell_pts, threshold) = function _case1212_isobands(cell_pts, threshold) =
let(mdpz = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4) let(center_p_z = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4)
mdpz < threshold ? [ center_p_z < threshold ? [
[ [
interpolated_pt(cell_pts[0], cell_pts[3], threshold), interpolated_pt(cell_pts[0], cell_pts[3], threshold),
[cell_pts[3][0], cell_pts[3][1], cell_pts[3][2]], [cell_pts[3][0], cell_pts[3][1], cell_pts[3][2]],
@@ -744,8 +744,8 @@ function _case1212_isobands(cell_pts, threshold) =
]; ];
function _case2120_isobands(cell_pts, lower, upper) = function _case2120_isobands(cell_pts, lower, upper) =
let(mdpz = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4) let(center_p_z = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4)
mdpz < upper ? [ center_p_z < upper ? [
[ [
interpolated_pt(cell_pts[0], cell_pts[3], lower), interpolated_pt(cell_pts[0], cell_pts[3], lower),
interpolated_pt(cell_pts[0], cell_pts[3], upper), interpolated_pt(cell_pts[0], cell_pts[3], upper),
@@ -770,8 +770,8 @@ function _case2120_isobands(cell_pts, lower, upper) =
]; ];
function _case0102_isobands(cell_pts, lower, upper) = function _case0102_isobands(cell_pts, lower, upper) =
let(mdpz = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4) let(center_p_z = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4)
mdpz < lower ? [ center_p_z < lower ? [
[ [
interpolated_pt(cell_pts[0], cell_pts[3], upper), interpolated_pt(cell_pts[0], cell_pts[3], upper),
interpolated_pt(cell_pts[0], cell_pts[3], lower), interpolated_pt(cell_pts[0], cell_pts[3], lower),
@@ -796,8 +796,8 @@ function _case0102_isobands(cell_pts, lower, upper) =
]; ];
function _case2021_isobands(cell_pts, lower, upper) = function _case2021_isobands(cell_pts, lower, upper) =
let(mdpz = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4) let(center_p_z = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4)
mdpz < upper ? [ center_p_z < upper ? [
[ [
[cell_pts[0][0], cell_pts[0][1], cell_pts[0][2]], [cell_pts[0][0], cell_pts[0][1], cell_pts[0][2]],
interpolated_pt(cell_pts[0], cell_pts[3], upper), interpolated_pt(cell_pts[0], cell_pts[3], upper),
@@ -822,8 +822,8 @@ function _case2021_isobands(cell_pts, lower, upper) =
]; ];
function _case0201_isobands(cell_pts, lower, upper) = function _case0201_isobands(cell_pts, lower, upper) =
let(mdpz = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4) let(center_p_z = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4)
mdpz < lower ? [ center_p_z < lower ? [
[ [
[cell_pts[0][0], cell_pts[0][1], cell_pts[0][2]], [cell_pts[0][0], cell_pts[0][1], cell_pts[0][2]],
interpolated_pt(cell_pts[0], cell_pts[3], lower), interpolated_pt(cell_pts[0], cell_pts[3], lower),
@@ -848,8 +848,8 @@ function _case0201_isobands(cell_pts, lower, upper) =
]; ];
function _case1202_isobands(cell_pts, lower, upper) = function _case1202_isobands(cell_pts, lower, upper) =
let(mdpz = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4) let(center_p_z = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4)
mdpz < upper ? [ center_p_z < upper ? [
[ [
interpolated_pt(cell_pts[0], cell_pts[3], upper), interpolated_pt(cell_pts[0], cell_pts[3], upper),
interpolated_pt(cell_pts[0], cell_pts[3], lower), interpolated_pt(cell_pts[0], cell_pts[3], lower),
@@ -874,8 +874,8 @@ function _case1202_isobands(cell_pts, lower, upper) =
]; ];
function _case1020_isobands(cell_pts, lower, upper) = function _case1020_isobands(cell_pts, lower, upper) =
let(mdpz = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4) let(center_p_z = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4)
mdpz < lower ? [ center_p_z < lower ? [
[ [
interpolated_pt(cell_pts[0], cell_pts[1], lower), interpolated_pt(cell_pts[0], cell_pts[1], lower),
interpolated_pt(cell_pts[1], cell_pts[2], lower), interpolated_pt(cell_pts[1], cell_pts[2], lower),
@@ -900,8 +900,8 @@ function _case1020_isobands(cell_pts, lower, upper) =
]; ];
function _case0212_isobands(cell_pts, lower, upper) = function _case0212_isobands(cell_pts, lower, upper) =
let(mdpz = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4) let(center_p_z = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4)
mdpz < upper ? [ center_p_z < upper ? [
[ [
interpolated_pt(cell_pts[0], cell_pts[3], upper), interpolated_pt(cell_pts[0], cell_pts[3], upper),
[cell_pts[3][0], cell_pts[3][1], cell_pts[3][2]], [cell_pts[3][0], cell_pts[3][1], cell_pts[3][2]],
@@ -926,8 +926,8 @@ function _case0212_isobands(cell_pts, lower, upper) =
]; ];
function _case2010_isobands(cell_pts, lower, upper) = function _case2010_isobands(cell_pts, lower, upper) =
let(mdpz = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4) let(center_p_z = (cell_pts[0][2] + cell_pts[1][2] + cell_pts[2][2] + cell_pts[3][2]) / 4)
mdpz < lower ? [ center_p_z < lower ? [
[ [
interpolated_pt(cell_pts[0], cell_pts[1], lower), interpolated_pt(cell_pts[0], cell_pts[1], lower),
interpolated_pt(cell_pts[1], cell_pts[2], lower), interpolated_pt(cell_pts[1], cell_pts[2], lower),