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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 14.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 14.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 14.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

picopie-0.3.0-cp310-cp310-manylinux_2_34_x86_64.whl (5.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

picopie-0.3.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.3.0.tar.gz.

File metadata

  • Download URL: picopie-0.3.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.3.0.tar.gz
Algorithm Hash digest
SHA256 7f52a1269aad976707cecd3e4b585f7cae0878211c5f98510fdd2ac8f1d1ca1a
MD5 451531739ad97a0ca1f3cca7173cc8b2
BLAKE2b-256 620a86584228c4ec88a497a227f6dc12ee88f9b23f9c8dd4a1ce42662942fda1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.3.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.3.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 345a59dcd0d12ba95669ed7684cd2c5f781772741318fe94c53fcb26c0797511
MD5 6c0931f39f8c6770b923a3a3ba9591a1
BLAKE2b-256 a48d6e6332656e7cdc5608fe9a59a21297ee040750a4a9c0c6fdad620676951c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.3.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8eb10955ba5d33c3f51d4323df06ff3af1442fc0786a27602c5e499929098c1e
MD5 621b40c4918b9584b744eadfaf59ed91
BLAKE2b-256 05fd1581b7c14c81583685410f505abf04964caf81c120c23bf7d37733823000

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.3.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 d853537936bfe13558f1edadd17505e5bbed647f791c7739e88a941b69e08a2b
MD5 69b7f8bb721c4d2e02172cdb04727d16
BLAKE2b-256 bbda215e01d5a0a9d9b6f0e5867aaf5c849cb38654c10e1462c81b6b2191224d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.3.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.3.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c5c1536a2b681a9ae735dbfd480b3f296b1c47c5e97d5920ce1f8ff73c8b6d74
MD5 efd5b4399a8a19b50005ad5815468181
BLAKE2b-256 54de6bb81caeab28ef349de49b9ce6066ba029bc3d9e5df08550fd37881e01de

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.3.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 852b72ced1fb2679c8182dc889732f7f3ad49faa6d5d4acac2fb2d853d8aa83f
MD5 12671fbcc78f6608712b67f890151cb3
BLAKE2b-256 6e3ffd348d8358c469f816590bfe3d3baedd26046689c85b4c9df58bbb403621

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.3.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 2aeb29e02a84c891903915e66816b7905db51b43fcef8fbb7462d92756e1a4ba
MD5 edb10fd35c65d2f79866b1e17d09c8df
BLAKE2b-256 59f53a35007c965224731351976123cf9dc7b4767a46457ae4a5f82f8c0bb303

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.3.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.3.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 44adb0519aadc76ca56192afab3ee7479fbbf1e233b2dd2b40fcde6a89ba1e4d
MD5 ed4432f29f99d00e82192f2d21747226
BLAKE2b-256 f9006715b726f5b735a407a91341df565235bcfa351ad03270bbfe27ebf3bfae

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.3.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 abcddf95b3c28eb6825f436cc66927f587450cff7d90ba06969f18317132b6f2
MD5 83ef77285d647a8031a8067678012c77
BLAKE2b-256 8127c3dd26b435a183c172b260f59771ac5067ef0819459b15ff807be0126708

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.3.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 59bec27bd1b49b6b3fff62b09901119d574e93f6ac4460503fb107b92185deeb
MD5 3d6a886161fecc204ba822fb748c8e10
BLAKE2b-256 e756b70a9b1727add3bc84850162e866f105fb3ef86e1612cab8897e885af595

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.3.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.3.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 75b1ad077c39e8a9291a5cd07f31d48ae5ba0000bc6968cc45db09229cf97fcc
MD5 7a2df02add8d5c9f3e54cab0cc14b9d5
BLAKE2b-256 f0dd8a4039fd7cf0e9e6d97609157b7a8ca3107f1aaa942051484891c9e6b750

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.3.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3a78cfd94d72f26ce03175db1e4108ca3b50a394e2554ddb0f363c25dee5ed32
MD5 c4742e8e456798351c4cb52de962a871
BLAKE2b-256 244adc918a9368a9974ab92cf2c07632e5fc8b2f4b112cd9e4931417f977720e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.3.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 fd2872b383e20adbcc430352ebba5cb5fb05d42f9cfaee73ce9ebb894b232d66
MD5 b8efbad5ebc81aecd4dd39dfca526a12
BLAKE2b-256 88a00b0f4804bab1192b236de83b6cd2e74961d65c73c1372c730adc777f9660

See more details on using hashes here.

Provenance

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