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 / 7701
7700  |  7702
Subject: 
Re: DAT files: Do No Harm
Newsgroups: 
lugnet.cad.dev
Date: 
Thu, 22 Aug 2002 17:09:23 GMT
Viewed: 
1838 times
  
I don't have any comments, except to say that I agree with pretty much
everything you wrote.  And that I'd be very hard-pressed to actually
implement some of it.  And I didn't completely understand all of your
points...

In lugnet.cad.dev, Erik Olson wrote:

> 
> What consideration should an editor program make for unfamiliar content or
> eccentric style when it loads and saves an LDRAW file with changes?
> 
> I am implementing the following general ideas in BrickDraw3D, based on
> various situations in test files.
> 
> A program which reads, edits, and writes an LDRAW file should:
> 
> 1. Do no harm: never change a line unless it really has been edited

Yes!

> 2. Use the same scheme of line breaks it found there (CR, CRLF, LF, LFCR)

Good idea, usually.

> 3. Keep the exact part filename specified, even if slightly different on
> host computer (example: when shield.dat maps to SHIELD.dat, or even shield.ldr)

Yeah.

> 4. Preserve indentation, maybe even try to mimic it when a new part is
> inserted to a step (as in pyramid.dat which has indentation)

Auto-indent is a good thing.

> 5. Preserve dangling line remnant (example: type 1 line has 2 part names...
> user was trying out alternatives. Jacob's vognhest.dat for example.)

Hmm, I suppose.  This is a subitem of "first, do no harm" I suppose.

> 6. Always format floats without trailing zeroes (printf "%g") but see #1

Yep.  But sometimes spaces.

> 7. (Maybe) fix minor math errors like degenerate matrices (but see #1)

Maybe.

> 8. Try not to fill in an implied part name (where an empty part name implies
> previous part) unless necessary (due to edit).

Huh?

> 9. Perform smart merges with the file copy to support simultaneous editing

Huh?^2

> 10. Try in other ways to format new lines in the way established in the file?
>  a. when the file has a nice table format, respect that

True.  Tabs vs. spaces?  Space-filled table format?

Here's another one:

10b. Preserve mid-command line breaks.  They're evil, but they can be
useful.  The flip side of this is "fix mid-command line breaks".

Steve



Message has 2 Replies:
  Re: DAT files: Do No Harm
 
(...) does this include "don't add any new lines unless they're intentional"? As in, a program shouldn't add (and forgive me if this is incorrect dat format): 0 edited by dan with DatZap on Tuesday :) Dan (24 years ago, 22-Aug-02, to lugnet.cad.dev)
  Re: DAT files: Do No Harm
 
(...) I found some model which was (mostly) all 3001.dat, except only the first line gave the part number! All following lines were meant to be the same part (with different location.) I guess the author's viewer tolerates this? So, the rule would (...) (24 years ago, 22-Aug-02, to lugnet.cad.dev)

Message is in Reply To:
  DAT files: Do No Harm
 
What consideration should an editor program make for unfamiliar content or eccentric style when it loads and saves an LDRAW file with changes? I am implementing the following general ideas in BrickDraw3D, based on various situations in test files. (...) (24 years ago, 21-Aug-02, to lugnet.cad.dev)  

14 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
    

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