Skip to main content

A Pythonic binding for the PicoGK computational-geometry kernel

Project description

PicoPie

A Pythonic binding for PicoGK — LEAP 71's compact computational-geometry kernel for engineering (voxel / level-set modeling on OpenVDB).

PicoPie binds the same native runtime the official C# library uses — so you get identical geometry and performance — then wraps it in an idiomatic, NumPy-friendly Python API. No .NET, no compiler, no system libraries: just pip install picopie.

import picogk
from picogk import Voxels

picogk.init(voxel_size_mm=0.2)

body = Voxels.sphere(radius=10)
hole = Voxels.sphere(center=(6, 0, 0), radius=6)
part = body - hole          # boolean subtract → new Voxels
part.shell_(1.0)            # hollow to a 1 mm wall (in place)

vol, bbox = part.calculate_properties()
print(f"{vol:.1f} mm³")
part.to_mesh().save_stl("part.stl")

Parametric shapes gallery

A gyroid-filled sphere built with picogk.shapes — see the gallery.

Install

pip install picopie            # core
pip install "picopie[viz]"     # + headless slice/mesh PNG helpers (Pillow, matplotlib)

or with uv:

uv add picopie

Wheels are self-contained — the native runtime (OpenVDB 13, PicoGK 26.2) and all its C++ deps are bundled. Prebuilt for CPython 3.10–3.13 on Linux (manylinux x86-64), macOS (Apple Silicon), and Windows (x64).

Documentation

  • Tutorials — a leveled path: Novice (uv setup + install → shapes → booleans), Intermediate (implicit modeling, meshes/files, fields), Advanced (performance, reliability, viewer), and Shapes (the parametric ShapeKernel layer)
  • Gallery — rendered parametric-shape examples
  • QuickLearn — the whole API in one annotated file (learn-x-in-y-minutes style)
  • API reference · docs build with mkdocs build (pip install -e ".[docs]")

Features

  • Voxels — primitives (sphere, capsule), booleans (+ - &), offsets, shell_ (hollow), implicit SDF modeling, and queries (is_inside, closest_point, surface_normal, ray_cast, calculate_properties).
  • Mesh — from voxels (marching cubes), NumPy vertices/triangles, STL/OBJ import and export.
  • Lattice (beams + spheres), ScalarField / VectorField (bulk set_many/get_many), Metadata, PolyLine.
  • File I/Osave_vdb / load_vdb round-trips voxels + fields (OpenVDB).
  • Headless viz ([viz]) — save_slice_png, save_slice_sheet, mesh_preview.
  • Interactive viewerpicogk.show(part) (GLFW/OpenGL, orbit camera) and render_png(part, "out.png") for offscreen renders.
  • Parametric shapes (picogk.shapes) — a Pythonic port of LEAP 71's ShapeKernel: Sphere/Box/ Cylinder/Cone/Ring/Lens/Pipe/PipeSegment/Revolve/LogoBox defined by local frames + modulations, spines/splines, lattices, implicit SDFs (gyroid, super-ellipsoid, …), measurement (volume/area/CoG/inertia), and colour/painter helpers — parity-tested vs C# ShapeKernel. See the Shapes tutorials and gallery.
  • Fast path — a compiled _fastloop extension (~13–28× faster bulk mesh/field transfer) with automatic pure-Python fallback.

Reliability

PicoPie is validated against the reference and hardened well beyond a naive binding:

  • Parity-tested vs C# PicoGK on the same runtime — volumes, dims, mesh counts/bbox, and geometric queries match to float precision.
  • Never aborts — the native runtime is patched so a C++/OpenVDB error surfaces as a catchable PicoGKError instead of killing the process; non-finite inputs are rejected up front. Verified against thousands of fuzzed inputs.
  • Reproducible & auditable — every upstream dependency is version-pinned; builds ship an SBOM (sbom.cdx.json) and hash-pinned build deps.
  • Green CI across Linux/macOS/Windows; mypy + ruff clean; ~190 tests.

Development

git clone https://github.com/Borderliner/PicoPie && cd PicoPie
python -m venv .venv && source .venv/bin/activate
scripts/build_runtime.sh         # build + stage the native runtime (see below)
pip install -e ".[dev]"
pytest

