How leap71/picogk works
Project type and purpose
• PicoGK is primarily a geometry-kernel library written in C#, paired with a C++ runtime (PicoGKRuntime) that wraps OpenVDB.
• It exposes core geometry operations (meshes, voxels, fields) via a “PicoGKRuntime” interop layer, provides a CLI tool and an interactive OpenGL viewer (using GLFW), and ships examples illustrating API usage.
File structure
• Top-level directories:
• Documentation/ – how-tos, install guides, architecture notes
• Examples/ – sample C# programs exercising the library
• ViewerEnvironment/ – zipped environment textures for the viewer
• Root .cs files (PicoGK_*.cs) implement the C# library: core data types (Mesh, Voxels, ScalarField, Lattice), I/O modules (.Stl, .VDB, .Csv, .Image), interop (PicoGK__Interop.cs), configuration, utilities, and viewer components (PicoGK_Viewer*.cs).
• No dedicated “src” folder, but the naming convention groups related functionality.
Extract architecture insights from README
• Two modules:
• PicoGK (C#) – high-level API, tools, examples
• PicoGKRuntime (C++) – thin extern “C” wrapper around OpenVDB, managed via DllImport
• Dependencies:
• OpenVDB (via PicoGKRuntime)
• GLFW (for the OpenGL viewer)
• Usage model: C# layer calls into C++ runtime → runtime forwards to OpenVDB → results returned to C#.
Main components
a. PicoGK C# Library
– Core geometry classes (Mesh, Voxels, Fields)
– I/O modules (.Stl, .VDB, .Csv, .Image)
– Utilities, logging, math helpers
– CLI tool (PicoGK_Cli)
– Viewer (PicoGK_Viewer + Actions, Keyboard, Animation, Timelapse)
b. PicoGKRuntime (C++ extern “C” API)
c. OpenVDB (3rd-party C++ library underneath the runtime)
d. GLFW / OpenGL (for rendering in the viewer)
e. File system (reading/writing STL, VDB, CSV, images)
f. Examples (client code illustrating API calls)
Relationships and data flows
• C# Library → PicoGKRuntime via P/Invoke (DllImport)
• PicoGKRuntime → OpenVDB core geometry engine
• C# Viewer → GLFW → GPU (OpenGL) for rendering meshes/voxels
• CLI and Examples → call high-level C# API → triggers runtime calls → file I/O or in-memory geometry ops → output to console, files, or viewer
• File I/O modules ↔ disk (STL, VDB, CSV, PNG, etc.)
Architectural patterns and design principles
• Layered architecture: Presentation/CLI/Viewer on top, C# API core in the middle, C++ runtime/interop below, then OpenVDB at the base
• Separation of concerns: I/O, core data structures, interop, viewer controls are all modular .cs files
• Plugin-style extensibility: extern “C” API in PicoGKRuntime allows other kernels to implement the same interface
• Example-driven: a directory of self-contained client apps driving the library
Final advice
• Be exhaustive: break out all key .cs files into functional groupings rather than lumping them into “Misc.”
• Data flow end-to-end: from client code (Examples/CLI) through the runtime to OpenVDB, back to viewer or disk
• Keep it simple visually, but list every major component and dependency explicitly