Geometric constraint solver

Gordan

CAD practitioner
Hi all,

Has any of you had any experience with Geometric constraint solvers? As far as I know OCCT doesn't have this implemented so I'm wondering how involved such a system would be for 2D and 3D.

FreeCAD has one implemented in the Sketcher module and for the most part I found it working reasonably well for basic constraints. I had issues with tangential constraints (Line-Circle). It would give undeterministic results for a fully constrained sketch so I opted for manual scripting usually. Hopefully this has been sorted out in the new release.

Anyhow, I'm a bit suprised that OCCT doesn't have it implemented which leads me to believe that it is probably quite complicated?

Any thoughts?
 

blobfish

CAD practitioner
Hi all,

Has any of you had any experience with Geometric constraint solvers? As far as I know OCCT doesn't have this implemented so I'm wondering how involved such a system would be for 2D and 3D.

FreeCAD has one implemented in the Sketcher module and for the most part I found it working reasonably well for basic constraints. I had issues with tangential constraints (Line-Circle). It would give undeterministic results for a fully constrained sketch so I opted for manual scripting usually. Hopefully this has been sorted out in the new release.

Anyhow, I'm a bit suprised that OCCT doesn't have it implemented which leads me to believe that it is probably quite complicated?

Any thoughts?
Yes they are complicated. I chose to use solvespaces library and have been happy with the results. If GPLV3 is acceptable, I would recommend you check that out. I would be skeptical of occt solver, as occt released a software product where they used freecads solver. If I remember correctly.
 

Quaoar

Administrator
Staff member
Anyhow, I'm a bit suprised that OCCT doesn't have it implemented which leads me to believe that it is probably quite complicated?
That's because OpenCascade largely remained without much investment into this sort of thing after it was published. I agree with @blobfish and @A-U : GccAna is not a general-purpose constraint solver, although it might be used for specific "declarative" primitive construction. If all you need is to build a couple of tangential circles, go for it. If not, forget about it. SolveSpace's author, to my knowledge, has an option to relicense his code for a fee if you wanna integrate it into commercial software. However, I was once told that this option is quite expensive.

I would definitely check FreeCAD's PlaneGCS to get started. Also, as far as I know, OCC fixed something there or added spline support or something else, but I'm not sure it was contributed back to FreeCAD. You may want to find the sources of Salome and compare its solver with the vanilla FreeCAD's version to see if there are any differences.

Topic in FreeCAD forum: https://forum.freecadweb.org/viewtopic.php?t=20541
 

Gordan

CAD practitioner
Thank for all the suggestions,

SolveSpace looks very nice! I'm checking it out at the moment. GPLV3 is acceptable.

I'll also have a look at FreeCAD's PlaneGCS definitely.
 

Quaoar

Administrator
Staff member
@A-U Is there a piece of documentation on how to use constrained sketches in CadQuery? I did a quick search but haven't found an example to try.
 
Top