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 extlib/eigen
cd cython
pip install -e .
Rebuild the module:
pip install -e . --no-deps
Run the unit tests:
python -m unittest
Uninstall the module:
pip uninstall python-solvespace
Release files for python-solvespace 3.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python_solvespace-3.0.8.tar.gz | 1.2 MB | Details |
Built distributions (wheels)
Total release size: 5.4 MB
Release files / python_solvespace-3.0.8.tar.gz
| Download URL | python_solvespace-3.0.8.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c5c132c1151cfa4cc8719474bbbafedd109d7203317e531f9160a37aaae644b0
|
|
BLAKE2b-256 checksum How to use checksums |
70d9edb532941527cfdbd22861ce574a57859952d21132f791a8706fafee9876
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / python_solvespace-3.0.8-cp311-cp311-win_amd64.whl
| Download URL | python_solvespace-3.0.8-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 242.8 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1191b004298d57936058d9dbdd395c44c1f46d5a9c854e36c507c49c3e6b6382
|
|
BLAKE2b-256 checksum How to use checksums |
b14c0140a197e00be797f3ee26278a9205cccfb668b8c7d7746350bb72bff3c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.0
|
Release files / python_solvespace-3.0.8-cp311-cp311-macosx_10_9_universal2.whl
| Download URL | python_solvespace-3.0.8-cp311-cp311-macosx_10_9_universal2.whl |
|---|---|
| Size | 704.0 kB |
| Tags | CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
c899978359d95c274bbcc31405b080517af3839beca98e3342c52a37409bb916
|
|
BLAKE2b-256 checksum How to use checksums |
e56a3d3f3ffa52b4952a4d63506b20d55e23e5bf34dfd096c185cfd4b262d9a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.0
|
Release files / python_solvespace-3.0.8-cp310-cp310-win_amd64.whl
| Download URL | python_solvespace-3.0.8-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 243.4 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
33c150f68c81addf8045e28ffeb28a828fcbbe9ab84cc4a9f1e50d0847b23bfb
|
|
BLAKE2b-256 checksum How to use checksums |
c7287e8ea55da42cd9e0ab9bdc607f5d57270c553baa9c4dab63866bba7c6e40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / python_solvespace-3.0.8-cp310-cp310-macosx_10_15_x86_64.whl
| Download URL | python_solvespace-3.0.8-cp310-cp310-macosx_10_15_x86_64.whl |
|---|---|
| Size | 386.5 kB |
| Tags | CPython 3.10 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
bd3366cda1f3bac7c239c3fad98c6eee97c3d9299ee5c3a1ab3e4ea5e112b81a
|
|
BLAKE2b-256 checksum How to use checksums |
1c73cfd7e631395b036052356517c2c8b8e7917308b4c397694da34260f7eff6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.8
|
Release files / python_solvespace-3.0.8-cp39-cp39-win_amd64.whl
| Download URL | python_solvespace-3.0.8-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 248.7 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
da03f9758553af996dc879dc939ce33336721896a8365f3e719491fca913b990
|
|
BLAKE2b-256 checksum How to use checksums |
f21b1754073fd9ae3322e201fa504fdb4ee5c13fde339ece9bab085b19f1d08e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / python_solvespace-3.0.8-cp39-cp39-macosx_10_15_x86_64.whl
| Download URL | python_solvespace-3.0.8-cp39-cp39-macosx_10_15_x86_64.whl |
|---|---|
| Size | 391.1 kB |
| Tags | CPython 3.9 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
967c55b10cc431cc867509c49cfaa164e1313d683029f57a74e4256989b364ba
|
|
BLAKE2b-256 checksum How to use checksums |
c66435d77989e460fbd392b70eaa1508a4e6db1150c1766b17faf7eeb413594f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|
Release files / python_solvespace-3.0.8-cp38-cp38-win_amd64.whl
| Download URL | python_solvespace-3.0.8-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 250.1 kB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
27343000974e477209dbb4f9d5f46af45d6b6c760b477a8c7a05e2b28a032195
|
|
BLAKE2b-256 checksum How to use checksums |
66a5b7a88d5bbbaf5d4a293e6be1574f83a7730e3359e363cf741fd98b13cefc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.10
|
Release files / python_solvespace-3.0.8-cp38-cp38-macosx_10_15_x86_64.whl
| Download URL | python_solvespace-3.0.8-cp38-cp38-macosx_10_15_x86_64.whl |
|---|---|
| Size | 389.4 kB |
| Tags | CPython 3.8 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
fd195c0ad977fc3f25d3589fee7609eaae4213994ad7faae2cad95c183978dd5
|
|
BLAKE2b-256 checksum How to use checksums |
628a136a1ebb52bf5649cd506097022678409c49b7f224202833766cda1a01fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.14
|
Release files / python_solvespace-3.0.8-cp37-cp37m-win_amd64.whl
| Download URL | python_solvespace-3.0.8-cp37-cp37m-win_amd64.whl |
|---|---|
| Size | 242.4 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1466613204c3814c52bb2532520dae41eea9e792e722a7df428cbc0121e9bde9
|
|
BLAKE2b-256 checksum How to use checksums |
9540d611d381cd8110257f2878fbe53a607f522c22560a18ed83c77dc1692418
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.9
|
Release files / python_solvespace-3.0.8-cp37-cp37m-macosx_10_15_x86_64.whl
| Download URL | python_solvespace-3.0.8-cp37-cp37m-macosx_10_15_x86_64.whl |
|---|---|
| Size | 385.0 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
4ae8ad1084a5ade1604401b53699ee3a2e4c7521638b0629ee79e4d5d1c9e718
|
|
BLAKE2b-256 checksum How to use checksums |
e2156fbdc4406683c4882de70ce325c27594f54d7472940fd19e37658e1898e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.15
|
Release files / python_solvespace-3.0.8-cp36-cp36m-win_amd64.whl
| Download URL | python_solvespace-3.0.8-cp36-cp36m-win_amd64.whl |
|---|---|
| Size | 255.6 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
c0ecc5fd4fe9fc63079ab371707bd4db6b121d89e15ed8f95650986aa9d57c4c
|
|
BLAKE2b-256 checksum How to use checksums |
838600a8f779e7f78626757d5dcf738d6d4debba9a51a076a6172c3586c933d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8
|
Release files / python_solvespace-3.0.8-cp36-cp36m-macosx_10_14_x86_64.whl
| Download URL | python_solvespace-3.0.8-cp36-cp36m-macosx_10_14_x86_64.whl |
|---|---|
| Size | 391.9 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc macOS 10.14+ x86-64 |
|
SHA-256 checksum How to use checksums |
6c682903335fc8caaf93863388dfabf500fc247f3e0207d55ec51a3810682772
|
|
BLAKE2b-256 checksum How to use checksums |
c0bb14303ae537f11b5a10ecddc76025351a562e6e94e2a37807de9cb95f7340
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15
|