This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Bomb Bloke's profile picture

[OpenComputers] print3d

Started by Bomb Bloke, 17 July 2018 - 04:06 PM
Bomb Bloke #1
Posted 17 July 2018 - 06:06 PM
pastebin get Lr9UyrkR print3d



Allows a Command Computer to produce 3D Prints, as though it were a 3D Printer from OpenComputers.

(OpenComputers must obviously be installed.)

Usage:

print3d <fileName> [count]

… where the file is a 3dm object. The script will /give the result to the nearest player, and also save a text file with the "give" command to disk.

3dm files depict models using Lua tables (formatted per this example). Each can be no larger than a single block, although multiple prints can be stacked in the world to create larger builds.

As this script is only accessible to operators, regular OpenComputers printing limitations are disregarded: the per-model shape limit is removed (no "model too complex" errors), and flat shapes also become possible (no "empty block" errors).

You can gain ready access to this sample collection of models with BBPack:

bbpack mount https://github.com/OpenPrograms/Sangar-Programs/tree/master/models models
print3d models/whatever.3dm

And here's the shape from the screenshot above:

pastebin get NvDBMD7f Thingy.3dm

Version History2018/07/18
1.0.0
Initial release.

2018/07/25
1.1.0
Script can now be loaded as an API, doubt I'll document it though.
Running it normally now also writes the "give" command to disk.
Edited on 25 July 2018 - 10:57 AM
Bomb Bloke #2
Posted 25 July 2018 - 12:49 PM
I've made a companion script which expands on the main one a bit; with them both installed, you can generate 3D models of Minecraft character skins:

pastebin get 1K7x1Dx2 3dmChar

Skins need to be saved as GIF files - use Paint.NET or something that understands the concept of transparency.

Fair warning, there's a large amount of NBT data in these models. After putting out a half dozen or so you'll notice that placing / destroying further blocks within the same chunk becomes slow. Wouldn't surprise me if too many statues would lead to world corruption, so don't go overboard!
Edited on 25 July 2018 - 10:54 AM