From 6e2929ff9b130b71a002b3cba12e0804c37be95d Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Wed, 29 Dec 2021 18:01:23 -0500 Subject: [PATCH] apply tweak --- transforms.scad | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/transforms.scad b/transforms.scad index c2f51ab..9210a8d 100644 --- a/transforms.scad +++ b/transforms.scad @@ -1380,14 +1380,13 @@ function _apply(transform,points) = assert(datadim==2 || datadim==3,"Data must be 2D or 3D") let( scale = len(transform)==tdim ? 1 : transform[tdim][tdim], - matrix = [for(i=[0:1:tdim]) [for(j=[0:1:datadim-1]) transform[j][i]/scale]] + matrix = [for(i=[0:1:tdim]) [for(j=[0:1:datadim-1]) transform[j][i]]] / scale ) - tdim==datadim - ? [for(p=points) concat(p,1)] * matrix - : tdim == 3 && datadim == 2 ? + tdim==datadim ? [for(p=points) concat(p,1)] * matrix + : tdim == 3 && datadim == 2 ? assert(is_2d_transform(transform), str("Transforms is 3D and acts on Z, but points are 2D")) [for(p=points) concat(p,[0,1])]*matrix - : assert(false, str("Unsupported combination: ",len(transform),"x",len(transform[0])," transform (dimension ",tdim, + : assert(false, str("Unsupported combination: ",len(transform),"x",len(transform[0])," transform (dimension ",tdim, "), data of dimension ",datadim));