/2schematic

Converts 3D file formats to Minecraft schematics

Primary LanguageC++GNU Lesser General Public License v3.0LGPL-3.0

2Schematic

The closest you can get to destroying your office with a pickaxe (without legal repercussions).

#Minecraft room

2schematic is a set of tools for converting colored 3D models of real-world environements into Minecraft .schematic files. The models can be built using an RGB-D camera (such as the Microsfot Kinect) and the ccny_rgbd software.

The supported input formats are:

  • Octomap (.ot) files
  • PCL pointcloud (.pcd) files

The output schematics can be imported into Minecraft world editors such as mcedit, which allow you to save worlds you can load and play inside MineCraft.

Building

First, obtain the dependencies. You can get either or both, depending on what input files you want to convert:

If one of the dependencies is not installed, the corresponding converter executable will not be built.

Download the package from github:

git clone https://github.com/idryanov/2schematic.git

To compile:

cd 2schematic
mkdir build
cd build
cmake ..
make

The executables will be generated in 2schematic/bin

Usage

Octomap to schematic:

octomap2schematic [file_in] [file_out] [filter_size] [material_mode]

Where the arguments are:

  • file_in: an Octomap file, (.ot format), with color.
  • file_out: a .schematic file
  • filter_size: The window size, in voxel units, to perform color median filtering. Set this to a small value (like 1 or 2) to make colors more uniform and remove random color blobs. Setting this to 0 will disable color filtering.
  • material_mode: 0 for "true" colors, 1 to color blocks by their height, 2 to make everything out of stone.

Example:

cd 2schematic
./bin/octomap2schematic ./sample/room.ot ./sample/room.schematic 1 0

PCL to schematic:

pcd2schematic [file_in] [file_out] [resolution] [filter_size] [material_mode]

Where the arguments are:

  • file_in: a PCL PointCloud file, (.pcd format), with color.
  • file_out: a .schematic file
  • resolution: the size, whatever units the pcd file is in, of each block. For example, if the pcd is in meters, 0.05 will produce one block for each 5cm of real-world space.
  • filter_size: The window size, in voxel units, to perform color median filtering. Set this to a small value (like 1 or 2) to make colors more uniform and remove random color blobs. Setting this to 0 will disable color filtering.
  • material_mode: 0 for "true" colors, 1 to color blocks by their height, 2 to make everything out of stone.

Example

cd 2schematic
./bin/pcd2schematic ./sample/room.pcd ./sample/room.schematic 0.05 1 0

Acknowledgements

Special thanks to Patrick Min for the schematic output code and the initial discussion.

Why?

Because I needed an excuse to procrastinate the actual research I have to do.

Feedback

Please drop me a line with any questions, comments or suggestions.

License

2schematic is licensed under GPLv3.