
OCCT
Open Source C++ 3D Modeling & Simulation Platform
Build Parametric 3D Models, Simulate Physics & Visualize CAD Data via Open Source C++ Library.
What is OCCT?
Open CASCADE Technology (OCCT) is a powerful open-source C++ software development platform for 3D CAD, CAM, and CAE applications. It provides comprehensive libraries for geometric modeling, mesh generation, data exchange (STEP, IGES, STL), visualization, and simulation. Designed for high-precision engineering and manufacturing workflows, OCCT enables developers to build robust parametric modeling tools, CAD viewers, and simulation applications with industry-standard capabilities.
The library supports advanced solid modeling operations like Boolean operations, fillets, chamfers, and sweeps, along with surface modeling, NURBS geometry, and parametric feature modeling. OCCT’s modular architecture includes dedicated toolkits for topology, geometry, visualization, data exchange, and application framework, making it ideal for complex engineering software development. With active community support and regular releases, OCCT serves as the foundation for numerous commercial and research-grade 3D applications worldwide.
Getting Started with OCCT
OCCT is distributed as open-source C++ libraries and can be installed via source build or precompiled binaries. The easiest way to start is by downloading the latest release from the [OCCT GitHub](https://github.com/Open-Cascade-SAS/OCCT) repository. For Linux users, many distributions provide OCCT packages via their package managers (e.g., `apt install libocct-dev` on Ubuntu). Windows developers can use prebuilt binaries or compile from source using CMake and Visual Studio. The official documentation includes step-by-step build guides for all supported platforms.
Install OCCT via Package Manager (Ubuntu/Debian)
sudo apt update
sudo apt install libocct-dev libocct-data-exchange-dev libocct-visualization-devBoolean Operations & Solid Modeling
OCCT provides robust Boolean operations (union, intersection, subtraction) for 3D solids, enabling complex shape creation from basic primitives. Its topology kernel supports advanced features like fillets, chamfers, holes, and ribs with high precision. Developers can create parametric features using C++ APIs and integrate them into CAD workflows. The library handles topological data structures efficiently, supporting both B-Rep and constructive solid geometry (CSG) modeling approaches. This makes OCCT ideal for developing engineering applications requiring precise geometric computations and feature-based modeling.
Perform Boolean Union on Two Solids via C++
TopoDS_Shape box1 = BRepPrimAPI_MakeBox(10, 10, 10);
TopoDS_Shape box2 = BRepPrimAPI_MakeBox(20, 5, 5);
BRepAlgoAPI_Fuse fuseOp(box1, box2);
if (fuseOp.IsDone()) {
TopoDS_Shape result = fuseOp.Shape();
// Save or visualize result
}Data Exchange (STEP & IGES)
OCCT includes comprehensive data exchange modules supporting ISO-standard formats like STEP (AP203/AP214) and IGES. These modules enable importing and exporting CAD models while preserving geometry, topology, metadata, and product structure. The STEP reader/writer supports full AP214 compliance for automotive and mechanical design data. Developers can programmatically process imported models, extract faces/edges, modify geometry, and re-export in different formats. This interoperability is crucial for CAD collaboration across different software ecosystems and ensures seamless integration into existing design workflows.
Import STEP File and Export as STL via C++
Handle(STEPCAFControl_Reader) reader = new STEPCAFControl_Reader();
IFSelect_ReturnStatus status = reader->ReadFile("model.step");
if (status == IFSelect_RetDone) {
Handle(TDocStd_Document) doc;
reader->Transfer(doc);
// Export to STL
STEPCAFControl_Writer writer;
writer.Write("output.stl");
}3D Visualization & Rendering
OCCT’s visualization toolkit provides powerful 3D rendering capabilities with support for hardware-accelerated OpenGL, ray tracing, and advanced lighting. Developers can build interactive CAD viewers with selection, highlighting, and navigation tools. The toolkit includes classes for 3D view management, scene graph handling, and custom rendering pipelines. Features like anti-aliasing, transparency, and wireframe/hidden-line display modes ensure professional-quality visualization. This makes OCCT suitable for developing engineering visualization tools, virtual reality applications, and simulation result browsers with real-time performance.
Create Interactive 3D Viewer with OCCT
Handle(V3d_Viewer) aViewer = new V3d_Viewer();
Handle(AIS_InteractiveContext) aContext = new AIS_InteractiveContext(aViewer);
Handle(AIS_Shape) anActor = new AIS_Shape(aShape);
aContext->Display(anActor, Standard_True);
// Enable rotation, zoom, pan
aViewer->InitActiveView();
aViewer->ActiveView()->SetDegenerateModeOn();Mesh Generation & Analysis
OCCT includes mesh generation tools that convert B-Rep models into triangulated meshes for simulation and visualization. The Mesh module supports adaptive meshing with control over edge and face tessellation accuracy. Developers can generate finite element meshes for CAE analysis, compute mesh quality metrics, and perform mesh operations like refinement and smoothing. The library also provides tools for mesh data exchange (STL, OBJ) and integration with external FEM solvers. This capability bridges CAD design and simulation workflows, enabling end-to-end development of engineering analysis applications.
Generate Mesh from B-Rep Shape via C++
BRepMesh_IncrementalMesh aMesh(aShape, 0.01);
// Access mesh data
TopExp_Explorer anExp(aShape, TopAbs_FACE);
for (; anExp.More(); anExp.Next()) {
TopoDS_Face aFace = TopoDS::Face(anExp.Current());
Handle(Poly_Triangulation) aTriangulation =
BRep_Tool::Triangulation(aFace, aLoc);
if (!aTriangulation.IsNull()) {
// Process triangulation nodes and triangles
}
}