Boolean Operation
Previous Topic  Next Topic 

 

 

 

 

 

 

Union

 

Cylinder +  Sphere

 

 

 

             // Add Cylinder

            sd3dSolid cylinder = fDrawCtrl1.Document.AddSolidCylinder(new Point3D(0, 0, 0), 100, 200, 28);

            // Add Sphere

            sd3dSolid sphere = fDrawCtrl1.Document.AddSolidSphere(new Point3D(120, 0, 100), 100);

            // Performs a union operation and the resulting solid will be added into the

            // entities collection.

            fDrawCtrl1.Document.AddSolidOpUnion(cylinder, sphere, falsefalse);

 

 

 

Subtraction

 

Cylinder - Sphere

 

 

 

           // Add Cylinder

            sd3dSolid cylinder = fDrawCtrl1.Document.AddSolidCylinder(new Point3D(0, 0, 0), 100, 200, 28);

            // Add Sphere

            sd3dSolid sphere = fDrawCtrl1.Document.AddSolidSphere(new Point3D(120, 0, 100), 100);

            // Performs a Subtraction operation and the resulting solid will be added into the

            // entities collection.

            fDrawCtrl1.Document.AddSolidOpSubtract(cylinder, sphere, falsefalse);

 

 

 

Intersection

 

Cylinder AND Sphere

 

 

 

              // Add Cylinder

            sd3dSolid cylinder = fDrawCtrl1.Document.AddSolidCylinder(new Point3D(0, 0, 0), 100, 200, 28);

            // Add Sphere

            sd3dSolid sphere = fDrawCtrl1.Document.AddSolidSphere(new Point3D(120, 0, 100), 100);

            // Performs an Intersect operation and the resulting solid will be added into the

            // entities collection.

            fDrawCtrl1.Document.AddSolidOpIntersect(cylinder, sphere, falsefalse);