Pycork is a Python library offering the functionality of the Cork boolean CSG library in a compiler friendly form suitable across all platforms. The library includes the dependencies for the Multi-Precision Integer and Rationals (MPIR) 3.0 built-in used by the Cork libary. The package aims to provide a simpler route for compiling the package for individuals and in addition, generating python bindings for use across other projects. Refactoring has been authored to tidy up the existing codebase so that it can be built across multiple platforms, in particular Windows, using the CMake build-system. At this stage, no further optimisations or improvements will be made specifically to the cork library, inclusive of its algorithms.
The python bindings are simple and offer access to the core functionality offered by the Cork library to perform boolean operations on watertight meshes. Additionally, it removes the awkward step of generatig .off files that are used in the command-line interface of the Cork library. The user may pass triangular meshes (vertices, tri-faces indices) as numpy arrays to each function.
For further information, see the latest release notes.
Installation
Installation is currently supported on Windows. No special requiremnets are necessary for using pycork, except having the numpy library available. It is recommend to also install the trimesh library to provide an interface to processing meshes as input for pycork.
conda install -c numpy
pip install trimesh
Installation of pycork can then be performed using pre-built python packages using the PyPi repository.
pip install pycork
Alternatively, pycork may be compiled directly from source. Currently the prerequisites are the a compliant c++ build environment, include CMake build system. Currently the package has been tested on Windows 10, using VS2019.
git clone https://github.com/drlukeparry/pycork.git && cd ./pycork
git submodule update --init --recursive
python setup.py install
Usage
The Cork CSG library, by design, has a simple interface for is functionality. Further detailed description of the function is therefore not necessary.
import numpy as np
import trimesh
import pycork
# Note any manifold, watertight mesh can be used in conjuction with the Trimesh library
meshA = trimesh.load_mesh('meshA.off')
meshB = trimesh.load_mesh('meshB.off')
# Extra list of vertices and triangular faces from the meshes
vertsA = meshA.vertices
trisA = meshA.faces
vertsB = meshB.vertices
trisB = meshB.faces
pycork.isSolid(vertsA, trisA)
pycork.isSolid(vertsB, trisB)
#Perform the boolean opertions directly with Cork library
vertsC, trisC = pycork.union(vertsA, trisA,
vertsB, trisB)
vertsD, trisD = pycork.intersection(vertsA, trisA,
vertsB, trisB)
meshC = trimesh.Trimesh(vertices=vertsC, faces=trisC, process=True)
Metadata
Release files for pycork 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pycork-0.1.0.tar.gz | 3.4 MB | Without provenance | Details for pycork-0.1.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| pycork-0.1.0-cp39-cp39-win_amd64.whl | CPython 3.9 | CPython 3.9 | Windows x86-64 | Details for pycork-0.1.0-cp39-cp39-win_amd64.whl |
| pycork-0.1.0-cp38-cp38-win_amd64.whl | CPython 3.8 | CPython 3.8 | Windows x86-64 | Details for pycork-0.1.0-cp38-cp38-win_amd64.whl |
| pycork-0.1.0-cp37-cp37m-win_amd64.whl | CPython 3.7 | CPython 3.7 pymalloc | Windows x86-64 | Details for pycork-0.1.0-cp37-cp37m-win_amd64.whl |
| pycork-0.1.0-cp36-cp36m-win_amd64.whl | CPython 3.6 | CPython 3.6 pymalloc | Windows x86-64 | Details for pycork-0.1.0-cp36-cp36m-win_amd64.whl |
| pycork-0.1.0-cp35-cp35m-win_amd64.whl | CPython 3.5 | CPython 3.5 pymalloc | Windows x86-64 | Details for pycork-0.1.0-cp35-cp35m-win_amd64.whl |
Total release size: 4.3 MB
Release files / pycork-0.1.0.tar.gz
| Download URL | pycork-0.1.0.tar.gz |
|---|---|
| Size | 3.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
05677aa5918fe657caf36318da97b04815cfdcc94f6681516c71d771f1573817
|
|
BLAKE2b-256 checksum How to use checksums |
208dcc3d5a7ba1d522ba48b0207c9245a3872514fa49598a769346321c0c9289
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
|
Release files / pycork-0.1.0-cp39-cp39-win_amd64.whl
| Download URL | pycork-0.1.0-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 173.3 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
81fac34e34c13ef9a9536507feb91abf999b13b14549d39c121076ae8cc55e1d
|
|
BLAKE2b-256 checksum How to use checksums |
186f0ce3af95608d6978c3cf5bd6335d1714a2404eab16481504a92b9d096332
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / pycork-0.1.0-cp38-cp38-win_amd64.whl
| Download URL | pycork-0.1.0-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 174.0 kB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
279187cedcf335b2c4ecf1d619014e5f15fb95bfa2ea7c2e802265c9bdda6ddc
|
|
BLAKE2b-256 checksum How to use checksums |
c9d0ed7129e0ce0d091c7b1ad4e323fc4c4dc51ac3df62914cbf59ace53988f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / pycork-0.1.0-cp37-cp37m-win_amd64.whl
| Download URL | pycork-0.1.0-cp37-cp37m-win_amd64.whl |
|---|---|
| Size | 174.2 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1752534774d2c1b883449cdcf8784cb574a51559add1157e066e02b4c001618f
|
|
BLAKE2b-256 checksum How to use checksums |
610ff325352cfdcfdecba527244f4112e102b1dbe2d0ac1caf4377aead2c4e34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9
|
Release files / pycork-0.1.0-cp36-cp36m-win_amd64.whl
| Download URL | pycork-0.1.0-cp36-cp36m-win_amd64.whl |
|---|---|
| Size | 174.2 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d449f456b68c9be5d49f330613839e23e33961c3a9bd1f14e0430089a63fdade
|
|
BLAKE2b-256 checksum How to use checksums |
ea4111175981f508865f8b669c909fa072b8f7cbf8f6c729f73640569a08d982
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8
|
Release files / pycork-0.1.0-cp35-cp35m-win_amd64.whl
| Download URL | pycork-0.1.0-cp35-cp35m-win_amd64.whl |
|---|---|
| Size | 174.1 kB |
| Tags | CPython 3.5 CPython 3.5 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d3f9f0c442720647d2310edd8708dc888afa700df50759c8e6d5580aededb5a2
|
|
BLAKE2b-256 checksum How to use checksums |
6423f4c5cc6c247fba5477209b0979aaed22dcb58eec0998a57b5456fb2fa993
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.2 requests/2.25.1 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.5.4
|
Security for pycork 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.