Download:
https://github.com/dgm3333/growwall (if you request pulls, then put a note in this forum)
https://github.com/dgm3333/growwall/archive/master.zipThis is a mod which started with the objective of building a wall. Using it you can semi-automatically create a wall (or other structure) from a line created on the ground, a bmp file, a wide variety of 3D mesh types (voxelised in binvox format) or just by walking where you wish your wall to be.
All you do is edit the lua to set the node you want to place (eg default:sandstonebrick), and the wall height (globals are at the top). You can also enter marker nodes, bmp and or binvox files, and offsets if you wish them. (don't be fooled by the scale option it currently doesn't work well)
Punch Functions:
To grow a single column of nodes punch any node other than the markernode and everything above it will be converted to the node of your choice to the height you want. To enable/disable the punch functions enter the chat command '/growwall'
To use a marker (eg to mark out a wall) place the marker (wool:red is default) where you wish the wall to go. Then punch any marker and all nearby marker nodes and the air/nodes above will be converted to the node of your choice. The conversion is iterative, so the conversion will extend as far as you have placed nodes, but each node must be within x+-1, z+-1, y+-3 of another marker.
BMP Import:
To place a bmp in the world enter the chat command '/growbmp'. By default this will be placed with bottom left at 0,0,0. However this can be modified with offsets, and scaled (but note upscaling will result in somewhat random gaps between blocks, and downscaling will set a block if it would have been set by any nodes - no averaging or smoothing is applied.
The bmp must be saved as 24bit format and uncompressed. The height of the wall is set from the darkness of the pixel - white is 0, black is maximum height. (Technically though the only channel used is the red channel, so it would be simple to also define varying node types using blue or green channels if you wanted to).
As always cavegen makes a nuisance of itself and randomly punches holes in the walls which were imported into ungenerated areas (ie with mapgen). The easiest way to fix this is to explore the structure entirely so mapgen has been completed then reimport it and the holes will be filled in...
3D Mesh Import:
To place a converted 3D mesh in the world enter the chat command '/growbnv'. Offsets and scaling work as above for bmps, and note the cavegen problems.
You will have to initially convert the mesh using the command-line tool binvox. binvox can import either mesh faces alone ("walls"), or solid objects with internal nodes filled. Limitations of binvox I've yet to fully explore are:-
* speed (very slow on my system, although apparently better with a new graphics card - mine is nearly 10yrs old),
* binvox conversion doesn't support multiple materials.
* resolution is limited by memory, but has max of 4096 nodes (='voxels') in any dimension (256x256 is approx footprint of a medium sized building). binvox crashes on my system with 8GB ram if attempting a 2048 point cubic grid.
BUGS with my code (not binvox) - put here to remind me to fix them when I get a mo:-
I'm not importing the grid dimensions correctly, so you need to set them manually
Walking Wall:
To enable/disable the walking wall function enter the chat command '/growwalk'. Then just walk where you want the wall to do - it will be placed when you move to the next x or z location, so going up or down won't cause nodes to be placed. You'll probably need to turn rapid move off (j key) or the wall will have gaps in it.
Hope it's useful (it took only me a few seconds to create a wall approx 1000 nodes long and 5 high on top of a pre-existing single node marker line).
It could be extended with more sophisticated wall types, or ability to place the bmp around as needed.
Licence: WTFPL v2 (NB binvox is a separate download and isn't included under this license)