About dli

LibreCAD developer I enjoy working on math/geometry core algorithms!

Draw Inscribed circles and ellipses

While the spline/text speed has improved substantially, more work is still needed on them, and a code review is undergoing.

Aside from the text insertion speed, there’s an independent long-term goal of adding C++11 support. We will do more than simply making it look like C++11, instead, performance, code readability and correctness of implementation should be among our goals.

Now, some new features implemented in the master branch. Please help testing them!

Several new drawing methods for ellipses/circles:

  • Ellipse inscribed in a convex quadrilateral, i.e., the ellipse tangential to four given lines;
  • Ellipse with given foci, a point on ellipse or the total distance to foci;
  • Ellipse with given center, three points on ellipse;
  • Ellipse with major axis in x-/y-directions with given center, and two points on ellipse;
  • Ellipse with major axis in x-/y-directions and four given points on ellipse;
  • Circle inscribed in a triangle, i.e., tangential to three given lines.

Please note the complexity of these new construction algorithms, so, we do expect bugs for certain drawing conditions.

If you find a bug in LibreCAD or you would like LibreCAD to do more, please file your report/request at our tracker on sourceforge:

http://sourceforge.net/tracker/?group_id=342582

The LibreCAD team

Tweaking for speed of text insertion in LibreCAD

I should write something about what we are doing now. At least to assure users that we are working hard to make LibreCAD better.

While doing the never ending task of testing, Claude, our quality control master from Quebec,  exposed the issue of text insertion speed in LibreCAD, and it turned out to be a bug hard to fix.

We have made some progress, but the battle is not over yet.

First, I did a code review for math functions, rewrote many math functions, and many core math functions are now at least 100% faster, and 400% faster in some cases by my own benchmarking. I enabled using of 2D vectors, instead of 3D vectors for our core vector class, in hope of processing one third less of data. Still, the speed improvement is not enough.

Then, there was a turning point. Rallaz  identified excessive creation of new preview for text in the drawing part, and fixed it in a simple and elegant patch. For a while, we celebrated the catch, and called it a win.

To our surprise, Claude reported speed trouble once again. It turned out the previous fast text insertion in testing of Rallaz’s patch was coincident with an error in container’s move() function (bug#3420260). After we fixed the bug#3420260, the speed issue resurfaced again. Rallaz fixed a serious speed bug, but it’s still not enough.

Performance tweaking is going on for the spline class, which is used heavily in text processing.

Ries wants LibreCAD to be fast and lite, and that’s exaclty what we are doing now!

If you would like to help, please join the team!

UPDATE: spline/text draw() methods updated, preview procedure also updated. The speed of text/spline handling has improved significantly. Code review is still going on.