Hacker News new | ask | show | jobs
Constrain – Interactive figures using declarative constraint solving (github.com)
48 points by rachitnigam 1252 days ago
7 comments

I love the idea, although it doesn't seem to perform very smoothly, even on simple examples. A related project is Penrose [^1], except the latter isn't interactive.

[^1]: https://penrose.cs.cmu.edu/

I was always impressed with how well Solidworks constraints could produce models of "mechanisms" — but maybe that's an easier/more easily constrained domain than arbitrary figures?

(Or software UIs: Amulet and Garnet bring up memories — but those were a different Myers)

The triangle demo doesn't seem completely stable, there are occasional flickering glitches, occasionally it also stays in a "wrong" state like this: https://ibb.co/4gD5NcB
GeoGebra's constraint solver has similar issues with this type of figure. I get the impression they get stuck in a local optimum or something.
This is fixed now, by choosing better constraints.
I couldn't find any information about its license.
Solvespace seems a lot more compelling

https://files.whitequark.org/SolveSpace/solvespace.html (web demo)

Looks great, I wonder if it's powerful enough to build a UI toolkit
Looks nice! Why does it use canvas and not SVG?
Canvas is generally more performant so I imagine it could be a better fit depending on how complex things get. Very rarely have I encountered the performance limitations of svg, though it has happened.
There has been some work on an SVG back end. It also supports rendering to PDF and PostScript.