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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 14.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 14.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 14.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

picopie-0.3.1-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.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.3.1.tar.gz.

File metadata

  • Download URL: picopie-0.3.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.3.1.tar.gz
Algorithm Hash digest
SHA256 81d225b2fa0232134e55a08da19a32ea1d12253f518946b26fe5c6d01419f360
MD5 2d8278b37a03ef74f9a1d0cfc9fb1d3a
BLAKE2b-256 f70979ce0dee34dc23f03a56c042c0f49c890ee44764bb94d20890f6678a0a62

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.3.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.3.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f0d9b9b84b2354642274a0e5b0b08b85c20e103f74dee765342bf8ff3b39322c
MD5 36d3ac214351b568761bd1bbab4a11b6
BLAKE2b-256 047ad276f33f4f452726164c3c70612a8c85e543530e957b471f7b8b8ffb3e74

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.3.1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 560b6c0b295b286a79ff793644babd03fdec01cdb5d8231cc675412b1d292ef5
MD5 b5f9c66ef689e2e1efc68b6bd779fbce
BLAKE2b-256 5a50e2039a75ee7f6eea12cd3ce8894acb45c3cc663bba01d52265966fbdfc75

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.3.1-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 20df728d7d981e68ea7bb09ecb0f5ffe9cc07555522bf0db02a78e37bb27cd67
MD5 015f13515a567adc55d020794debc744
BLAKE2b-256 e2cbad8ce0544d95b291c1a5128c813f09b75d651eb8703275f32af16d5f80fd

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.3.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.3.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 67aa6e4ee90c6bfa23c40c402cd89f7d7e664e3f8860651fd4e96f1ceff2866f
MD5 999aba93a2969611a7c98ab83b02cd65
BLAKE2b-256 981f58386f9d74583aa54a1c242c0e48ad38fc901e35f0127c170686754c486c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.3.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3f905d116f707098e453f4b82900fd65fd3670684a7e110c10a9002d2ce22b71
MD5 07ce8dc5df4a1c754481674eca983ed6
BLAKE2b-256 06b6e5718186096a43f0850ce472c0b269b69bc1d8eda17f14aa4e764f537d71

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.3.1-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 c3917ef59a975e0f6e87a4c8712ef67cd3971b63e389364ab1ca9b301714f9a0
MD5 744ad349f2a7676724269be9a1f41a51
BLAKE2b-256 e2c8807fa1610ac07968a3dcb88641b1fdb696f911f50a6f65a5d65529c6bc53

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.3.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.3.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4b391ff993a066aeba89daff49cfd393c21dead1f798acf77d37826b530b37d7
MD5 4d803da8feef253c3399ee3322fd7a78
BLAKE2b-256 0b82fc369498d8adbabd4a98e47f857b4d5cbfde4dcb243cf0abf35a97c3eb0a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.3.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 da4936b67d8f2c483447bfc8dd70160487305ea5c7f0ab0ff667b7a2a02919e6
MD5 f8398f91d367b26cf28e98fbabfe8edc
BLAKE2b-256 c95896ed1ad622df9360fa9cc7f06ca06933e0b8c2e3773fff22258f794d1543

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.3.1-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f44ff13c3a8a71e575c477713134a1ae66ebbc492b8efc4d5f80be51937c2be0
MD5 ef7a4ae10ba7d8e195bcc5d049992143
BLAKE2b-256 8e48478971ce98cfee4935bbb65a33556eba3889df10ddafedb7251ae05551d6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: picopie-0.3.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.3.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2747edcde907c690b6ce055ac270029b00c81bf4d834182da1f9c43531d6485c
MD5 2c564cfedf0c869723b1fb8717c770e9
BLAKE2b-256 62fa88c5ff7ae309ee10b68794416ad8300054b28aa6afe37c7dd5d7a7f605bd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.3.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b699a6686e6e18fb3e1dda569836cecb022fb59b89ad8c459695d0329fff4cbc
MD5 b8c0cb8f3dbaec4cefa4c4327085eda1
BLAKE2b-256 45875c7f95af503179d9d67e97c1e02cb3343aac7131be5df90176b035a09767

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for picopie-0.3.1-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ba4fd655ad8df2113131215adfbfd27df6cd631aad532d492c1b6ff97ee25ed0
MD5 9bc0097c619a0d1ac71547ce820c84a3
BLAKE2b-256 8699f3f5bbeb877e1dfa24ab1d83977a7b7b5cc1016961c1a393ba5a881155b1

See more details on using hashes here.

Provenance

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