To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 852
851  |  853
Special: 
[DAT] (requires LDraw-compatible viewer)
Subject: 
LDraw FAQ
Newsgroups: 
lugnet.cad, lugnet.cad.dev
Date: 
Tue, 9 Feb 1999 11:04:09 GMT
Viewed: 
1566 times
  
                                   LDraw FAQ

0) About this FAQ

   The questions and answers in this FAQ is mainly summaries of
   communication in the discussion group lugnet.cad.dev.

  0a) Table of contents

     * 0) About this FAQ:
          + a) Table of contents
          + b) Locations of the FAQ
          + c) Useful addresses
     * 1) What is this LDraw thing?
     * 2) Where can I get a copy of LDraw?
     * 3) Can I get the source code?
     * 4) What platforms does the program work on?
     * 5) Where can I find examples?
     * 6) Who made it?
     * 7) What does LEGO (the company) think of it?
     * 8) Where can I ask questions about LDraw?
     * 9) Mailing list?!? What mailing list?
     * 10) Other LEGO CAD programs
     * 11) How can I convert a LDraw .dat file to a .bmp file?
     * 12) Can I use models as if they were pieces?
     * 13) How can I insert comments in the .dat files?
     * 14) How can I get the pieces to line up?
     * 15) How can I turn a hinge from one step in the instructions to
       the next?
     * 16) What's the most recent edition of the LDraw package?
     * 17) What does the numbers that follow the "-a" parameter mean?
     * 18) Why don't the -MS and -MP options draw the last step of my
       model?
     * 19) What do I do when LEdit crashes?
          + a) - when you try to get the on-screen parts list
          + b) - with the message "Graphics error: Invalid device driver
            file (EGAVGA.BGI)"
     * 20) What is the .DAT file format?
     * 21) How can I make ray-traced images of LDraw models?
     * 22) How does one map a bitmap onto a LDraw object?
     * 23) How can I get a clear brick in LDraw?
     * 24) How can I create a part that is not yet in LDraw?
     * 25) How can I find the numbers for a view in LDraw?
     * 26) Where does LDraw look for files
     * 27) What is the colour code for ... ?
     * 28) Runtime Error 200 ???
     * 29) Runtime Error 003 ???
     * 30) Can I get LDraw to put the BMP files somewhere else?
     * 31) What is the parts voting procedure?

  0b) Locations of the FAQ

   The LDraw FAQ will be posted to the discussion groups rec.toys.lego,
   lugnet.cad, and lugnet.cad.dev.

   The FAQ can be downloaded/read at these URL's:
     * <URL:http://hugin.risoe.dk/JJ_Memorial/FAQ/> (hypertext)
     * <URL:http://hugin.risoe.dk/JJ_Memorial/FAQ/text> (plain text)

  0c) Useful addresses

   FAQ editor:
          Jacob Sparre Andersen (sparre@cats.nbi.dk)

   Expert:
          James Jessiman (July 25th, 1997, James passed away)

1) What is this LDraw thing?

   LDraw is a DOS program that allows you to draw LEGO models, create
   building instructions for them, etc. - A LEGO-style Computer Aided
   Design system.

   The current edition can generate a sequence of .bmp files (MS-Windows
   bitmaps), one for each step in a building instruction, from a LDraw
   .dat file.

   You can edit LDraw files with the accompanying LEdit program or with
   your favourite text editor (the latter is said to be very hard, but I
   do it anyway. - Jacob).

   It's free!

2) Where can I get a copy of LDraw?

   You can download LDraw directly from James' Web site at
   <URL:http://silo.riv.csu.edu.au/%7Ejjessiman/ldraw/index.html>, but I
   suggest that you go through the James Jessiman Memorial
   (<URL:http://hugin.risoe.dk/JJ_Memorial/official.html>) where you can
   get new collections of parts as well. You can also download LDraw from
   Bram Lambrecht's LDraw and LEdit tutorial.

3) Can I get the source code?

   No!

   But you can get the source code for LDLite (a Win32 replacement) at
   <URL:http://www.gyugyi.com/l3g0/ldlite/>.

4) What platforms does the program work on?

   MS-DOS. Including DOS in OS/2, Win-95 and Win-NT.

   There's no Mac and Unix versions.

   But there is one in progress (see section 3).

5) Where can I find examples?

   These documents contains LDraw'n models. Either as data files for
   LDraw or as processed images:

   L3P Gallery (includes ray-traces):
          <URL:http://www.netby.net/Nord/Mandelvej/Hassing/l3pgal.html>

   Jacob's LEGO building instructions:
          <URL:http://hugin.risoe.dk/LEGO/Byggevejledninger/>

   Space ship Black 'n' White:
          <URL:http://silo.riv.csu.edu.au/%7Ejjessiman/lego/models/jsa/BL
          KWHT.HTML>

   Train car and office building:
          <URL:http://tortie.me.uiuc.edu/%7Edorneich/lego/Elego.html>

   Mechanical joystick and the Blacksplorien shuttle:
          <URL:http://www.uni-karlsruhe.de/Uni/RZ/Personen/rz71/Private/L
          ego/lego.html>

   Various models:
          <URL:http://www.chuh.org/Students/Bram-Lambrecht/LEGO/Models.ht
          ml>

   RC Car and 4x4 with differentials:
          <URL:http://www.nd.edu/%7Elego/grp2/www/4x4instr.htm>

   Jaco van der Molen's USS Enterprise:
          <URL:http://www.globalxs.nl/home/j/jmolen/stinlego/stinlego.htm
          >

