Skip to main content

Python ctypes bindings for PicoGK runtime with vedo viewer

Project description

pycogk

Python package for working with PicoGK from Python.

This is an unofficial community library.

The package keeps a PicoGK-like API where practical while adapting parts of the experience to Python, including a vedo-based viewer layer.

Why pycogk

Use pycogk when you want to script computational geometry workflows in Python while leveraging PicoGK runtime capabilities:

  1. Build implicit geometry with lattices.
  2. Convert to voxels and apply boolean/filter/offset operations.
  3. Extract meshes and work with STL/VDB/CLI/TGA.
  4. Create scalar/vector field workflows.
  5. Preview and iterate quickly from Python.

Install

From PyPI:

pip install pycogk

From this repository:

pip install "git+https://github.com/ghedo44/PycoGK.git"

Import Name

The distribution name is pycogk, but the Python import is:

import picogk

Runtime Notes

pycogk loads the PicoGK native runtime using ctypes.

Bundled runtime targets currently include:

  1. win-x64
  2. osx-arm64

If your platform is not bundled, set PICOGK_RUNTIME_PATH to a compatible binary.

PowerShell example:

$env:PICOGK_RUNTIME_PATH = "C:\path\to\picogk.1.7.dll"
python your_script.py

Quick Start

from picogk import Lattice, Voxels, Mesh, go

def task() -> None:
  with Lattice() as lat:
    lat.AddSphere((0.0, 0.0, 0.0), 10.0)
    with Voxels.from_lattice(lat) as vox:
      with Mesh.from_voxels(vox) as msh:
        print("triangles:", msh.nTriangleCount())

go(0.5, task, end_on_task_completion=True)

Documentation

New-user docs are organized like a book:

  1. Book Home
  2. Chapter 1: Orientation
  3. Chapter 2: Installation and Runtime
  4. Chapter 3: First Project
  5. Chapter 4: Core Concepts
  6. Chapter 5: Modeling Workflow
  7. Chapter 6: Viewer and Interaction
  8. Chapter 7: Data IO
  9. Chapter 8: Troubleshooting
  10. Chapter 9: Production and Publishing

Examples

Runnable examples are in examples:

  1. examples/basic_usage.py
  2. examples/01_lattice_to_mesh.py
  3. examples/02_voxel_boolean_filters.py
  4. examples/03_scalar_vector_fields.py
  5. examples/04_openvdb_io.py
  6. examples/05_stl_io_and_mesh_math.py
  7. examples/06_slicing_and_cli.py
  8. examples/07_images_and_tga.py
  9. examples/08_animation_and_csv.py
  10. examples/09_polyline_and_viewer.py
  11. examples/10_utils_tempfolder_log.py
  12. examples/11_viewer_controls_and_timelapse.py

Status

pycogk is actively developed and has production-readiness gates, but it is still an unofficial project and not a drop-in official replacement.

For readiness details, see:

  1. Production Readiness
  2. Parity Matrix
  3. Publishing Guide

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

pycogk-0.1.0.tar.gz (4.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycogk-0.1.0-py3-none-any.whl (4.7 MB view details)

Uploaded Python 3

File details

Details for the file pycogk-0.1.0.tar.gz.

File metadata

  • Download URL: pycogk-0.1.0.tar.gz
  • Upload date:
  • Size: 4.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycogk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 df6716d07d96edb1867a241a9cc9645139ced120de306882f3b192d46e94daa3
MD5 876cc5c34fa2c7dc32373cf055ff3c64
BLAKE2b-256 133f60b8b45d80b9297e925a27b12c69cf71812a0cccd79eec2ac49906018c81

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycogk-0.1.0.tar.gz:

Publisher: publish-pypi.yml on ghedo44/PycoGK

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycogk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pycogk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycogk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf296fa9cb2971cb48398e2f016f72d9be064d5997282fb05cda979afe7da56b
MD5 7a6dbff583102085335f063414f49c4c
BLAKE2b-256 c8b10c623ddb8a96ecf54791906e26e007e28657c0bb2675b60ae24b66827de9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycogk-0.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on ghedo44/PycoGK

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