Esempio n. 1
0
        /// <summary>
        /// run cutting algorithm
        /// </summary>
        public void Cut(GameObject primitive, bool fillHoles, bool deleteOriginal)
        {
            MeshUtils.Log("Cutting: " + primitive.name);

            var cutter = new MeshCutter();

            // create cutting plane
            var plane = ComputePlane();

            GameObject cut0, cut1;
            GenerationTimeMS = cutter.Cut(primitive, plane, fillHoles, deleteOriginal, out cut0, out cut1);

            if (cut0 != null)
            {
                cut0.AddComponent<DefaultObject>();
                cut1.AddComponent<DefaultObject>();
            }
        }
Esempio n. 2
0
        public void Cut()
        {
            MeshUtils.Log("Cutting: " + cuttingObject.name);

            var cutter = new MeshCutter();

            // create cutting plane
            var plane = ComputePlane();

            ContourData contour;

            GameObject cut0, cut1;
            GenerationTimeMS = cutter.Cut(cuttingObject, plane, triangulateHoles, deleteOriginal, crossSection, out cut0, out cut1, out contour);

            if (cut0 != null)
            {
                cut0.AddComponent<DefaultObject>();
                cut1.AddComponent<DefaultObject>();
            }
        }
Esempio n. 3
0
        /// <summary>
        /// run cutting algorithm
        /// </summary>
        public void Cut(GameObject primitive, bool fillHoles, bool deleteOriginal)
        {
            MeshUtils.Log("Cutting: " + primitive.name);

            var cutter = new MeshCutter();

            // create cutting plane
            var plane = ComputePlane();

            ContourData contour;

            GameObject cut0, cut1;
            GenerationTimeMS = cutter.Cut(primitive, plane, fillHoles, deleteOriginal, crossSection, out cut0, out cut1, out contour);

//            contour.ShowContourDBG(float.MaxValue);
//            contour.CreateGameObject(true);

            if (cut0 != null)
            {
                cut0.AddComponent<DefaultObject>();
                cut1.AddComponent<DefaultObject>();
            }
        }