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.

⚠️ Unofficial & community-maintained. PicoPie is an independent project — not affiliated with, endorsed by, or supported by LEAP 71. It binds the open-source PicoGK runtime, but the API, packaging, and namespace (picopie, not picogk) are ours. Please file issues here, not with the PicoGK team.

import picopie
from picopie import Voxels

picopie.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 picopie.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 viewerpicopie.show(part) (GLFW/OpenGL, orbit camera) and render_png(part, "out.png") for offscreen renders.
  • Web viewer ([web]) — picopie.web.show(part) renders inline in Jupyter/VS Code/Colab via three.js (works over SSH, where the desktop viewer can't), and picopie.web.export_html(part, "v.html") writes a self-contained interactive file.
  • Parametric shapes (picopie.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 PicoPieError 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 (picopie/_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.5.0.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.5.0-cp313-cp313-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

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

Uploaded CPython 3.13macOS 14.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

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

Uploaded CPython 3.12macOS 14.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

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

Uploaded CPython 3.11macOS 14.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

picopie-0.5.0-cp310-cp310-manylinux_2_34_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

picopie-0.5.0-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.5.0.tar.gz.

File metadata

  • Download URL: picopie-0.5.0.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.5.0.tar.gz
Algorithm Hash digest
SHA256 fa363468f2d9995a091d57dc45828f0b6d9ac5eb7cc23bb6e6ddbb3f4ed0adff
MD5 a149fba25f7381617dfb6b4475aa6c10
BLAKE2b-256 2feb8d521443304d57ea2e862344c8c819ff18851bb1e11e7b4e35a7e8d59696

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.5.0.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.5.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: picopie-0.5.0-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.5.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3a9faf2534a208cfd109210d67fca060b83d030d53fdd386a1f6a231d0c323ca
MD5 9c03e5ed8f41176a8fab18164d5411d4
BLAKE2b-256 04feb7fe668ac90d11e309a0f17a46063b37e45cd0a11d7896bbb2bc3ef4d491

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.5.0-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.5.0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for picopie-0.5.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 46f98d46f489d77c37098f9a1ccc520cde8535b5723a9fb768bc8fe4d13702d1
MD5 2e6e9d284041403b1362c0d137ad03dc
BLAKE2b-256 f063741b3b6639dbfb2cc68868be010b5f4564176e00b57d2e82e8c03c107eec

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.5.0-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.5.0-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for picopie-0.5.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 9ca4e7af75e6237aed8152538e08413d94cebe971beac6c41af0ba20ea866526
MD5 9858c05492ccead517506c49c09e7f01
BLAKE2b-256 886843959c88cbe35194ae7426eec7c88f44e61ec2dc3ba9ccf539e24724059e

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.5.0-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.5.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: picopie-0.5.0-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.5.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 bd508cb10601fe215f6a3b70b301f62d034aa08b5205a331648ab14324c3a298
MD5 401dc4c5a08b177717bb05abeed90561
BLAKE2b-256 4683c1b3cd25a77e56114b7a0cb053e840323acdca68c40efeeaed95a07ebff7

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.5.0-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.5.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for picopie-0.5.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9698114aa08f885b3fec22958d8258a4115141748c257b51e55adc44af32ad97
MD5 902ce08665706184a6a2070c6b5e5e97
BLAKE2b-256 0613908bac378a52e1ee55ee758b96b0fb62a2a28d3a764bfd40d27333b41376

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.5.0-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.5.0-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for picopie-0.5.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 12920e053d0ec9eea8c2d2c4e67a19359a947f7b0d2a28d03fe9cc2a1a794d71
MD5 b56540393f40f3c89fa91d140f2e1f1c
BLAKE2b-256 5ffcf71b558c249fd2dc8744c81f97cd95f2249901a1f0fb13bf27071679e3df

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.5.0-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.5.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: picopie-0.5.0-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.5.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 cb8cd7a9fed43a4a82ef54541a0fe8313835a3de4b0e9a158e128c66b7f5fb0b
MD5 8fa885e77f3eb52f3662f2348073d8d0
BLAKE2b-256 00e995cd6b13be3c72e7763974e9061b6fc3819fa43a96c2ddc1d98d1fab81fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.5.0-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.5.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for picopie-0.5.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 dcdb417e9f74c026ceacd72f6e65b3295f716c1788d79f1087e09fa43370571e
MD5 71cf0d89b5eb018e677b966f16302c10
BLAKE2b-256 b1eac566ed0c6942e91c164af3d4b59ff445ecb7df05731287ab1582bf8bdf04

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.5.0-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.5.0-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for picopie-0.5.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 1f537e510c8054612f94a5bf7fa4d4f08cab60762ea40087a37f2ccb042062ec
MD5 e6ab5d6eb95d7fcd167e4d23df3434c1
BLAKE2b-256 7e07945b48cf436a79344cbc018ce5dc5f2032d89630c4f6941c061fe508e2d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.5.0-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.5.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: picopie-0.5.0-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.5.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 bc45bdebffdccf8cd7d9e80ea9cdbd9fbef981ac9c9ef0b9d59a7d22667f5cfd
MD5 d89514955af64acb5bc3a4eee955ee87
BLAKE2b-256 0fd2dbffdbabd7da1f869efdb2ef5c922c76d1767a44135ba6fb2d65947265ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.5.0-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.5.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for picopie-0.5.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0f5e2221271d91df5e2272a2fbc77ba7976c1dc47af55134d6be82f9c6eec10d
MD5 f0e92f8e775734c89bfe923d90598aef
BLAKE2b-256 fd0b38b8a7b7da93b4500b4d240dc68337f1bcf96a2c055880e02e68b6a50563

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.5.0-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.5.0-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for picopie-0.5.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 90fa83a1a92b25a1078b44ae46cff59b9d90ec059a8ec6271c90ac0250f1cbc8
MD5 133e080425442ae194529166d4eb4f9a
BLAKE2b-256 d6f8c3fcf9afd81ea89da5ca957c10c81874e4cbde7b0a2e107774c4259fdced

See more details on using hashes here.

Provenance

The following attestation bundles were made for picopie-0.5.0-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