6) Who made it?

   James Jessiman. James passed away July 25th, 1997.

   We are trying to continue James' work in the discussion group
   lugnet.cad.dev (see section 9). Many people are working on modelling
   more parts, and Paul Guygyi has written a LDraw clone for MS-Windows.

7) What does LEGO (the company) think of it?

   No idea!

8) Where can I ask questions about LDraw?

   If you can't find the answer here, please ask on the discussion groups
   lugnet.cad or lugnet.cad.dev, and write a section for the FAQ based on
   the response.

9) Mailing list?!? What mailing list?

   Until recently technical discussions regarding LDraw (and other LEGO
   related CAD packages) were located on the "LEGO-style Computer Aided
   Design" mailing list. This mailing list has been superceded by the
   discussion group lugnet.cad.dev. You can access the discussion group
   in three ways:
     * Through the web page
       <URL:http://www.lugnet.com/news/display.cgi?lugnet.cad.dev>
     * Through e-mail (see the guidelines at
       <URL:http://www.lugnet.com/news/mail/>)
     * As newsgroups (see the guidelines at
       <URL:http://www.lugnet.com/news/>)

10) Other LEGO CAD programs

   Gryphon Bricks (see <URL:http://www.gryphonsw.com/bricks/index.html>)
          For making building instructions.

   Paul Gyugyi's L3G0 (see
          <URL:http://www.gyugyi.com/legocad/legocad.html>)
          For ray-tracing.

   SimLego (see <URL:http://home2.swipnet.se/%7Ew-20413/simlego.htm>)
          For making building instructions.
          Development stopped 1997.06.23. The author, Tore Eriksson, said
          that "SimLego will never come close to LDraw".

   Visio
          Huw Millington has a parts library for this.

   LeoCAD (see <URL:http://www.geocities.com/Colosseum/3479/leocad.htm>)
          LeoCAD is a LEGO CAD program for Windows (95 and NT). It can
          import and export LDraw files.

   Anton Raves' LEGO library for POV-Ray (see
          <URL:http://ourworld.compuserve.com/homepages/Anton_Raves/How_T
          o.html>)
          POV-Ray is a free ray-tracing program.

   Paulo Caparica Junior's LDraw to DXF Converter (see
          <URL:http://www.geocities.com/Eureka/Gold/3269/>)

   ld2vr (see <URL:http://perso.wanadoo.fr/paris.jean-pierre/LD2VR/>)
          A LDraw to VRML compiler.

   Matthew D. Bates' Track Designer (see
          <URL:http://ourworld.compuserve.com/homepages/train_depot/td.ht
          m>)
          A track lay-out program for MS-Win.

11) How can I convert a LDraw .dat file to a .bmp file?

   If you want to convert the LDraw .dat file MY_MODEL.DAT to a sequence
   of .bmp files;
    1. Go to the catalog where the LDRAW.EXE file resides.
    2. Execute the command LDraw -MS MY_MODEL.DAT at the DOS command
       line.

   You will find a sequence of .bmp files named MY_MOD01.BMP,
   MY_MOD02.BMP ... in the subdirectory BITMAP.

12) Can I use models as if they were pieces?

   Yes. The .dat files just have to be stored in the MODELS subdirectory.
   You refer to them by the file name (no path specification), just as
   with the pieces (whose .dat files are found in the PARTS
   subdirectory).

13) How can I insert comments in the .dat files?

   In LEdit:
    1. Insert a new piece.
    2. Pick /Edit Line-Type Comment
    3. Type in your comment.
    4. The piece line will change to a comment line.

   In a text editor: Start the line with a zero.

14) How can I get the pieces to line up?

   I'll list various peoples suggestions.
   Jacob

  Jeremy H. Sproat suggests:

   I start with the 3-D view, then go to two of the "normal" views to
   line the puppy up. If I'm putting a piece in among a bunch of others
   and my view is obstructed, it helps to turn on the "Stop at cursor"
   option.

   If I'm putting in a piece that needs to go at an odd angle, and there
   is already another piece at the same angle, I load the .dat file into
   a text editor and copy and paste the line of the first piece. I then
   load it into LEdit and move it around.
   Sproat

  Bram Lambrecht suggests:

   I check a couple of different views to check sometimes. I usually use
   James' method: hit down, so that all but the studs are visible. If the
   fit is correct, bring the piece up the correct number of moves.
   Bram Lambrecht

