Sketcher error, "radius should be positive number"

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!
garya
Posts: 422
Joined: Tue Nov 20, 2018 1:00 am
Location: Ovando, MT, USA

Sketcher error, "radius should be positive number"

Post by garya »

I'm running an older (0.18.0.18.4) release and am wondering if the issue I'm seeing is still present, so looking for a sanity check.

Load the attached file and edit Sk_RimCross.
The arc has been constrained with both endpoints on the circle.
The vertical and horizontal bar have been made coincident and the left end of the horizontal bar has been made coincident with the lower left point on the arc. The two legs of the arc are equal.
If you select the upper two points and attempt to make them coincident, I get the error:
"Updating geometry: Error build geometry(1): gp_Circ::SetRadius() - radius should be positive number
Invalid solution from DogLeg solver."

Does this error still exist in 0.19?

Is there a better way to create this sketch?
This example is cut down from a sketch with a wedge in each quadrant and an outer ring, to make a "tire" with four spokes.

OS: FreeBSD 11.3-RELEASE-p12
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.0.18.4
Build type: Release
Python version: 3.7.8
Qt version: 5.14.2
Coin version: 4.0.0
OCC version: 7.4.0.beta
Locale: C/Default (C)
Attachments
Bug_Sketcher_HoleCross_5.FCStd
(14.95 KiB) Downloaded 59 times
edwilliams16
Veteran
Posts: 3191
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Sketcher error, "radius should be positive number"

Post by edwilliams16 »

Was it your intention to make the center of the arc where the two straights join?
kisolre
Veteran
Posts: 4166
Joined: Wed Nov 21, 2018 1:13 pm

Re: Sketcher error, "radius should be positive number"

Post by kisolre »

It works here:
.
Coincidence working.gif
Coincidence working.gif (78.58 KiB) Viewed 1752 times
.
OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23717 (Git)
Build type: Release
Branch: master
Hash: 254ed951f924687e3dffb325288bbc0333980b9c
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Bulgarian/Bulgaria (bg_BG)
abdullah wrote: ping
See the gif - the wire in question first shows fully constrained after the coincidence but then properly switches to unconstrained.
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: Sketcher error, "radius should be positive number"

Post by chrisb »

There is indeed something wrong with solving this sketch. If I drag the center of the arc towards the center of the circle, and create the coincidence, parts of the sketch show as being constrained;
Bildschirmfoto 2021-01-18 um 23.34.23.png
Bildschirmfoto 2021-01-18 um 23.34.23.png (22.38 KiB) Viewed 1751 times
but they aren't: The center of the arc can still be moved. And if I do so, the color of arc and lines turn back to white again.

This is another case of a partially dropped constraint. The right way would be to add a vertical constraint between the right end of the arc and the upper end of the vertical line.

My version is the latest available, yet it is more than two weeks old.

OS: macOS 10.15
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23578 (Git)
Build type: Release
Branch: master
Hash: 50c3cbf00579dc4941ca743c25720d016b0453ce
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: C/Default (C)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: Sketcher error, "radius should be positive number"

Post by chrisb »

There is another buglet: The vertical line has an equality and a vertical constraint. Only the equality is hidden (moved to virtual space), but the vertical constraint symbol is shown if and only if the equality is shown too.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
garya
Posts: 422
Joined: Tue Nov 20, 2018 1:00 am
Location: Ovando, MT, USA

Re: Sketcher error, "radius should be positive number"

Post by garya »

edwilliams16 wrote: Mon Jan 18, 2021 9:24 pm Was it your intention to make the center of the arc where the two straights join?
Yes
garya
Posts: 422
Joined: Tue Nov 20, 2018 1:00 am
Location: Ovando, MT, USA

Re: Sketcher error, "radius should be positive number"

Post by garya »

chrisb wrote: Mon Jan 18, 2021 10:46 pm There is indeed something wrong with solving this sketch. If I drag the center of the arc towards the center of the circle, and create the coincidence, parts of the sketch show as being constrained;
but they aren't: The center of the arc can still be moved. And if I do so, the color of arc and lines turn back to white again.
Right; it's not constrained because the center of the arc (coincident with joining straight lines) is not yet constrained
chrisb wrote: Mon Jan 18, 2021 10:46 pm This is another case of a partially dropped constraint. The right way would be to add a vertical constraint between the right end of the arc and the upper end of the vertical line.
I see how a vertical constraint solves the issue. Is the coincident constraint somehow a partial over-constaint? Is there some intelligient way to learn / intuit that I need a vertical constraint instead of a coincident one? I have had other cases where geometry implies something is coincident, but the sketcher doesn't see it that way so I have to add a coincident constraint. Unfortunately I don't have an example; it might have been a result of undoing something that just left points on top of each other.
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: Sketcher error, "radius should be positive number"

Post by chrisb »

garya wrote: Mon Jan 18, 2021 11:36 pm
edwilliams16 wrote: Mon Jan 18, 2021 9:24 pm Was it your intention to make the center of the arc where the two straights join?
Yes
In that case you should have omitted the equality constraint on the lines. It follows from the fact that both lines are radiuses of the arc and they are coincident in the center and on the endpoints.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: Sketcher error, "radius should be positive number"

Post by chrisb »

garya wrote: Mon Jan 18, 2021 11:53 pm Is there some intelligient way to learn / intuit that I need a vertical constraint instead of a coincident one?
Look at my sketcher tutorial in my signature: If you know the number of constraints consumed by a constraint, you should always have a look at the solver messages. If the number of degrees of freedom doesn not shrink as expected, you should choose a different constraint.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
garya
Posts: 422
Joined: Tue Nov 20, 2018 1:00 am
Location: Ovando, MT, USA

Re: Sketcher error, "radius should be positive number"

Post by garya »

chrisb wrote: Mon Jan 18, 2021 10:50 pm There is another buglet: The vertical line has an equality and a vertical constraint. Only the equality is hidden (moved to virtual space), but the vertical constraint symbol is shown if and only if the equality is shown too.
I noticed that also but forgot to mention it.
It may be a result of previous actions, if that's possible. This sketch was the result of deleting components of a previous sketch which had the pieces for a wedge in each of the quadrants. When I first built it, I didn't get an error for some reason connecting the pieces in the first quadrant; I only saw it when doing the one in the upper right quadrant after having done the one in the upper left.
Post Reply