[Mod] Build semi-auto or BMP/3d Mesh import [growwall]

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

[Mod] Build semi-auto or BMP/3d Mesh import [growwall]

by dgm5555 » Sun Mar 22, 2015 23:27

Download: https://github.com/dgm3333/growwall (if you request pulls, then put a note in this forum)
https://github.com/dgm3333/growwall/archive/master.zip

This 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.

Image
Image
Image
Image
Image
Licence: WTFPL v2 (NB binvox is a separate download and isn't included under this license)
Last edited by dgm5555 on Sat Mar 28, 2015 11:28, edited 17 times in total.
 

User avatar
Napiophelios
Member
 
Posts: 940
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: Build Wall semi-automatically

by Napiophelios » Mon Mar 23, 2015 06:47

Wow thats pretty cool.

works with all patterns I have thrown at it;
makes for an easy way to build a quick structure
 

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Re: Build Wall semi-automatically

by dgm5555 » Tue Mar 24, 2015 10:39

I've extended it a bit, so it can now read a bmp file in and build a wall (or any other shape) from that.
At the moment it reads the red channel as height, with black being highest, and white being ground level.
(the easiest way to do this is draw in gray so each channel will be the same value)
It doesn't load into areas which haven't been generated.

I've moved it to a git repo, as lots of mods are possible (see the top post for this)
 

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Re: Build semi-auto or BMP/3d Mesh import [growwall][mod]

by dgm5555 » Fri Mar 27, 2015 22:10

I've now extended it a bit more so 3D meshes can also be imported. it uses binvox for the initial conversion, which means it can (currently) convert will Wavefront OBJ, Geomview OFF, Autocad DXF, PLY and STL, if they contain polygons only, and VRML 1.0.

apparently Unigrafix UG, VTK, XGL, PovRay POV, BREP, and JOT support are temporarily disabled
 

User avatar
Hybrid Dog
Member
 
Posts: 2681
Joined: Thu Nov 01, 2012 12:46

Re: Build semi-auto or BMP/3d Mesh import [growwall][mod]

by Hybrid Dog » Sat Mar 28, 2015 08:33

Can you also generate mesh files from buildings in minetest?

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪
 

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Re: Build semi-auto or BMP/3d Mesh import [growwall][mod]

by dgm5555 » Thu Apr 30, 2015 20:53

Hybrid Dog wrote:Can you also generate mesh files from buildings in minetest?

My script only imports meshes, but prestidigitator's made an export script:-
https://forum.minetest.net/viewtopic.php?f=9&t=9948
 

alket
New member
 
Posts: 1
Joined: Fri Feb 06, 2015 09:59
GitHub: alketii
IRC: alket
In-game: alket

Re: [Mod] Build semi-auto or BMP/3d Mesh import [growwall]

by alket » Tue Jul 28, 2015 13:51

I installed this plugin and did /growwall , it says that its invalid command.
 

User avatar
cd2
Member
 
Posts: 562
Joined: Mon Jun 01, 2015 06:30
Location: Linux
GitHub: cdqwertz
In-game: cd cd2
 

User avatar
jogag
Member
 
Posts: 106
Joined: Wed Aug 12, 2015 18:32
Location: Online
GitHub: jogag
IRC: jogag
In-game: jogag

Re: Build semi-auto or BMP/3d Mesh import [growwall][mod]

by jogag » Thu Aug 20, 2015 15:38

dgm5555 wrote:I've now extended it a bit more so 3D meshes can also be imported. it uses binvox for the initial conversion, which means it can (currently) convert will Wavefront OBJ, Geomview OFF, Autocad DXF, PLY and STL, if they contain polygons only, and VRML 1.0.


Wow! I can now 3D-print my things in Minetest!!!
To do that, I extended the mod command with the import parameters (mesh file, block to use) and I used my own digiline-controlled command block, along with a luacontroller and a keyboard from my (WIP) Digiline Stuff pack.

Great work!
 

User avatar
benrob0329
Member
 
Posts: 1238
Joined: Thu Aug 06, 2015 22:39
Location: Michigan
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03

Re: [Mod] Build semi-auto or BMP/3d Mesh import [growwall]

by benrob0329 » Thu Aug 20, 2015 16:31

The link in your signature is broken, I'd like to use that digilines mod, it sounds awesome!
 

User avatar
Evergreen
Member
 
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
Location: A forest in the midwest
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

Re: [Mod] Build semi-auto or BMP/3d Mesh import [growwall]

by Evergreen » Fri Aug 21, 2015 14:11

benrob0329 wrote:The link in your signature is broken, I'd like to use that digilines mod, it sounds awesome!

Diglines is available here: viewtopic.php?t=5263
Back from the dead!
 

User avatar
benrob0329
Member
 
Posts: 1238
Joined: Thu Aug 06, 2015 22:39
Location: Michigan
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03
 

User avatar
jogag
Member
 
Posts: 106
Joined: Wed Aug 12, 2015 18:32
Location: Online
GitHub: jogag
IRC: jogag
In-game: jogag

Re: [Mod] Build semi-auto or BMP/3d Mesh import [growwall]

by jogag » Sat Aug 22, 2015 11:28

benrob0329 wrote:I'm talking about the Digiline Stuff Modpack...

I'm working on that, it has a digiline printer, an IoT router, wireless, and SD cards...
Currently coding the most interesting mod: the Internet of Things mod, which adds a router with Wi-Fi capability...

EDIT: here's the link to the topic
 


Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 2 guests