TopoDS_Shape shape = ... ; // Some shape if (shape.ShapeType() == TopAbs_COMPOUND) { // Do something if the shape is a compound, a collection of other shapes }
TopoDS_Sphere sphere; BRepPrimAPI_MakeSphere sphereMaker(gp::XOY(), 10.0); sphere = sphereMaker.Shape();This code snippet shows how to create a sphere shape using the BRepPrimAPI_MakeSphere function. The `gp::XOY()` parameter specifies the center point of the sphere, and 10.0 specifies the radius. The resulting shape is assigned to the `sphere` variable, which is an instance of the TopoDS_Shape class. Package Library: OpenCASCADE Technology library.