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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 14.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 14.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 14.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

picopie-0.4.1-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.1-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.1.tar.gz.

File metadata

  • Download URL: picopie-0.4.1.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.1.tar.gz
Algorithm Hash digest
SHA256 fc59136862971f2aed25e4cda52c5cf2256f5baa834600933e7a55b5b720bd89
MD5 9617084615171b56fda408cd1f40940f
BLAKE2b-256 3a0971f8275173efd73e4b75f48a1ffd322e51bfaa24629e627307f04e162bfb

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.4.1-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.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d5b2f57b854235e119f9ab868e64bcc9fede0a9d27b56b53c274adeb015a6588
MD5 92643827f476fda4e4cab8a8d1518caf
BLAKE2b-256 32b61ce0578ceddaf01364693acac0e56a602f41fb560f9e095e2f2530841819

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f022ee005fb0930d6449ab7c8eb4ce630f613b314cad5506890ee86ddc58571a
MD5 56fad82b58503fcfd0ab41eebd751419
BLAKE2b-256 a8fe44ee55f0459d0a33819f208ed59b72e181880b4caa3ea327adc17dcfc7d7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.1-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ea12b4c661d03230e4c194872c0638ec77aab97aa4f0363c98b2c6c2444e3990
MD5 4a863bf016b80adab930a8a47c1fe7ee
BLAKE2b-256 f692a4f018f5e9f2b0babc1ce76fc2e64cb6419e9e6775762abf230db63b100a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.4.1-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.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2576a19bc00f497901d55ef991ea0b3d3904364d4dd60cd3a19bb61072c4585f
MD5 8ecee7203c79d887c38e3beced98548f
BLAKE2b-256 b48ecbbeb5121396f12c8d0ae32f83a3d67bb574555c9d3b36cd62237eb58b5b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d9180e6915db14a56206379f5c8f6bc3fd45aa736a5b4c08fcd96a99fcbaed2c
MD5 1223c1f0606758801efa9491bb752f34
BLAKE2b-256 e188e87098f3dfbdbdd15ee2883a280b33706e29107e259b7d59b7f1f8ee444b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.1-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 c143a22c283684674b3adf61faa7ebb08bacf78cc59374eba6224993d1ab83b3
MD5 254bec4f55323506812c87611c490370
BLAKE2b-256 50faed022dfd278b0a1613c1936564468a03ab91b5a93f6f4a002f8bfd767c7b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.4.1-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.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1ae8cecd6aa62938629a65fd5238caa5d6d6b4b734b98df8cf5b2ef3da5372b4
MD5 85f9b60a9aa0b4323958d6a31606d00c
BLAKE2b-256 2e7979dec40d56226c908fe440486e47812c0d1754588c974721201522a442b7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 592865d4d79ecbd27556f8d006bf44407d9c0221a18ecbad78b2ba26446ad893
MD5 f5941483d3bfd0efa82fda67ae1debb9
BLAKE2b-256 d19ec3717386a2f8eee6ca76143fea42aeeb6dbbaf634cc9ea84b54105776a2c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.1-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 7a8b1c4db916948b1071a4ba9ef3396170c15100077fe813b264a64f3f73482f
MD5 20752c05733325e4a08f7eb23dd3d7aa
BLAKE2b-256 cabc65a2b71c272eb4d76a3f2ae21d708c0c11ee81937a2462f0b3507e23036e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.4.1-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.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6a02ef6f17ef14b33d530d784eda6ec085861c56fe05af6b34d24f38ce135ff2
MD5 b41be07681b7c8d931d15250620037a5
BLAKE2b-256 b44cb38113b57dd38d205439d719a48ad8747ee441363ae922b102c2b0bacde0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 24101ec40337295def04a851c4983d4bfc405e0db0bce0f4ae51ed60b298613d
MD5 0b9605a7019ba100fdadbaf62b5d6487
BLAKE2b-256 2e4ee5c835509a6a3f166ac05141e1f3d0a7d20522d070386a84e843a0655e8e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.1-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 d57da566f7f05681c066996a5edbe63e227ca300520404b11a08f7107ae37f4f
MD5 697b3aef9707600e72644e66fa827edd
BLAKE2b-256 f0758f49d090f00de2b64519d4830f283b6405dee20bd6b10ada0695d7c43f93

See more details on using hashes here.

Provenance

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