示例#1
0
        void initialize_cut_op()
        {
            if (MeshSourceOp != null)
            {
                return;
            }

            MeshSourceOp = new WrapDMeshSourceOp()
            {
                MeshSourceF    = () => { return(InputMeshSO.Mesh); },
                SpatialSourceF = () => { return(InputMeshSO.Spatial); }
            };
            CutOp = new CutPolygonHoleOp()
            {
                MeshSource = MeshSourceOp
            };
            ComputeOp = new ThreadedMeshComputeOp()
            {
                MeshSource = CutOp
            };

            if (CutPreviewMaterial == null)
            {
                CutPreviewMaterial = SOMaterial.CreateFlatShaded("add_hole_cut", Colorf.DimGrey);
            }

            CutPreviewSO = new DMeshSO()
            {
                EnableSpatial = false
            };
            CutPreviewSO.Create(new DMesh3(), CutPreviewMaterial);
            Scene.AddSceneObject(CutPreviewSO);
            CutPreviewSO.SetLocalFrame(InputMeshSO.GetLocalFrame(CoordSpace.ObjectCoords), CoordSpace.ObjectCoords);
            CutPreviewSO.SetLocalScale(InputMeshSO.GetLocalScale());
        }
示例#2
0
        public override void Setup()
        {
            targetSceneToObjUnitScale = SceneTransforms.SceneToObject(ReprojectTargetSO, 1.0f);

            ReprojectTargetMeshOp = new WrapDMeshSourceOp()
            {
                MeshSourceF    = () => { return(ReprojectTargetSO.Mesh); },
                SpatialSourceF = () => { return(ReprojectTargetSO.Spatial); }
            };

            base.Setup();
        }