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.6.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.6.0-cp313-cp313-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 14.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 14.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 14.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

picopie-0.6.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.6.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.6.0.tar.gz.

File metadata

  • Download URL: picopie-0.6.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.6.0.tar.gz
Algorithm Hash digest
SHA256 68daa2d115f3493c9174e691fa3851c7a47b08492e8961905cfea3f7342931ad
MD5 1e7038f4963017324a9d6f8c354e85be
BLAKE2b-256 82bafc730babdc82c1f773ff95ae6f62f1d0972a94eb99d3c1e30f033d017be2

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.6.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.6.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 10e0dcf72a32c0c753ba07cbabe2ae94ccb187fef4bed187522445a823d716ca
MD5 55d82fd3c0a12519104c6036d9653bfa
BLAKE2b-256 8dc7a27d1497b636b6cf725adf9bac37026de1644ee8ca4cc8437d0db2261749

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.6.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a09a1e58df8e18faba25d51feea90c3f5d19c0b2eaba78b031a8e29a62965d37
MD5 eb6b87fd87369d76f8188421c5f0a64b
BLAKE2b-256 8c405740fed60360094d086f2aec418cc36463750e23debc308b61b48a3b7fd1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.6.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 66d2b47143ae2835b9aa0708335f9c7642737307f33630c59f5a04145e137b7f
MD5 663e8373f98e528a7f4408a7262365b0
BLAKE2b-256 eb843a112e311af96cab8b4a0d666743d8d2d8193ab28881adc02680e9b4a624

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.6.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.6.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 75fa9a73639a08617d35d613d56112f08f46706bdce43f57729eab25cdae5f61
MD5 38c955fbf07235011bcc0d914ecf5b09
BLAKE2b-256 eae4d3a98464b0dc5f68836e8191cd0fcde7bdda0b8d2654e047ffb6a94edf67

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.6.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7baa9cea2fe80738b2e5033d8b6c378aa754b4012caa98bedf214c15fbf7737c
MD5 9d61f0d4d666f06c837bca7cf8204d91
BLAKE2b-256 23544b50fd94ea56d5279def4abff040a4788ce66009796958011c8e77c997ef

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.6.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 a4dd783f058b7ceba76b222b825f10ed63b08bb8386d785086e2f9167d643cee
MD5 dc4112b0c3c0c06cbd07b2c8619621f2
BLAKE2b-256 02867cd22ff0d6fbc5c0a78033b18ef8b143b79fba8396b8fabff4e93d339922

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.6.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.6.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0e9f499e020055847a70ae9ed4bab877f6a46603d7dc9b8a54f8e0acd9feea80
MD5 2aa2604ca0a03870ffb8329e405f13a4
BLAKE2b-256 04f7d0cdbec4a7dc63e8c3d0c04f178f3a05de1825af28da7e2c14db9d024563

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.6.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a6ff04fc0d685fba332c175fac3612965c53c15c2567d31a703dabb3b8052c15
MD5 b9d20c264abb7483fa3a3d179fc5cce6
BLAKE2b-256 1c40b90ce5f7d3b805dbfc217bf5dc14355d6cd8ad5026556473235cf6c812d2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.6.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 8dc4d650d334c2098c842fb364299bce2a76fba770444148fd118211955328a0
MD5 55067a59298bccce6e44aad6dab966f5
BLAKE2b-256 7e4db29f46cc9a613ea263faff260cbd16b351ded1c54658dacdffc09fac1820

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.6.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.6.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b615d8c44b6f94de89f9714bb0219fbba2213547e24bb4499efeebc230d2e1d1
MD5 72d01c5b7b60d0f87cf39285f3766bca
BLAKE2b-256 5300a3cec22cf2782fa5f0651a7a76660cae0917ac95d7c7cbaa05ac7376b1ce

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.6.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d24b7c8f8e55aef7625a86dfa05a737d09bcfb6b54ba3ff95dca2c814c57d682
MD5 4e89a739f3155687ee5d002e5ad7445e
BLAKE2b-256 841e420963682764f9a990db53d95db54af44e60d5cb38e1abcc55ff346006be

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.6.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 84603c4660937e1eda1455ee18bae3904a926434eff6260cb9b41e4d6350285b
MD5 42e1d00227cc9275131db986c0ea3630
BLAKE2b-256 b00ac37fdca6a4f317e57b61489c1e9adbecb46b00345a90aa3b3daa9c09c018

See more details on using hashes here.

Provenance

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