15) How can I turn a hinge from one step in the instructions to the next?

    1. Draw the model up to the step before where the piece changes.
    2. Add the step commands to the .dat file, including the last one.
    3. Add a '0 CLEAR' command at the end of the file.
    4. Copy everything before the last step command to after the clear
       command, so that you have the model repeated.
    5. Remove the step commands from the latter half of the file.
    6. Change the orientation of the hinge in the latter half of the
       file.

   If you use LEdit, you will have to exit it, to do step 3 to 4/5 in a
   text editor.

16) What's the most recent edition of the LDraw package?

   You can find links to the package itself, and to the L-CAD parts
   collections at <URL:http://hugin.risoe.dk/JJ_Memorial/official.html>.
   The last collection of new parts is from January 1999.

   There is a tutorial for LDraw and LEdit at
   <URL:http://library.advanced.org/20551/>.

   External units:

   Tore Eriksson's LDraw Launcher (see
          <URL:http://home2.swipnet.se/%7Ew-20413/ldlaunch.htm>)

   Patrick Sayre-Little's printable visual parts catalog (see
          <URL:http://www.calpoly.edu/%7Ewsayreli/lego.html>)
          For MS Word 95/7.0

   Jacob Sparre Andersen's Fractal landscape generator for DOS, OS/2, and
          AIX (see
          <URL:http://hugin.risoe.dk/meyer/LEGO/V%E6rkt%F8j/#landskaber>)
          :
          May 9th 1997.

   Steve Bliss' LDraw Add-On for Win-95 and Win-NT (see
          <URL:http://home.att.net/%7Eblisses/ldaddon.html>):
          May(?) 1998.

   Jacob Sparre Andersen's file splitter for DOS, OS/2, and AIX (see
          <URL:http://hugin.risoe.dk/meyer/LEGO/V%E6rkt%F8j/#Split.LDraw.
          Files>):
          June 20th 1997.

   Huw Millington's parts list generator for Win-95 (see
          <URL:http://www.pncl.co.uk/%7Ehuw/lego/ldraw/ldrawlist/ldrawlis
          t.html>):
          June 27th 1997.

   Richard Goldfinder's program that creates Bezier curves for LDraw (see
          <URL:http://www.eskimo.com/%7Egoldfndr/lego/>):
          June 14th 1997.

   Tore Eriksson's bitmap to LDraw converter (see
          <URL:http://home2.swipnet.se/%7Ew-20413/bmp2dat.htm>):
          June 14th 1997

   Lutz Uhlmann's LDraw to POV-Ray converter (see
          <URL:http://titan.informatik.uni-bonn.de/%7Euhlmann/files.html>
          ):
          January 5th 1999

   Lars C. Hassing's LDraw to POV-Ray converter (see
          <URL:http://www.netby.net/Nord/Mandelvej/Hassing/l3p.html>):
          January 3rd 1999

   Tore Eriksson's LDraw vector drawing program (see
          <URL:http://home2.swipnet.se/%7Ew-20413/ldd.htm>)
          July 15th 1997.

   You should always remember to have a look at the overview of LDraw
   resources at the James Jessiman Memorial (see
   <URL:http://hugin.risoe.dk/JJ_Memorial/ldraw.html>).

17) What does the numbers that follow the "-a" parameter mean?

   The first three numbers determine the position along the screen X
   axis. The first one is how much the model X axis affects the position.
   The next one is how much the model Y axis affects the position and the
   last one is how much the model Z axis affects the position.

   So:
    Screen X = Model X * First number +
               Model Y * Second number +
               Model Z * Third number


   The next three numbers are for the screen Y axis and finally the last
   three are for the screen Z axis. I.e.:
    Screen Y = Model X * Fourth number +
               Model Y * Fifth number +
               Model Z * Sixth number

    Screen Z = Model X * Seventh number +
               Model Y * Eighth number +
               Model Z * Ninth number


   The screen Z axis is not really drawn. It is only used to determine
   which piece is visible and which piece isn't.

   The screen X axis goes to the right, the Y axis goes down, and the Z
   axis goes away from you (into the screen).

18) Why don't the -MS and -MP options draw the last step of my model?

   You have to insert a step command at the end of the .DAT file. [This
   problem should have been solved in the present version of
   LDraw/LEdit.]

19) What do I do when LEdit crashes?

   Stop editing your .DAT files in Notepad! Or at least, stop making
   mistakes when you do edit them. [Says Steve]

  19a) - when you try to get the on-screen parts list

   Run MAKELIST to regenerate the file PARTS.LST. [This problem should
   have been solved in the present version of LDraw/LEdit.]

  19b) - with the message "Graphics error: Invalid device driver file
  (EGAVGA.BGI)"

   There are two possible reasons for this. Either
    1. you have copied another version of the file "EGAVGA.BGI" on top of
       the one delivered in the LDraw package,
       or
    2. you run LEdit in/from a catalog where you keep another version of
       "EGAVGA.BGI" than the one delivered in the LDraw package.

   In the first case, you will have to reinstall all of LDraw (run the
   installation programs with the option -y to speed up the process). In
   the latter case, you should try to run LEdit from the catalog LDraw
   and LEdit are installed in.

