[Sketch] circle tangent constrain issue

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
regis
Posts: 725
Joined: Sun Jul 12, 2015 8:17 am
Contact:

[Sketch] circle tangent constrain issue

Post by regis »

Circle tangent contraint having an issue when trying to contrain to external linked geometry
To recreate
Create a normal circle from either sketcher or draft circle
now start a new sketch and pick the external of the previously created circle, and draw a circle constrained to external geometry, it gives all kinds of code errors.

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20943 (Git)
Build type: Release
Branch: master
Hash: ceb23799c76df3ebfa7be4b9fe83bb62de60bc6c
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/Canada (en_CA)

Code: Select all

GuiCommand: Circle
Pick center point
Pick radius
18815 <App> Document.cpp(3715): Failed to recompute Unnamed#Sketch: Solving the sketch failed
Recompute failed! Please check report view.
18832.6 <App> Document.cpp(3715): Failed to recompute Unnamed#Sketch: Solving the sketch failed
Recompute failed! Please check report view.
18833.1 <App> Document.cpp(3715): Failed to recompute Unnamed#Sketch: Solving the sketch failed
Recompute failed! Please check report view.
18890.1 <App> Document.cpp(3715): Failed to recompute Unnamed#Sketch: Solving the sketch failed
Recompute failed! Please check report view.
18890.6 <App> Document.cpp(3715): Failed to recompute Unnamed#Sketch: Solving the sketch failed
Recompute failed! Please check report view.
Attachments
SKETCH CIRCLE CONSTRAINT TEST.FCStd
(15.64 KiB) Downloaded 42 times
Snipaste_2020-05-11_02-41-07.png
Snipaste_2020-05-11_02-41-07.png (208.93 KiB) Viewed 2419 times
Snipaste_2020-05-11_02-38-28.png
Snipaste_2020-05-11_02-38-28.png (189.06 KiB) Viewed 2419 times
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: [Sketch] circle tangent constrain issue

Post by chrisb »

My guess: when you first created your circle you didn't really move the mouse to draw the circumference. Together with Autoconstraints=on a tangency constraint with the x- or y-axis was created, yielding a radius of 0.

Recovery: Delete the tangency.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
regis
Posts: 725
Joined: Sun Jul 12, 2015 8:17 am
Contact:

Re: [Sketch] circle tangent constrain issue

Post by regis »

chrisb wrote: Mon May 11, 2020 7:14 am My guess: when you first created your circle you didn't really move the mouse to draw the circumference. Together with Autoconstraints=on a tangency constraint with the x- or y-axis was created, yielding a radius of 0.

Recovery: Delete the tangency.
Yeah I think you have a point here, when i drew the circle i started the new sketcher circle from the center point of the external geometry circle and i guess it creates a tangent contraint automatically.
But this time around i draw the circle somewhere near the center point of the external geometry and then snapped the coincidental contraint and the tangent constraint and it works.
C_h_o_p_i_n
Posts: 225
Joined: Fri Apr 26, 2019 3:14 pm

Re: [Sketch] circle tangent constrain issue

Post by C_h_o_p_i_n »

Hi,

I noticed a stange bahavior too ...
tangent_snap.png
tangent_snap.png (35.97 KiB) Viewed 2267 times
Using a construcion line (1) I was using tangential constraints ( shown as (5,6) ) to make the line (1) a tangent with the half-circles at (2) and (3).

After reducing the length (4) the tangent (1) snapped to an ... not existing / virtual / ghost - circle ( not seen but imaginable if you make full circles in your mind ) ...

Not shure if this fits into this problem too ...

Kind regards, Stefan

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20886 +2253 (Git)
Build type: Release
Branch: LinkStage3
Hash: 1274af1c841a65ca38dfd7a7887dbc8de9e1e21e
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: [Sketch] circle tangent constrain issue

Post by chrisb »

C_h_o_p_i_n wrote: Sat May 16, 2020 8:57 am I noticed a stange bahavior too ...
It is impossible to analyze this without the sketch.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
C_h_o_p_i_n
Posts: 225
Joined: Fri Apr 26, 2019 3:14 pm

Re: [Sketch] circle tangent constrain issue

Post by C_h_o_p_i_n »

Ok,

Before:
before.png
before.png (37.06 KiB) Viewed 2147 times


I changed the constraint (1) (marked in the sketch below) from 10mm to 5mm.

The construction Line (2), which was used to constrain the outer end using tangent-constraints, jumped to tangent an imaginary circle, which might be presumed at this position.

As it might be seen in the sketch below...

What I had expected was a sketch like the one above with constraint (1) set to 5mm, and line (2) still beeing at the outer end.

After:
after.png
after.png (30.96 KiB) Viewed 2147 times
Kind regards,
Stefan
Attachments
FilamentRad.FCStd
(20.77 KiB) Downloaded 40 times
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: [Sketch] circle tangent constrain issue

Post by chrisb »

This is correct behaviour. Tangency is always applied to the whole circle. The same for lines, where tangency is calculated to touch the infinite prolongation of the line.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
C_h_o_p_i_n
Posts: 225
Joined: Fri Apr 26, 2019 3:14 pm

Re: [Sketch] circle tangent constrain issue

Post by C_h_o_p_i_n »

Hello Chris,

while you might be right about how FreeCad handles this internally ...

In this case there are two solutions - the choosed one - and the one to be seen in the "before.png"
(how likely is it, that one mean to attach a tangent to something imaginary while something real exists rather close?)

IMHO the solver might have evalutate the solution higher which tangents the "real" (see-able) part of the circle ...
( .... or perhaps offer to choose between possible solutions ... )

Kind regards,
Stefan
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: [Sketch] circle tangent constrain issue

Post by chrisb »

There are several situations where humans see quickly how a "desired" solution should look like. However, the solver doesn't know about such things . He has a set of equations to solve, and one of them is derived from "tangent on this circle".

It has been discussed in several topics about "flipping" sketches that it would be desirable to have inequality constraints as well, such as in your case "right of the circle's center". This is not implemented yet.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: [Sketch] circle tangent constrain issue

Post by abdullah »

chrisb wrote: Thu May 21, 2020 10:12 pm There are several situations where humans see quickly how a "desired" solution should look like. However, the solver doesn't know about such things . He has a set of equations to solve, and one of them is derived from "tangent on this circle".

It has been discussed in several topics about "flipping" sketches that it would be desirable to have inequality constraints as well, such as in your case "right of the circle's center. This is not implemented yet.
Thanks for the daily work you do in the forums. It is amazing how much you filter out and does not get to the tracker (for good reason), which saves tons of developer time. :) :) :D :D
Post Reply