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

Uploaded Source

Built Distributions

python_solvespace-3.0.7-cp310-cp310-win_amd64.whl (244.1 kB view details)

Uploaded CPython 3.10 Windows x86-64

python_solvespace-3.0.7-cp310-cp310-macosx_10_15_x86_64.whl (383.2 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

python_solvespace-3.0.7-cp39-cp39-win_amd64.whl (243.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

python_solvespace-3.0.7-cp39-cp39-macosx_10_15_x86_64.whl (383.2 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

python_solvespace-3.0.7-cp38-cp38-win_amd64.whl (245.2 kB view details)

Uploaded CPython 3.8 Windows x86-64

python_solvespace-3.0.7-cp38-cp38-macosx_10_14_x86_64.whl (380.3 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

python_solvespace-3.0.7-cp37-cp37m-win_amd64.whl (238.3 kB view details)

Uploaded CPython 3.7m Windows x86-64

python_solvespace-3.0.7-cp37-cp37m-macosx_10_15_x86_64.whl (376.0 kB view details)

Uploaded CPython 3.7m macOS 10.15+ x86-64

python_solvespace-3.0.7-cp36-cp36m-win_amd64.whl (250.0 kB view details)

Uploaded CPython 3.6m Windows x86-64

python_solvespace-3.0.7-cp36-cp36m-macosx_10_14_x86_64.whl (382.4 kB view details)

Uploaded CPython 3.6m macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: python_solvespace-3.0.7.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/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.15

File hashes

Hashes for python_solvespace-3.0.7.tar.gz
Algorithm Hash digest
SHA256 169e8caa54a24951b7d412a61b8007dae73f66c236d219924175a65510efedb4
MD5 bdf77bebfb8ceb6c09584422c43f6aaf
BLAKE2b-256 db86d46947cb016631f8881a27864117288707d4af86f4d144263dc3e693c21c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_solvespace-3.0.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 48d2680920858ffb02ae1c3f4b03a54f3b1d7a2e5c0e779ae5eb542e45551872
MD5 354e7fbe369e041133704e5630496911
BLAKE2b-256 48b816b0aa7836b3931902a0dafc472b1142fc4be5bebd2936611c69b7303831

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_solvespace-3.0.7-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6ead9a79b1ccee52e86d4d02087a826fe065a81bc13fee9581ad0a90a88b71d3
MD5 f941b4c3133cfc31cbf3d14a83403f60
BLAKE2b-256 c5baa1ce31cc2251eef27f28dbff21a588b6ea553de966255aaca212a85e9529

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_solvespace-3.0.7-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9b737c544cddafe9fa172eefb49230133dec036da4499e8dca252fdc0e70dd98
MD5 c33d08d9abb17603299e10525df50da9
BLAKE2b-256 3bc15041faf8b1f76d43cb09084d5843814c126283bad68c9148e6b8a3579c98

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_solvespace-3.0.7-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 761e513621cc887a2b3eb6a8180aec0722822364f7c96e950a759b0b3d60f7dd
MD5 b640328958801c7355b7de15e0f985af
BLAKE2b-256 a71cf6c6a73c9208af3d1d1aed3610cb86411e665f4f47abba18c2a99b0efac0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_solvespace-3.0.7-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e5ccf06167c66a74832982c8efb742a6dce3521d7b52f35977c9b31dc079875f
MD5 799c4cc77b354403e0f09ccd32e29dae
BLAKE2b-256 84056b49cb2dc25a665bbe9ec5a3de765172f04319d6a9ab2b999a53bc28b6f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_solvespace-3.0.7-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 6f6ba2b8d59e967d2433b0564235d337ee412e498e377bbcf4aaff4021e8b62c
MD5 f7cfbd3e922f0606ebbb8c13bb8b85bb
BLAKE2b-256 ea67e740b34dfd8cbf62a676e9697a0b987d4c44e00aee40c76ad61fcead52cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_solvespace-3.0.7-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 91ec19c5e4b4825e0b05adb38432d89f1c44e46a452f5ef60bbd4d749aa55245
MD5 ace0397b7166dcb89ef868c706f5a0d0
BLAKE2b-256 5a9ebd4009465c142959e44e8e8cc3079f9f6d3b253baae91ec1f867a793b5c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_solvespace-3.0.7-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 925e048f00ee7d4ae5741b48fe123a88c3f469a17c464c167cf5fd8c2e07c5a9
MD5 a491fd56b721be09119136fd81f888c6
BLAKE2b-256 4cb03a090875f4878cde1105163ef7a77cd9110df5bbf2d9fb615415b65f3e2d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_solvespace-3.0.7-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 250.0 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/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.8

File hashes

Hashes for python_solvespace-3.0.7-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 8ed50ac724698f0f27a2ed2f621d5c89f92edd6b536dd9ebadc27a4a0491e74a
MD5 703f94c09b8316b96bcc344fbac22ceb
BLAKE2b-256 e8e3fa07662bc6308dbef907eeeeef6c2228db6c82072a7fed31281cee1b8c13

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_solvespace-3.0.7-cp36-cp36m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 382.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/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.15

File hashes

Hashes for python_solvespace-3.0.7-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 50082587844a2cf24e6def02d136d14fa7db9134f3485589b396681e1aedd39c
MD5 c44355539446cb3770be3449d16f1560
BLAKE2b-256 7128b631ee9fe73e48500e75d28642fe8b649b9899309b54e468319ea8b163a5

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