1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-17 04:04:16 +02:00

use m_transpose

This commit is contained in:
Justin Lin
2022-05-07 12:20:16 +08:00
parent 6106f1fc56
commit c5ac23200b
3 changed files with 17 additions and 9 deletions

View File

@@ -9,6 +9,8 @@
**/
use <_impl/_tri_delaunay_impl.scad>;
use <../matrix/m_transpose.scad>;
use <tri_delaunay_shapes.scad>;
use <tri_delaunay_indices.scad>;
use <tri_delaunay_voronoi.scad>;
@@ -17,8 +19,9 @@ use <tri_delaunay_voronoi.scad>;
function tri_delaunay(points, ret = "TRI_INDICES") =
let(
_indices_hash = function(indices) indices[3],
xs = [for(p = points) p.x],
ys = [for(p = points) p.y],
transposed = m_transpose(points),
xs = transposed[0],
ys = transposed[1],
max_x = max(xs),
min_x = min(xs),
max_y = max(ys),

View File

@@ -8,11 +8,14 @@
*
**/
module vrn2_from(points, spacing = 1, r = 0, delta = 0, chamfer = false, region_type = "square") {
xs = [for(p = points) p.x];
ys = [for(p = points) abs(p.y)];
use <../matrix/m_transpose.scad>;
region_size = max([(max(xs) - min(xs) / 2), (max(ys) - min(ys)) / 2]);
module vrn2_from(points, spacing = 1, r = 0, delta = 0, chamfer = false, region_type = "square") {
transposed = m_transpose(points);
xs = transposed[0];
ys = transposed[1];
region_size = max([max(xs) - min(xs), max(ys) - min(ys)]);
half_region_size = 0.5 * region_size;
offset_leng = spacing * 0.5 + half_region_size;

View File

@@ -9,13 +9,15 @@
**/
use <../__comm__/__angy_angz.scad>;
use <../matrix/m_transpose.scad>;
// slow but workable
module vrn3_from(points, spacing = 1) {
xs = [for(p = points) p.x];
ys = [for(p = points) abs(p.y)];
zs = [for(p = points) abs(p.z)];
transposed = m_transpose(points);
xs = transposed[0];
ys = transposed[1];
zs = transposed[2];
space_size = max([max(xs) - min(xs), max(ys) - min(ys), max(zs) - min(zs)]);
half_space_size = 0.5 * space_size;