Building the native runtime (Linux) needs system deps:

sudo apt-get install -y --no-install-recommends \
  libboost-all-dev libblosc-dev libtbb-dev extra-cmake-modules \
  xorg-dev mesa-common-dev libgl1-mesa-dev ninja-build cmake g++ git
scripts/build_runtime.sh

PicoPie locates the runtime automatically: bundled in the wheel (picogk/_lib/), else under native/, else via $PICOGK_RUNTIME (full path to the shared library). Cross-platform wheels are built by cibuildwheel in .github/workflows/wheels.yml.

See ROADMAP.md for the (now-complete) phase history and PLAN.md for the architecture rationale.

License

Apache-2.0, matching upstream PicoGK / PicoGKRuntime. Ported by Mohammadreza Hajianpour and Vish Vadlamani.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

picopie-0.3.2.tar.gz (1.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

picopie-0.3.2-cp313-cp313-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.13Windows x86-64

picopie-0.3.2-cp313-cp313-manylinux_2_34_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

picopie-0.3.2-cp313-cp313-macosx_14_0_arm64.whl (20.1 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

picopie-0.3.2-cp312-cp312-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.12Windows x86-64

picopie-0.3.2-cp312-cp312-manylinux_2_34_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

picopie-0.3.2-cp312-cp312-macosx_14_0_arm64.whl (20.1 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

picopie-0.3.2-cp311-cp311-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.11Windows x86-64

picopie-0.3.2-cp311-cp311-manylinux_2_34_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

picopie-0.3.2-cp311-cp311-macosx_14_0_arm64.whl (20.1 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

picopie-0.3.2-cp310-cp310-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.10Windows x86-64

picopie-0.3.2-cp310-cp310-manylinux_2_34_x86_64.whl (5.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

picopie-0.3.2-cp310-cp310-macosx_14_0_arm64.whl (20.1 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

File details

Details for the file picopie-0.3.2.tar.gz.

File metadata

  • Download URL: picopie-0.3.2.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for picopie-0.3.2.tar.gz
Algorithm Hash digest
SHA256 4d2495449640b4eba4137bf55a07dab1653d27036d848b82243ff897b7343c4c
MD5 0b6e08ac7dfc5059b9b5c1b3270e9eac
BLAKE2b-256 33ab62a05bb78db41e33ece097d951e9adfea584229d66422abedca46f6c697b

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.3.2.tar.gz:

Publisher: wheels.yml on Borderliner/PicoPie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picopie-0.3.2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: picopie-0.3.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for picopie-0.3.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8e7aa48af408a4c37fae8d3a854877c63e110c778a4114e3ba8d6f355a6fa463
MD5 f7b6e627a30a2b71c56790b191ccf455
BLAKE2b-256 a8b599193d893367160e87eac861300835d8485bc9772afe7d0dc69848a5be6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.3.2-cp313-cp313-win_amd64.whl:

Publisher: wheels.yml on Borderliner/PicoPie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picopie-0.3.2-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for picopie-0.3.2-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 fb807779ea317e6325d2d0f39663f9327f01b3a93cd411c2e71b37aad4c49dbd
MD5 7cd9b63f8465f9f418f5bf61e26efcda
BLAKE2b-256 e9d537e08eae8c7806621b505e0d681253b882a78b534503bae5625d90b28538

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.3.2-cp313-cp313-manylinux_2_34_x86_64.whl:

Publisher: wheels.yml on Borderliner/PicoPie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picopie-0.3.2-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for picopie-0.3.2-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 31ba8508fcf8a72614a5d2c680b3c55062cc75afc31a57e0f8b9767faaa0cecb
MD5 ba73d13b60f57d094cb6b547da40bdf9
BLAKE2b-256 f8e2eef31e3c0ff45c826ff513f0388f1888f8f53acfc9843302222852d119df

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.3.2-cp313-cp313-macosx_14_0_arm64.whl:

Publisher: wheels.yml on Borderliner/PicoPie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picopie-0.3.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: picopie-0.3.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for picopie-0.3.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 04f57e19bb5ac8a7894272e53abf643a49bb65298b9f2f33426944a1b41b0049
MD5 b834349fcd9b1e3ac1d7fd5c8decc2ca
BLAKE2b-256 ab1e775131b2594c0656507a6a0b61c5344bf23dca2c1d5f378d41cb330f8c65

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.3.2-cp312-cp312-win_amd64.whl:

Publisher: wheels.yml on Borderliner/PicoPie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picopie-0.3.2-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for picopie-0.3.2-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f311168bcc3208cb48a68ef52de58a710431fab291830a6d16392e46b8e6548d
MD5 4348b8fd83a3b3f4037e6d0740c88b48
BLAKE2b-256 efaec571ccbca04d154b7e0689d3634fcc2bf94ffee999130b6dfe3eab86aed6

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.3.2-cp312-cp312-manylinux_2_34_x86_64.whl:

Publisher: wheels.yml on Borderliner/PicoPie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picopie-0.3.2-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for picopie-0.3.2-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 8e15e75db4d186de623e207371de7c57de0b31959474845b11e437f8b001a326
MD5 413fa5d62fa2b52b5b674c394df68c8a
BLAKE2b-256 4d61c41acd076377c0e8941100b3b24ff77b410c11ab628617756d0436a062cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.3.2-cp312-cp312-macosx_14_0_arm64.whl:

Publisher: wheels.yml on Borderliner/PicoPie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picopie-0.3.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: picopie-0.3.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for picopie-0.3.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2215aa0624c76b34395cf193f1340d9b42c6303cb7f38343cd3fb0db0d3eea70
MD5 38e3413af88b0090cc846e8cf922611d
BLAKE2b-256 0d636a966f6f1673a60af5ed065cd65d5258f731a3e80cd21cecb55ff1f5a173

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.3.2-cp311-cp311-win_amd64.whl:

Publisher: wheels.yml on Borderliner/PicoPie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picopie-0.3.2-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for picopie-0.3.2-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 eaf6d82ca7d71b70c685cd65925a0896b2f5def4254bc4859eb23b4b4c5574d3
MD5 7e1dae90007509df4968bb0a1992683c
BLAKE2b-256 37f738dbe35b20896fa6140bdd0de89fd1b82a5e62bbe639837042cb5370cfa1

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.3.2-cp311-cp311-manylinux_2_34_x86_64.whl:

Publisher: wheels.yml on Borderliner/PicoPie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picopie-0.3.2-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for picopie-0.3.2-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 8290604d3646d7683ed639a693f9e1ba69de483416133a1a14f4ad7483c112f3
MD5 09efdf14f786af8325854065437ca902
BLAKE2b-256 9b56316e02fd92d700047bccf7dab6e4edeb159058884eac637b66bc7e73804e

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.3.2-cp311-cp311-macosx_14_0_arm64.whl:

Publisher: wheels.yml on Borderliner/PicoPie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picopie-0.3.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: picopie-0.3.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for picopie-0.3.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e4548ff894c9675e903614dffa92ca5850b58da4eb2a522d74137e53fc99cb96
MD5 05851541446a053b211c024a28900b1a
BLAKE2b-256 02be037a779a429e1c1ceb37a34981f3718d314eb030ca6e65b6753129861ef1

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.3.2-cp310-cp310-win_amd64.whl:

Publisher: wheels.yml on Borderliner/PicoPie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picopie-0.3.2-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for picopie-0.3.2-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3c8892204d70205fe7b08266e950800edf71d4ecf2b76590b69965d0a86d6a0c
MD5 fc7195ce7ad9cbc964bf74e449289098
BLAKE2b-256 bd1f850881b9fb48de6b7dc8bb954cf477ef844ed60e8e8cede92232ba245334

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.3.2-cp310-cp310-manylinux_2_34_x86_64.whl:

Publisher: wheels.yml on Borderliner/PicoPie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picopie-0.3.2-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for picopie-0.3.2-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e82c80ae3f7c6bb64c799904aa8d4cf98b2656b4d5a2473e902953cc566b7ee9
MD5 f3fab53c1e3f377d75024806b7900f56
BLAKE2b-256 96ce4cefd7b7272d5875b0eebc4e9008a570acb6eb9aac631c1e7838eef346c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.3.2-cp310-cp310-macosx_14_0_arm64.whl:

Publisher: wheels.yml on Borderliner/PicoPie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page