l2cu

l2cu

Donate

[ L²CU // Project Page ] [ Version // 01-21-2023 ]


Welcome to L²CU

L²CU uses Frobulator to streamline the scripts and make redundant code a thing of the past.

L²CU (The LDraw Linux Command line Utility) stems from a set of independent scripts written over the last few years to respond to an obvious need for efficient management of LDraw model files in several ways, with bulk editing being one of them.

Most older and even more modern editors miss that mark to provide such features and that is where L²CU tries to fill the gap in a simple, user-friendly way.

What can it do?

L²CU supports the standard LDraw model file extension (ldr) and the multi-part document (model assembly) file extension (mpd).

In short, with L²CU you can:

You can also tweak or rework the utility’s functions to match your preferences.

How does it work?

LDraw model files (ldr, mpd and even dat) are plain text files, thus making them stream edit friendly:

L²CU is a shell script (BASH) that parses and modifies the text in the model file to get the job done. It is optimized for portability and uses a very minimal set of dependencies to get the job done.

What does it need?

On startup, L²CU verifies the presence of necessary dependencies before proceeding and pocessing the user’s change request(s).

You will need:

Common utilities either already set up on your Linux-based system or that you can easily install using your distribution’s package manager:

The ‘render’ and ‘export’ features depend on the following. Install them before processing:

‘render’

The render function generates preset, high defintion renders, of the selected LDraw model files or projects (using LeoCAD to process the renders).

The user can choose from set defaults or specify the latitude and longitude parameters of the camera, as well as a file saving suffix to register the coordinates as a viewing angle string to the file name:

Defaults (as arrays):

latitude=( 30 30 30 30 )

longitude=( 225 45 180 0 )

view=( “quarter-back” “quarter-front” “back” “front” )

You can refer to the LeoCAD help manual to get you started on setting up your editing and rendering preferences.

‘export’

This function serves as a 3D standard file exporter. It can generate (with the use of Leocad and/or Blender) the following formats:

The model exports can be used for showcase purposes, displaying them online in personal or commercial galleries (uses WebGL: Three.JS)

Examples:

‘modify’

Here is where the batch editing happens: this feature is extremely helpful when processing massive model updates and color or part adjustments that would normally be done manually through an editor.

The script uses stream editing to find and replace the desired elements, using the LDraw file specification syntax as reference.

The user can modify any ldr or mpd file in one of four ways:

‘get’

The ‘get’ function lets you download and extract the LDraw parts library. This is especially useful for quick updates or if you’re getting started.

You can:

‘make-list’

The ‘make-list’ option was the initial project script that started L²CU over 6 years ago.

This (now) function was built as a need to replace the ‘mklist.exe’ utility that is found and packaged with the base LDraw parts library archive. It serves the exact same purpose: parse and generate an updated list of all the parts located under the main ‘LDraw’ directory (within ./LDraw/parts).

The user can create a list that sorts the parts in that directory either by part [n]umber or by part [d]escription.

This utility comes in handy with the use of editors or other LDraw related application that do not have the ability to generate their own parts index or that rely on the oldtext based index (parts.lst) to load parts into the editor (i.e.: MLCAD, which can be run using Wine when using Linux-based distributions).

More modern or cutting-edge editors now generate a cached dynamic index or database on startup and do not require the list generated by this function anymore.

To find examples that make use of L²CU, or to simply browse my models, you can visit my Blog which is hosted at GitHub as well.

Repositories:

Frobulator to streamline the scripts and make redundant code a thing of the past.

LeoCAD to export LDraw models into an exploitable 3D format via L²CU.

LPub3D to generate instructions out of the models submitted to L²CU.

Three.JS to create the viewer used to render and display my models on your web browser.

GNU/Bash as the shell environment on top of which the scripts function.

Projects:

[ Dextop // Project Page ]

[ Frobulator // Project Page ]

[ L²CU // Project Page ]

[ Lego // Linux // Project Page ]

[ Nathanel + Titane // Project Page ]

[ Terminal // Project Page ]

Reports:

Submit bug report or feature request


[ L²CU // Project Page ] [ Version // 01-21-2023 ]

Enjoying L²CU? Buy me a coffee to show your appreciation!

Donate