Beispiel #1
0
        public static Mesh Subtract(this Mesh a, Mesh b, Action <string, double> reporter, CancellationToken cancellationToken)
        {
            if (a.Faces.Count == 0)
            {
                return(b);
            }

            if (b.Faces.Count == 0)
            {
                return(a);
            }

            return(BooleanProcessing.Do(a,
                                        Matrix4X4.Identity,
                                        // other mesh
                                        b,
                                        Matrix4X4.Identity,
                                        // operation type
                                        CsgModes.Subtract,
                                        ProcessingModes.Polygons,
                                        ProcessingResolution._64,
                                        ProcessingResolution._64,
                                        // reporting
                                        null,
                                        1,
                                        0,
                                        null,
                                        cancellationToken));
        }
Beispiel #2
0
        public static (Mesh subtract, Mesh intersect) IntersectAndSubtract(Mesh a, Mesh b, Action <string, double> reporter, CancellationToken cancellationToken)
        {
            var subtract = BooleanProcessing.Do(a,
                                                Matrix4X4.Identity,
                                                // other mesh
                                                b,
                                                Matrix4X4.Identity,
                                                // operation type
                                                CsgModes.Subtract,
                                                ProcessingModes.Polygons,
                                                ProcessingResolution._64,
                                                ProcessingResolution._64,
                                                // reporting
                                                null,
                                                1,
                                                0,
                                                null,
                                                cancellationToken);

            var intersect = BooleanProcessing.Do(a,
                                                 Matrix4X4.Identity,
                                                 // other mesh
                                                 b,
                                                 Matrix4X4.Identity,
                                                 // operation type
                                                 CsgModes.Intersect,
                                                 ProcessingModes.Polygons,
                                                 ProcessingResolution._64,
                                                 ProcessingResolution._64,
                                                 // reporting
                                                 null,
                                                 1,
                                                 0,
                                                 null,
                                                 cancellationToken);

            return(subtract, intersect);
        }