A Python library for Gordon Surface interpolation using B-splines.
Project description
Gordon Surface Library for CadQuery's OCP
This library provides a Python implementation for creating Gordon surfaces, a method for interpolating a network of curves to generate a smooth surface. It is designed to be compatible with CadQuery's OCP and leverages B-spline mathematics.
The implementation is written entirely in Python and is adapted from the original C++ code in occ_gordon
Features
- Gordon surface interpolation from profile and guide curves.
- Compatibility with B-spline representations.
- Integration with CadQuery's OCP (OpenCASCADE Python) for geometric primitives.
Installation
This package can be installed using pip.
pip install ocp_gordon
Dependencies
- OCP (OpenCASCADE Python)
- NumPy
- SciPy
Usage
Here's a basic example of how to use the library:
# Assume you have profile_curves and guide_curves defined as lists of B-spline objects
# profile_curves = [...] # List of Geom_BSplineCurve objects
# guide_curves = [...] # List of Geom_BSplineCurve objects
from ocp_gordon import interpolate_curve_network
gordon_surface = interpolate_curve_network(profile_curves, guide_curves, tolerance=3e-4)
For more detailed examples, please refer to the examples/ directory in the source code.
Test
To run tests, first install pytest, then:
python -m pytest
Notable Difference from C++ Code
- In
intersect_bsplines.py, themath_BFGSmethod is polyfilled and used in place ofmath_FRPR, as neithermath_BFGSnormath_FRPRis usable in OCP due to the lack ofmath_Vectorexposure. The intersect detection algorithm has been improved for both speed and reliability. - In the
_solve()function ofbspline_approx_interp.py, regularization has been added to prevent singular matrix issues, which can occur in cases such as when the input curve is a B-spline derived from a circle. - A new file,
misc.py, has been introduced to implement missing OCP utilities. The primary additions includeclone_bsplineandmath_BFGS.
License
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Citing
The algorithm was originally described in:
@article{siggel2019tigl,
title={TiGL: an open source computational geometry library for parametric aircraft design},
author={Siggel, Martin and Kleinert, Jan and Stollenwerk, Tobias and Maierl, Reinhold},
journal={Mathematics in Computer Science},
volume={13},
number={3},
pages={367--389},
year={2019},
publisher={Springer},
doi={10.1007/s11786-019-00401-y}
}
Project details
Release history Release notifications | RSS feed
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 ocp_gordon-0.1.14.tar.gz.
File metadata
- Download URL: ocp_gordon-0.1.14.tar.gz
- Upload date:
- Size: 114.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a552f7c53018a2a96c44c1e8a73c19b88125bfd3d90241ee69a92c95af6dcc16
|
|
| MD5 |
6cb0a1d6a053e00808bcb2f965401d20
|
|
| BLAKE2b-256 |
cb8421592d1bdba14b2c177e6e929042963803bc869c89fb242e4bde40699b6f
|
Provenance
The following attestation bundles were made for ocp_gordon-0.1.14.tar.gz:
Publisher:
release.yml on gongfan99/ocp_gordon
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ocp_gordon-0.1.14.tar.gz -
Subject digest:
a552f7c53018a2a96c44c1e8a73c19b88125bfd3d90241ee69a92c95af6dcc16 - Sigstore transparency entry: 601053619
- Sigstore integration time:
-
Permalink:
gongfan99/ocp_gordon@fdbc3f624e9844903dd125fa9a7ff476d5573f5b -
Branch / Tag:
refs/tags/v0.1.14 - Owner: https://github.com/gongfan99
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fdbc3f624e9844903dd125fa9a7ff476d5573f5b -
Trigger Event:
push
-
Statement type:
File details
Details for the file ocp_gordon-0.1.14-py3-none-any.whl.
File metadata
- Download URL: ocp_gordon-0.1.14-py3-none-any.whl
- Upload date:
- Size: 51.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02ee43a88770343f41701a5bdf9245d55db4bbb20b1ae341631f118dfc5d53ea
|
|
| MD5 |
c7c452d56a5e045dae022d9050bc1b83
|
|
| BLAKE2b-256 |
d9502cc8a6972f781ca33c7d0ce78a3e3fc7c00981dedd2a1ce40bc35b1f80c1
|
Provenance
The following attestation bundles were made for ocp_gordon-0.1.14-py3-none-any.whl:
Publisher:
release.yml on gongfan99/ocp_gordon
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ocp_gordon-0.1.14-py3-none-any.whl -
Subject digest:
02ee43a88770343f41701a5bdf9245d55db4bbb20b1ae341631f118dfc5d53ea - Sigstore transparency entry: 601053622
- Sigstore integration time:
-
Permalink:
gongfan99/ocp_gordon@fdbc3f624e9844903dd125fa9a7ff476d5573f5b -
Branch / Tag:
refs/tags/v0.1.14 - Owner: https://github.com/gongfan99
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fdbc3f624e9844903dd125fa9a7ff476d5573f5b -
Trigger Event:
push
-
Statement type: