Profile Picturesijmen_v_b
€0+

[WorldPainter script]: Road Flatten

2 ratings
Add to cart

[WorldPainter script]: Road Flatten

€0+
2 ratings

This is a script for WorldPainter it is used to flatten roads meaning the change in height on a road will go the shortest distance across the road.

To use it:

1. you need to give a 1 pixel wide line in the centre of the road (thicker lines give slightly worse results).
this can be a layer, terrain, or image mask.
2. set the width of your road (you can Ctrl+z if you make a mistake)
3. Optionally, you can give a layer that will be applied to the whole road.
4. Optionally, you can give a slab layer as it has slabify build in with fewer settings.
5. run the script.

This will make the height on the left side of the road the same as the right side.
This also means the height transitions are at right angles to the road (this is what makes the water of the river script behave).

Note: if roads are on steep slopes, it will both cut into the slope and extend out of it, this can lead to some hard edges.
Some clean-up might be necessary. I recommend adding a temporary layer to all the roads (step 3) and then smoothing with the “except on” filter set to this temporary layer. Then, once it looks nice, you can remove said layer.

Advanced:
If you open the script and scroll down a bit, you'll find a boolean to change the default slabify selection from thin to thick. I tried to make it obvious; you'll know when you find it.

For the nerds:
what it actually does is that for every pixel of the centre line it will project a disk with the specified radius, setting all the surrounding blocks to the same height as the centre. If a block lies on multiple of these discs, it will take the average height of the centres of the discs. This makes it some smooth and flatten combination. The height of each block of the road is therefore the average of the blocks within the specified radius. And since a block on the left side of the road will have the same blocks in range as a block on the right side, this makes them the same height. This has the pleasant side effect that the height transitions are at 90 degrees to the direction of the road, no matter the angle. This happens to work fairly well for curved roads too. This is what makes the water of the river script have these nice small height transitions, limiting how far the water can spread by connecting two adjacent source blocks. (This version only sets the terrain height, not the water height.)



Version 2.3: Parameters will now be remembered between runs.


Version 2.2: first version with enough polish for release.

Add to cart
56 downloads
Size
4.95 KB
Copy product URL

Ratings

5
(2 ratings)
5 stars
100%
4 stars
0%
3 stars
0%
2 stars
0%
1 star
0%