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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 14.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 14.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 14.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

File metadata

  • Download URL: picopie-0.4.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.4.0.tar.gz
Algorithm Hash digest
SHA256 25f1174fb78877da2d1d43f3a3520b31bd83ac1ea921ece3188a9263bbfd15d7
MD5 a8d34dcfb6583ef0a27083445ca2a949
BLAKE2b-256 3bd342a8220611cae997f32d16788de0648eeb84cb3705bdc36ed98fc490a660

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.4.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.4.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 bd6a2f51600b6aa26ded1932e75c0d30161d40e70a608ad10c0d8a462d8f170e
MD5 2945b070dc5ce74b87bb5c651cf46dc8
BLAKE2b-256 f92c76ce7914da20b2f927c4bcc5e027e9fc2ee728c652528eb62feac594da9c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e7dd480b7e98c55b7aa1868ad26b33a2659db2f8d54afac4c0857cffbba842f5
MD5 7ae999c494b99ea7d38270ad09e1a62b
BLAKE2b-256 a936525666f084f3aa5de7de4e4b9fd57468cc9263dbabb1e8a04d48d6094c85

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 bf192b0e6879418a9ccd27829c68c81ce49fc89f3080e64d9f449c38c9ab0b9d
MD5 de38fd50628eec34dfd5ef046c1896d6
BLAKE2b-256 3c1d06696d3b11929715ec5b9d1693e7d69129064ffd3052b3ad3b1db458b259

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.4.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.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 217c98c230907373470ce81f7ad22caa786c7c739589863acb4eb57d693f5591
MD5 577a51f0dc29539897a0a3a57648c365
BLAKE2b-256 c579b1223124d5997be9e48e7f3c7e91cfc1a65b78bd110b7f38617a6e96d6d0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ac422fa7393b7d2ef9b5b0f5919a9fff6cabb03bd4acfba4bc60f9bd2cc14f83
MD5 9c4dd66c7be1e5c6ff016c5fbc21b803
BLAKE2b-256 ad5eeb359e52a9483f435fa1c41c3e6cfbfed9e46f5e2f4e907a5bec3eda9bcb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 6e7259a9f8e7c79e278ef98087cdbf1d1a2db7472e6d3e6a167143a4b0034196
MD5 1ce93e5f62d55a787f42d4a2d2ab1ba0
BLAKE2b-256 49d003f3d1074fc95abd021fc7160cefeb19a616a64aa46782b09b4358e84e6c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.4.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.4.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0a303ada541c5d8b691127d69235b0cdd289936c1f5bc9f1dd18e9498426b1be
MD5 20f3aefa2470b890341ec9ff96681f22
BLAKE2b-256 1991dd1cf88855d0f270188ce09f7c21aea19b0ff6fe38d9fe9336d831d72f18

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5594b53bb4f5e5a525b62572580e9e260bd7813fe2ef13b310190c6aac7661fe
MD5 d95a6b41024e18025eb275254421be99
BLAKE2b-256 2655f56f319db4efd4f0e3b27cc8c7b08cc555964ddca6a8151022bd7525a76a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 562633b9453494aa809aa2b9e6f6de3712e1e9fa2736624a3970fc5d65e49787
MD5 4c6a92e61882f47af97546ba6e06c592
BLAKE2b-256 7866ce3faccbcffeb0253684f14ac00dc5008012968d91b70494b0b806358d6f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.4.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.4.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 03563c6d04829b0d7165d41819e58ad8dac00af77ffaacf4f2c4a525e5e7f0b8
MD5 9aa738b4ae45dd365a9e9871a0fcc5cd
BLAKE2b-256 5af59b547baf3f68418ec9722da8524fb4610ac8dfdf5d9fc831c18a98d153e0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9bf3f750e8f68c73f762fac0c807ddcd1343fab427f472c3a9d512bf72e1811b
MD5 8bf2503f8a108425d296d07d7599494d
BLAKE2b-256 a5f3c96fa5763ce4cd65541f4473ebd0ee73ac8a1b87b41a78ba07f5921061f2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.4.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 b297395b1772f5a1dafb6416064fac46515df90930f7d476b6946944ef3abfd4
MD5 6117fd692e535fcda2c3c79f81382031
BLAKE2b-256 95bedcf8adf4de53265801eb3e205e67c80b32c2171799a4036441f3309345ad

See more details on using hashes here.

Provenance

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