1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-05 14:27:45 +02:00

the src lt is sorted, so set sorted param to true

This commit is contained in:
Justin Lin
2020-03-13 09:44:03 +08:00
parent 8f7149a550
commit 363f01c84f
2 changed files with 8 additions and 8 deletions

View File

@@ -23,10 +23,10 @@ function _mz_hamiltonian_upper_right(x, y) =
function _mz_hamiltonian_corner_value(dots, x, y) =
let(
c1 = has(dots, [x, y]) ? 1 : 0,
c2 = has(dots, [x, y + 1]) ? 2 : 0,
c3 = has(dots, [x + 1, y + 1]) ? 4 : 0,
c4 = has(dots, [x + 1, y]) ? 8 : 0
c1 = has(dots, [x, y], sorted = true) ? 1 : 0,
c2 = has(dots, [x, y + 1], sorted = true) ? 2 : 0,
c3 = has(dots, [x + 1, y + 1], sorted = true) ? 4 : 0,
c4 = has(dots, [x + 1, y], sorted = true) ? 8 : 0
)
c1 + c2 + c3 + c4;

View File

@@ -2,10 +2,10 @@ use <util/has.scad>;
function _px_surround_corner_value(pts, x, y) =
let(
c1 = has(pts, [x, y - 1]) || has(pts, [x - 1, y - 1]) ? 1 : 0,
c2 = has(pts, [x - 1, y]) || has(pts, [x - 1, y + 1]) ? 2 : 0,
c3 = has(pts, [x, y + 1]) || has(pts, [x + 1, y + 1]) ? 4 : 0,
c4 = has(pts, [x + 1, y]) || has(pts, [x + 1, y - 1]) ? 8 : 0
c1 = has(pts, [x, y - 1], sorted = true) || has(pts, [x - 1, y - 1], sorted = true) ? 1 : 0,
c2 = has(pts, [x - 1, y], sorted = true) || has(pts, [x - 1, y + 1], sorted = true) ? 2 : 0,
c3 = has(pts, [x, y + 1], sorted = true) || has(pts, [x + 1, y + 1], sorted = true) ? 4 : 0,
c4 = has(pts, [x + 1, y], sorted = true) || has(pts, [x + 1, y - 1], sorted = true) ? 8 : 0
)
c1 + c2 + c3 + c4;