Adding library eigen to v2

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding library eigen to v2

dxli
we are adding the eigen library to v3, and I think it's a good idea to add it to v2 as well.

The eigen library is header only (as boost), but still need a little work to set up dependency for all platforms.
Reply | Threaded
Open this post in threaded view
|

Re: Adding library eigen to v2

ravas
If it will solve https://github.com/LibreCAD/LibreCAD/issues/523
then I support it. ;-]

Otherwise I suggest waiting until 2.2.0.

It would be helpful to minimize changes until the release of 2.1.0
because I'm almost ready to tag it as beta.
Reply | Threaded
Open this post in threaded view
|

Re: Adding library eigen to v2

dxli
Yes, the current PoC version seems to be good with issue 523:

Lots of cleanup needed though.

You may test from my branch:

https://github.com/dxli/LibreCAD/tree/quadratic

ravas wrote
If it will solve https://github.com/LibreCAD/LibreCAD/issues/523
then I support it. ;-]

Otherwise I suggest waiting until 2.2.0.

It would be helpful to minimize changes until the release of 2.1.0
because I'm almost ready to tag it as beta.
Reply | Threaded
Open this post in threaded view
|

Re: Adding library eigen to v2

ravas
All I did was:
brew install eigen
and it built.

This problem remains:

1. using Polygon (Cor,Cor) create a triangle with points (0,0) and (10,0)
2. using Tangential 3 Circles create the incircle of the triangle
3. using the 2 Points line tool try to create the contact triangle using Snap Intersection

It does not snap to the tangent point that would be at (5,0).
Reply | Threaded
Open this post in threaded view
|

Re: Adding library eigen to v2

ravas
I switched it from inches to millimeters and it finds the (5,0) intersection.
Reply | Threaded
Open this post in threaded view
|

Re: Adding library eigen to v2

ravas
Disregard that... millimeters didn't change anything... I think I had snap middle on.
Reply | Threaded
Open this post in threaded view
|

Re: Adding library eigen to v2

ravas
Repeating the test, but with base points (100,100) & (110,100)
it will find the base intersection of (105,100)
but not the other two.
Reply | Threaded
Open this post in threaded view
|

Re: Adding library eigen to v2

dxli
There are actually two problems:

1, found two closely spaced intersections for one;
2, found none.

For issue (1), it was quite bad, showing errors from equation solvers at the 10^-8 level. The solvers are now with better precision level, so I don't see the issue (1) any more. The quartic solver is not touched yet, but work has been done for (quadratic, cubic, and quadratic-quadratic).

For issue (2), I think it might be managed partly by investigating tolerance levels. If roots are found by precision of 10^-10, and testing intersections at the same level seems to be tough. This comes back to the old idea, we should consider the drawing precision level, for example, if user precision is 10^-5, we may consider intersections at 10^-7.

There's no clear solution yet, unfortunately.


ravas wrote
Repeating the test, but with base points (100,100) & (110,100)
it will find the base intersection of (105,100)
but not the other two.
Reply | Threaded
Open this post in threaded view
|

Re: Adding library eigen to v2

dxli
Forgot to mention, it's needed to build with LC_DEBUGGING to use the new solvers:

qmake -r librecad.pro DEFINES += LC_DEBUGGING
Reply | Threaded
Open this post in threaded view
|

Re: Adding library eigen to v2

dxli
In reply to this post by ravas
hi ravas,

it seems to be better for me now.

Can you update and test again?

ravas wrote
Repeating the test, but with base points (100,100) & (110,100)
it will find the base intersection of (105,100)
but not the other two.
Reply | Threaded
Open this post in threaded view
|

Re: Adding library eigen to v2

ravas
It looks like you solved the problem of the missing tangent point (yay!).
The double intersection problem doesn't seem to appear until there is more than 7 digits.
I'm not sure if this is an improvement on what we had before.
I tried testing with 2.0.10, but the missing tangent point problem exists there.
I guess you added a couple of commits to 2.0.
It might be preferable to revert those, for an easier frame of reference.
Reply | Threaded
Open this post in threaded view
|

Re: Adding library eigen to v2

ravas
In reply to this post by dxli
Is it possible to add the patch for the missing tangent point, without adding eigen?
Reply | Threaded
Open this post in threaded view
|

Re: Adding library eigen to v2

dxli
No.

I feel I should merge my quadratic branch (with eigen). The equations solvers should offer better precision by: some "long double" intermediate, Kahan summation. RS_Math is a namespace now, instead of an all static class. I will remove the Vasilis' coincs code for the time being, because my initial attempt to convert the interface to LC style failed, and Vasilis will be able do the integration of his toolset better.

The trouble would be building scripts:

1, Linux, needs eigen3 through pkg-config;
2, Mac: need to test whether pkg-config + eigen3 also works;
3, Windows, need to update wiki to manually download and configure similar to boost, since eigen is header only as well.

I currently don't have access to windows or mac.

Can you help me out here?
ravas wrote
Is it possible to add the patch for the missing tangent point, without adding eigen?
Reply | Threaded
Open this post in threaded view
|

Re: Adding library eigen to v2

ravas
I switched from Windows to openSUSE.

I think Qt's macdeployqt is enough for OS X.

Since adding eigen to 2.1.0 is going to make the release more difficult,
it might be prudent to make a 2.1 branch soon and then add eigen to the master (2.2).
I'm mostly ready to tag 2.1.0 as beta.
Reply | Threaded
Open this post in threaded view
|

Re: Adding library eigen to v2

dxli
no problem. My quadratic branch is based on the master branch, meaning it's trivial to use "git merge --squash" or "git rebase " on the master branch.

ravas wrote
I switched from Windows to openSUSE.

I think Qt's macdeployqt is enough for OS X.

Since adding eigen to 2.1.0 is going to make the release more difficult,
it might be prudent to make a 2.1 branch soon and then add eigen to the master (2.2).
I'm mostly ready to tag 2.1.0 as beta.