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.7.0.tar.gz (1.1 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.7.0-cp313-cp313-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.13Windows x86-64

picopie-0.7.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.7.0-cp313-cp313-macosx_14_0_arm64.whl (20.1 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

picopie-0.7.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.7.0-cp312-cp312-macosx_14_0_arm64.whl (20.1 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

picopie-0.7.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.7.0-cp311-cp311-macosx_14_0_arm64.whl (20.1 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

picopie-0.7.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.7.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.7.0.tar.gz.

File metadata

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

File hashes

Hashes for picopie-0.7.0.tar.gz
Algorithm Hash digest
SHA256 85a95636b83dc7bcce2a3d4af7c876357671365be466772e49b4047665d5cdc3
MD5 2cc0adad1ec8fd392840cad716ef09bb
BLAKE2b-256 ebb10b712ad0e3f25bc4f2f844f4f1b70e3bff84b412c2745946a491fc95599b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.7.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.7.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e824a41d866bd66f82856645c87fc7b1e5dee9d54035e676a4b09d3075c0c429
MD5 ad8dcaa0bc4b4da511a8681d0d64c3d8
BLAKE2b-256 36ffe4a478d3b95dccfefcd9f63f14b7f9f9a65539c25d7bd604ff007b1818da

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.7.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 fac122f37d4464e9adb00a03de18b8124413ce1b62d847f70c04ceef38c13330
MD5 87bbe0b7617db022d5767bd4f1896222
BLAKE2b-256 11e64acd33a15bf77ee702dec7dec33f4f310bf2bcd9108d2f3c7259beb3b14a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.7.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 aa35d800786d658b7762038f89d709f260c6eb39081b82f6530f020b6efb1b55
MD5 1a643aa319f009b11e4a2f01cd81e006
BLAKE2b-256 cdddd3b1b08db5012faa27c255708e497ee474defeee06d4465419c2ddbfd7e3

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.7.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.7.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8ee1942d66ab02770d8c4ab3c86e14a676d212490846207b73339ea3abacf7dd
MD5 83e82cd8a95d1080c72c7b3b179dd243
BLAKE2b-256 b328b6b4f29f233d2291aa423a70ea520374b755d62cd5a9360695021f271bfb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.7.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5be757c867b5c84274f25e58e4f1987eb6bc8cdb58d542f811e9aef2996cdda6
MD5 a6005fcc6c4e1381f65eb05bdcf22c5f
BLAKE2b-256 afc5c1a3c9df23ef1b69ae59d2b1e76a6f68665cb5855780bf5b10a2a643e7b0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.7.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 af52b8e227df9be36a3dbdea3ff284eebc659eab2dc1ddfb11623c5d998ebb53
MD5 5c5dba56a8389d111daac04a331d6575
BLAKE2b-256 c7af18cf76d5a09a2bacbf43e75a8d22e60c4c6eb0e279cc5dc27b5d0c5eb3ba

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.7.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.7.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5476aed8a1e216b923bfbb4ade761b8f79c0776bec2e4ca23b32afb49afafd02
MD5 78e87a57c6582d04f02c5123b33e0f6e
BLAKE2b-256 bd2f1755fb95f9aa52aba01789541e3a0f5bcb895cbfa433ae0d239dc5255a52

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.7.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9addfd15745d8c005e262ac02e1259b580c35966ac305f5d6d399329bb5c726f
MD5 81e5af6b3c861ac0793ae1c7638d6dbb
BLAKE2b-256 ae18ae610edbe163bff39cb8cb700b7731b888fbe68f5e98bf5ecd6e54813649

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.7.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 6ae375dfea18171ae9a689003309f21d2cc1c3549b18bd854121939626f986e6
MD5 6eb4ac26d113f3d9dd0c8a795a6ea605
BLAKE2b-256 d5990f63e831bf8ff030f6fa3dd71543a5b71789f79253421f62460462fc9a87

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.7.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.7.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8c6fe88f829748a5361a8d0bd926875bde866d1d82925c6ef30992de80339776
MD5 e5d198a52b40307f196729bd86ae25a3
BLAKE2b-256 12fb09f1c7748caf8a30abc8bf39dfdd747cd49f9f92bd38a0e86317623e255d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.7.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 342ed63c906b05aa4e5a85bc9f2547871c2411759b9a67fad00d2322b9954efd
MD5 30bc8fe5fd236598d751e179b78c05fe
BLAKE2b-256 9093c74aeb13469a7b50ce1872888e12700658c1956a3a56f2238ea659a7d6a8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.7.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 3e12173dc805ce6ad9406035fdd2ac14baf56257cfe2a7f9f0fd09f0bc24cce8
MD5 445c7186debc4baec8483bcae778d3e7
BLAKE2b-256 d5254340746276c89f03bd8ab4bc7a0eb3967015deae5fe135913d8ce2e6d984

See more details on using hashes here.

Provenance

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