View Issue Details

IDProjectCategoryView StatusLast Update
0000800SketcherFeaturepublic2015-10-06 11:48
Reporterscopaev Assigned Tologari81  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version0.12 
Fixed in Version0.16 
Summary0000800: Formula/Equation Based Constraints
DescriptionThe ability to use formulas/equations to control sketcher dimensions.
The ability to add a custom Label Name to the dimension lines that can be used in the equations.
Tagsconstraints, equation, formula
FreeCAD Information


related to 0001437 closed FreeCAD Global parameters 
has duplicate 0001098 closedabdullah FreeCAD Add ability to use variables and forumulas 
related to 0001174 closed FreeCAD Allow user to input simple mathematical expressions when setting values to constraints. 
related to 0001711 closed File formats global data variables for using in constraints 
related to 0002250 closedyorik File formats global data variables for using in constraints 



2012-09-19 22:44

developer   ~0002407

This feature should have a larger scope than sketcher.


2012-09-20 13:09

reporter   ~0002410


what larger scope did you have in mind?


2012-09-20 17:34

developer   ~0002412

I would think anything that takes a feature parameter should have the same ability. I think it is also useful to tie parameters/variables to assembly, sub-assembly and project scopes.


2012-09-26 17:18

reporter   ~0002427

Yes please.

I very much agree on making every parameter accept formulas and be easily accessible from other formulas.

Maybe start in the part design wb, and make the pad lenght etc. accessible in such a way. With some small additions to the possible constrains, this would enable truly parametric and complex modelling.

A natural extension to this would be a way to mark some values as external input, and autogenerating a gui form, a kind of a part factory. Maybe the constrain solver could be used somehow to allow overlapping input constrains, such that only a fraction of the marked input values are needed. Maybe this needs a separate issue?

Challenges I foresee:
* The choice of language for the formulas? Sandboxed python (hard, see pypy), an existing math->python translator or a custom one with a limited list of functions?
* Cyclical references. Pythons recursion limit can be set low enough?


2014-08-21 16:04

developer   ~0004983

I see somebody will try to tackle this:

Just some additional info there actually is solution available in FreeCAD ATM that allows setting relations between datum constraints and object properties. It is called Spreadsheet PropertyController. Sketch constraints are now exposed as properties and that adds additional support but for this latest part i guess some changes would be needed to get full support:

Bottom line this feature already exist in FreeCAD and this feature request could be marked as solved/implemented. The feature itself i guess needs more polishing and should be more talked about because i am guessing a lot of FreeCAD users are not aware it exists.

Relevant links:


2014-08-21 16:17

developer   ~0004984

And it somebody will test this it took me a while to understand this:

"Target Property: The name of the property to control, or the number of the datum-based constraint"

User actually has to count datum constraints and input the number of its position. But it does work!

Therefore i proposed Spreadsheet PropertyController should not tackle with sketch directly any more but to take datum constraints from sketch properties (feature was just implemented):

This would be easier as user could rename constraint for example to Angle and then in Spreadsheet PropertyController just input Angle Under Property Name (Target Property) instead of current situation where the number of datum constraint must be provided (but the number can easily change if one of the constraints before it gets deleted).


2014-08-23 15:16

developer   ~0004995

Last edited: 2014-08-23 15:18

I won't reopen this bug report to add small note:

I tested the change and i can confirm it works! I wanted to update this on the FreeCAD Wiki but i would have to restore password and i newer edited wiki in the first place and if somebody else finds the time this could be added:

"Target Property: The name of the property to control, or the number of the datum-based constraint"

Changed to something like:

"Target Property: The name of the property to control, or the number of the datum-based constraint. If datum-based constraint is named the datum-based constraint name can be used instead of the number."

Infographic probably could help new users when learning to use this feature:

But i doubt it complies with FreeCAD Wiki standards regarding images.

Small hint when working with spreadsheet to define relations: set Windows mode to Tile or Cascade first and it becomes easy and fun thing to do. And spreadsheet in the end is (one of the possible) very powerful way to tackle this area.

Cheers and for all devs lately expressing interest in this area good luck!


2015-10-06 11:48

manager   ~0006478

Expressions have been implemented:

Issue History

Date Modified Username Field Change
2012-07-19 14:41 scopaev New Issue
2012-07-19 14:42 scopaev Tag Attached: constraints
2012-07-19 14:42 scopaev Tag Attached: equation
2012-07-19 14:42 scopaev Tag Attached: formula
2012-08-06 18:43 logari81 Status new => assigned
2012-08-06 18:43 logari81 Assigned To => logari81
2012-09-19 22:44 tanderson69 Note Added: 0002407
2012-09-20 13:09 pperisin Note Added: 0002410
2012-09-20 17:34 tanderson69 Note Added: 0002412
2012-09-26 17:18 drayko Note Added: 0002427
2014-02-21 12:58 shoogen Relationship added related to 0001174
2014-02-23 18:51 shoogen Relationship added related to 0001437
2014-08-19 02:09 normandc Relationship added has duplicate 0001098
2014-08-21 16:04 triplus Note Added: 0004983
2014-08-21 16:17 triplus Note Added: 0004984
2014-08-23 15:16 triplus Note Added: 0004995
2014-08-23 15:18 triplus Note Edited: 0004995
2014-08-25 13:24 wmayer Relationship added related to 0001711
2015-10-06 11:48 abdullah Note Added: 0006478
2015-10-06 11:48 abdullah Status assigned => closed
2015-10-06 11:48 abdullah Resolution open => fixed
2015-10-06 11:48 abdullah Fixed in Version => 0.16