tangent constraints are kinda slow and choppy

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
0000matteo0000
Posts: 4
Joined: Fri Jan 21, 2022 9:10 pm

tangent constraints are kinda slow and choppy

Post by 0000matteo0000 »

I am pretty new to FreeCAD, and I was making a pretty complex sketch that used a lot of tangent constraints.
I noticed hat moving pieces of the sketch or rotating it around a constrained point seemed pretty slow and choppy.
I realized that the sketch was being marked as fully constrained, even though there are actually 2 possible solutions for an arch with two tangent constraints at its end points, one mirrors the other.
I was able to improve the choppiness by replacing the tangent constraints with parallel or perpendicular constraints on construction lines that were built as radius of the arch.
It seems though that the choppiness still appears when trying to do a full rotation, especially when crossing the axes with the point i am dragging.
Is this a bug, or is there something I can do to solve the issue?
One thing I considered is the use of an "always clockwise" or "always counterclockwise" version of angle definition, but I couldn't find that.

There is an example attached to this message.
tangent_constraint_test.FCStd
(8.04 KiB) Downloaded 20 times
OS: Debian GNU/Linux bookworm/sid (GNOME/gnome-xorg)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.9.7
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.1
Locale: English/United Kingdom (en_GB)
Last edited by 0000matteo0000 on Sat Jan 22, 2022 11:47 am, edited 1 time in total.
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: tangent constraints are kinda slow and choppy

Post by chrisb »

0000matteo0000 wrote: Fri Jan 21, 2022 10:22 pm There is an example attached to this message.
Hi and welcome to the forum!

The attachment is missing.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
0000matteo0000
Posts: 4
Joined: Fri Jan 21, 2022 9:10 pm

Re: tangent constraints are kinda slow and choppy

Post by 0000matteo0000 »

edited to add it inline
domad
Veteran
Posts: 2051
Joined: Mon Jun 22, 2020 12:16 pm

Re: tangent constraints are kinda slow and choppy

Post by domad »

0000matteo0000 wrote: Sat Jan 22, 2022 11:47 am .....
Hello 0000matteo0000, greetings to the Community!
Attached is your file in which the correct sketch has been added which includes 3 "tangency" constraints, one "dimensional" and one "point onto object".
Attachments
tangent_constraint_test.FCStd
(9.67 KiB) Downloaded 16 times
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: tangent constraints are kinda slow and choppy

Post by drmacro »

domad wrote: Sat Jan 22, 2022 12:54 pm
0000matteo0000 wrote: Sat Jan 22, 2022 11:47 am .....
Hello 0000matteo0000, greetings to the Community!
Attached is your file in which the correct sketch has been added which includes 3 "tangency" constraints, one "dimensional" and one "point onto object".
While the constraint scheme in your example is appropriate. I think the OP was talking about rotating the sketch geometry.
Peek 2022-01-22 08-02.gif
Peek 2022-01-22 08-02.gif (261.62 KiB) Viewed 1032 times
This can't be accomplished with your constraint scheme.

To the OP point. The observed behaviour, as noted, is dependant the constraint scheme and how the solver reacts as the a self constrained set of geometry (i.e. geometry constrained to it self, but not the coordinate system). The solver equations are being solved as you rotate.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
0000matteo0000
Posts: 4
Joined: Fri Jan 21, 2022 9:10 pm

Re: tangent constraints are kinda slow and choppy

Post by 0000matteo0000 »

Yes, I was talking about rotating it, also the proposed sketch if allowed to rotate seems to perform better and has a third tangent constraint I am not allowed to add in my version of FreeCAD without it being marked as redundant. What was your FreeCAD version?
domad
Veteran
Posts: 2051
Joined: Mon Jun 22, 2020 12:16 pm

Re: tangent constraints are kinda slow and choppy

Post by domad »

drmacro wrote: Sat Jan 22, 2022 1:14 pm .....
Hello drmacro, greetings to the community!

Yes, thanks for letting me know, I had not correctly interpreted the request, in any case it is sufficient to eliminate the "point onto object" constraint on the horizontal axis to have the same effect, it is not necessary to create a construction line, you will get it anyway a degree of freedom due to the 3 tangencies and the dimensional constraint and therefore in this case there will be rotation.
Attachments
tangent_constraint_test.FCStd
(9.95 KiB) Downloaded 6 times
tangent.png
tangent.png (160.57 KiB) Viewed 970 times
0000matteo0000
Posts: 4
Joined: Fri Jan 21, 2022 9:10 pm

Re: tangent constraints are kinda slow and choppy

Post by 0000matteo0000 »

so is there any way to make orientation-aware constraints?
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: tangent constraints are kinda slow and choppy

Post by chrisb »

0000matteo0000 wrote: Sun Jan 23, 2022 11:37 pm so is there any way to make orientation-aware constraints?
Some are (angle). Most aren't.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: tangent constraints are kinda slow and choppy

Post by drmacro »

Depends on what your definition is.

If you select only a vertex in the lower left quadrant and put on horizontal and vertical constraints, the values will be negative.

But that doesn't really induce the solver to keep them negative.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Post Reply