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

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.5.0.tar.gz (173.6 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.5.0-cp313-cp313-win_amd64.whl (346.2 kB view details)

Uploaded CPython 3.13Windows x86-64

planegcs-0.5.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (426.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

planegcs-0.5.0-cp312-cp312-win_amd64.whl (346.2 kB view details)

Uploaded CPython 3.12Windows x86-64

planegcs-0.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (426.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for planegcs-0.5.0.tar.gz
Algorithm Hash digest
SHA256 007a20e6e1d85f3499fddfea236a61ee58a04e1deecc19346ffc02ac3d60906c
MD5 3c5904781690ff9ce97c31ad76ab15dc
BLAKE2b-256 f7eb80c58f26e75e680028a9c66c76fe0fd3117443187bbc53e79cef8423aabd

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: planegcs-0.5.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 346.2 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.5.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5ec938d322848c35b2ba276ae9d91bef3256ad9df81d8b84fbc2be9dfbfe724a
MD5 072e1f2a361eff6b8ba88ad6aa452cef
BLAKE2b-256 6b215198a8918ff22bd1eb60be33ad9f2c48b2fd0d79c9258774694f22d04fcc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for planegcs-0.5.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b5ab59dd88c4185b38ce4983a365c48e613013e050554a9be61894695695e967
MD5 c360c6ea4efa1c6b4ec43f498c8db8c1
BLAKE2b-256 14c23f70dcf8557c236e7b8350d2cc1f2019910aff7d2af4e6231c0ea74653df

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: planegcs-0.5.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 346.2 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.5.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 565c86a40322ea6ea20f1b5a5a0270fecaaa43666faf7b57264f1659cf198b63
MD5 0b2f7a9ec0e83f27afc9f3819708165c
BLAKE2b-256 f0c7795a87abd4f87e41dc4d296c5bf465fbae4311864102412d49655ead00bc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for planegcs-0.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 502f1d497c5517a99b34e0df04cae4f3e7bfc17d5d7f57d0e6659bdce7f4b7d6
MD5 c4f26754cd5b9a7f25d962c150353fa9
BLAKE2b-256 5ac109938676765750d399be1763372720fd04a1fcff4c71b0edd21f9354f5d4

See more details on using hashes here.

Provenance

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