HBM005: LDraw Tutorial (V)


 

LDraw Tutorial (V)

LDraw

 

LSynth 3.0 y Lpub/LDview

 

Text and Images by Jetro

 

LSynth 3.0

At the closing date for the last part of this tutorial LSynth 4 had just been announced, including a number of important updates. Some of these can be seen at first glance: there are more types available for synthesizing and there are new constraint parts to guide these new types. But there have also been a number of important changes inside the program that make it a lot more flexible. But first let me explain how to install this new version because at the moment it is a three step process.

Instalar LSynth 3.0

Installing LSynth 3.0[1] requires a little more tan downloading and running the executable which you can get here: [2] In order to be able to use all the new LSynth functions you will also need to download a file with new constraint parts [3] which are necessary to be able to correctly synthesize some of the new types of parts. These parts are still unofficial so you may want to place them in the same folder as the rest of your unofficial parts. Maybe you want to keep them in a separate folder (Unofficial\LSynth) but remember to tell MLCad.ini where to look for them so they will turn up in the MLCad parts tree. The parts are the following:

LS01.dat - LSynth Constraint Part - Type 1 - "Hose"
LS02.dat - LSynth Constraint Part - Type 2 - "Hose"
LS03.dat - LSynth Constraint Part - Type 3 - "Hose"
LS04.dat - LSynth Constraint Part - Type 4 - "String"
LS05.dat - LSynth Constraint Part - Type 5 - "NXT Cable"
LS06.dat - LSynth Constraint Part - Type 6 - "Power Functions Cable"
LS07.dat - LSynth Constraint Part - Type 7 - "Chain Start"
LS08.dat - LSynth Constraint Part - Type 8 - "Chain End"
LS09.dat - LSynth Constraint Part - Type 9 - “RCX Cable”

Additionally the following elements will be installed, which are necessary to correctly synthesize the flexible parts:

LS10.dat - LSynth Electric Cable Segment
LS11.dat - LSynth Electric Cable Segment NXT
LS20.dat - LSynth Technic Pneumatic Hose - End Piece
LS21.dat - LSynth Technic Pneumatic Hose - Cross Section
LS30.dat - LSynth Electric Technic Fibre Optics - End Piece
LS40.dat - LSynth Technic Flexible Axle - End Piece
LS41.dat - LSynth Technic Flexible Axle - Cross Section
LS50.dat - LSynth Technic Flex-System Hose - End Piece
LS51.dat - LSynth Technic Flex-System Hose - Cross Section
LS60.dat - LSynth Short Straight String Segment
LS70.dat - LSynth Electric Power Functions Cable Segment

Finally MLCad.ini needs to be made ready in order to be able o use LSynth from within MLCad. If you haven’t made any changes to MLCad.ini you can simply download the latest version [4] and overwrite your current MLCad.ini. If you have made any changes, take careful note of them (you may have indicated the location of unofficial parts as explained in a previous part of this tutorial) and apply them again in the newer version. In addition to information necessary to LSynth and about the location of your parts library, MLCad.ini contains a lot of information for the minifig generator which is updated (increased) periodically. The latest version of MLCad.ini comes prepared to define the location of unofficial parts and LSynth parts. Towards the end of the file you will find the following lines:

1 = SHOW Parts
2 = HIDE P
; 3 = SHOW Unofficial\Parts
; 4 = HIDE Unofficial\P
; 5 = SHOW Unofficial\LSynth


Provided you have followed the suggestions abut the location of unofficial files, you simply need to delete the semicolon before numbers 3, 4 and 5 and you are ready to go.
Finally you’ll have to define the location of LSynth in the following line:


[LSYNTH]
%PATH = "Define absolute path to LSynth"

For example in the following way:

%PATH = "C:\Programs\LSynth"

¡You are ready to get started!

 

LDraw

First steps

As you will have seen from the list of constraint parts, you can synthesize many more flexible parts with this new version of LSynth. There are now a total of 18 possibilities predefined:

Hose or cable type:

01 - ELECTRIC_NXT_CABLE

02 - ELECTRIC_POWER_FUNCTIONS_CABLE

03 - ELECTRIC_RCX_CABLE

04 - FIBER_OPTICS_CABLE

05 - HOSE_FLEXIBLE

06 - MINIFIG_CHAIN

07 - STRING_HOSE

08 - TECHNIC_AXLE_FLEXIBLE

09 - TECHNIC_FLEX-SYSTEM_CABLE

10 - TECHNIC_FLEX-SYSTEM_HOSE

11 - TECHNIC_PNEUMATIC_HOSE

12 - TECHNIC_RIBBED_HOSE

 

Closed belt/tread/chain type

13 - RUBBER_BAND

14 - RUBBER_BELT

15 - TECHNIC_CHAIN_LINK

16 - TECHNIC_CHAIN_TREAD

17 - TECHNIC_CHAIN_TREAD_38

18 - TECHNIC_TREAD

