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 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

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.8.tar.gz (1.2 MB view details)

Uploaded Source

Built Distributions

python_solvespace-3.0.8-cp311-cp311-win_amd64.whl (242.8 kB view details)

Uploaded CPython 3.11 Windows x86-64

python_solvespace-3.0.8-cp311-cp311-macosx_10_9_universal2.whl (704.0 kB view details)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)

python_solvespace-3.0.8-cp310-cp310-win_amd64.whl (243.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

python_solvespace-3.0.8-cp310-cp310-macosx_10_15_x86_64.whl (386.5 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

python_solvespace-3.0.8-cp39-cp39-win_amd64.whl (248.7 kB view details)

Uploaded CPython 3.9 Windows x86-64

python_solvespace-3.0.8-cp39-cp39-macosx_10_15_x86_64.whl (391.1 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

python_solvespace-3.0.8-cp38-cp38-win_amd64.whl (250.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

python_solvespace-3.0.8-cp38-cp38-macosx_10_15_x86_64.whl (389.4 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

python_solvespace-3.0.8-cp37-cp37m-win_amd64.whl (242.4 kB view details)

Uploaded CPython 3.7m Windows x86-64

python_solvespace-3.0.8-cp37-cp37m-macosx_10_15_x86_64.whl (385.0 kB view details)

Uploaded CPython 3.7m macOS 10.15+ x86-64

python_solvespace-3.0.8-cp36-cp36m-win_amd64.whl (255.6 kB view details)

Uploaded CPython 3.6m Windows x86-64

python_solvespace-3.0.8-cp36-cp36m-macosx_10_14_x86_64.whl (391.9 kB view details)

Uploaded CPython 3.6m macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: python_solvespace-3.0.8.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for python_solvespace-3.0.8.tar.gz
Algorithm Hash digest
SHA256 c5c132c1151cfa4cc8719474bbbafedd109d7203317e531f9160a37aaae644b0
MD5 87e0160d8c6721f66527d9a1c0f83d6a
BLAKE2b-256 70d9edb532941527cfdbd22861ce574a57859952d21132f791a8706fafee9876

See more details on using hashes here.

File details

Details for the file python_solvespace-3.0.8-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for python_solvespace-3.0.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1191b004298d57936058d9dbdd395c44c1f46d5a9c854e36c507c49c3e6b6382
MD5 0a6a9bd51e58855aa40e09468fe70ef2
BLAKE2b-256 b14c0140a197e00be797f3ee26278a9205cccfb668b8c7d7746350bb72bff3c7

See more details on using hashes here.

File details

Details for the file python_solvespace-3.0.8-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for python_solvespace-3.0.8-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 c899978359d95c274bbcc31405b080517af3839beca98e3342c52a37409bb916
MD5 b5e40ff0d148a66201d13e335c4e4145
BLAKE2b-256 e56a3d3f3ffa52b4952a4d63506b20d55e23e5bf34dfd096c185cfd4b262d9a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_solvespace-3.0.8-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 33c150f68c81addf8045e28ffeb28a828fcbbe9ab84cc4a9f1e50d0847b23bfb
MD5 f5a2b27c6fee089f6e15bbcc096042ff
BLAKE2b-256 c7287e8ea55da42cd9e0ab9bdc607f5d57270c553baa9c4dab63866bba7c6e40

See more details on using hashes here.

File details

Details for the file python_solvespace-3.0.8-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for python_solvespace-3.0.8-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 bd3366cda1f3bac7c239c3fad98c6eee97c3d9299ee5c3a1ab3e4ea5e112b81a
MD5 616085e94db7f4c44b6ceb3cd1714a67
BLAKE2b-256 1c73cfd7e631395b036052356517c2c8b8e7917308b4c397694da34260f7eff6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_solvespace-3.0.8-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 da03f9758553af996dc879dc939ce33336721896a8365f3e719491fca913b990
MD5 ca02793f6c1869e097e55af2cb889c17
BLAKE2b-256 f21b1754073fd9ae3322e201fa504fdb4ee5c13fde339ece9bab085b19f1d08e

See more details on using hashes here.

File details

Details for the file python_solvespace-3.0.8-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for python_solvespace-3.0.8-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 967c55b10cc431cc867509c49cfaa164e1313d683029f57a74e4256989b364ba
MD5 db9dee79b45ffe679656a4cc06d17076
BLAKE2b-256 c66435d77989e460fbd392b70eaa1508a4e6db1150c1766b17faf7eeb413594f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_solvespace-3.0.8-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 27343000974e477209dbb4f9d5f46af45d6b6c760b477a8c7a05e2b28a032195
MD5 11ca746a7aba85147839160b477f7bd2
BLAKE2b-256 66a5b7a88d5bbbaf5d4a293e6be1574f83a7730e3359e363cf741fd98b13cefc

See more details on using hashes here.

File details

Details for the file python_solvespace-3.0.8-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for python_solvespace-3.0.8-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 fd195c0ad977fc3f25d3589fee7609eaae4213994ad7faae2cad95c183978dd5
MD5 201c7d03c47706167de5115c6a889f84
BLAKE2b-256 628a136a1ebb52bf5649cd506097022678409c49b7f224202833766cda1a01fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_solvespace-3.0.8-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 1466613204c3814c52bb2532520dae41eea9e792e722a7df428cbc0121e9bde9
MD5 0dba1f04faffb6d50cb20e67cc4e8cc8
BLAKE2b-256 9540d611d381cd8110257f2878fbe53a607f522c22560a18ed83c77dc1692418

See more details on using hashes here.

File details

Details for the file python_solvespace-3.0.8-cp37-cp37m-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for python_solvespace-3.0.8-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 4ae8ad1084a5ade1604401b53699ee3a2e4c7521638b0629ee79e4d5d1c9e718
MD5 5b7572fad666123e9a8f7952ce416a85
BLAKE2b-256 e2156fbdc4406683c4882de70ce325c27594f54d7472940fd19e37658e1898e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_solvespace-3.0.8-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 255.6 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using 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

File hashes

Hashes for python_solvespace-3.0.8-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 c0ecc5fd4fe9fc63079ab371707bd4db6b121d89e15ed8f95650986aa9d57c4c
MD5 7296652a36443dcfcd8ed303a9bc830b
BLAKE2b-256 838600a8f779e7f78626757d5dcf738d6d4debba9a51a076a6172c3586c933d8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_solvespace-3.0.8-cp36-cp36m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 391.9 kB
  • Tags: CPython 3.6m, macOS 10.14+ x86-64
  • Uploaded using 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

File hashes

Hashes for python_solvespace-3.0.8-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 6c682903335fc8caaf93863388dfabf500fc247f3e0207d55ec51a3810682772
MD5 d9df8a5dc29c400d46e2dd9e09665c23
BLAKE2b-256 c0bb14303ae537f11b5a10ecddc76025351a562e6e94e2a37807de9cb95f7340

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