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.7.0.tar.gz (187.7 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.7.0-cp313-cp313-win_amd64.whl (397.1 kB view details)

Uploaded CPython 3.13Windows x86-64

planegcs-0.7.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (468.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.12Windows x86-64

planegcs-0.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (468.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for planegcs-0.7.0.tar.gz
Algorithm Hash digest
SHA256 0e118afe83bef5ad4f6ea52e9418c3b0e3fd7370f34c8364612a6770fe06628b
MD5 801a7186884a380b718fb67c9cc86961
BLAKE2b-256 5cf1ce8c398b2b6d1251e0e9d240a375adc0da6a2bc9007e3e224df5426bf657

See more details on using hashes here.

Provenance

The following attestation bundles were made for planegcs-0.7.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.7.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: planegcs-0.7.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 397.1 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.7.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 707f4517e6e623fc83d8643271be3a043c93c2b1bbe796a26f9917eb1a6ae6ce
MD5 29a7f3a6f37b2562e9a9a2c6a54e598c
BLAKE2b-256 45199f6a6994c1702af84504862c4b943fb15eeafbc170720f35266849b661c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for planegcs-0.7.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.7.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for planegcs-0.7.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f78a03eb0eba9161f1ac47324a1ecfdc2f957ec823202cc629381fd9dbebf115
MD5 32ffb695cb97f1089f2b52ad1d9d63eb
BLAKE2b-256 bde7fe895c67934c7f25d5f1baf377a0da12f02b882bcbf282655beca56982e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for planegcs-0.7.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.7.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: planegcs-0.7.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.7.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a26bfd5318be6ee29667976749d78a71c812fadea9d0e2a467a75fc56b68ec6c
MD5 d55dd4e6742296f920d6ac474ae9e57a
BLAKE2b-256 b4d7de5116a7204f51fca96e69e196550fcb6bcb66bb67e1f1fcd6c2a88c4f3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for planegcs-0.7.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.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for planegcs-0.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fbcda3ac8745416e723985b84802643c1454eca29c02912404667187d9a26943
MD5 a9f3ac1b48bc35990e57512f732e6d53
BLAKE2b-256 2270c6b19168ae6e21845bc45ea8e1cd2c26423af8adb3bad60210ef4a5f6021

See more details on using hashes here.

Provenance

The following attestation bundles were made for planegcs-0.7.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