ldraw Python Package

Home David Projects ldraw
Updated: 2010-03-10

Note: This project is now being maintained as a project at Alioth.
See the project's home page for news and further information.

Introduction

LDraw is a standard format used by CAD applications that create LEGO® models and scenes.

The ldraw package provides facilities to allow users to create LDraw scene descriptions using the Python programming language. Pieces are specified by their positions, orientations and other properties in normal executable Python scripts which are run to create model files.

A figure created with the ldraw package
shown in LDView.
from ldraw.colours import *
from ldraw.figure import *

figure = Person()
print figure.head(Yellow, 35)
print figure.hat(Black, "3901")  # Hair Male
print figure.torso(Red, "973") # Torso
print figure.hips(Blue)
print figure.left_leg(Blue, 5)
print figure.right_leg(Blue, 20)
print figure.left_arm(Red, 0)
print figure.left_hand(Yellow, 0)
print figure.right_arm(Red, -90)
print figure.right_hand(Yellow, 0)
print

License

The contents of this package are licensed under the GNU General Public License (version 3 or later).

Download

ldraw-0.10.tar.bz2
Contains the ldraw Python package and examples.

Trademarks

LDraw is a trademark of the Estate of James Jessiman. LEGO is a registered trademark of the LEGO Group.