Python library of Solvespace.
Project description
python-solvespace
Python library from the solver of SolveSpace, an open source CAD software.
The example extracted from unit test:
from python_solvespace import SolverSystem, ResultFlag
sys = SolverSystem()
wp = sys.create_2d_base() # Workplane (Entity)
p0 = sys.add_point_2d(0, 0, wp) # Entity
sys.dragged(p0, wp) # Make a constraint with the entity
...
line0 = sys.add_line_2d(p0, p1, wp) # Create entity with others
...
line1 = sys.add_line_2d(p0, p3, wp)
sys.angle(line0, line1, 45, wp) # Constrain two entities
line1 = sys.entity(-1) # Entity handle can be re-generated and negatively indexed
...
if sys.solve() == ResultFlag.OKAY:
# Get the result (unpack from the entity or parameters)
# x and y are actually float type
dof = sys.dof()
x, y = sys.params(p2.params)
...
else:
# Error!
# Get the list of all constraints
failures = sys.failures()
...
Solver can also be serialized and copied, but can not modify or undo last step.
import pickle
print(pickle.dumps(sys))
sys_new = sys.copy()
The entity and parameter handles should have the same lifetime to the solver.
Install
pip install python-solvespace
Build and Test (Repository)
First build and install the module from the repo:
git submodule update --init extlib/mimalloc
cd cython
pip install -e .
Build the module:
pip install -e . --no-deps
Run the unit tests:
python -m unittest
Uninstall the module:
pip uninstall python-solvespace
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 Distributions
File details
Details for the file python_solvespace-3.0.6.tar.gz
.
File metadata
- Download URL: python_solvespace-3.0.6.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 951b4cf3858dc337bbfa9f6d9efe9fd6e8dfa7fed022556196add1ba5a56b045 |
|
MD5 | 91650d3d67ca44498cfc67eb5c6b9f33 |
|
BLAKE2b-256 | 50a64e01d2c90de41a431041f813aebada874d05d6d578ce25b2462872d2a3e6 |
File details
Details for the file python_solvespace-3.0.6-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: python_solvespace-3.0.6-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 241.7 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aef8e16fcefdab2241c0bab747e94152b8254e96643976964bbcec867639b7e1 |
|
MD5 | 7fc1c5293ff5ae1d746e133a65422c0c |
|
BLAKE2b-256 | e78e195e0b63686b2974a6fa61c7704c7a86e7918889bc0846bd663cdc782ca7 |
File details
Details for the file python_solvespace-3.0.6-cp310-cp310-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: python_solvespace-3.0.6-cp310-cp310-macosx_10_15_x86_64.whl
- Upload date:
- Size: 381.5 kB
- Tags: CPython 3.10, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0b68e54525cab0bafc3d2ed62cd3b5d9ee75d7baf301f4c8cb20d33cd7a7208 |
|
MD5 | 1900cb6b4d29e96423fa6e4f08961418 |
|
BLAKE2b-256 | f4832665a1f62fd3321350859f437bebbcef815fb67aced48c0d3a9bf6c2eb8b |
File details
Details for the file python_solvespace-3.0.6-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: python_solvespace-3.0.6-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 241.2 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c883c4a2680ba0257d7bd389f85cfdb02f2e56aab7afaf11f37bf7d9854c3dd |
|
MD5 | 725017d4565c767257235b043c08759a |
|
BLAKE2b-256 | 0ef3bed66cd885ca48961996f0e2feee64dc6687bbf67f03ce9c916d8cf9ede6 |
File details
Details for the file python_solvespace-3.0.6-cp39-cp39-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: python_solvespace-3.0.6-cp39-cp39-macosx_10_15_x86_64.whl
- Upload date:
- Size: 381.4 kB
- Tags: CPython 3.9, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ce3887773bde38948577188020074d251e2d73851423f4279d47e1114f144ad |
|
MD5 | 85e449c6cafd7264722c0cc96786d713 |
|
BLAKE2b-256 | dc47ec60ab67e690288c7b3727ac213c8234795a9e66c45061d6bdd18c6e0863 |
File details
Details for the file python_solvespace-3.0.6-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: python_solvespace-3.0.6-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 242.3 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 116c0a23bc417e817d18c38e9f0ecded025b8311670ffb99599fe062a7d436d5 |
|
MD5 | 96a85cbd31a67c553a6cfb0a12b12304 |
|
BLAKE2b-256 | 73bf151fd86aa3d57ba85f1f3f2c27585419ca24d20d9397aaa9a9797f42a578 |
File details
Details for the file python_solvespace-3.0.6-cp38-cp38-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: python_solvespace-3.0.6-cp38-cp38-macosx_10_14_x86_64.whl
- Upload date:
- Size: 377.9 kB
- Tags: CPython 3.8, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b0e307aa227ebd688e39d6a0e096ed9a482e93d8f3c247b8293aff5cd63aacc |
|
MD5 | 30af6ddc17f992d992496b70e5b3c8f2 |
|
BLAKE2b-256 | d5ef7193c405eb8016479c22fd71013aabbfd7fd45119a6fdbea3f6e3eaf4d14 |
File details
Details for the file python_solvespace-3.0.6-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: python_solvespace-3.0.6-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 236.6 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ba67d2a88f6d34c67d4f83d7a299056fd7518606d8c3ca9b54b8faa4095d834 |
|
MD5 | 41b9725a161763abd4d009afeefd23ec |
|
BLAKE2b-256 | adc82d145d7afa3d7d84729549571f3b16a6868638712f9604c64b58850543c7 |
File details
Details for the file python_solvespace-3.0.6-cp37-cp37m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: python_solvespace-3.0.6-cp37-cp37m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 374.0 kB
- Tags: CPython 3.7m, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b13165a2274cfc60fb749e09df6e4f03bde3cc88821285fc02264ddede25357c |
|
MD5 | d5bfce0d3611a5f097f57e7d85aa91fc |
|
BLAKE2b-256 | 707fa7a4d2e894ca94d0c43edd9d9aacb24fc487a32dd40018b135112899ee5b |
File details
Details for the file python_solvespace-3.0.6-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: python_solvespace-3.0.6-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 248.2 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04fec66470949add61b086aca192e8715e6c70f5ede3cbd7cda16b118b9cbe68 |
|
MD5 | e057bbff5bed487e2f7e0d65b8bd0bbb |
|
BLAKE2b-256 | 8683cfb27f3eb9e4e1a60a34fe31e72d9891cff2cec643d9bb8001fc6e24aa50 |
File details
Details for the file python_solvespace-3.0.6-cp36-cp36m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: python_solvespace-3.0.6-cp36-cp36m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 380.4 kB
- Tags: CPython 3.6m, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef73c5a5e03af77b8d3bd7cc7f95ffa8a9b3c8cc7bd8d67e5fdbc49b3dc432f2 |
|
MD5 | d0aeb9138cbff03caabada59cfa037f4 |
|
BLAKE2b-256 | 233bc2a9aaa1a548918d3b9f414c2e11bf0f9d19c640a61d88c5adc0528fa0ed |