xzw 3 tahun lalu
induk
melakukan
1ad2f54eb5
1 mengubah file dengan 17 tambahan dan 1 penghapusan
  1. 17 1
      main.js

+ 17 - 1
main.js

@@ -208527,7 +208527,7 @@ and limitations under the License.
            }
        }
        , */
-        t.prototype.createCroppingJobDto = function() {//改成每个数据集都传一个矩阵
+        /* t.prototype.createCroppingJobDto = function() {//改成每个数据集都传一个矩阵,但是只能适用于分成多个文件下载,因为没有传递点云之间相对变换的信息
              
             return { 
                 transformation_matrix: this.selectedDatasets.map((t)=>{
@@ -208539,6 +208539,22 @@ and limitations under the License.
                 aabb: "b-0.5 -0.5 -0.5 0.5 0.5 0.5" //剪裁空间( 所有点在乘上这个矩阵后, 还能落在 1 * 1 * 1的box内的点就是所裁剪的
                
             }
+        } */
+        t.prototype.createCroppingJobDto = function() {//改成每个数据集都传一个矩阵, 剪裁空间和模型变换独立开
+            var box = this.ViewService.mainView.getVolumeClippingLayer().getBoxFrame()
+            var getMatrix = (m)=>{
+                return (new o.Matrix4).copy(m).transpose()
+            }
+            return { 
+                transformation_matrix: this.selectedDatasets.map((t)=>{
+                    return {
+                        id: t.id,
+                        matrix: getMatrix(t.m2w_.elements)
+                    } 
+                }) ,
+                aabb: "b-0.5 -0.5 -0.5 0.5 0.5 0.5" //剪裁空间原始范围( 所有点在乘上这个矩阵后, 还能落在 1 * 1 * 1的box内的点就是所裁剪的
+                aabbMatrix: getMatrix(box.matrixWorld.elements)
+            }
         }
         ,
        t.prototype.getTransformationMatrix = function(t) {//点云截取