(SOLVED) Can you set (increase) the calculation accuracy of freecad?

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
thomas-neemann
Veteran
Posts: 11904
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

(SOLVED) Can you set (increase) the calculation accuracy of freecad?

Post by thomas-neemann »

in this example i would expect an intersection to be found. does anyone have a solution?
Bildschirmfoto_2022-09-26_19-43-56.png
Bildschirmfoto_2022-09-26_19-43-56.png (47.13 KiB) Viewed 1280 times
1942.FCStd
(5.22 KiB) Downloaded 32 times
Last edited by thomas-neemann on Mon Sep 26, 2022 9:33 pm, edited 1 time in total.
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
demonlibra
Posts: 79
Joined: Tue Jan 21, 2020 1:11 pm

Re: Can you set (increase) the calculation accuracy of freecad?

Post by demonlibra »

There are no intersection.
Use Snap Angle or draw extra line from center of circle.
изображение_2022-09-26_224646147.png
изображение_2022-09-26_224646147.png (4.53 KiB) Viewed 1241 times
изображение_2022-09-26_225004734.png
изображение_2022-09-26_225004734.png (46.02 KiB) Viewed 1234 times
User avatar
thomas-neemann
Veteran
Posts: 11904
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: Can you set (increase) the calculation accuracy of freecad?

Post by thomas-neemann »

demonlibra wrote: Mon Sep 26, 2022 7:47 pm ...

Thanks for the tip, that works, I just showed a simple example here. but it should also work something like this
Bildschirmfoto_2022-09-26_21-49-55.png
Bildschirmfoto_2022-09-26_21-49-55.png (18.17 KiB) Viewed 1228 times
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
User avatar
Roy_043
Veteran
Posts: 8544
Joined: Thu Dec 27, 2018 12:28 pm

Re: Can you set (increase) the calculation accuracy of freecad?

Post by Roy_043 »

The problem is caused by the BoundBox check inside the findIntersection function:
https://github.com/FreeCAD/FreeCAD/blob ... #L107-L113

Quite recently a tolerance has been added, but this is not enough here. The BoundBox of the circle is not as accurate as you would want (or expect) it to be, it is namely based on the polygonal representation of the circle in the 3D view:

Code: Select all

BoundBox (-29.9027, -29.9757, 0, 30, 29.9757, 0)
We need to rethink this portion of the code.

But for now: make the circle smoother:
Angular Deflection = 1.00 °
Deviation = 0.10
The intersection is then found even if the Draft "Internal precision level" preference is set to 8.

The spiral example most likely fails for a different reason as the BoundBoxes of the objects seem to clearly overlap. Please post that file.
User avatar
thomas-neemann
Veteran
Posts: 11904
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: Can you set (increase) the calculation accuracy of freecad?

Post by thomas-neemann »

Roy_043 wrote: Mon Sep 26, 2022 8:26 pm ...Please post that file.

thanks for the info, will test it, here is the file
start26sep.FCStd
(5.9 KiB) Downloaded 28 times


edit

it works, thank you very much
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
User avatar
Roy_043
Veteran
Posts: 8544
Joined: Thu Dec 27, 2018 12:28 pm

Re: Can you set (increase) the calculation accuracy of freecad?

Post by Roy_043 »

The start26sep.FCStd file is perhaps wrong? There is no line connected to the spiral.
User avatar
thomas-neemann
Veteran
Posts: 11904
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: Can you set (increase) the calculation accuracy of freecad?

Post by thomas-neemann »

Roy_043 wrote: Mon Sep 26, 2022 8:47 pm The start26sep.FCStd file is perhaps wrong? There is no line connected to the spiral.
yeah that's what it's all about. I'm currently making a video with your information. here is the file
tn2243.FCStd
(11.6 KiB) Downloaded 31 times
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
User avatar
mfro
Posts: 666
Joined: Sat Sep 23, 2017 8:15 am

Re: Can you set (increase) the calculation accuracy of freecad?

Post by mfro »

Roy_043 wrote: Mon Sep 26, 2022 8:26 pm The problem is caused by the BoundBox check inside the findIntersection function:
https://github.com/FreeCAD/FreeCAD/blob ... #L107-L113
Just for clarity and to avoid misunderstandings: this isn't caused by any intersection calculation inaccuracy.

FreeCAD does not even try to calculate it because it thinks as the bounding boxes don't overlap the entities can't intersect.
Cheers,
Markus
User avatar
thomas-neemann
Veteran
Posts: 11904
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: Can you set (increase) the calculation accuracy of freecad?

Post by thomas-neemann »

Roy_043 wrote: Mon Sep 26, 2022 8:47 pm ...
here is the video

https://www.youtube.com/watch?v=D-inGbwiSTU

phpBB [video]
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
User avatar
Roy_043
Veteran
Posts: 8544
Joined: Thu Dec 27, 2018 12:28 pm

Re: Can you set (increase) the calculation accuracy of freecad?

Post by Roy_043 »

mfro wrote: Mon Sep 26, 2022 8:54 pm FreeCAD does not even try to calculate it because it thinks as the bounding boxes don't overlap the entities can't intersect.
I am aware of that.
Post Reply