I get a lot of questions about how I create LEGO parts. This is Part I - The Basics.
Most "standard" parts can be created using only simple math. Standard parts consist of square, circular, and angled blocks - regular geometric blocks. I will refer to BrickLink (www.bricklink.com/), but many others use similar methods:
Step 1: BRICK IDENTIFICATION:
Almost every piece has a part number molded into the part, usually in the bottom "female" side cavity, and usually consists of 4 to 6 digits (go ahead, look at your own bricks). This is a number that corresponds to the shape only, as many colors can be cast in the same mold. If you look in the back of the Build Instructions (those that have a parts list) you'll see a longer number. That number is the color code combined with shape number. That is the number that they inventory by. Both the shape number and color/brick number can be searched in BrickLink.
Step 2: DIMENSIONS:
There's some debate about what a "unit is". Some people refer to the "stud" and others refer to "LU" (LEGO unit), with even more debate on what a LU is. In the CAD world it doesn't really matter. Pick a unit and make your multiples. LEGOs are metric. I use a 0.8 or 1.6 mm rule. Basic geometric bricks are made of only these dimensions. These are also ideal representational dimensions since we're not going to manufacture these. Studs are Ø4.8 by 1.6 high, one brick length/width is 8.0, brick height is 9.6, etc. See image below.
Step 3: EXCEPTIONS:
There are many exclusions from this rule, not counting organic blocks (animals, hair, tools, etc.). The major exceptions are sloped bricks, axle connectors, and some Technic features. Sloped bricks need to be researched (BricklInk) to find the angle of the slope. The bottom edge is not usually a 0.8 mm unit and is usually derived from the clearance of other pieces. The same goes for axle connectors. These have angles that behave with Technic "stacks". A Technic "stack" is one of a few types of connected Technic beams. Since the LEGO brick is taller than the Technic pin spacing and not square, a 45° connection would not connect properly for many bricks away from the origin. Again, look the angle up in BrickLink. The Technic liftarm height is also in contention. Some say 7.4, some say 7.2. I use 7.2 because it's a multiple of 0.8, but physical measurements reveal that it's on the 7.4+ side. In CAD-land it probably doesn't matter, and I created the #data block (in my library models) so that it can easily be changed.
Step 4: CONCLUSION:
Try making your own bricks using just multiples of 0.8. You'll get farther than you think. See the below image to see how it all works.
Step 5: (Basic Brick Dimensions)