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.4.0.tar.gz (141.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.4.0-cp313-cp313-win_amd64.whl (325.3 kB view details)

Uploaded CPython 3.13Windows x86-64

planegcs-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (396.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

planegcs-0.4.0-cp312-cp312-win_amd64.whl (325.3 kB view details)

Uploaded CPython 3.12Windows x86-64

planegcs-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (397.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for planegcs-0.4.0.tar.gz
Algorithm Hash digest
SHA256 8104837dc1af1693d93a5d562697f2fb8ac483e6900e4b04f49805ccaff9e2ac
MD5 e8f7721258e90ab9accb284ba6a2b250
BLAKE2b-256 7ec12d6f43ac55fadf47033a9501939113d2993765e7d4e06df808a3c473912b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: planegcs-0.4.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 325.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.4.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 03ce70add6b2995c8a401a3d45281ad36cd662369ae36f692d60422d30165f71
MD5 e2c72be56430efd05ccbce570dc36596
BLAKE2b-256 9405f1b2e8c7b99562d1bac2781ef0a6a50613f6f61bfa327b5867a499c42137

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for planegcs-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c440b798f0f62e4646e4e282a6a8aea1fe162d1bdd88b11350062255836fbdd2
MD5 cd1d1613d20f2ab2483ef5a2d5f20ada
BLAKE2b-256 bfa64a118b43654c1a1f2d8998dda8162f3487aac7b0716e38f23d923676725c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: planegcs-0.4.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 325.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.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1f0b5d133b1f12b74b305d35ad75e32b10cd26655d470d5fc0d880156c168820
MD5 d3ba3a05dc32585489ee1532775bb4c9
BLAKE2b-256 da0553bc14ff86d9cb02906330463f16bdadc46972c7a136e2badff559c8dd2c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for planegcs-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7fd29bd98ad6c8f064dd63a0d90957d559009da1fb849a2143da9f16c48850c7
MD5 3aa0c7f068199f4122d72acad481e7b9
BLAKE2b-256 0a232ef7b00ab7ec6457da00ea17a13add03ea83d21616b5f41ff608437dd26d

See more details on using hashes here.

Provenance

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