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.
- Official PicoGK project (C++ / C#): https://github.com/leap71/PicoGK
- This Python package repository: https://github.com/ghedo44/PycoGK
The package keeps a PicoGK-like API where practical while adapting parts of the experience to Python, including a vedo-based viewer layer.
Project Layers: picogk and shapekernel
This repository ships two Python layers that are designed to work together.
picogk (runtime and low-level API)
picogk is the runtime-facing layer.
It wraps the PicoGK native library via ctypes and exposes core primitives and utilities such as:
Library,go, and viewer orchestration.Lattice,Voxels,Mesh, andPolyLine.ScalarFieldandVectorField.- Native-format IO helpers and processing utilities.
Use picogk when you want direct control over runtime operations, lifecycle, and API behavior.
shapekernel (high-level modeling layer)
shapekernel is a higher-level geometric modeling toolkit built on top of picogk.
It provides reusable shape abstractions and modeling workflows inspired by ShapeKernel concepts:
- Parametric base shapes (
BaseBox,BaseCylinder,BaseSphere, and more). - Frame/spline/modulation utilities for constructing complex geometry.
- High-level helper toolkits (
Sh,Measure,MeshUtility,CylUtility). - Visualization and migration helpers for ShapeKernel-style workflows.
Use shapekernel when you want expressive construction patterns and less low-level plumbing.
Relationship Between Them
shapekerneldepends on and usespicogkfor runtime execution.picogkdoes not depend onshapekernel.- You can adopt either layer independently, or combine both in one workflow.
Practical mental model:
- Author geometry logic in
shapekernelwhen useful. - Convert/process/render/export through
picogkruntime objects.
Why pycogk
Use pycogk when you want to script computational geometry workflows in Python while leveraging PicoGK runtime capabilities:
- Build implicit geometry with lattices.
- Convert to voxels and apply boolean/filter/offset operations.
- Extract meshes and work with STL/VDB/CLI/TGA.
- Create scalar/vector field workflows.
- 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:
win-x64osx-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, VedoViewer, go
viewer = VedoViewer(title="pycogk Quickstart")
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:
viewer.Add(msh, nGroupID=1)
viewer.SetViewAngles(30.0, 20.0)
viewer.RequestUpdate()
print("triangles:", msh.nTriangleCount())
go(0.5, task, end_on_task_completion=False, viewer=viewer)
Close the viewer window to end the program.
Documentation
Documentation is split into two tracks:
picogkdocs: runtime-centric API and production workflows.shapekerneldocs: high-level shape, spline, frame, and modeling composition workflows.
picogk docs
- Book Home
- Chapter 1: Orientation
- Chapter 2: Installation and Runtime
- Chapter 3: First Project
- Chapter 4: Core Concepts
- Chapter 5: Modeling Workflow
- Chapter 6: Viewer and Interaction
- Chapter 7: Data IO
- Chapter 8: Troubleshooting
- Chapter 9: Production and Publishing
shapekernel docs
- Book Home
- Chapter 1: Orientation
- Chapter 2: Concept Mapping
- Chapter 3: Frames and Splines
- Chapter 4: Base Shapes
- Chapter 5: Modulations and Utility Functions
- Chapter 6: Visualization and Preview
- Chapter 7: Measurements and Runtime Helpers
- Chapter 8: Migration Guide
Examples
Runnable examples are in examples:
- examples/basic_usage.py
- examples/01_lattice_to_mesh.py
- examples/02_voxel_boolean_filters.py
- examples/03_scalar_vector_fields.py
- examples/04_openvdb_io.py
- examples/05_stl_io_and_mesh_math.py
- examples/06_slicing_and_cli.py
- examples/07_images_and_tga.py
- examples/08_animation_and_csv.py
- examples/09_polyline_and_viewer.py
- examples/10_utils_tempfolder_log.py
- examples/11_viewer_controls_and_timelapse.py
ShapeKernel-focused examples are in examples/shapekernel:
- examples/shapekernel/example_spline.py
- examples/shapekernel/ex_base_box_showcase.py
- examples/shapekernel/ex_base_cylinder_showcase.py
- examples/shapekernel/ex_base_lens_showcase.py
- examples/shapekernel/ex_base_pipe_segment_showcase.py
- examples/shapekernel/ex_base_pipe_showcase.py
- examples/shapekernel/ex_base_ring_showcase.py
- examples/shapekernel/ex_base_sphere_showcase.py
- examples/shapekernel/ex_basic_lattices.py
- examples/shapekernel/ex_lattice_manifold_showcase.py
- examples/shapekernel/ex_lattice_pipe_showcase.py
- examples/shapekernel/migration_sh_preview_equivalents.py
- examples/shapekernel/migration_visualization_equivalents.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:
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pycogk-0.2.0.tar.gz.
File metadata
- Download URL: pycogk-0.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba909920ea02d116cfe1a466b8d7c0a1f8494a12284412bec31837df3d3c736d
|
|
| MD5 |
5ca9359b42b35c825585c8af06e67b47
|
|
| BLAKE2b-256 |
f4511f9bad35b7139365b6c66ef6a746b0d31572c294391bea9bfe9a15800fcf
|
Provenance
The following attestation bundles were made for pycogk-0.2.0.tar.gz:
Publisher:
publish-pypi.yml on ghedo44/PycoGK
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pycogk-0.2.0.tar.gz -
Subject digest:
ba909920ea02d116cfe1a466b8d7c0a1f8494a12284412bec31837df3d3c736d - Sigstore transparency entry: 1111539154
- Sigstore integration time:
-
Permalink:
ghedo44/PycoGK@dd0d635bf0fd0eaef5052731cd2d83225d85197b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ghedo44
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@dd0d635bf0fd0eaef5052731cd2d83225d85197b -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pycogk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pycogk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4a5afa2a011e4dbf4366d78ce55a730d6716778c4522728e2d4aa4edaa41d22
|
|
| MD5 |
4244e499cfbebfa5dbd8ea92ab54aad0
|
|
| BLAKE2b-256 |
9b3cc8dda7622713f5291c8a863c3ddfa26047b268df16e68b30c112622647be
|
Provenance
The following attestation bundles were made for pycogk-0.2.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on ghedo44/PycoGK
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pycogk-0.2.0-py3-none-any.whl -
Subject digest:
e4a5afa2a011e4dbf4366d78ce55a730d6716778c4522728e2d4aa4edaa41d22 - Sigstore transparency entry: 1111539218
- Sigstore integration time:
-
Permalink:
ghedo44/PycoGK@dd0d635bf0fd0eaef5052731cd2d83225d85197b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ghedo44
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@dd0d635bf0fd0eaef5052731cd2d83225d85197b -
Trigger Event:
workflow_dispatch
-
Statement type: