Skip to content
Nils Schmidt edited this page Apr 7, 2016 · 101 revisions

LDPartEditor User Manual (Work In Progress)


This manual does not cover all official LDraw specifications which were ratified by the LDraw Standards Commitee. If you want to start from the beginning, you should probably read the specifications first and gather some experience from the community forums to get started.

Becoming famliar with "part authoring", the creation of parts, is just like playing an instrument: it is a matter of talent, time and effort.

If you want to drop me a note, please create an issue here or chat with me.

Version 0.8.9

Table of Contents

  1. Getting Started
  2. The Welcome Dialog
  3. The Text Editor
  4. Text Editor Features for the Advanced User
  5. The 3D Editor
  6. 3D Editor Features for the Advanced User

1. Getting Started


Make sure that you choose the right architecture for your OS and JVM (64bit or 32bit). Does my JVM support 64-bit?

  1. Download the zip-Archive from here. I recommend to use the 64-bit version, if possible.
  2. Extract the archive content to the location of your choice
    • On windows, double-click "run.bat" to start LDPE.
    • On linux/mac, you have to excecute the shell script "run.sh" to start LDPE.

The application folder

Please note that this software is in the beta stage. Although, LDPE 0.8.9 was carefully tested and developed, there are already known issues for this release. There is a potential risk of data loss. Please make a backup of all your part files you are working on. Something can go wrong in about 100.000 lines of code.

Top

2. The Welcome Dialog


When you start LDPartEditor for the first time (or you had reset the configuration), you will see the "Welcome Dialog". In this dialog you can specify the path of your LDraw Library, your LDraw Parts Tracker Username and your Real Name.

Dialog on first start

Note: If you want to contribute to the official LDraw library as a part author you have to agree to release the Work under the Creative Commons Attribution License version 2.0 ("the CCAL"). More info here.

Additionally, you can set your part authoring folder and the folder for the unofficial parts library. The benefits of using a seperate library for unofficial parts are quite self-explanatory: You can't mess up the official library content with LDPartEditor.

Note: The LDraw path and the unofficial path folder will be automagically filled if you had set the environment variable %LDRAWDIR% (Windows only)

When all paths are specified, you can hit the OK button. The program will load the primitives first and then it will parse the first line of each official library part. This will take some time and it is slower than parsing the parts.lst file, but it guarantees that you will see the actual library content.

Pro Tip: The application folder will contain a file named config.gz which stores your personal configuration. You can delete this file if you want to reset your settings. This may be neccessary if the 3D view is broken.

Information for beta testers: The error_log file may contain useful debug information for me as the lead developer of LDPartEditor.

Top

3. The Text Editor


The Text Editor

The text editor let you edit the content of a *.dat file.

Pro Tip: You can drag and drop the tabs on other text editor windows and rearrange their order.

Top

Text Editor Shortkeys:

Keys Action
Alt+Shift+R Sync Edit Edit vertex coordinates ("SyncEdit")
Esc Cancel "SyncEdit"
Alt+F Quick fix all issues in the selection
Ctrl+A Select all
Alt+I Inline selection
Alt+C Round selection
Ctrl+Z Undo
Ctrl+Y Redo
Ctrl+S Save

Top

Analysing Part Errors:

Double Click on Error

A double click on an item in the error list will highlight the line in the text editor.

Context Menu On Error

With a right click, you can open the context menu and trigger a quick fix.

Note: Not all errors and warnings can be fixed automatically. Some of them require human brainpower.

Top

Text Editor Buttons:

Button Action
New Dat Creates a new *.dat file
OpenDat Opens an existing *.dat file
Undo Undo (max. 100 steps)
Undo Redo
Cut Cut
Copy Copy
Paste Paste
Delete Delete
Toggle Error List Toggles the part error list visibility.
Find and Replace Opens a standard search and replace dialog. The dialog uses the text editor tab which was last selected.
Sort Sorts the text editor content by a custom criteria. You can set the scope to file or selection and you can sort by... 1. ...colour, ascending. 2. ...colour, descending. 3. ...type, ascending. 4. ...type, descending. 5. ...type and then colour, ascending. 6. ...type and then colour, descending. Pro Tip: The sorting process will not change the BFC winding or !TEXMAP definitions.
Split Quads Splits selected quad lines (type 4) into triangles (type 3)
Unrectifier Splits all quad lines (type 4) into triangles (type 3) and inlines all rect primitives
Duplicates Removes all duplicates and all invisible optional lines
Inline Inlines the selection with partial BFC conformity
Inline Deep Inlines the selection recursively with partial BFC conformity and no comments and whitespace ("Deep Inline")
Inline Linked Inlines the selection "linked" so that the inlined file can be automatically exported with the Subfile Compiler (see Features for the advanced user)
Compile Subfile Data Reloads the sub-file contents and parses the file for !LPE INLINE meta commands and builds the subfiles automatically (see Features for the advanced user)
Round Rounds the selection. Rounding Settings You can customise the rounding settings by pressing Ctrl and clicking on this button
Toggle TEXMAP Toggles texmap geometry data meta command for the selected text !:
Toggle Comment Toggles the comment mask for the selected text
Palette Opens a dialog for choosing a colour for the selected text. Pro Tip: You can customise the colour palette by pressing Ctrl and clicking on a colour button

Top

Text Editor Features for the Advanced User

###!LPE INLINE

A click on Compile Subfile Data Update/Compile linked Subfile Data reloads the sub-file content and parses the file for the special !LPE INLINE meta command. All data between !LPE INLINE and !LPE INLINE END is parsed as subfile data.

Syntax:

0 !LPE INLINE 1 [Colour Code] [Matrix] [Subfile Name]
0 !LPE INLINE END

!LPE INLINE can be nested.

0 !LPE INLINE 1 [Colour Code1] [Matrix1] [Subfile Name1]
0 !LPE INLINE 1 [Colour Code2] [Matrix2] [Subfile Name2]
0 !LPE INLINE END
0 !LPE INLINE 1 [Colour Code3] [Matrix3] [Subfile Name3]
0 !LPE INLINE END
0 !LPE INLINE END

Take a look at this snippet:

1 9 10 -4 10 1 0 0 0 -1 0 0 0 -1 myTestStud.dat
0 !LPE INLINE 1 14 0 -4 0 1 0 0 0 -1 0 0 0 -1 myTestStud.dat
0 Stud Tube Open without Outer Cylinder
0 Name: myTestStud.dat
0 Author: Magnus Forsberg [MagFors]
0 !LDRAW_ORG Unofficial_Primitive
0 !LICENSE Redistributable under CCAL version 2.0 : see CAreadme.txt

0 BFC CERTIFY CCW

1 7 0 0 0 2 0 0 0 -1 0 0 0 -2 4-4ring3.dat
0 BFC INVERTNEXT
1 14 0 -4 0 -6 0 0 0 4 0 0 0 -6 4-4cylc.dat
0 !LPE INLINE_END

After compiling this code, LDPartEditor creates a primitive file in your project location (inside the "P" folder), namely myTestStud.dat. Colour 14 will be replaced by colour 16. The content is also multiplied by the inverse of the original transformation matrix.

Top

!LPE CSG - Contructive Solid Geometry (CSG)

LDPartEditor has build-in CSG features. You can use CSG bodies by defining them with the text editor. I recommend to use basic LDraw primitives first (like box.dat and 8-8sphe.dat), so you can edit them in the 3D editor and transform them into a CSG model later on.

The general workflow will proceed as follows:

  1. Create basic shapes with the !LPE CSG_{Geom} ... meta command (of course {Geom} needs to be replaced by a valid shape)
  2. Modify the shapes with the set operations !LPE CSG_UNION, !LPE CSG_DIFFERENCE, !LPE CSG_INTERSECTION
  3. Compile the result with !LPE CSG_COMPILE ...
  4. Modify the shapes until your work is finished
  5. Inline the !LPE CSG_COMPILE meta command to generate the triangles
  6. Eliminate all T-junctions manually

Now we will create a model like this:

CSG Shape

0 // CSG commands can be used in subfiles, too
0 // The identifiers are non-global and bound to the file / subfile

0 // It is possible to inline CSG commands from subfiles

0 BFC CERTIFY CCW

0 // Set the quality and epsilon value (optional)
0 // SYNTAX 0 !LPE CSG_QUALITY [3 to 48]
0 !LPE CSG_QUALITY 24
0 // SYNTAX 0 !LPE CSG_EPSILON [>=.0001]
0 !LPE CSG_EPSILON .0001

