Special:
|
[DAT] (requires LDraw-compatible viewer)
|
Subject:
|
Re: MPD spec
|
Newsgroups:
|
lugnet.cad.dev
|
Date:
|
Fri, 3 Mar 2000 16:33:03 GMT
|
Reply-To:
|
rui.martins@NOMORESPAMlink.pt
|
Viewed:
|
899 times
|
| |
| |
> > - Which (inline) file in the (.mpd) file is considered the root of the
> > model ?
>
> The first.
>
> > - Is the (example.mpd) file converted to a (example.dat) file, with
> > references to all other files, when using MPDspliter ?
>
> You can't trust that the MPD file and the first file in the
> MPD file has the same name, but it will generally be the
> case.
> > By the way
> > (Can you supply a compiled version of MPDsplitter for WinX86/LinuxX86 ?)
>
> There is a Linux binary at
> <URL: http://hugin.ldraw.org/meyer/LEGO/V%E6rkt%F8j/Split_LDraw_Files/ >.
OK, I saw it after asking, but what about the Win/DOS X86 version.
NOTE: Not every one uses ADA, i.e. has an ADA Compiler Installed.
> > - Is it allowed to have ldraw commands before the first (0 FILE) Meta
> > command ?
>
> No.
>
> If the interpreter is aware that it is processing an MPD
> file they will be ignored, but it is considered an error.
> > I think we should define a more precise and correct spec !
>
> Yes.
The following proposition may may seem awkward, but bare with me.
This is My proposition for changing the MPD format:
(how to build My proposition MPD)
- The "filename.mpd" represents the "filename.dat" and it's submodel files
- The "filename.dat" is inserted first in the resulting "filename.mpd",
but it will NOT have a "0 FILE filename" meta command (this is New).
This avoids having to check for commands before the first
"0 FILE filename" meta command, and it seems (to me at least) more
straight forward.
- The "subfile1.dat", "subfile2.dat", etc files are inserted just after
having the root "filename.dat" insert, but these subfiles now will be
inserted using the "0 FILE filename" meta command.
So,
- Every command until the first "FILE" command is a DUMP of the
"filename.dat".
- Every data after a "FILE" command is a DUMP of the file referenced
(named) in that specific "FILE" command, Until a new "FILE" command or
the end of file is found.
Example:
source files (*.dat)
--- file begin "model.dat" ---
0 New MPD example
0 Just Draw a '+'
2 7 -1 0 0 +1 0 0
2 7 0 -1 0 0 +1 0
1 7 0 0 0 1 0 0 0 1 0 0 0 1 m_sub1.dat
1 7 0 0 0 1 0 0 0 1 0 0 0 1 m_sub2.dat
--- file end "model.dat" ---
--- file begin "m_sub1.dat" ---
0 New MPD example subfile 1
0 Just Draw a '| |'
0 left vertical line
2 7 -1 -1 0 -1 +1 0
0 right vertical line
2 7 +1 -1 0 +1 +1 0
--- file end "m_sub1.dat" ---
--- file begin "m_sub2.dat" ---
0 New MPD example subfile 2
0 Just Draw a '| |' rotate by 90 degrees
0 bottom horizontal line
2 7 -1 -1 0 +1 -1 0
0 upper horizontal line
2 7 -1 +1 0 +1 +1 0
--- file end "m_sub2.dat" ---
-----------------------------------
so My proposition MPD format would be:
--- file begin "model.mpd" ---
0 New MPD example
0 Just Draw a '+'
2 7 -1 0 0 +1 0 0
2 7 0 -1 0 0 +1 0
1 7 0 0 0 1 0 0 0 1 0 0 0 1 m_sub1.dat
1 7 0 0 0 1 0 0 0 1 0 0 0 1 m_sub2.dat
0 ----
0 FILE m_sub1.dat
0 ----
0 New MPD example subfile 1
0 Just Draw a '| |'
0 left vertical line
2 7 -1 -1 0 -1 +1 0
0 right vertical line
2 7 +1 -1 0 +1 +1 0
0 ----
0 FILE m_sub2.dat
0 ----
0 New MPD example subfile 2
0 Just Draw a '| |' rotate by 90 degrees
0 bottom horizontal line
2 7 -1 -1 0 +1 -1 0
0 upper horizontal line
2 7 -1 +1 0 +1 +1 0
--- file end "model.mpd" ---
Note: every line starting with "--- file " does NOT belong to the files,
they were just used to delimit the files.
I think this format is better, because it's simple, and requires no
specific error detection, apart form the ones used in regular *.dat files.
Also you can probably use the same procedures that load the DAT files,
by supporting just another meta command (0 FILE filename).
If you see it from another perspective, you can have generalise and say
that a DAT file is just a special case of an MPD file, it does NOT have
"FILE" meta commands, apart from that is exactly equal.
NOTE:
I think that it will NOT be hard to change the existing aplications
which currently support the current MPD format.
I know that there probably exists some resistance to changes, but I think
it is for the better.
NOTE2: For retro compatibility (if absolutly required) we can define the
first file defined with a "FILE" command as the ROOT file, if before the
"FILE" command there are no other commands.
After all this, tell me your thoughts !
Rui Martins
|
|
Message has 2 Replies: | | Re: MPD spec
|
| Rui: (...) It's "Ada", not "ADA"! Neither does everybody have MS-Windows installed (and I am one of them). I don't mind distributing binaries for DOS and MS-Windows, but somebody else has to compile them. [...] There is a very good reason that I (...) (25 years ago, 4-Mar-00, to lugnet.cad.dev)
| | | Re: MPD spec [DAT]
|
| (...) I understand your proposal, but it has the bad side effect of requiring a double-pass through all the files. For example, if the first line of your file is: 1 1 0 0 0 1 0 0 0 1 0 0 0 1 foo.dat and foo.dat is not found in the search path, the (...) (25 years ago, 6-Mar-00, to lugnet.cad.dev)
|
Message is in Reply To:
| | Re: MPD spec
|
| Rui: (...) The first. (...) You can't trust that the MPD file and the first file in the MPD file has the same name, but it will generally be the case. (...) There is a Linux binary at <URL: (URL) >. (...) No. (...) If the interpreter is aware that (...) (25 years ago, 3-Mar-00, to lugnet.cad.dev)
|
65 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
|
|
|
|