예제 #1
0
파일: CSG.cs 프로젝트: BioFluidix/CSharpCSG
        /// <summary>
        /// Returns a csg consisting of the polygons of this csg and the specified csg.
        ///
        /// The purpose of this method is to allow fast union operations for objects that do not intersect.
        ///
        /// </summary>
        ///
        /// <p>
        /// <b>WARNING:</b> this method does not apply the csg algorithms. Therefore, please ensure that this csg and the
        /// specified csg do not intersect.
        ///
        /// <param name="csg">csg</param>
        ///
        /// <returns>a csg consisting of the polygons of this csg and the specified csg</returns>
        ///
        public CSG dumbUnion(CSG csg)
        {
            CSG result = this.clone();
            CSG other  = csg.clone();

            result.polygons.AddRange(other.polygons);

            return(result);
        }
예제 #2
0
파일: CSG.cs 프로젝트: BioFluidix/CSharpCSG
        private CSG _unionNoOpt(CSG csg)
        {
            Node a = new Node(this.clone().polygons);
            Node b = new Node(csg.clone().polygons);

            a.clipTo(b);
            b.clipTo(a);
            b.invert();
            b.clipTo(a);
            b.invert();
            a.build(b.allPolygons());
            return(CSG.fromPolygons(a.allPolygons()).optimization(getOptType()));
        }