Skip to main content

Python bindings for FreeCAD's PlaneGCS 2D geometric constraint solver

Project description

planegcs

Python bindings for FreeCAD's PlaneGCS 2D geometric constraint solver.

This project extracts the constraint solver system from FreeCAD's Sketcher component, changes the headers so that it can be used outside FreeCAD, and adds some thin C++ and Python wrappers so it can be used as a Python library. As per the FreeCAD licence requirements, the result is licenced under the LPGL 2.1 or later.

Installation

pip install planegcs

or:

uv add planegcs

If wheels aren't available, you'll need C++ tools and some development headers:

  • eigen3
  • boost

Quick Start

from planegcs import Sketch, SolveStatus

s = Sketch()

# Create three points for a triangle
p1 = s.add_fixed_point(0, 0)
p2 = s.add_point(5, 0)
p3 = s.add_point(2.5, 4)

# Create lines
l1 = s.add_line(p1, p2)
l2 = s.add_line(p2, p3)
l3 = s.add_line(p3, p1)

# Make it equilateral
s.equal_length(l1, l2)
s.equal_length(l2, l3)

# Make base horizontal
s.horizontal(l1)

# Fix the side length to 5
s.set_p2p_distance(p1, p2, 5.0)

# Solve
status = s.solve()
assert status == SolveStatus.Success

# Read results
print(s.get_point(p1))  # (0.0, 0.0)
print(s.get_point(p2))  # (5.0, 0.0)
print(s.get_point(p3))  # (~2.5, ~4.33)

Docs

Full documentation at readthedocs, and in the docs/ folder (requires Sphinx to build).

Contributing

See CONTRIBUTING.md for details on coding standards.

License

LGPL-2.1-or-later (same as the FreeCAD source code it wraps).

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

planegcs-0.8.0.tar.gz (188.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

planegcs-0.8.0-cp313-cp313-win_amd64.whl (397.2 kB view details)

Uploaded CPython 3.13Windows x86-64

planegcs-0.8.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (468.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

planegcs-0.8.0-cp312-cp312-win_amd64.whl (397.1 kB view details)

Uploaded CPython 3.12Windows x86-64

planegcs-0.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (468.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

File details

Details for the file planegcs-0.8.0.tar.gz.

File metadata

  • Download URL: planegcs-0.8.0.tar.gz
  • Upload date:
  • Size: 188.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for planegcs-0.8.0.tar.gz
Algorithm Hash digest
SHA256 09e77e6e3a27fa77d3b5a69065ea4c82ae6ed35753246a2e518b1a6005fea162
MD5 2f2dfb0c61523ca737050c0c1d62bfa2
BLAKE2b-256 6c6d2ae123c5913387f52ab5b969f25bbc513d41f04546ecc5662ab86464a495

See more details on using hashes here.

Provenance

The following attestation bundles were made for planegcs-0.8.0.tar.gz:

Publisher: release.yml on spookylukey/planegcs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file planegcs-0.8.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: planegcs-0.8.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 397.2 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for planegcs-0.8.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6412308c98004dc4d02f0e169c11553bc73ca5ec01b9b8756fc0c2f4fb0792ae
MD5 bd89a6ff122639c7d13d9ccd45f3b3f2
BLAKE2b-256 f1909e15c226932056a636c911f0df88981395c619992df8a07c56e266d16f71

See more details on using hashes here.

Provenance

The following attestation bundles were made for planegcs-0.8.0-cp313-cp313-win_amd64.whl:

Publisher: release.yml on spookylukey/planegcs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file planegcs-0.8.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for planegcs-0.8.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 de30b5b34e43b5f8bf4c11d89e625ddfd633ded2a621e71e58146d12721d0cfb
MD5 dfc09ee726f32c309b8f430c54a4604f
BLAKE2b-256 a9407ca54bb9b36d4a6e1c8bc8576518b2b90183629bc22fc21e846cafe2c899

See more details on using hashes here.

Provenance

The following attestation bundles were made for planegcs-0.8.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on spookylukey/planegcs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file planegcs-0.8.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: planegcs-0.8.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 397.1 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for planegcs-0.8.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 eaca385138e8ae01402c432b7eafd1eece71f77913576c3fbb90a97280cc263f
MD5 fe3e1332a00e599ce4c4e7ad0490bc5e
BLAKE2b-256 01b4c8679aef89e1457e969e97bbeaaa20e4fc705fa69926b3b6e37935344d4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for planegcs-0.8.0-cp312-cp312-win_amd64.whl:

Publisher: release.yml on spookylukey/planegcs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file planegcs-0.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for planegcs-0.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b7cee480273c1544534f374cc09e068cbcc04625313cbb42a0af386a27537bd1
MD5 3366fda2d2e5c31dd2779af22b535dfa
BLAKE2b-256 53bc1b9f891f47946622d48023d4f7d89a61d4bc9e961612510665bfcfc67360

See more details on using hashes here.

Provenance

The following attestation bundles were made for planegcs-0.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on spookylukey/planegcs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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