To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.dev.org.ldrawOpen lugnet.cad.dev.org.ldraw in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / Organizations / LDraw / 671
670  |  672
Subject: 
Re: Making Ldraw Parts
Newsgroups: 
lugnet.cad.dev, lugnet.cad.dev.org.ldraw
Date: 
Wed, 12 Jan 2000 23:15:16 GMT
Viewed: 
51 times
  
Andrew Hull <taxihamster@hotmail.com> wrote in message
news:Fo7G6D.oA@lugnet.com...
Does anyone either (1) have a tutorial or (2) have time to write something • out
on how to make ldraw parts? I would like to learn. I have been using ldraw • for
many years, since i was eight or nine if it's been around that long. If • anyone
could do so, i would greatly appreciate!!

I started on a tutorial, but never finished it.  Notably absent is an
explanation of using primitives.  Here's what I had (Tim, feel free to use
parts or all of this on ldraw.org):

Ldraw parts have two basic components:  faces and edge-lines.

FACES
Faces represent all physical "sides" of a part.  Each side of a part will be
made up of one or more faces.  Faces are either triangles or quadrilaterals
(quads).  Triangles take the form:
3 <color code> x1 y1 z1 x2 y2 z2 x3 y3 z3
while quads take the form:
4 <color code> x1 y1 z1 x2 y2 z2 x3 y3 z3 x4 y4 z4
Unless the face is part of a colored pattern on the part, color 16 should be
used for all faces.  This is the "user-supplied" color which is set when the
part is used in a model.

The four points of the quad should be ordered clockwise or counterclockwise
around the face.  "Bowties", where the points are not so ordered will still
work, but are frowned upon.

EDGE-LINES
Lines do not represent physical aspects of the part, but are used to show the
outline of the part, and to show the "edges" between they physical sides of a
part.  Anywhere two faces of a part intersect at an angle other than 0
degrees, an edge line should be used to represent the intersection of the
sides.  Curving portions of a part present a special case which will be dealt
with later.  Edge lines take the form:
2 24 x1 y1 z1 x2 y2 z2
Note that edge lines always use color 24 (except when used as part of a
colored pattern), which is the complement color to color 16.  This means that
no matter what color the user selects for color 16, the edge lines will
always be a contrasting color.

CURVES and OPTIONAL LINES
Curving or rounded portions of an LDraw part present a special case.  Because
all faces in LDraw must be triangles or quads, curves must be represented by
a series of quads which approximate the curves.  For a complete cylinder,
LDraw parts usually use 16 quads (each representing 22.5 degrees of the
cylinder).  This works for small and medium sized cylinders, but for large
cylinders more quads should be used.

What is special about the quads used for a curved portion of a part is that
they do not need edge lines drawn between them.  If edge lines were used
between all 16 quads of a cylinder, in LDraw it would look like it had 16
distinct sides, not like a rounded cylinder.  However, if no edge lines are
drawn, the rounded section of the part will have no visible outer boundary.
For this purpose, Optional Lines are used so that the lines will appear only
if they form the outer boundary of the curved portion of a part.  Optional
lines take the form:
5 24 x1 y1 z1 x2 y2 z2 x3 y3 z3 x4 y4 z4

  The first two columns are line type and color, as usual.  The next 6
columns
are the x,y,x coordinates of point 1 and point 2, which form the actual line
segment to be drawn.  The last 6 columns are x,y,x of points 3 and 4, which
are used to determine whether or not the optional line gets drawn.  If, in
the rendering view, points 3 and 4 lie on the same side of a line through
points 1 and 2, then the optional line gets drawn, otherwise not.

There is a pretty good section on optional lines in the Ldraw FAQ, but I'll
try my hand at an explanation:

Type 1 lines are for primitives, sub-parts, etc.
Type 2 lines are just point A to point B line segments.
Type 3 lines are triangles
Type 4 lines are quadrilaterals (quads for short)
Type 5 lines are "optional" point A to point B line segments.  Here's how
they
work:
  The first two columns are line type and color, as usual.  The next 6
columns
are the x,y,x coordinates of point A and point B.  Then the last 6 columns
are
x,y,x of points C and D, which are used to determine whether or not the
optional line gets drawn.  If, in the rendering view, points C and D lie on
the same side of a line through points A and B, then the optional line gets
drawn, otherwise not.  Type 5 lines are used for curved surfaces so that only
edge lines on the outer edge of the surface get drawn.  If you think of a
cylinder standing upright, you want edge vertical lines to show at the
extreme
right and left sides of the cylinder, but not on the surface of the cylinder
between the extremes.

For choosing points C and D, you use the "previous" and "next" points on the
circle on which point A or point B lie.  So if point A is at 0 degrees on the
"top" circle of the cylinder, you could use the point at -22.5 degrees on the
top circle for C and the point at +22.5 degrees for point D.  Alternatively,
you could use the previous and next points on the bottom circle, and I have
even seen people use the previous point from the top circle and the next
point
from the bottom circle.


-----
Feel free to make comments/suggestions to this,

-John Van



Message has 2 Replies:
  Re: Making Ldraw Parts
 
(...) - snip - This is all good reference for a tutorial, but IMHO we should all get together for a tutorial based upon all our expiriance with creating parts. From there a tutorial can be written? This is an idea but it will take longer for that (...) (25 years ago, 12-Jan-00, to lugnet.cad.dev, lugnet.cad.dev.org.ldraw)
  Re: Making Ldraw Parts
 
(...) This made me go look at the FAQ, and I found the following inconsistencies in the FAQ. in Topic "LINE TYPES" we have (the FAQ has): (...) which I think its wrong in the line starting with "5: Draw ...." and further ahead in the FAQ (section (...) (25 years ago, 13-Jan-00, to lugnet.cad.dev, lugnet.cad.dev.org.ldraw)

Message is in Reply To:
  Making Ldraw Parts
 
Does anyone either (1) have a tutorial or (2) have time to write something out on how to make ldraw parts? I would like to learn. I have been using ldraw for many years, since i was eight or nine if it's been around that long. If anyone could do so, (...) (25 years ago, 12-Jan-00, to lugnet.cad.dev)

17 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