This project is a fork of AntonEvmenenko/2d_geometric_constraint_solver
- Modify 2d_geometric_constraint_solver into a complete python package that could be used both GUI and headless in other python projects.
- Expand the list of available constraints. At the moment we have added a limit on segment length and distance between points.
- Expand the set of supported geometric primitives.
This project is an attempt to utilize mathematical optimization algorithms, specifically SLSQP, to deal with geometric constraint solving problem.
Currently, the project is not stable and mature enough to be considered seriously, but you can still experiment with it.
Here you can find more information on how it works: https://vmnnk.com/en/2023-10-18/2d-geometric-constraint-solver
pip install -r requirements.txt
python main.py
- Move around the canvas by holding down the mouse wheel button and dragging
- Use the buttons on the left to add a new segment or an arc. You can also use hotkeys ('s' for segment, 'a' for arc)
- Left click the point/segment/arc to select it. Click on an empty space to clear the selection
- The available constraints are automatically displayed for the selected items. Left click the constraint button on the right to apply the constraint
- To delete a segment or an arc, select it and press DELETE
- To remove a constraint, left click its icon and press DELETE
- Press 'i' to print some debug information