Answers.Body: <p>Both, often in the same file.</p>
  
  <p>If you take a look at the <a href="http://www.ldraw.org/Article218.html">.ldr file format specification</a> you can see that each file is made up of an number of different types of "line", one of which is a Subfile Reference where you can specify the colour, position, rotation and scale of the model.</p>
  
  <p>Other lines can then be added to describe Lines, Triangles, Quadrilaterals and Optional Lines, which are specified by their individual vertices.</p>
  
  <p>For example, the 1x1 Brick [part:3005] has the following non-comment lines (I've added comments to show what it's doing):</p>
  
  <pre><code>0 Author: James Jessiman
  0 !LICENSE Redistributable under CCAL version 2.0
  
  0 // Meta line, causes the next line to be drawn "inside-out", to make 
  0 // the inside of the brick.
  0 // Followed by a subfile reference for a "box with 5 faces".
  0 BFC INVERTNEXT
  1 16 0 24 0 6 0 0 0 -20 0 0 0 6 box5.dat
  
  0 // Draw 4 quadrilaterals to fill in the edges of the base of the brick
  4 16 10 24 10 6 24 6 -6 24 6 -10 24 10
  4 16 -10 24 10 -6 24 6 -6 24 -6 -10 24 -10
  4 16 -10 24 -10 -6 24 -6 6 24 -6 10 24 -10
  4 16 10 24 -10 6 24 -6 6 24 6 10 24 10
  
  0 // Draw another 5 sided brick for the outside of the brick
  1 16 0 24 0 10 0 0 0 -24 0 0 0 10 box5.dat
  
  0 // Draw a stud on the top using the "stud" subfile.
  1 16 0 0 0 1 0 0 0 1 0 0 0 1 stud.dat
  </code></pre>
  
  <p>Common subfiles include the studs and tubes on bricks.</p>
  
  <p>When you save a model in MLCad or similar as an .ldr file it's basically all Subfile lines.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2012-03-08T08:04:09.590Z
Answers.LastActivityDate: 2012-03-08T09:36:33.057Z
Answers.LastEditDate: 2012-03-08T09:36:33.057Z
Answers.UserDisplayName: Zhaph - Ben Duguid
Body: <p>Sorry if this is kind of a dumb question, but do LDraw files describe models (with translation and rotation values with references to bricks contained in other files), or do they describe the bricks themselves (such as the individual vertices, lines, polygons, etc.)?  Or do different LDraw file types work in different ways?</p>
  
Tags: <software><cad><ldraw>
Title: Do LDraw files describe models, bricks, or both?
UserDisplayName: fouric
ThreadText: # Do LDraw files describe models, bricks, or both?
  
  (Asked by: username_0 on 2012-03-08)
  
  Sorry if this is kind of a dumb question, but do LDraw files describe models (with translation and rotation values with references to bricks contained in other files), or do they describe the bricks themselves (such as the individual vertices, lines, polygons, etc.)? Or do different LDraw file types work in different ways?
  
  **Tags:** software, cad, ldraw
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2012-03-08. Score: 5 | Accepted answer
  
  Both, often in the same file.
  If you take a look at the .ldr file format specification you can see that each file is made up of an number of different types of "line", one of which is a Subfile Reference where you can specify the colour, position, rotation and scale of the model.
  Other lines can then be added to describe Lines, Triangles, Quadrilaterals and Optional Lines, which are specified by their individual vertices.
  For example, the 1x1 Brick [part:3005] has the following non-comment lines (I've added comments to show what it's doing):
  0 Author: James Jessiman
  0 !LICENSE Redistributable under CCAL version 2.0
  
  0 // Meta line, causes the next line to be drawn "inside-out", to make 
  0 // the inside of the brick.
  0 // Followed by a subfile reference for a "box with 5 faces".
  0 BFC INVERTNEXT
  1 16 0 24 0 6 0 0 0 -20 0 0 0 6 box5.dat
  
  0 // Draw 4 quadrilaterals to fill in the edges of the base of the brick
  4 16 10 24 10 6 24 6 -6 24 6 -10 24 10
  4 16 -10 24 10 -6 24 6 -6 24 -6 -10 24 -10
  4 16 -10 24 -10 -6 24 -6 6 24 -6 10 24 -10
  4 16 10 24 -10 6 24 -6 6 24 6 10 24 10
  
  0 // Draw another 5 sided brick for the outside of the brick
  1 16 0 24 0 10 0 0 0 -24 0 0 0 10 box5.dat
  
  0 // Draw a stud on the top using the "stud" subfile.
  1 16 0 0 0 1 0 0 0 1 0 0 0 1 stud.dat
  
  Common subfiles include the studs and tubes on bricks.
  When you save a model in MLCad or similar as an .ldr file it's basically all Subfile lines.
  
  
  ---
  
  