As can be seen the possibilities are much broader now and the new treads (TECHNIC_CHAIN_TREAD_38) strings (STRING_HOSE) and minifigs chains (MINIFIG_CHAIN) have already been included. However, although there is a fiber optics cable in the list, this type can only be used to synthesize the Fibre Optics x165 which came (for example) with the Space Shuttle 8480, but not the x400 which came with the RCX, Spybots and some Exoforce sets. But since the new configuration of LSynth no longer has part definitions hard coded in the executable but depends on the external file lsynth.mpd it is possible to add new types of parts and modify existing ones using the available parts. The definition of the fiber optics cable that is included in lsynth.mpd is the following:

FILE FIBER_OPTICS_CABLE.ldr

0 FIBER_OPTICS_CABLE SYNTHESIS DEFINITION

0 Name: FIBER_OPTICS_CABLE.ldr

0 Author: Kevin L. Clague

0 Unofficial Model

0 SYNTH BEGIN DEFINE FIBER_OPTICS_CABLE HOSE STRETCH 2 50 0

0 ROTATION CENTER 0 0 0 1 "Custom"

0 ROTATION CONFIG 0 0 1 0 0 0 0 2 0 0 0

1 0 0 0 2 4-4cyli.dat

1 0 0 0 0 2 0 0 0 1 0 0 0 2 4-4cyli.dat

0 // LSynth Electric Technic Fiber Optics - End Piece

1 28 0 0 0 1 0 0 0 1 0 0 0 1 S\LS30.dat

0 SYNTH END

 

The Fiber Optics Cable x400 is wider and both ends of this cable are the same. If you have a look at the following definition which Philo suggested for the x400 cable you will see that tweaking the parameters and eliminating the last two lines about end pieces you can quite easily create a ‘new’ kind of flexible part in LSynth:

0 FILE FIBER_OPTIC_CABLE.ldr

0 FIBER_OPTIC_CABLE SYNTHESIS DEFINITION

0 Name: FIBER_OPTIC_CABLE.ldr

0 Author: Kevin L. Clague

0 Unofficial Model

0 SYNTH BEGIN DEFINE FIBER_OPTIC_CABLE HOSE STRETCH 8 50 0

0 ROTATION CENTER 0 0 0 1 "Custom"

0 ROTATION CONFIG 0 0 1 0 0 0 0 4 0 0 0

1 0 0 0 4 4-4cyli.dat

1 0 0 0 0 4 0 0 0 1 0 0 0 4 4-4cyli.dat

1 0 0 0 0 4 0 0 0 1 0 0 0 4 4-4cyli.dat

0 SYNTH END

 

In view of this flexibility by editing the lsynth.mpd file it is a good idea to check the availability of an update to this file periodically in order to make the most of the improvements and/or additions that may be included in this file. The use of LSynth hasn’t changed beyond the availability of new flexible parts and constraint parts so for information on how to use the program please consult the part 4 of this tutorial.

LDview

Until now we have talked almost exclusively about the tools that are available through the MLCad interface. However, the world of LDraw is much larger than that. In addition to a library of virtual parts, the tools that make up the LDraw environment can be roughly divided in three categories:

- Construction tools

- Rendering tools

- Publishing tools.

So doesn’t MLCad provide options for all of these? Well, in a very limited way it does: it allows you to build a model, but also lets you see it in 3D and see construction steps. However, the possibilities of MLCad in these last two areas are rather limited, and there are other tools – equally easy to use – that give you much better results. As its name indicates, LDView is a tool for viewing (or rendering) LDraw files. It allows you to see 3D constructions with good quality without needing a lot of resources (processor, memory) and lets you adjust viewing parameters to your needs and likes. And it’s available for Windows, Mac and Linux!

Installing LDView

Installing LDView is quite straight forward but its worth having a closer look at some options that will allow you to create renderings of a higher quality. The program can be downloaded from the website that has been dedicated to this tool [6]. Select the version that corresponds to your operative system and after downloading, install it. The first time you start the program it will ask you if you have the LDraw Parts Library installed and if so, where. If you tell the installer LDraw is not installed, it will download the parts library in order to be able to work with it. Since you may need unofficial parts to see certain renders there are two options. You can let LDView download the unofficial parts it needs for each render. You can also indicate in what additional folder(s) LDView needs to look for the unofficial parts. To do this go to File > Extra Dirs... and click on the icon that says "C:\" towards the bottom of the window that opens. You can then select the folders that contain unofficial files (for example C:\LDRAW\Unofficial). You can of course use both options at the same time.

Configuring LDView

You can get to the LDView configuration window by clicking on Edit > Preferences (or Ctrl+May+P). The following elements deserve special attention as they improve the quality of the final image considerably. However, as always, you will need to find the right balance between quality and speed (the higher the quality the more complex the rendering and the more time the computer needs) although modern computers don’t have much of a problem in this area. On the first tab (General) you will want to select the highest available value for FSAA (Full Scale Anti Aliasing) and mark the checkbox for "Antialiased lines". In the "Colors" area you can choose the background colour for your renderings. The values for Default and Transparent only apply when rendering original LDraw parts files.

