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.
  • Web viewer ([web]) — picogk.web.show(part) renders inline in Jupyter/VS Code/Colab via three.js (works over SSH, where the desktop viewer can't), and picogk.web.export_html(part, "v.html") writes a self-contained interactive file.
  • 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.4.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.4.2-cp313-cp313-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 14.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 14.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 14.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

picopie-0.4.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.4.2.tar.gz.

File metadata

  • Download URL: picopie-0.4.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.4.2.tar.gz
Algorithm Hash digest
SHA256 20e906d8589d9f613e36bfb897886d8a59e4301e70421ffb1586bcc3a5f53510
MD5 d74a29cab69eb6b0ef2366b404384a1c
BLAKE2b-256 a783af648d855f14c98c4a9632e89e4570844aca5c3f184c6290ee021dc90084

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.4.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.4.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d3614a7adf4c72de9788294819b004de4327d4bf745db4c1ff278cefc80b0aef
MD5 e5f530ce472621d2f04182145c91c4cc
BLAKE2b-256 94a96afb0b361b2404bec430b31ec04031cce7325e4d9741914e28cf1be92d1c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.2-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c3413f727112072eb2303def45f7f9afc326e4e7032e5ae7d298d32d4cd93317
MD5 73dc3dbf6deb62957ccbc71155b74ce4
BLAKE2b-256 957d82b306fc7ee5f44d09baca9e9904a7c790464b55c42e29f36515a7dcb53c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.2-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e639ac38dfd50385be79bb16122bca8be66bc3a37628785f1daf0ee9dbf58933
MD5 f0cda0b0ef46192b9d741b28d1008f12
BLAKE2b-256 1acee70194f6d8c3e592a6181c3f161913f5ef65630be4ea1ad8832d573c0c4e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.4.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.4.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e7f4c8f984eca1c6629e320affe03a0135fa654a079ee94fd5fea32c4bd1e9dd
MD5 9e474d9c94b36e8f8fa67e7d738bf64c
BLAKE2b-256 c8bc2db73221e3665566e349914166a9679bf74c9954d1bed243769e827cdeab

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.2-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 68d96b3c6b7c5dc61141c5b7453a7c18751fb64dce301719304f3dc0233bd724
MD5 6d5d96dfc1f06ee31a4840bb635bbbad
BLAKE2b-256 fd1dd9c5891137b36397bbe842e52f701847310630c18028edf65abaaa54a180

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.2-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 0a0496f2cc6c6e7a694521ca3727f5f4f32c64c521e89f12c49ee6fdd2f8837a
MD5 04fe992235d8c43897c36ad351bcd268
BLAKE2b-256 f50af0dc81a822080702b63aa98adbb9caf624185fbef731dc017b8072d22521

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.4.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.4.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a1996b4bb4f54b41ac7381b618f299a4f81bbb8c2f4ea1365e53b3032cf163ea
MD5 351bc46def6b0a0943b97e277fffdf17
BLAKE2b-256 1324aa78541ef349f833c8a28a0ef3198cfbcb757aa02dce87dfd4730fe86178

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.2-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8d1acb567a2b9e29270e36fb2284d19f1e8fa7cc2a671d436548e6cd0d7bf7dd
MD5 046bae2c7ed7211f5cf766ca6da4aa1f
BLAKE2b-256 215d50c5138baaec772a4a722ac8f54dd5c8a1429a519ba300d7be974f700516

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.2-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 c3f9a79da82abb61110a242fad967811d6316bb02dc2366d008f2f9d56cb841a
MD5 f07baa1b44d197936048e5af67381048
BLAKE2b-256 034818feac5dfe2c07402d4498a090a18e80ab5b038ea1b1ffe886cc350b3935

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.4.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.4.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 853ab62d82b091e1e73a5dabc97e5542448d97d5e0e9bcba449c263cb7ac09c6
MD5 2a692bc07fb0cdf8c04c14334fe21325
BLAKE2b-256 ba7735120f079f2805a9679060483b21f2281d64fd935d4d588e92a5c1b16003

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.2-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 591b31cb44d5b1e9a2678e9d6b59832aaabcfe42ddc1c9c2b8aa8e04873d25fe
MD5 d5653b58892dce8ba7d367ca201e0578
BLAKE2b-256 a32df8fcb017455d4d708d4a3dce4d129d691ed33ddcc6d7d1425c40aa832e06

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.2-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 002d85a90858ce10d01e370416a1872213164cc06c6db678e9bebaf59ac4d208
MD5 c564b37cc406f209452176f9b15fc92b
BLAKE2b-256 8d2468d0cd27b9e7c429e7c0302a79fab66516b587163906b7e36a9ccf4bcd4d

See more details on using hashes here.

Provenance

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