Apparently, QCAD 3 converts some coordinates to different value. All my drawings are in millimeter drawing and paper units and I usually specify coordinates with integer values in Q2, like Start Point : X=300 Y = 200 and End Point : X=300 Y =3110.

Now this same line, unmodified, gets the following coordinates in Q3 : Start Point : X=299.999936 Y = 200 and End Point : X=299.999936 Y =3110.000006.

Is it possible to avoid these unexpected differences.

## Coordinate values

**Moderator:** andrew

**Forum rules**

Always indicate Operating system, QCAD version

Attach Drawing files, Screenshots

### Re: Coordinate values

When are these coordinate changes happening?

- after saving in QCAD 2 / loading in QCAD 3

- after saving / loading in QCAD 3

- directly after drawing

I cannot reproduce this problem but I can imagine that the inaccuracy was already present in the QCAD 2 file (you might find those values in the DXF file with a text editor).

Note that the QCAD 3 property editor shows more decimals than the QCAD 2 property editor, so these errors might not have been so visible in QCAD 2.

There are generally three reasons for these errors:

- Small errors introduced when scaling entities up and down or rotating them (see also third point).

- File format restrictions: QCAD 2 DXF files are stored with only 6 decimals for compatibility reasons (QCAD 3 stores all values with 12 decimals).

- Computers cannot represent all values (not even finite decimals) internally due to the way how they store numbers (long story, Google knows all about it ). For example the exact value of '2.3' will always include an error. The closest representable number for a computer is 2.2999999999999998.

- after saving in QCAD 2 / loading in QCAD 3

- after saving / loading in QCAD 3

- directly after drawing

I cannot reproduce this problem but I can imagine that the inaccuracy was already present in the QCAD 2 file (you might find those values in the DXF file with a text editor).

Note that the QCAD 3 property editor shows more decimals than the QCAD 2 property editor, so these errors might not have been so visible in QCAD 2.

There are generally three reasons for these errors:

- Small errors introduced when scaling entities up and down or rotating them (see also third point).

- File format restrictions: QCAD 2 DXF files are stored with only 6 decimals for compatibility reasons (QCAD 3 stores all values with 12 decimals).

- Computers cannot represent all values (not even finite decimals) internally due to the way how they store numbers (long story, Google knows all about it ). For example the exact value of '2.3' will always include an error. The closest representable number for a computer is 2.2999999999999998.

### Re: Coordinate values

Logged off before I could submit my completely typed reply !

### Re: Coordinate values

MiHeGo wrote:Logged off before I could submit my completely typed reply !

This shouldn't happen as cookies (sessions) are set to expire in a year. Tip: In most decent browsers you can simply hit back and rescue your content.

### Re: Coordinate values

To-day, I was again logged off while typing my reply... But now as I saved my text, I could paste it in a new reply. Then I used the "Save Draft" button but now I have to investigate where to retrieve it (or delete it as I can again paste my text).

I'm replying to Andrew comments on coordinates in a next Post.

I'm replying to Andrew comments on coordinates in a next Post.

### Re: Coordinate values

andrew wrote:When are these coordinate changes happening?

As soon as I opened a copy of a Q2 file withQ3.

andrew wrote:...I can imagine that the inaccuracy was already present in the QCAD 2 file

Actually, most of my values were typed as integer, some times at most with 2 decimals. If I change in Q3 a value like "281,999967" into a "281" and save the file, close Q3 and reopen the file, the integer value is there as "281" and not some "281,000000" and not scaled or adjusted to some internal number. What Q3 can do when processing its values, why is it impossible when opening a Q2 file ?

andrew wrote:- Small errors introduced when scaling entities up and down or rotating them...

I totally agree, also when extending a line until it crosses some other lines. But not when it comes about values entered at the keyboard.

What matters here is that all other entities touching an entity for which I change a value, must also be changed. Otherwise, you will get problems for instance when hatching an area. I guess 2 adjacent lines must have the same coordinates for the junction point including up to the 6the decimal ... or the 12th ???

andrew wrote:- Computers cannot represent all values (not even finite decimals) internally due to the way how they store numbers

Sorry, this time, I have to completely disagree with that position. As a professsional programmer for 40 years (and more to come), I had never a problem storing and retrieving integer values or fixed decimals ones. Merely a matter of selecting the right data type.

For instance an Ariane missile was lost because some internal routines were using 64-bits arithmetic and values where others were using 128-bits precision.

Simply, would you accept to receive a payement of an amount of 23,99 swiss Francs (QCAD 3 update) instead of 24,00 SWF ? Or a salary of approximately 4.999,98 € instead of 5.000,00 € ?

### Re: Coordinate values

MiHeGo wrote:andrew wrote:...I can imagine that the inaccuracy was already present in the QCAD 2 file

Actually, most of my values were typed as integer, some times at most with 2 decimals. If I change in Q3 a value like "281,999967" into a "281" and save the file, close Q3 and reopen the file, the integer value is there as "281" and not some "281,000000" and not scaled or adjusted to some internal number. What Q3 can do when processing its values, why is it impossible when opening a Q2 file ?

As previously mentioned: the error is very likely there already in the QCAD 2 file. QCAD 3 cannot possibly guess that 281,999967 is not exactly what you want.

MiHeGo wrote:andrew wrote:- Computers cannot represent all values (not even finite decimals) internally due to the way how they store numbers

Sorry, this time, I have to completely disagree with that position. As a professsional programmer for 40 years (and more to come), I had never a problem storing and retrieving integer values or fixed decimals ones. Merely a matter of selecting the right data type.

For instance an Ariane missile was lost because some internal routines were using 64-bits arithmetic and values where others were using 128-bits precision.

Simply, would you accept to receive a payement of an amount of 23,99 swiss Francs (QCAD 3 update) instead of 24,00 SWF ? Or a salary of approximately 4.999,98 € instead of 5.000,00 € ?

I'm not talking about integers or your specific case but finite decimals in general (2.3, 0.1, ..). Maybe you're still willing to learn something new?

http://en.wikipedia.org/wiki/Floating_p ... y_problems

[Edit: the financial world has ways of dealing with this. Highly off-topic and not my beer..]

Return to “QCAD 3 Troubleshooting and Problems”

### Who is online

Users browsing this forum: No registered users and 3 guests