Goop
2026
C++17 SDF kernel with a stable C ABI, driven from C# on .NET Framework 4.8, .NET 8, and .NET 10.
- C++17
- C ABI
- C#
- .NET
- CMake

Goop is a small signed-distance-field kernel. A C++17 core sits behind a stable C ABI. C# drives it through a fluent API on .NET Framework 4.8, .NET 8, and .NET 10. Shapes combine with CSG and smooth blends, mesh with surface nets, and export as binary STL.
Status is experimental. The pipeline works end to end on Windows x64. The shape vocabulary is still small: a sphere, translation, union, intersection, subtraction, and smooth union.
Implemented
- Sphere primitive with translation.
- CSG union, intersection, and subtraction.
- Smooth union with a blend radius, so surfaces melt instead of leaving a crease.
- Single-point and batch distance evaluation in one native call.
- Surface-nets meshing with progress reporting and cancellation. Output is watertight and wound consistently.
- Binary STL export.
- Narrow C ABI: reference-counted handles, SafeHandle ownership, exception-safe callbacks, and an ABI version check on first use.
- One NuGet package that ships the native DLL for all three target frameworks. A separate project consumes the packed
.nupkgthe way an outside caller would.
Architecture
consumer app
↓
Goop.dll C#, fluent API
↓ P/Invoke
goop.h C ABI
↓
goop_native C++17 SDF graph and surface-nets mesher
The C boundary is the product surface. Everything above it may be C#. Everything below it may be C++. The line itself is C.
The C++ core knows nothing about the ABI. api.cpp is the only export file. It maps handles to objects, turns exceptions into status codes, and validates arguments.
Shape expressions are a DAG, not a tree. Nodes are intrusively reference counted so shared subexpressions are not copied. Native code never returns memory the caller must free. The caller allocates buffers. Native code only fills them.
Limits
- Only Windows x64 is supported end to end.
- Only a sphere and translation exist as primitives and transforms. Box, torus, cylinder, rotation, and scale are not implemented.
ToMeshneeds the caller to supply a box that contains the shape.- Averaging edge crossings rounds off sharp CSG features.
- The mesher evaluates every grid sample, including deep interior and far exterior.
- Releasing a deeply nested expression recurses once per level.
Figures
