How to install PicoGK and run your first model on Windows or macOS.
| Requirement | Version | Notes |
|---|---|---|
| .NET SDK | 9.0 or later | The example project targets net9.0 |
| Operating System | Windows x64 or macOS arm64 | Native runtime is bundled in the NuGet package for these platforms |
| Disk space | ~500 MB | For .NET SDK, NuGet cache, and PicoGK runtime |
This fork commits the native binaries for win-x64 and osx-arm64 under runtime/native/, so there is no separate runtime install on those two platforms. (Upstream PicoGK ships them through the PicoGK NuGet package instead.) For Linux or other architectures you must build the PicoGKRuntime C++ library yourself and point src/PicoGK__Config.cs at it.
Windows (PowerShell):
winget install Microsoft.DotNet.SDK.9macOS (Homebrew):
brew install --cask dotnet-sdkVerify:
dotnet --version
Clone or open this repo, then from the repo root:
dotnet run --project examples\PicoGKExamples.csprojThe examples project builds against the local kernel source in src/ and loads the native runtime committed under runtime/native/, so no NuGet download of PicoGK is involved. The viewer window opens and runs whichever task is wired up in examples/Program.cs, currently GyroidCylinder.Task (a gyroid TPMS infill inside a loaded cylinder, voxel size 0.3 mm). An STL file is written to your log folder, by default C:\Users\<you>\ on Windows or ~/Documents/ on macOS and Linux. The PicoGK log file lands in the same folder.
Close the viewer window to exit.
PicoGK/
├── README.md
├── LICENSE Apache-2.0, unmodified
├── NOTICE Fork disclosure + third-party binary attribution
├── CHANGELOG.md How this fork diverges from upstream
├── .gitmodules Submodule manifest (vendor/ entries)
├── src/ Kernel C# source
│ ├── PicoGK.csproj NuGet package source
│ ├── PicoGK_*.cs Public API (one file per topic area)
│ ├── PicoGK__Interop.cs P/Invoke bindings to native runtime
│ └── PicoGK__Config.cs Native library name / path
├── runtime/ Bundled native binaries + viewer env
│ ├── native/win-x64/ .dll for Windows
│ ├── native/osx-arm64/ .dylib for macOS
│ └── ViewerEnvironment/ HDR environments (Default, SkyBlue, etc.)
├── examples/ Your local examples project
│ ├── Program.cs Entry point, picks which Task() to run
│ ├── PicoGKExamples.csproj
│ ├── PicoGK_Examples.sln
│ └── 01_GettingStarted/
├── projects/ Your own build projects go here
├── vendor/ Submodules, every leap71 repo (see docs/vendor.md)
│ ├── PicoGKRuntime/ C++ native runtime source
│ ├── PicoGKInstaller/ Non-NuGet install scripts
│ ├── PicoGK_Examples/ Upstream reference examples
│ ├── PicoGKUnitTests/ Regression tests
│ ├── PicoGK_SimulationExample/ Simulation coupling example
│ ├── LEAP71_ShapeKernel/ Higher-level primitives + lofts + airfoils
│ ├── LEAP71_LatticeLibrary/ TPMS / gyroid / strut lattices
│ ├── LEAP71_HelixHeatX/ Helical heat exchanger reference
│ ├── LEAP71_RoverWheel/ Rover wheel reference
│ └── LEAP71_QuasiCrystals/ Quasicrystal lattice generator
└── docs/ This documentation
After cloning, populate the submodules:
git submodule update --init --recursiveOr clone with --recursive from the start:
git clone --recursive https://github.com/<your-fork>/PicoGK.gitCreate a new file under examples/01_GettingStarted/MyFirstModel.cs:
using PicoGK;
using System.Numerics;
namespace PicoGKExamples
{
class MyFirstModel
{
public static void Task()
{
Voxels body = Voxels.voxSphere(Vector3.Zero, 30f);
Voxels hole = Voxels.voxSphere(Vector3.Zero, 25f);
Voxels shell = body - hole;
Library.oViewer().Add(shell);
Mesh msh = new Mesh(shell);
msh.SaveToStlFile(Path.Combine(Library.strLogFolder, "MyFirstModel.stl"));
}
}
}Edit examples/Program.cs to point at your task:
Library.Go(0.5f, MyFirstModel.Task);Run it:
dotnet run --project examples\PicoGKExamples.csprojEvery PicoGK program calls Library.Go(voxelSize, taskFn) exactly once. It:
- Loads the native runtime
- Initializes log file in
strLogFolder - Creates the singleton viewer
- Spawns a worker thread and runs your
Task()inside it - Pumps the viewer's main loop on the original thread
- Exits when you close the viewer
Voxel size is in millimetres and is global. Smaller = finer detail + more memory. Typical values:
1.0f: fast, low-resolution previews0.5f: default for most parts0.3f: printable detail at typical FDM nozzle scale0.1f: very high resolution, expect minutes per operation on large parts
examples/PicoGKExamples.csproj already references the kernel by project, not by NuGet package:
<ItemGroup>
<ProjectReference Include="..\src\PicoGK.csproj" />
</ItemGroup>That is deliberate in this fork: it is what lets a local edit to the C# kernel source rebuild straight into your examples, and it is how ANVIL consumes this repository from a sibling checkout. The native runtime loads from runtime/native/ via the library name in src/PicoGK__Config.cs.
To use the official upstream package instead, swap the <ProjectReference> for <PackageReference Include="PicoGK" Version="..." />. Note that the upstream package is on the 2.x line while this fork sits on 1.7.7.5, so the APIs may not match.
| Symptom | Cause | Fix |
|---|---|---|
DllNotFoundException: picogk.1.7 |
Native runtime missing | On Linux: build PicoGKRuntime. On Win/macOS: re-restore NuGet packages. |
| Viewer opens, immediately closes | Task() threw an exception |
Check console / log file in Documents\PicoGK\Logs\ |
Out of memory on new Mesh(vox) |
Voxel size too small for part | Increase voxel size, or trim the bounding box first |
| "Could not load file or assembly" on macOS | Wrong architecture (x86_64 vs arm64) | Confirm you're on Apple Silicon; Intel Macs are not supported by the bundled runtime |
| Can't find the STL output | Default Library.strLogFolder is user home on Windows (C:\Users\<you>), ~/Documents on Unix |
Pass an explicit strLogFolder to Library.Go(...) if you want a specific folder |
- PicoGK Overview (what the kernel is, who built it, what it's for)
- API Reference (every public class and method)
- Coding for Engineers (book-length tutorial that builds real parts)
- Design Philosophy (why the API is small on purpose)
- LEAP 71 Projects (what is being built with this kernel)
- Vendored Submodules Guide (what each
vendor/library does and how to use it)