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.6.0.tar.gz (183.2 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.6.0-cp313-cp313-win_amd64.whl (384.3 kB view details)

Uploaded CPython 3.13Windows x86-64

planegcs-0.6.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (468.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

planegcs-0.6.0-cp312-cp312-win_amd64.whl (384.3 kB view details)

Uploaded CPython 3.12Windows x86-64

planegcs-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (467.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for planegcs-0.6.0.tar.gz
Algorithm Hash digest
SHA256 aa3ba513a7ee962bab16c79b35a1a4bc39f24f34a79f1d96e53b1b552feceecc
MD5 918f44d0b6b6aec16afaa96a609e8889
BLAKE2b-256 0f7e4c4712bc2a4e89524145ff423bc0cf55fde3cf06acaad525b033cbb6743f

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for planegcs-0.6.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9396811678d8bd86cdc92f55404f4f8f4bff087f04d226b132516b70dbad1c85
MD5 e87ac1f4b6a3ee7d70fc4c28373e3603
BLAKE2b-256 43eada44e1d9d312af19b0b96797d3574ec12c84feba7053ca247116968548bd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for planegcs-0.6.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6fbff2aae42355dfe38c210c51b9a7feefff32e4fc2df4eaf8c33924abe52ad9
MD5 22a818b91c66e64b5a910cfa2b9f3fb9
BLAKE2b-256 affd5a13b4f3e07231ffc55a5016f73f410913eb5184e6bc12cea48a7048643c

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for planegcs-0.6.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1a5b162630b6d20e18c2ad2fa17659dec26bc11c8d0f1b7e94600bb1d665bec8
MD5 9e51c7605a30828bea298a8b6379afa2
BLAKE2b-256 4bc8d1e3e22514fe8c06320ed29c6fbbddf7e648a1d9a7f6cc2a5071821f1a4c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for planegcs-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 21b8e08f0397ac9d8323c252777842a197c99b5368ef57b1691eebca93d18000
MD5 70fee83d4aadf6238db0ee53a56d20d6
BLAKE2b-256 51e6145be7f3cab6abc086ec600428091737958e6014e7d219f99979374e84a8

See more details on using hashes here.

Provenance

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