Feature request: equality constraint between lines and arcs in the Sketcher

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Feature request: equality constraint between lines and arcs in the Sketcher

Post by DeepSOIC »

I had a master plan on this. It included:
* reference-dimension constraints (thanks to Abdullah, we have them, and I nudged him to the right direction for supporting the next pieces of the plan)
* expression constraint. It is to define an expression using reference dimensions as variables. This can be replaced by a few math constraints, like ratio, sum, maybe something else to avoid messing with expression parsing... but expressions is the preferred way to go.

This should be some massive power. Things like length ratios, belts, angle equality become easily possible. Problem is, I'm not coding it yet :lol: .

I remember someone (I think it was ickby) pointed out there is some expression toolkit in OpenCascade, with support of derivatives. That sounds very promising, but I haven't looked into it yet, and it's unlikely to happen any time soon I'm afraid.

Length constraint is still a necessity, though, and there is no reason for not implementing it now :mrgreen: .
chrili_rakete
Posts: 54
Joined: Thu May 15, 2014 11:51 am

Re: Feature request: equality constraint between lines and arcs in the Sketcher

Post by chrili_rakete »

DeepSOIC wrote: Length constraint is still a necessity, though, and there is no reason for not implementing it now :mrgreen: .
8-) Thanks!
chrili_rakete
Posts: 54
Joined: Thu May 15, 2014 11:51 am

Re: Feature request: equality constraint between lines and arcs in the Sketcher

Post by chrili_rakete »

triplus wrote: P.S. I am wondering if expressions could be used in combination with existing constraints. I guess it depends on the use case.
This was the hint! You actually can constrain the length of a line to the length of an arc in the same sketch via the expression:

Code: Select all

Sketch.Shape.Edge1.Length
where Edge1 is the arc in the sketch.

This is what I was looking for, thank you!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Feature request: equality constraint between lines and arcs in the Sketcher

Post by triplus »

chrili_rakete wrote:This is what I was looking for, thank you!
You're welcome.
eivindkvedalen
Posts: 602
Joined: Tue Jan 29, 2013 10:35 pm

Re: Feature request: equality constraint between lines and arcs in the Sketcher

Post by eivindkvedalen »

chrili_rakete wrote: This was the hint! You actually can constrain the length of a line to the length of an arc in the same sketch via the expression:

Code: Select all

Sketch.Shape.Edge1.Length
where Edge1 is the arc in the sketch.

This is what I was looking for, thank you!
My gut feeling (as I have not tested this) is that this is not going to be stable, as the geometry is updated after the solver has finished its computations.

(I think you just found a loop-hole in the dependency tracking in freecad's expression system, and I'd consider that a bug...)

Eivind
Post Reply