LDview

The "Misc" area contains two options that are of special interest: "Process ldconfig.ldr" and "Show errors after loading". The first option deserves more explanation than this in a future part of this tutorial and "Show errors after loading" is very useful to determine why an LDraw file isn’t rendered as expected, and provides information about files and parts that are missing.

The "Default Save Directories" area allows you to select where screenshots, parts lists or the whole model will be saved and you can choose between the folder the original model is in (Model), the last folder that was used (Last saved...), or a location to be specified at the time of saving the file (Specified). The options on the Geometry that you might want to use are easily accessible in the icon bar of the main interface and it is more practical to test the configuration that best suits your needs there. The same is true for the Effects tab, although this is the place where you can easily the direction of the lighting.

On the Primitives tab you may want to select "Primitive substitution". This allows LDView to use its own primitives [7] which can result in more natural and less angular rendering. Also, this is the only way you can also select "Texture studs" which will print the LEGO logo on all studs. Again, the more advanced the options you select, (the further down the more advanced) the better the quality of the final render, but with the corresponding 'cost'. The option "Curve quality" allows you to adjust the number of sides that will be used to draw a curve. If you take a look at a stud in MLCad you will see that all studs are 8 sided. Using the curve quality these parts can be made rounder, but use the option with care because it may occasionally produce undesired results. The options "Primitive substitution" and "Texture studs" are also available in the main interface.

The Updates tab has an option to "Automatically check LDraw.org for missing parts". In case a part that is required to correctly render an LDraw file is not installed, LDView will try to download it from the Parts Tracker at LDraw.org automatically. If for any reason LDView is not able to connect to the internet, this option will be automatically disabled and you will need to enable it manually to use it again. Finally, the Preference Sets tab gives you Access to a number of predefined configuration sets that can serve as a basis for your own optimum configuration. You can also save your own configuration sets and even assign a keyboard shortcut (hot key) to load those preferences in a fast and easy way.

Using LDView

The use of LDView is very intuitive. You simply need to load an LDraw file in order for it to be rendered and dragging with the mouse you can view it from any angle. Sometimes it can be a little hard to get the exact angle you want in all three directions. This is due to the fact that the model rotates around a fixed point that cannot be changed. There are several aids to make it easier to find the exact angle you want. One of them is the set of keyboard shortcuts Ctrl + 0-6 with which you can obtain the following angles: "two-thirds" (the default with which LDraw opens all models) front, back, left, right, top and bottom. Ctrl+9 allows you to select a specific angle for the model as well as the distance at which you want to place it.

To see the render closer up (or further away) you can use the mouse Wheel or hold the right mouse button and drag. In addition, holding Ctrl+Alt and dragging allows you to move the whole model which is very useful if you want to zoom in on a specific detail of the render.

Some times you notice you made a mistake in your LDraw file when you have a close look at a rendering in LDView, or you may want to hide part of a construction to be able to see what’s behind it. If you open MLCad or another editor and make the necessary changes you can simply click on the third icon from the left in the LDView icon bar to reload the file and see the changes you saved. The next group of icons provides access to some of the options we’ve seen in the preferences window. I encourage you to test each one of them to see how they affect your renders so you can choose the configuration that best suits you.

Finally there is a group of options on the icon bar (after 'Step:') that are new in LDView 4. They allow you to see the steps that have been included in the LDraw file. This can be very useful both to build rebuild a model of which we have obtained building instructions and for creating high quality images forstep by step instructions of your own constructions. Another novelty in this version of LDView is that inn addition to the steps you can see the individual files that make up an MPD. In order to access this function you need to go to "Tools > MPD model selection" (Ctrl+M) and in the window that opens select what part of the MPD you want to see. LDView also allows you to change the lighting angle of a model in a very easy way. Simply hold the Shift button and move the mouse. If you have trouble finding the right angle you can get back to one of the ‘standard’ angles in the Effects tab from Edit > Preferences.

LDraw

 

More information

But that’s not all. LDView can give you much more information. It can generate a list of parts used in a model in HTML format. This list can include information such as the reference number o each part, its colour, quantity and description and allow you to Access an image of the part on Peeron.com. Another type of information LDView can give is related to the camera angle for use in Pov-Ray, a much more powerful, but also much more complex rendering tool.

Screensavers

The LDView installation procedure presents you with an option to install a screensaver. If you would like to use this option but forgot to mark it during installation, never mind. You can safely reinstall LDView without uninstalling it first and all your preferences will be saved. You ca configure the screensaver just like any other screensaver – rightclick on the desktop, select “Properties” and go to the Screen Saver tab. After going through all this information I can only make one recommendation: test, test and test again. LDView is easy to use and I’m certain that after a few attempts you will be able to get exactly the result you wanted. If you have any further questions or suggestions please let me know either on the HispaLUG forum [8] or at info@hispabrickmagazine.com.

 

[1] Another complete tutorial is available at www.holly-wood.it/lsynth/tutorial-e