20) What is the .DAT file format?

   .DAT files are text (yes, you can edit them in EDIT or Notepad or your
   favourite text editor). Each line is a single command, and each line
   is independent. The commands are (mostly) very simple, there are only
   a few different commands. Specific commands are identified by the
   first number on the line, which is called the line-type. The contents
   and format of the rest of the line depend on the line-type. I do not
   know of any length-limit on command lines.

  Line types

   Each line in the .DAT file is a single command. The first number on
   each line is the line type, valid values are 0 through 5, with the
   following meanings:
   0:
          comment or meta-command
   1:
          Part-file reference
   2:
          Line
   3:
          Triangle
   4:
          Quadrilateral
   5:
          Draw a line between the last two points, if both points are on
          the same side of the line between the first two points.

   If the line type for a line is not a valid value, the line is ignored.

   Meta-commands require a keyword to follow the line-type. These
   keywords must be in all-caps, and you should assume that if the
   meta-command doesn't require more information, you shouldn't give it
   any additional information.

  Commands

   Here is a complete (as far as I know) list of LDraw drawing- and
   meta-commands:
     * Model Title
     * Step
     * Write
     * Clear
     * Pause
     * Save
     * Comment
     * Part
     * Line
     * Triangle
     * Quadrilateral
     * Optional-Line

   And here are the details of each command. Meta-commands are listed
   first, with the "real" commands after. The command-names are wholly
   made up by me, I don't have any "official" names for these things.

   Model Title.
          The descriptive name of the model- or part-file.

        Line format:
               0 title-text

          where title-text is whatever you want to name your model.
          This is a meta-command, sort of. If the first line in a .DAT
          file has line-type 0, the remainder of that line will be
          considered the title for the file (at least for parts files).
          This overrides any meta-commands on the line.

   Step meta-command.
          Marks the end of a building step.

        Line format:
               0 STEP

          This command will cause LDraw to stop until you press <enter>,
          and it will cause LDraw to save the current image into a bitmap
          file in the ldraw\bitmap directory. These two effects are
          controlled by the -M command line option (see ldraw.doc for
          info on -M).

   Write meta-command.
          Displays a message at the top of the screen.

        Line format:
               0 WRITE message-text
        or:
               0 PRINT message-text

          where message-text is whatever you want displayed on the
          screen.
          The displayed message is not saved in the image-bitmap files.

   Clear meta-command.
          Clears the screen.

        Line format:
               0 CLEAR

          Useful for advanced model files. Don't forget to redraw all the
          parts you just erased by using this command.

   Pause meta-command.
          Causes LDraw to stop until you press <enter>.

        Line format:
               0 PAUSE

          This is like the Step command, but it does not save bitmaps,
          and it is not affected by the -M command line option.

   Save meta-command.
          Causes LDraw to save the current image in a bitmap.

        Line format:
               0 SAVE

          This is also like the Step command, but it does not cause LDraw
          to pause, and it is not affected by the -M command line option.

   Part command.
          Inserts a part defined in another .DAT file.

        Line format:
               1 colour x y z a b c d e f g h i part.dat

          where

          + colour is a colour code: 0-15, 16, 24, 32-47, 256-511
          + x, y, z is the position of the part
          + a - i are orientation & scaling parameters (see below for
            more on this)
          + part.dat is the filename of the included file

          Parts may located in the p\, parts\, or models\ subdirectories
          (under the ldraw\ directory). They may also be located in the
          current directory. James has arranged the directories so that
          p\ contains elements that are intended to be used as part of
          elements (such as stud.dat). The parts\ directory contains
          finished parts, ready to be used in construction models. And
          the models\ directory contains construction models.
          Part files can also include Part commands. There don't seem to
          be a specific limit to how deep these references can go.

   Line command.
          Draws a line between two points.

        Line format:
               2 colour x1 y1 z1 x2 y2 z2

          where

          + colour is a colour code: 0-15, 16, 24, 32-47, 256-511
          + x1, y1, z1 is the position of the first point
          + x2, y2, z2 is the position of the second point

   Triangle command.
          Draws a filled triangle between three points.

        Line format:
               3 colour x1 y1 z1 x2 y2 z2 x3 y3 z3

          where

          + colour is a colour code: 0-15, 16, 24, 32-47, 256-511
          + x1, y1, z1 is the position of the first point
          + x2, y2, z2 is the position of the second point
          + x3, y3, z3 is the position of the third point

   Quadrilateral command.
          Draws a four-sided, filled shape between four points.

        Line format:
               4 colour x1 y1 z1 x2 y2 z2 x3 y3 z3 x4 y4 z4

          where

          + colour is a colour code: 0-15, 16, 24, 32-47, 256-511
          + x1, y1, z1 is the position of the first point
          + x2, y2, z2 is the position of the second point
          + x3, y3, z3 is the position of the third point
          + x4, y4, z4 is the position of the fourth point

   Optional-Line command.
          Draws a line between the first two points, if the projections
          of both points onto the screen are on the same side of an
          imaginary line between the projections of the last two points
          onto the screen.

        Line format:
               5 colour x1 y1 z1 x2 y2 z2 x3 y3 z3 x4 y4 z4

          where

          + colour is a colour code: 0-15, 16, 24, 32-47, 256-511
          + x1, y1, z1 is the position of the first point
          + x2, y2, z2 is the position of the second point
          + x3, y3, z3 is the position of the third point
          + x4, y4, z4 is the position of the fourth point

          Here is an example using the optional line command. If we try
          to approximate a (cylindrical) stud with a hexagonal prism we
          have something like this:

             1___________2
            /             \
           /               \
         6/                 \3
         |\                 /|
         | \               / |
         |  \5___________4/  |
          \  |           |  /
           \ |           | /
            \|___________|/


          + The line below 1 should not be drawn because 6 and 2 are on
            different sides.
          + The line below 2 should not be drawn because 1 and 3 are on
            different sides.
          + The line below 3 should be drawn because 2 and 4 are on the
            same side.
          + The line below 4 should not be drawn because 3 and 5 are on
            different sides.
          + The line below 5 should not be drawn because 4 and 6 are on
            different sides.
          + The line below 6 should be drawn because 5 and 1 are on the
            same side.

          resulting in the following drawing:

             1___________2
            /             \
           /               \
         6/                 \3
         |\                 /|
         | \               / |
         |  \5___________4/  |
          \                 /
           \               /
            \_____________/


  Colours

   Colours are outlined in LEDIT.DOC. Two special values are 16 and 24.
   16 is the 'current colour', i.e., whatever colour was specified on the
   type 1 line which caused the current line to be executed. Colour 24 is
   a complementary colour to the current colour, usually the bright/dark
   complementary shade. So if the current colour is dark blue, colour 24
   would give bright blue.

   Also, colours 256 through 511 are dithered. So if you want to combine
   colours J and K, figure your colour value as

                        colour = (J * 16) + K + 256

   The complementary colour of J is used as the complementary colour of
   the dithered value. So you can control the edge colour (somewhat) by
   switching J and K.

   Line type 1's format is:
   Line Format:
          1 colour x y z a b c d e f g h i part.dat

   Fields a through i are orientation & scaling parameters, which can be
   used in 'standard' 3D transformation matrices. Fields x, y and z also
   fit into this matrix:

    | a d g 0 |
    | b e h 0 |
    | c f i 0 |
    | x y z 1 |


   so that every point (x, y ,z) gets transformed to (x', y', z') :

    x' = a*x + b*y + c*z + x
    y' = d*x + e*y + f*z + y
    z' = g*x + h*y + i*z + z


   or, in matrix-math style:

                                    | a d g 0 |
    | X' Y' Z' 1 | = | X Y Z 1 | x  | b e h 0 |
                                    | c f i 0 |
                                    | x y z 1 |


21) How can I make ray-traced images of LDraw models?

   There are two tools for converting LDraw models to the format of the
   ray-tracer POV-Ray. L2p is based on Lutz Uhlmann's very detailed parts
   library, LGEO. It is available for DOS and Linux. L3p is based on the
   LDraw parts library. Only available for DOS.

  Lutz Uhlmann's LGEO tutorial

   Lutz Uhlmann's LGEO tutorial can be found at
   <URL:http://titan.informatik.uni-bonn.de/%7Euhlmann/tutorial.html>.

  Jacob's quick recipe for making ray-traced images of LDraw models

    1. Convert your LDraw .DAT files to POV-Ray .INC files with L2P:
         > l2p -i -v -t -l my_model.dat my_model

       It is important that you process sub-models as well, because L2P
       simply converts a reference to a .DAT sub-model to a reference to
       a .INC sub-model.
    2. Make a copy of the scene file Lutz has included in the package
       (l2p_test.pov):
         > copy l2p_test.pov my_model.pov

    3. Edit the fourth line in your new scene file (the one that says:
       #include "l2p_test.inc"). It should refer to the .INC file for
       your model instead:

            #include "lg_color.inc"
            #include "lg_defs.inc"

            #include "my_model.inc"


    4. Run POV-Ray with the new scene file. This is how I do it in Linux.
       There are probably some minor differences when you do it in DOS:
         > povray +L/usr/lib/povray/include/ +Llgeo/ +Imy_model.pov

       The first +L refers to the POV-Ray libraries, the second +L refers
       to the LGEO library, and the +I refers to the scene file.

  Bram's additions for Win95 users

   In the windows version instead of writing a long command line, you
   need to go to Edit Rendering Settings and add the command line options
   (+L).

22) How does one map a bitmap onto a LDraw object?

   Use BMP2LDRAW, BMP2DAT or Tore's LDraw vector drawing program (see the
   answer to question 16) to create a .DAT file with just the image.

   Copy the DAT file for the part you are going to add the bitmap to from
   the Parts catalog to the Models catalog, and give it a new name.

   Insert the bitmap as a part in the new DAT file. Translate and rotate
   the bitmap part as appropriate. B

