コード例 #1
0
ファイル: AddHoleTool.cs プロジェクト: tomleetv/gsTools
        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
ファイル: ReprojectTool.cs プロジェクト: tomleetv/gsTools
        public override void Setup()
        {
            targetSceneToObjUnitScale = SceneTransforms.SceneToObject(ReprojectTargetSO, 1.0f);

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

            base.Setup();
        }