0 // Define the shapes
0 // SYNTAX 0 !LPE [CSG SHAPE] [ID (can be any string without spaces)] [COLOUR] [MATRIX]
0 !LPE CSG_CUBOID    a  4 0 0 0 1 0 0 0 1 0 0 0 1
0 !LPE CSG_ELLIPSOID b  1 0 0 0 1.35 0 0 0 1.35 0 0 0 1.35

0 !LPE CSG_CYLINDER  c  2 0 -1 0 .7 0 0 0 2 0 0 0 .7
0 !LPE CSG_CYLINDER  d  2 -1 0 0 0 2 0 .7 0 0 0 0 .7
0 !LPE CSG_CYLINDER  e  2 0 0 -1 .7 0 0 0 0 .7 0 2 0

0 // Modify the shapes
0 // SYNTAX 0 !LPE [CSG FUNCTION] [origin ID] [origin ID2] [target ID3]

0 !LPE CSG_UNION c d d
0 !LPE CSG_UNION d e d
0 !LPE CSG_INTERSECTION a b f
0 !LPE CSG_DIFFERENCE f d f

0 // Compile the output
0 // SYNTAX 0 !LPE CSG_COMPILE [ID]
0 // The COMPILE command displays the CSG volume on the screen
0 // Inlining the following line will generate triangles of the CSG volume
0 !LPE CSG_COMPILE f

0 // E.g. 
0 // Inlined: !LPE CSG_COMPILE f
3 4 -10 1.5752766 7.3133416 -10 1.5752766 8.313231 -10 3.3930404 7.6749177
3 4 -10 1.5752766 7.3133416 -10 -2.6084895 6.481139 -10 -2.6084895 7.9504156
3 4 -10 1.5752766 7.3133416 -10 -2.6084895 7.9504156 -10 9.094947E-16 8.866396
...

Note: Change 0 !LPE CSG_COMPILE f to 0 !LPE CSG_COMPILE d and see what happens. Do you understand why it displays three green cylinders?

CSG supports the following shapes

  • CSG_CIRCLE
  • CSG_CONE
  • CSG_CUBOID
  • CSG_CYLINDER
  • CSG_ELLIPSOID
  • CSG_QUAD

Top

4. The 3D Editor


The 3DEditor

Primitive Area

It is possible to change the zoom and the rotation of the primitive area. You can zoom with Ctrl+Scroll Wheel and you can rotate the view by pressing the Middle Mouse Button and moving the mouse.

You can scroll with the Scroll Wheel, or with Page Up/Page Down or by pressing the Right Mouse Button and moving the mouse.

Primitive Area

Pro Tip: You can edit the contents of primitive_rules.txt to create custom categories.

To insert a primitive into your model, you have to drag and drop it from the primitve area into a 3D view.

DragNDropPrimitives

You can extend a closed primitive category Closed Category by double-clicking on it. The extended category will look like this

Extended Category

Of course, you can collapse an opened category by double-clicking on it again.

Top

Subfile Manipulation Tricks

Pro Tip: You can move the manipulator to the origin of any selected sub-part with a double click on the 3D view.

Top

3D Editor Features for the Advanced User

###Move a vertex on a line

You can move a single vertex on a defined line between two vertices. Create the following snippet:

0 // "Move on Line" Tutorial

2 24 0 0 0 4 6 0
0 !LPE VERTEX 4 4 0

It should look like this:

A line and a vertex

Now select the two vertices from the line:

Two selected vertices

Click on the "Move on Line" button from the 3D editor (Move on Line).

Select the vertex which should be "moved" on this line.

The target vertex is selected

Finally, click on "Merge/Split"->"Set X/Y/Z (for Selection)"

X and Z are not checked

Uncheck the X-axis and the Z-axis and click "OK".

The vertex is now on 2.667|4|0

The vertex is now moved to a point (2.667|4|0) on this line where Y is 4.

Synopsis: LDPE can calculate the vertex position on the line between two choosen vertices.

  1. Select two vertices
  2. Hit the "ML" botton
  3. Select one vertex
  4. Click on "Merge/Split"->"Set X/Y/Z (for Selection)"
  5. Uncheck two axes and click OK.

Top

Clone this wiki locally