From 363f01c84f27dd344b51b708c280a88c4f0cc693 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Fri, 13 Mar 2020 09:44:03 +0800 Subject: [PATCH] the src lt is sorted, so set sorted param to true --- src/experimental/_impl/_mz_hamiltonian_impl.scad | 8 ++++---- src/experimental/_impl/_px_surround_impl.scad | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/experimental/_impl/_mz_hamiltonian_impl.scad b/src/experimental/_impl/_mz_hamiltonian_impl.scad index c4eec0bb..3866deef 100644 --- a/src/experimental/_impl/_mz_hamiltonian_impl.scad +++ b/src/experimental/_impl/_mz_hamiltonian_impl.scad @@ -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; diff --git a/src/experimental/_impl/_px_surround_impl.scad b/src/experimental/_impl/_px_surround_impl.scad index 1913bf1f..96cae427 100644 --- a/src/experimental/_impl/_px_surround_impl.scad +++ b/src/experimental/_impl/_px_surround_impl.scad @@ -2,10 +2,10 @@ use ; 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;