LDraw cliff.html

From LDraw.org Wiki
Jump to navigation Jump to search
LDraw cliff.html
Developer(s) Sylvain Sauvage
Initial release 2019
Current version 2019
Development status Stable
Operating system Anyone, works in a recent browser
Available in English
Type LDraw model / landscape generator
License GPLv3+ / Free & libre
Website ldraw_cliff.html
Software infobox

ldraw_cliff.html is a standalone HTML/ECMAScript application to generate LDraw models (LDR) of cliff landscapes.

It runs in a browser.

And it can generate this kind of model:

Installation and Running

Download the Zip bundle. Unpack it wherever you want and open the file ldraw_cliff.html in your favorite (and recent) browser. Fill the form, click on the “Click Me!” button at the bottom of the page and a link to a downloadable LDR file will appear.

How does it work?

The main algorithm randomly builds columns of bricks (and slopes), piling them “down” each others, trying to follow (not to be too far from) the neighbouring bricks. The bricks are chosen according to probabilities that varies with the position (top, middle, or bottom of the wall).

When the algorithm can’t find bricks, that is when a column is too far from its neighbour and no bricks can be found to fill the gap, it uses a 1x1 brick. That results in flat portions and warning messages.


Main Parameters

The generated “cliff wall” will be exactly “width” studs (one brick-width) wide and, at most, “height” bricks high.

Top Line Parameters

The algorithm starts with the top line and randomly goes down, adding bricks below. So these parameters define the overall shape of the top line.

If you choose not to vary the depth of the top line, it will be a straight line. Otherwise, it will be fixed on the leftmost and rightmost points but will vary randomly in between to the extent of the “maximum depth variation” parameter.

If you choose not to vary the height of the top line, it will be flat. Otherwise, it will vary randomly, not descending below “maximum height variation” and not varying more than “maximum slope of the top” between two adjacent bricks.

Curving the top line gives it a cubic curve, either advancing (positive value) or receding (negative value).

The offset parameter allows to have an oblique wall. Otherwise, leftmost and rightmost top points are aligned on 0.

The more the top line varies, the more the chances of “difficulties” for the algorithm to find bricks to build the wall.

Bumpiness

Bumpiness is how far one column can be from its neighbours.

Main Colours

All the colours are LDraw colour numbers.

The grass colour is the colour of the top plates.

The sand colour is the colour of the baseplates.

The rock colour(s) is a comma-separated list of weighted colours for the rocks. By default, the colours are layered. “72,71” means that the bottom half of the wall will be DBG (72) and the top half will be LBG (71). Adding a weight to the colour number will augment the proportion according to the weight. “72,71:2” means the bottom third (default weight is 1) will be DBG and the top two-thirds will be LBG.

Instead of layering the colours, you can choose to randomly use them (in that case, use a high weight for the main colour and low weights for the accent colours).

Climbing Path

You can add a climbing path to the cliff. It works by “pushing” back the wall above the path, randomly climbing and randomly turning (turning is mandatory when hitting a side).

The path is made of coloured plates of a fixed or variable width.

Pebbles

These parameters define how “pebbles” are spread on the ground at the bottom of the wall.

Sea

Some blue (or other colours) plates can be randomly put in front of the wall (and pebbles) in a sinuous wave.

Caves

You can choose to dig caves.

Digging a cave means pushing back the wall in a random zone. The borders are “smoothed” so that the cave aren’t too squarish.

You can choose to add plates on the caves’ ground.

Plants

Flower stems can be added on top of the wall (offset chessboard like). Otherwise, 1x1 plates are randomly added to prevent the top to be too flat.

Back Line

The sides and top plates are prolonged in the back to give a bit of context.

Minifigure

To better view the scale, a minifig can be added on top of the cliff or on the beach, or both.