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, which are 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.
It is a pure Python library which 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)
For more detailed examples, please refer to the examples/ directory in the source code.
Test
To run tests, first install pytest, then:
cd tests
python test_all.py
Notable Difference from C++ Code
- In
intersect_bsplines.py, a polyfilledmath_BFGSis used instead ofmath_FRPR. Bothmath_BFGSandmath_FRPRare not usable in OCP because OCP does not exposemath_Vector. Theactivate()function in this file has also been changed since the original one does not work well. - In the
_solve()function inbspline_approx_interp.py, the regularization is added to prevent singular matrix which occurs in some cases for example when the input curve is a bspline converted from a circle. - A new file
misc.pyis added to implement some missing classes/functions from OCP. The major ones areclone_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.3.tar.gz.
File metadata
- Download URL: ocp_gordon-0.1.3.tar.gz
- Upload date:
- Size: 106.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a1a58d732868befab24624870cf48f1ff38678fdc18352cc291b4c240c5f98f
|
|
| MD5 |
1aaf638ec21bf1d0b0b77885d8211da0
|
|
| BLAKE2b-256 |
8f7139da5ee710325541f02da3ac72b68fd18431f086f6776b1a4b13a31810d5
|
Provenance
The following attestation bundles were made for ocp_gordon-0.1.3.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.3.tar.gz -
Subject digest:
4a1a58d732868befab24624870cf48f1ff38678fdc18352cc291b4c240c5f98f - Sigstore transparency entry: 570132652
- Sigstore integration time:
-
Permalink:
gongfan99/ocp_gordon@6a30254f7234ef9263f747d5d1244856e961cb34 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/gongfan99
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6a30254f7234ef9263f747d5d1244856e961cb34 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ocp_gordon-0.1.3-py3-none-any.whl.
File metadata
- Download URL: ocp_gordon-0.1.3-py3-none-any.whl
- Upload date:
- Size: 47.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 |
8ed9eb5903029f93af27543de0e8eb0eec957a5567238e4634869d41958d61a4
|
|
| MD5 |
6d3c5becf82180a80d76690648e7ae89
|
|
| BLAKE2b-256 |
d436904795bd0f52c822f246cb7f6bc159d8d9ec3b90ee1d0fde21bd38fafb5e
|
Provenance
The following attestation bundles were made for ocp_gordon-0.1.3-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.3-py3-none-any.whl -
Subject digest:
8ed9eb5903029f93af27543de0e8eb0eec957a5567238e4634869d41958d61a4 - Sigstore transparency entry: 570132656
- Sigstore integration time:
-
Permalink:
gongfan99/ocp_gordon@6a30254f7234ef9263f747d5d1244856e961cb34 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/gongfan99
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6a30254f7234ef9263f747d5d1244856e961cb34 -
Trigger Event:
push
-
Statement type: