Skip to main content

Python library of Solvespace.

Project description

PyPI GitHub license

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_solvespace-3.0.5.tar.gz (221.3 kB view details)

Uploaded Source

Built Distributions

python_solvespace-3.0.5-cp310-cp310-win_amd64.whl (221.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

python_solvespace-3.0.5-cp310-cp310-macosx_10_14_x86_64.whl (332.2 kB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

python_solvespace-3.0.5-cp39-cp39-win_amd64.whl (220.9 kB view details)

Uploaded CPython 3.9 Windows x86-64

python_solvespace-3.0.5-cp39-cp39-macosx_10_14_x86_64.whl (332.2 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

python_solvespace-3.0.5-cp38-cp38-win_amd64.whl (222.4 kB view details)

Uploaded CPython 3.8 Windows x86-64

python_solvespace-3.0.5-cp38-cp38-macosx_10_14_x86_64.whl (327.9 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

python_solvespace-3.0.5-cp37-cp37m-win_amd64.whl (218.3 kB view details)

Uploaded CPython 3.7m Windows x86-64

python_solvespace-3.0.5-cp37-cp37m-macosx_10_14_x86_64.whl (325.1 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

python_solvespace-3.0.5-cp36-cp36m-win_amd64.whl (218.0 kB view details)

Uploaded CPython 3.6m Windows x86-64

python_solvespace-3.0.5-cp36-cp36m-macosx_10_14_x86_64.whl (327.3 kB view details)

Uploaded CPython 3.6m macOS 10.14+ x86-64

File details

Details for the file python_solvespace-3.0.5.tar.gz.

File metadata

  • Download URL: python_solvespace-3.0.5.tar.gz
  • Upload date:
  • Size: 221.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for python_solvespace-3.0.5.tar.gz
Algorithm Hash digest
SHA256 68d98232849eb0811f374287fe56dcb346ad96193d963a825e244cbd9c536f92
MD5 697391b8922d82190774c3a493d855eb
BLAKE2b-256 1b04430e4046d346c6b58c81d9601abc9b8b17720098e79b44a4344bfcb1d14c

See more details on using hashes here.

File details

Details for the file python_solvespace-3.0.5-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: python_solvespace-3.0.5-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 221.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for python_solvespace-3.0.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6bdeadd53db0c4df9643397b1cb8930e5cd847810a3bf0fad5313a83802e08d1
MD5 71816d832ae67c318d70851ca8493fc7
BLAKE2b-256 c02bdf8148198356a324a241b6374f1ab65085f17488ae927b18a7b822b80971

See more details on using hashes here.

File details

Details for the file python_solvespace-3.0.5-cp310-cp310-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: python_solvespace-3.0.5-cp310-cp310-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 332.2 kB
  • Tags: CPython 3.10, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for python_solvespace-3.0.5-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 33410c9afe30a3abbacad31a5bb5ee897a3a94aba37bd9d433ff924f47cc80b1
MD5 6db0f7439c75dd16f9a65c44cba2d0f7
BLAKE2b-256 7b25d03b0194e24dd0dc34128cfc594f787c3181ce35c94d5c529bd976712978

See more details on using hashes here.

File details

Details for the file python_solvespace-3.0.5-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: python_solvespace-3.0.5-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 220.9 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for python_solvespace-3.0.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 025c25841a5e7914c2b01818ec554527be5fffe5357df1a34672a33dfb4ac262
MD5 7aed9e50b4a460f4b8fd51901f049587
BLAKE2b-256 4295318722499a813732fdea99534ba754e525e656c3f5e893a9351bb276a3bf

See more details on using hashes here.

File details

Details for the file python_solvespace-3.0.5-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: python_solvespace-3.0.5-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 332.2 kB
  • Tags: CPython 3.9, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for python_solvespace-3.0.5-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 7ade63e838fa8663aa850882e1ca599b3bf412532cfaf82a891156d567a2044f
MD5 6cfa78f37c0fc7f8dc8e29006050e7c3
BLAKE2b-256 74a4ab5729dfe7c0ef08d462aa2c4cece7110301e23a32fa7915afc1bb93dfec

See more details on using hashes here.

File details

Details for the file python_solvespace-3.0.5-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: python_solvespace-3.0.5-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 222.4 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for python_solvespace-3.0.5-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 c721bdb1f0b04c149654450fb965a584960cb8cc4bac7579392cd361aa60f4d4
MD5 13fba4cc16801c0cab27061ef3b68b57
BLAKE2b-256 36e1f19078055a77e7d99fbc77bcea37573cec6a0f88352b2e9b9501a92671ee

See more details on using hashes here.

File details

Details for the file python_solvespace-3.0.5-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: python_solvespace-3.0.5-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 327.9 kB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for python_solvespace-3.0.5-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b393e0524ae0fa52bf61437119ccd7f80ae857103b72dd878ba5aa99dc172e21
MD5 707c7737c61236eff5df4086ba5c0c07
BLAKE2b-256 50cfef550270b7c9e4c92e25d60a90cf43fdee47996c9db066bfa64fe6a1fddb

See more details on using hashes here.

File details

Details for the file python_solvespace-3.0.5-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: python_solvespace-3.0.5-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 218.3 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for python_solvespace-3.0.5-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 e14d5430fe905eb910148f6619f3fc937498634d8deeac37d65f447a420f1379
MD5 d4640c77afdcec0b1a2f34237e1a07e3
BLAKE2b-256 4126066e5212266fcaaf052043cd41ef0acf7d685164db5c5138e3a88a1c5b03

See more details on using hashes here.

File details

Details for the file python_solvespace-3.0.5-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: python_solvespace-3.0.5-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 325.1 kB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for python_solvespace-3.0.5-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 eec7a77af3c766067804db6231d4992c38a029bacd5f3a8dbee7ab42e188e037
MD5 381a77d13da28c09a330e834b5a023db
BLAKE2b-256 1cbc60c9ac167cac61945b19242c67d7737e61d9597699afd4245a98184700b1

See more details on using hashes here.

File details

Details for the file python_solvespace-3.0.5-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: python_solvespace-3.0.5-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 218.0 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8

File hashes

Hashes for python_solvespace-3.0.5-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 89ee28f7c99e3dc9141fc90f7a37b2642d861457847f3ba3854f74f427df4596
MD5 c1aadc4445dfc3a30ce5e2da64228d8a
BLAKE2b-256 8899a5194dc9bd13e21e2c061d7a770cde1329de48f9aab10bd95a5cf62c2162

See more details on using hashes here.

File details

Details for the file python_solvespace-3.0.5-cp36-cp36m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: python_solvespace-3.0.5-cp36-cp36m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 327.3 kB
  • Tags: CPython 3.6m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15

File hashes

Hashes for python_solvespace-3.0.5-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 be20eec634055245a15ae31f489cc420f07bee2ed79ff32492d191bc4fc8c5a1
MD5 6f73307aaf84f792c9155e4f054b9f6b
BLAKE2b-256 0c7aaada91bd991681ae19d4a274f4ed65e86229abfdb65350ca924a1bea0867

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page