<p>Its called a <strong>geometric constraints solver</strong> (a <a href="https://www.cs.purdue.edu/homes/cmh/distribution/papers/Constraints/CAD95.pdf" rel="nofollow noreferrer">good primer</a> on subject). You can find a open source solver as part of <a href="http://www.opencascade.com/" rel="nofollow noreferrer">Open Cascade</a> but its a bit convoluted to get going. A simpler solution for just solving, but also 3D solver capable, is <a href="http://geosolver.sourceforge.net/" rel="nofollow noreferrer">geosolver</a>.</p>

<p>Making your own (algebraic solution being easiest to write) is also not that hard, just a bit of work to make it automatically write the equations (and be efficient at solving). Take the following drawing as a example (made and solved with Mathematica):</p>

<p><a href="https://i.sstatic.net/hoDbc.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/hoDbc.png" alt="enter image description here"></a></p>

<p>You can simply conclude that its a sum of vectors that has to loop back at the origin thus:</p>

<p>$$
7\begin{pmatrix}\sin(15^\circ)\\ \cos(15^\circ)\end{pmatrix}+5\begin{pmatrix}\sin(120^\circ)\\ \cos(120^\circ)\end{pmatrix}+2\begin{pmatrix}\sin(195^\circ)\\ \cos(195^\circ)\end{pmatrix}+4\begin{pmatrix}\sin(\delta)\\ \cos(\delta)\end{pmatrix}+x\begin{pmatrix}\sin(-90^\circ)\\ \cos(-90^\circ)\end{pmatrix}=0
$$</p>

<p>And solve the 2 unknowns from 2 equations, either algebraically or by using a gradient descent solver of some kind.</p>

CC BY-SA 3.0
2016-06-20T19:31:53.083Z
2016-06-21T06:38:59.667Z
2016-06-21T06:38:59.667Z
joojaa
<p>I am looking for the correct term for a type of problem solver. Since its hard to google for something without knowing its name, I hope that the good people of this stackexchange may be able to help me.</p>

<p>When defining shapes in CAD systems based on constructive solid geometry, you start out with a (usually 2D) sketch, from which you extrude, rotate, or otherwise generate a 3D shape. You make this sketch by defining a set of curves (lines, arcs, bezier, etc.) and then defining a set of constraints. This is co-linear to that, this line is parallel to that line, the distance here is so and so.</p>

<p>If you define a valid combination of constraints, the CAD system can almost always find a configuration of the curves matching those constraints. What is the part of the CAD system called, that finds those solutions? Is there a good open-source implementation that I could use?</p>

<p>I tried search terms like "geometry solver" or "geometric solver", but I couldn't find anything relevant.</p>

<computational-geometry><cad>
Solving a set of Geometry Constraints - What's that Method called?
Rikki-Tikki-Tavi
# Solving a set of Geometry Constraints - What's that Method called?

(Asked by: username_0 on 2016-06-20)

I am looking for the correct term for a type of problem solver. Since its hard to google for something without knowing its name, I hope that the good people of this stackexchange may be able to help me.

When defining shapes in CAD systems based on constructive solid geometry, you start out with a (usually 2D) sketch, from which you extrude, rotate, or otherwise generate a 3D shape. You make this sketch by defining a set of curves (lines, arcs, bezier, etc.) and then defining a set of constraints. This is co-linear to that, this line is parallel to that line, the distance here is so and so.

If you define a valid combination of constraints, the CAD system can almost always find a configuration of the curves matching those constraints. What is the part of the CAD system called, that finds those solutions? Is there a good open-source implementation that I could use?

I tried search terms like "geometry solver" or "geometric solver", but I couldn't find anything relevant.

**Tags:** computational-geometry, cad


---

## 1 answers

### Answer by username_1 on 2016-06-20. Score: 3 | Accepted answer

Its called a **geometric constraints solver** (a [good primer](https://www.cs.purdue.edu/homes/cmh/distribution/papers/Constraints/CAD95.pdf) on subject). You can find a open source solver as part of [Open Cascade](http://www.opencascade.com/) but its a bit convoluted to get going. A simpler solution for just solving, but also 3D solver capable, is [geosolver](http://geosolver.sourceforge.net/).

Making your own (algebraic solution being easiest to write) is also not that hard, just a bit of work to make it automatically write the equations (and be efficient at solving). Take the following drawing as a example (made and solved with Mathematica):

[![enter image description here](https://i.sstatic.net/hoDbc.png)](https://i.sstatic.net/hoDbc.png)

You can simply conclude that its a sum of vectors that has to loop back at the origin thus:

$$
7\begin{pmatrix}\sin(15^\circ)\\ \cos(15^\circ)\end{pmatrix}+5\begin{pmatrix}\sin(120^\circ)\\ \cos(120^\circ)\end{pmatrix}+2\begin{pmatrix}\sin(195^\circ)\\ \cos(195^\circ)\end{pmatrix}+4\begin{pmatrix}\sin(\delta)\\ \cos(\delta)\end{pmatrix}+x\begin{pmatrix}\sin(-90^\circ)\\ \cos(-90^\circ)\end{pmatrix}=0
$$

And solve the 2 unknowns from 2 equations, either algebraically or by using a gradient descent solver of some kind.


---

