NetOcc
Open CASCADE Technology (OCCT) 8.0.1 for .NET: generated C# bindings with OCCT's names unchanged, one namespace per OCCT package (OCC.Core.gp, OCC.Core.BRepPrimAPI). One AnyCPU package for .NET Framework 3.5 and 4.5+, .NET 6, 8 and 10, with natives for win-x64, win-x86, linux-x64 and osx-arm64, and OCCT's documentation in IntelliSense.
dotnet add package NetOcc
// a 60 x 40 x 20 block with a hole through it
var block = new BRepPrimAPI_MakeBox(60, 40, 20).Shape();
var axis = new gp_Ax2(new gp_Pnt(30, 20, -1), new gp_Dir(0, 0, 1));
var hole = new BRepPrimAPI_MakeCylinder(axis, 8, 22).Shape();
var part = new BRepAlgoAPI_Cut(block, hole).Shape();
// round every edge by 1.5, each once
var edges = new TopTools_IndexedMapOfShape();
TopExp.MapShapes(part, TopAbs_ShapeEnum.TopAbs_EDGE, edges);
var fillet = new BRepFilletAPI_MakeFillet(part);
foreach (var edge in edges)
{
fillet.Add(1.5, TopoDS.Edge(edge));
}
var rounded = fillet.Shape();
// its volume, then the part as STEP and, triangulated, as STL
var properties = new GProp_GProps();
BRepGProp.VolumeProperties(rounded, properties);
Console.WriteLine($"volume: {properties.Mass():F1} mm³");
var step = new STEPControl_Writer();
step.Transfer(rounded, STEPControl_StepModelType.STEPControl_AsIs);
step.Write("part.step");
new BRepMesh_IncrementalMesh(rounded, 0.1);
new StlAPI_Writer().Write(rounded, "part.stl");
Covered
All 362 packages of OCCT's FoundationClasses, ModelingData, ModelingAlgorithms, ApplicationFramework and DataExchange modules, and of Visualization's TKService, TKV3d, TKOpenGl (the driver) and TKMeshVS: geometry, topology, booleans, fillets, offsets, sweeps, shape healing, meshing, HLR, OCAF and XCAF documents, STEP, IGES, STL, glTF, OBJ, PLY and VRML, and 3D views.
Where to go
| Start | Introduction: OCCT's layers and packages. Getting started: install, a first part. |
| Guide | Geometry, Topology, Modeling, Analysis and repair, Meshing, Files, Assemblies, Documents, 3D views |
| Concepts | From C++ to C#, Object lifetimes, Errors, How NetOcc works |
| Reference | Class index: every type, linked to OCCT's reference manual. Platforms, Building from source, Troubleshooting |
| Development | Design decisions, Pitfalls, Licensing, Skipped members |
Every example on this site is compiled against the package on each change and run, except the on-screen 3D views, which need a window and a GPU.