GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - LasseD/buildinginstructions.js: Render LEGO building instructions in the browser using three.js

BranchesTags
Open more actions menu

Latest commit

 

History

696 Commits
696 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/ISSUE_TEMPLATE
.github/ISSUE_TEMPLATE
 
 
apps
apps
 
 
css
css
 
 
js
js
 
 
ldraw_parts
ldraw_parts
 
 
ldraw_unofficial
ldraw_unofficial
 
 
models
models
 
 
official
official
 
 
omr_icons
omr_icons
 
 
tests
tests
 
 
textures
textures
 
 
unofficial
unofficial
 
 
CAlicense.txt
CAlicense.txt
 
 
CAlicense4.txt
CAlicense4.txt
 
 
CAreadme.txt
CAreadme.txt
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
ldconfig.ldr
ldconfig.ldr
 
 
releases.md
releases.md
 
 
sample_animation.htm
sample_animation.htm
 
 
sample_functions.htm
sample_functions.htm
 
 
sample_instructions.htm
sample_instructions.htm
 
 
sample_part.htm
sample_part.htm
 
 
sample_part_standard.htm
sample_part_standard.htm
 
 
sample_partslist.htm
sample_partslist.htm
 
 
sample_physical.htm
sample_physical.htm
 
 
sample_previews.htm
sample_previews.htm
 
 
sample_view.htm
sample_view.htm
 
 

Repository files navigation

buildinginstructions.js

Render LEGO building instructions in the browser using three.js and the LDraw parts library.

See this project visualized on BrickHub.org

Sample image of a building instructions step generated on the fly using buildinginstructions.js

Getting Started

After copying the files in this repository, you can view:

sample_view.htm for how to set up a render. This sample is less than 100 lines and provides a good starting point that is easy to grasp.

sample_instructions.htm for how to set up building instructions, including options for personalization and step editing. This is how instructions appear on BrickHub.org.

sample_physical.htm shows the 'physical' renderer where StandardMaterial from three.js is used for a more realistic look.

Sample image of a the physical renderer generated on the fly using buildinginstructions.js

sample_partslist.htm demonstrates how to display parts lists. The example has two modes (list and grid) with additional part information when in list view and clicking small images result in larger previews with additional information. This example follows how parts lists are displayed on BrickHub.org.

sample_part.htm provides a break down of a single part. Points highlight where lines, triangles and quads are positioned. This can be used to inspect new or existing LDraw parts.

sample_previews.htm shows how to use LDRPreviews.js to show preview icons on any page.

sample_functions.htm shows how to perform operations on LDraw models, such as changing all parts of a certain color, and applying improvements toward OMR-compliance.

Standard File Structure

If you want to view additional models, then add the necessary LDraw files directly to the 'ldraw_parts' directory. Downloaded files from the LDraw parts library should thus result in a file structure as follows:

  • /ldraw_parts - Contains all parts from '/p' and '/parts', such as '1.dat' and '1-4cylc3.dat'.

  • /ldraw_parts/8 - Place the content of '/p/8' here.

  • /ldraw_parts/48 - Place the content of '/p/48' here.

  • /ldraw_parts/s - Place the content of '/parts/s', such as '10s01.dat' here.

LDraw File Structure with Searching

See the file sample_part_standard.htm for how to use buildinginstructions.js with the standard setup of ldraw files (official and unofficial). It searches for files in the two directories 'official/' and 'unofficial'.

Hosting Locally

Files are fetched asynchronously, so opening the sample files in your browser might not work out of the box due to default security settings. To get around this you can either host the files on a local server or disable the browser checks. As an example, Chrome can be started with the following parameters in order to disable these security settings:

 --disable-web-security --user-data-dir=some_directory_where_it_is_ok_that_chrome_saves_a_lot_of_files

Alternatively, if you have python3 installed, then you can fire up a local HTTP server by running:

  python3 -m http.server

For earlier versions of python, the following should work:

  python -m SimpleHTTPServer

Feel free to raise issues or make pull requests. The project is in active development.

Vision

  • Generate LEGO building instructions, parts lists, and 3D models directly in the web browser.

  • Automatically modify LEGO building instructions to make the LEGO models easier to build.

  • Contribute to a fun user experience for LEGO builders of all ages.

  • Reduce paper waste by replacing the need of traditional building instructions.

  • Become a valuable addition to the LDraw suite of applications.

License

buildinginstructions.js is in the Public Domain.

The LDraw library is redistributable under CCAL version 2.0 : see CAreadme.txt.

Three.js and OrbitControls.js use the MIT license.

dat.GUI is licensed under Apache License 2.0

About

Render LEGO building instructions in the browser using three.js

Topics

brickhubjavascriptldrawldraw-editorldraw-viewerlegolego-instructions

Resources

Readme
Unlicense
Activity

Stars

149 stars

Watchers

5 watching

Forks

35 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.