To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 11058
11057  |  11059
Subject: 
Re: number notation in official parts
Newsgroups: 
lugnet.cad.dev
Date: 
Fri, 12 Mar 2010 00:39:24 GMT
Viewed: 
22891 times
  
In lugnet.cad.dev, Philippe Hurbain wrote:
My suggestion would be to read numbers in that notation but never write them.
I mostly agree with this policy.

I'm not sure why LDDP would write them that way (it would require some strange
output routines) but if one thing writes them then it's best to read them.
There is nothing strange in the routines, it is the standard format used to
represent very large or very small numbers in a limited number of digits.

I definitely know this. I see them far too much in my job as a numerical
physicist ;)

My point is that to write in mixed format (some %f and others %e) requires some
strange coding unless there is a weird language which does it automatically. I'm
pretty sure that to do it in C or Fortran would be quite hard.

Actually since values never get very large in LDraw parts (biggest is probably
50x50 baseplate, thus 1000 ldu), it's all a matter of proper rounding. As far as
I can tell, 4 digits after comma is OK for position coordinates, and 6 digits is
enough for matrices coefficients. The problem mentionned with values such as
1e-15 should not have occured if I had properly rounded the file.

Yes. Actually LDraw files should always use a fixed digit rounding and never a
percentage rounding.

Note also that LDDP has an auto rounding feature (on by default) that would have
prevented the problem from the beginning. But I disable it since this may
accumulate errors during complex parts work.

Also note that MLCad also cherfully generates scientific notation numbers (eg.
9.9e-005) for any number below 0.0001

Philo

That is bad behaviour IMO. It implies an accuracy which is not there. You should
never display anything more accurate than the maximum error (give or take a
bit).

To expand on your comment about proper rounding: The nature of operations in
LDraw files is such that fixed digit rounding is better in almost all
circumstances (except where you have a scaling and rotation, a rotation of a
huge or poorly centered submodel or many multiples of rotations such as in
complex part design). In a model file you are only interested in results within
x LDU where x is something less than 1 and in a standard model x will be at
maximum around 1000 times the error in a rotation in the most extreme case.

Tim



Message has 1 Reply:
  Re: number notation in official parts
 
(...) Actually, in C, %g does exactly this. Having said that, I think LDDP is a Delphi app, so it uses Pascal, and I don't remember how Pascal does formatting. --Travis (14 years ago, 12-Mar-10, to lugnet.cad.dev)

Message is in Reply To:
  Re: number notation in official parts
 
(...) I mostly agree with this policy. (...) There is nothing strange in the routines, it is the standard format used to represent very large or very small numbers in a limited number of digits. Actually since values never get very large in LDraw (...) (14 years ago, 11-Mar-10, to lugnet.cad.dev)

13 Messages in This Thread:





Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR