trevorsandy / lpub3d

An LDraw™ editor for LEGO® style digital building instructions.
https://trevorsandy.github.io/lpub3d/
132 stars 19 forks source link

Enable support for alternative LDraw libraries #132

Closed trevorsandy closed 5 years ago

trevorsandy commented 5 years ago

Subject

Add support for LDraw VEXIQ Robotics and TENTE Construction libraries.

Environment

Version of LPub3D - 2.3.0 Operating system - All

Expected behaviour

LPub3D should provide the same level of integration and convenience as the default LEGO LDraw library

Actual behaviour

LPub3D currently require additional configuration and setup to allow alternative LDraw library.

Solution

Bundle TENTE and VEXIQ LDraw archive libraries to enable the same 'built-in' functionality as that available for the currently bundled LEGO LDraw libraries (official and unofficial). Enable the capability to launch and/or switch LPub3D into either of the bundled libraries. Enable the full scope of functionality in LPub3D across all the bundled libraries.

trevorsandy commented 5 years ago

Implemented.

While it was always possible to 'configure' LPub3D to accommodate alternative LDraw libraries, this enhancement goes a step further to integrate the TENTE® Construction and VEX IQ® Robotics LDraw libraries allowing the user to switch libraries with a single command line flag: -lv | --libvexiq, -lt, | --libtente. As you may already know, LPu3D uses the archived instance of the LDraw library, however, a disk instance of the LDraw library is required for the bundled renderers - LDView and LDGLite.

Beginning with v2.3.3, LPub3D bundles the TENTE and VEX IQ LDraw archive libraries allowing the application to automatically unpack the library to disk should the disk library not exist. On application launch, if the user elects (using the above flags) to use a library that does not exist in the standard searched locations on disk, the application will prompt the user to either select the library path or unpack the bundled library. If unpack is selected, the library is unpacked to the User's application data path in the subdirectory were LPub3D already deposits user data. the extracted is named TENTEParts, and VEXIQParts respectively. For example, the path to the disk library could look like this on Windows: C:\Users\Trevor\AppData\Local\LPub3D Software\LPub3D\TENTEParts

When you have a disk instance of the LDraw library present, LPub3D will automatically 'validate' the type of library at that location (by checking for an official part), and trigger the comprehensive switch to that library when you enter the path or select it using the LDraw Library path 'Browse' button in the Preferences dialogue. Parts used to validate the library are:

LEGO LDraw Library: /parts/1.dat
TENTE LDraw Library: /parts/4circulo.dat
VEX IQ LDraw Library: /parts/228-2500-001.dat

Note that changing from one path to another where the library content is still the same type (e.g. LEGO), or selecting a path where the parts above are not present at the specified location will not trigger a 'library switch'.

Each library is linked to its own:

screenshot - 17_10_2018 20_49_52

screenshot - 18_10_2018 09_53_30

screenshot - 18_10_2018 09_57_10

screenshot - 18_10_2018 10_22_30

screenshot - 17_10_2018 20_50_53

screenshot - 18_10_2018 10_23_49

Cheers,