23) How can I get a clear brick in LDraw?

   Colour 47 (clear white) works pretty good.

   See section 27 for more information on colours.

24) How can I create a part that is not yet in LDraw?

   First check if somebody else are working on the part. You can do that
   on the parts tracker (see
   <URL:http://www3.hmc.edu/%7Ezbenz/parttracker/partlist.shtml>). Steve
   Bliss, Jaco van der Molen, and Tore Eriksson present different
   approaches to creating parts, and Manfred Moolhuysen has some detailed
   advice for using the predefined subparts (without studying math). But
   first of all, you should check out which primitives are available (at
   <URL:http://hugin.risoe.dk/JJ_Memorial/FAQ/Primitives_Reference>).

   When you have finished the part, you should check it for technical
   mistakes with l3p -check, and then send it to jjmemorial@geocities.com
   so it can be included in the L-CAD parts distribution.

  Steve Bliss writes:

   Hmm. "Directions for making parts". Hmm. I can't think of directions,
   so much as advice. I don't really see how there could be a 1-2-3
   cookbook approach. But here are some thoughts:

   When you model a part, you need to think in terms of vertices, edges
   and surfaces. Your part-file has to provide one or more commands for
   each edge and surface. You need to specify these edges and surfaces by
   the XYZ position of their vertices. So you have to measure out where
   the vertices are. The trick with lego parts is that they are
   (typically) built around the familiar sizes of studs and plates (and
   bricks). So you often measure parts by comparing them to other parts
   (like simple bricks and plates).

   The typical way to start drawing a part is to examine the .DAT file
   for a similar part. At least, that's the way *I* do it. ;-) Doing an
   LEDIT xxxx.DAT will let you step through each line in the part-file,
   so you can see what the effects are. And how other people have built
   their parts.

   Here are some suggestions on what you should check out as you get
   started:
    1. Study the LDraw language section of the LDraw FAQ. Become very
       familiar with the formats, and what they do.
    2. Expertise with computer graphics methods is very helpful. You
       should at least be comfortable with the concepts of rotating,
       translating, and scaling, even if you aren't comfortable with the
       theory behind them.
    3. Forget about LEdit, except as a sometimes buggy way of stepping
       through the part-files you create. Notepad will be your friend for
       creating new parts. I also use Excel, LDraw Add-On's Inliner, and
       the little Torus Generator I wrote. If you find another tool that
       is helpful for parts-modelling, I'd like to know!
    4. Learn what's in the ldraw\p\ directory. This directory contains a
       number of subpart files that are useful in different parts.
       STUD.DAT is used in almost every LDraw part in existence (and most
       of the others use STUD2.DAT). The other files are useful
       "synthetic primitives", such as rings, discs, cylinders, and
       spheres. Some of them are LEGO-specific, such as PEGHOLE.DAT, and
       some are very general, such as 1-4DISC.DAT (BTW, the '1-4' means
       1/4).

   What kind of instructions/information would you like to see? I'd be
   happy to answer questions (and I'm sure others would as well), but I
   don't have time to write up a big list of instructions right now. Tips
   I can provide, but I hate throwing off a bunch on context-free
   information which may or may not be relevant.

   Tip #1: The LDraw standard for positioning is to center the piece on
   X=0 and Z=0. Usually, the top of the part (excluding studs) is set to
   Y=0.

   Tip #2: Look for repeated elements in a part, which you can write up
   as a sub-part file. I find long lists of LDraw commands to be very
   confusing. Using subparts can shorten the file, and make things more
   comprehensible. In writing my chain-saw blade, my final version used
   10 custom files. I used the inliner utility to combine all these files
   before publishing.

   Tip #3: Use the 0 command-line to insert as many comments as you want.
   You can always remove them before publishing, if you don't want
   everyone to see your notes. This can really help to organise long
   files, making it easier to go back and fix sections later.

   Tip #4: Notepad is not very good. Wordpad is better. You may have
   another editor you like even more.

   I can't think of anything else right now. Ask lots of questions.

   Steve

  Jaco van der Molen writes:

    1. I made a drawing on paper of the basic points and started mapping
       these coordinates.
    2. Next I used Excel (yes, MS Excel) to define the coordinates of all
       other points and combined these into lines and faces.
    3. To finish the job, I used Editpad to remove the tabs and replace
       them by spaces and there I had it!

   Sjaacko

  Tore Eriksson writes:

   While making a part, I often use different colours so that I can
   easily see what areas are still to be covered, if a polygon came out
   right, and which one didn't.

   You can find an example at
   <URL:http://hugin.risoe.dk/JJ_Memorial/FAQ/25a.gif>.

   When everything is done, it's easy to set all to colour 16 or 24.

   Tore

  Manfred Moolhuysen writes:

   Examining the existing part file of a basic lego brick also helps you
   to understand how part files are made.

   Most of them use subparts, handy primitive shapes like cylinders,
   circles, disks, and the studs that are on top of or inside the bricks.
   You find all the available subparts in the subdirectory P.

   The line:
   1 16 0 8 0 -6 0 0 0 -12 0 0 0 6 4-4cyli.dat


   means you are including a full cylinder wall, a tube with both ends
   open. The other #-#cyli.dat subparts are useful if you want just a
   part of a cylinder wall, say 3-4cyli.dat for a 270 degrees cylinder
   part.

   The numbers 0 8 0 tells LDraw to place the cylinder base centred at
   the point (X = 0, Y = 8, Z = 0), just like the placing of normal
   parts.

   The 9 numbers following represent combined information about the
   dimensions of the cylinder and its orientation in space. In
   mathematics it is called a transformation matrix, but luckily for us
   we can tackle this in a "you don't have to know math" way.

   To put it simply:
     * The pure value of the numbers represent the dimensions.
     * The distribution of the numbers over the 9 available positions and
       the fact if they are positive or negative represent the
       orientation.

   In this example the cylinder radius is 6 units (= diameter 12). the
   two numbers 6 are responsible for that. If those two numbers were not
   equal the result would have been a "squeezed" pipe with an oval
   cross-section. The 12 says the cylinder is 12 units high or long.

   I have worked out a simple way to deal with the orientation of
   subparts, without getting my mind in a numerical twist:
     * I make a one line dat file whit the subparts proper dimension, but
       no orientation information. Example:
        1 16 0 0 0 6 0 0 0 12 0 0 0 6 4-4CYLI.DAT

       This is a cylinder with radius 6 hanging down 12 units from the
       zero plane.
     * I load the one line file in LEdit and give it the right
       orientation with the TURN option. Then i save it, and paste the
       result into my part file. In this last stage i also give it the
       correct insertion point.

   You see, no math at all. It also works for all the other subpart
   types.

    Some examples and detailed instructions:

Create this file, in the LDRAW\MODELS directory:

0
1 16 0 0 0 6 0 0 0 12 0 0 0 6 4-4CYLI.DAT
0

and name it TEST.DAT. View it in LDRAW and see the result.

now change the file in:

0
1 16 0 0 0 6 0 0 0 24 0 0 0 6 4-4CYLI.DAT
0

View the result in LDRAW again. You will see the cylinder is twice as long
now.

now change the file in:

0
1 16 0 0 0 12 0 0 0 24 0 0 0 12 4-4CYLI.DAT
0

View the result in LDRAW again. You will see the cylinder is twice as wide
now.

now change the file in:

0
1 16 50 24 20 12 0 0 0 24 0 0 0 12 4-4CYLI.DAT
0

View the result in LDRAW again. You will see the cylinder has been moved to
a different spot.

Now you have an idea what the numbers do if you change them:

position 3,4 and 5 were 50 24 20 and control the insertion point of the
subpart.
position 6 to 14 were 12 0 0 0 24 0 0  0 12 and control the size of the
subpart.

Changing the order and the signs of the last 9 numbers turns your cylinder,
so it is pointing in another direction. This is what you do in LEDIT.

first change file TEST.DAT back in:

0
1 16 0 0 0 12 0 0 0 24 0 0 0 12 4-4CYLI.DAT
0

We set the numbers on positions 3,4 and 5 to 0 0 0, so the cylinder will
turn around its insertion point.

Start LEDIT, press the ESCAPE-key, press F (stands for file) and L
(for load) Type the file name: TEST.DAT.

line:
1 16 0 0 0 12 0 0 0 24 0 0 0 12 4-4CYLI.DAT
is in the middle of the three lines displayed at the top of the screen. the
line above reads START and the line under reads END.

Press ESCAPE again, Press T (for turn) and X (for x-axis).
Type the angle: 90

   On the screen it seems the cylinder has disappeared, but if you press
   PAGE-UP followed by PAGE-DOWN the cylinder is redrawn in its new
   position. As you can see the cylinder is laying on its belly now.

   First save the file: press the ESCAPE-key, press F (for file) and S
   (for save). Then open it in your text editor or in windows and cut and
   paste the line in the file where you need it.

   If you turn the subpart around Z instead of X it is turned into
   another direction. Turning around Y is just like spinning the cylinder
   around its center, you see no difference at all.

   If your file has more than one subpart in it, you can select the one
   you are going to turn with the PAGE-DOWN and PAGE-UP keys. It must be
   the middle one of the 3 lines displayed at the top of the screen.

   Now try to do something similar with RECT.DAT, make the file
0
1 16 0 0 0 40 0 0 0 1 0 0 0 20 RECT.DAT
0


   Just start to play and fiddle a little bit with the numbers on
   positions 6, 10 and 14, and see what results you get.

   M. Moolhuysen

25) How can I find the numbers for a view in LDraw?

    1. Fire up LEdit.
    2. Choose the front view (/VF).
    3. Rotate the default piece until it's sitting the way you want to
       view.
    4. Look at the part-line in the top of screen (between the START and
       END lines).
    5. Write down the 6th through 14th numbers (everything after the 1 0
       0.0 0.0 0.0).
    6. Exit LEdit.
    7. Run LDraw with the command LDRAW -a6th,7th,8th,...,14th file.dat
       (using the numbers you wrote down after the -a option).

26) Where does LDraw look for files

   LDraw looks for .DAT files in the following catalogs, in the order
   they are listed.
    1. The current catalog.
    2. The P catalog.
    3. The PARTS catalog.
    4. The MODELS catalog.

27) What is the colour code for ... ?

   The following list is based on the documentation for LDraw, on
   discussions on the L-CAD mailing list, and on a compilation of RGB
   colour values by Todd Lehman (LDraw is not using the RGB values listed
   here). I have added some <red, green, blue, alpha> codes for rendering
   transparent parts in POV-Ray and other ray-tracing packages. Most of
   them are copied from Lutz Uhlmann's LGEO package.

   Black
          LDraw: 0
          RGB: 51 51 51

   Blue
          LDraw: 1
          RGB: 0 51 178

   Brown
          LDraw: 6
          RGB: 102 51 0

   Chrome
          LDraw: 383
          RGB: 204 204 204

   Cyan
          LDraw: 11

   Dark cyan
          LDraw: 3

   Dark grey
          LDraw: 8
          RGB: 102 102 88

   Dark pink
          RGB: 255 51 153

   Electrical contacts
          LDraw: 494 (yellow)
          RGB: 204 204 204 (chrome)

   Glow in the dark
          RGB: 224 255 176

   Gold
          LDraw: 334
          RGB: 240 176 51

   Green
          LDraw: 2
          RGB: 0 127 51

   Grey
          LDraw: 7
          RGB: 153 153 153

   Light blue
          LDraw: 9
          RGB: 0 128 255

   Light green
          LDraw: 10
          RGB: 51 255 102

   Light purple
          RGB: 224 204 240

   Light red
          LDraw: 12

   Light yellow (Belville)
          LDraw: 495
          RGB: 255 255 128

   Lime green (Blacktron II)
          RGB: 173 221 80

   Magenta
          LDraw: 5

   Mint green (Belville)
          LDraw: 431

   Orange
          LDraw: 462

   Pastel green
          RGB: 102 240 153

   Pink
          LDraw: 13
          RGB: 255 176 204

   Purple
          RGB: 153 51 153

   Purple blue
          RGB: 76 0 204

   Red
          LDraw: 4
          RGB: 204 0 0

   Silver
          LDraw: 383
          RGB: 204 204 204

   Tan
          LDraw: 382
          RGB: 204 170 102

   Transparent (white)
          LDraw: 47
          POV: <1.0, 1.0, 1.0, 0.9>

   Transparent dark blue
          LDraw: 33
          RGB: 0 0 153
          POV: <0.00, 0.00, 0.94, 0.90>

   Transparent green
          RGB: 0 80 24
          POV: <0.00, 0.83, 0.00, 0.90>

   Transparent green-yellow (?)
          RGB: 204 255 0
          POV: <0.80, 1.00, 0.00, 0.90> or <0.85, 1.00, 0.00, 0.85>

   Transparent light blue
          LDraw: 41
          RGB: 153 192 240
          POV: <0.75, 0.90, 1.00, 0.95>

   Transparent orange
          RGB: 255 102 0
          POV: <1.00, 0.68, 0.00, 0.80>

   Transparent red
          LDraw: 36
          RGB: 204 0 0
          POV: <1.00, 0.20, 0.00, 0.90>

   Transparent yellow
          RGB: 240 196 0
          POV: <0.99, 0.96, 0.00, 0.90>

   White
          LDraw: 15
          RGB: 255 255 255

   Yellow
          LDraw: 14
          RGB: 255 229 0

