DarwinNE / FidoCadJ

FidoCadJ is a free user-friendly vector graphic editor for MacOSX, Linux, Windows and Android with a library of electronic symbols.
http://darwinne.github.io/FidoCadJ/
GNU General Public License v3.0
111 stars 40 forks source link

Increase precision of arrows #172

Closed DarwinNE closed 4 years ago

DarwinNE commented 4 years ago

The rendering of arrows is not very precise as the segment is superposed to the tip. With relatively large segment widths, this yields an ugly result, as follows:

wrong_arrows

This should be corrected.

DarwinNE commented 4 years ago

It should work for Bézier courbes, too!

DarwinNE commented 4 years ago

Of course, one must not forgot about splines (curves)... :-)

DarwinNE commented 4 years ago

I changed a little the style of the arrows from the version 0.24.7 so that they fit more what were my original intentions. This will change a little how the drawings are rendered, but in the vast majority of the situations, it will improve the drawings.

This code contains some (rather extreme) example of arrows:

[FIDOCAD]
FJC A 3.0
FJC B 3.0
LI 30 40 60 5 0
FCJ 3 2 14 8 0 0
CV 0 70 15 65 45 95 20 85 55 110 55 0
FCJ 3 3 14 8 0
BE 40 45 40 70 65 60 120 80 0
FCJ 3 2 14 4 0 0

This is the NEW result, with version 0.24.8: arrows_vers_0_24_8

Whereas this is the result with the version 0.24.7: arrows_vers_0_24_7

The changes are more evident with the empty arrows, but the geometry is the same for filled arrows, too. This means that the Bézier and spline curves change slightly of shape when they are traced with and without arrows.

DarwinNE commented 4 years ago

Now it remains to check the export towards all vector files supporting arrows: SVG, PDF, PGF, EPS 😭

DarwinNE commented 4 years ago

The implementation should be complete. Let's close this issue that required much more work than expected at a first sight.