Loading

Hey! This thing is still a Work in Progress. Files, instructions, and other stuff might change!

Minecraft structure planner to OpenSCAD Ruby converter

by Nudel_P, published

Minecraft structure planner to OpenSCAD Ruby converter by Nudel_P Jul 9, 2011
0 Share
Download All Files

Thing Apps Enabled

Order This Printed View All Apps

Contents

Use This Project

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag

Thing Statistics

7827Views 1627Downloads

Summary

I've been working on this Ruby script on and off for a while now, but never felt it was ready for distribution. Then http://minecraftprint.com/ came along, and made me push an early version out. While I see the benefit of being able to search through an entire world and pick out the structure to print, it's not really an option for larger worlds, and the selection method seemed cumbersome.

My idea is to use an established file format as the base for conversion - http://www.minecraftwiki.net/wiki/Schematic_File_Format The worldwide Minecraft communities create and read this format with an assortments of tools. At the server I play on, we use World Edit, with it you can select and save areas of the world to file very easy. To make it simpler to convert I send the schematic file through Minecraft structure planner which exports to xml.

At the moment the script is VERY crude. It runs through a Minecraft Structure Planner xml file and creates a OpenSCAD file where it places a cube(); (and it's block type) every time it finds a block. Warning: This is the first time I've touched Ruby, so if you know how to use it, my sincere apologies in advance.

I hope someone else might want to build upon this work/idea. :-)

Planned improvements:
Converting slabs, stairs, fences and perhaps other objects.
Using a special block for support structure.
Output optimization so it's possible to convert large structures.

Future improvements:
Reading the World Edit schematic files directly.
Exporting to stl directly with World Edit?

Instructions

In short:
Use world edit to save schematic, convert it to xml with minecraft structure planner, run mc.rb and use OpenScad to convert the file to stl.

In long:
You need Ruby - http://www.ruby-lang.org/ and the xmlsimple gem - http://xml-simple.rubyforge.org/
Minecraft Structure Planner (MSP) - http://minecraftstructureplanner.com/

I have only tried to convert others schematics, and simple ones I've made myself in MSP. But here's some pointers to how you could go along:

To copy buildings from a server it needs to run Bukkit - http://www.bukkit.org - with World Edit - http://www.minecraftforum.net/topic/42214-pluginbukkit-worldedit-32-feature-rich-13-01/
For single player you can use single player commands and World Edit - http://www.minecraftforum.net/topic/94310-173-single-player-commands-v210-2-another-new-update/

Select the area you want to copy/print. ( I like to use //wand )
Use //save filename
Somehow fish out the .schematic file from the server folder.
Import the schematic file into MSP and save it in the MSP xml format, in the same folder as mc.rb.
Rename the file test.xsp (or edit mc.rb and change the file name)
Run mc.rb
Open test.scad and enjoy your work.

Notes/limitations:
There's a hard limit on (I guess) the number of objects possible in OpenSCAD, and since it converts every single block as a cube(); it reaches that limit pretty fast. So this version only works with small buildings.

There need to be at least one block in every column, as there's no check for empty columns at the moment. The easiest way to fix this is to lay a full base on the first layer.

OpenSCAD takes forever to render the file.

The object might come out mirrored, as I can't quite recall which version I fixed that in. :-P

All Apps

3D Print your file with 3D Hubs, the world’s largest online marketplace for 3D printing services.

App Info Launch App

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

App Info Launch App

Kiri:Moto is an integrated cloud-based slicer and tool-path generator for 3D Printing, CAM / CNC and Laser cutting. *** 3D printing mode provides model slicing and GCode output using built-in...

App Info Launch App
KiriMoto Thing App

With 3D Slash, you can edit 3d models like a stonecutter. A unique interface: as fun as a building game! The perfect tool for non-designers and children to create in 3D.

App Info Launch App

Print through a distributed network of 3D printing enthusiasts from across the US, at a fraction of the cost of the competitors. We want to change the world for the better through technology, an...

App Info Launch App

Quickly Scale, Mirror or Cut your 3D Models

App Info Launch App

3D Print a wide range of designs with Treatstock. Easy to use tools to get the perfect result. The global 3D printing network that connects you with high-quality and fast working print services nea...

App Info Launch App

This is utterly awesome!

Thank you! :)

It's not really complicated, as ruby have easy access to xml compilers. I used "xmpsimple" here, which makes it a real breeze.

I took the route via OpenSCAD so it's possible to do parametric adjustments to it without touching the converter itself, but a direct-to-stl version would be possible as well.

Top