28) Runtime Error 200 ???

   LEdit crashes with runtime error 200 on some fast machines. Some delay
   routines which use a fixed value to count down just resolve to fast on
   these machines. There is a solution to this problem at
   <URL:http://hugin.risoe.dk/JJ_Memorial/rte200fx.html>.

   If you can read German, you can also go to
   <URL:http://www.heise.de/ct/ftp/pcconfig.shtml> and download
   bppatch.zip, which will do this job for you.

29) Runtime Error 003 ???

   The hidden message in this code is "path not found". It occurs if the
   path to LDraw contains "long" (more than eight letters) catalog names.
   The problem can be solved by moving LDraw to a directory named
   C:\LDraw.

30) Can I get LDraw to put the BMP files somewhere else?

   No, but you can move the files with a command like this:
   C:\LDRAW> move BITMAPS\MODEL-01.BMP D:\Where\I\Want\My\Pictures


31) What is the parts voting procedure?

   Part voting is democratic and is handled by Terry Keller, there is
   usually a vote after the 15th of every month. Terry is very respected
   by the group, so sometimes he makes decisions on ideas that don't
   warrant a vote (or basically gives us the final word). Primitives are
   handled by a committee.
     _________________________________________________________________

   Even though I try to, I can't know everything, so please write me, if
   you have corrections or additions to the FAQ.
   Jacob

   Latest update: February 9th 1999.



1 Message in This Thread:

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

Custom Search

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