3D Printer: Difference between revisions

From OpenComputers: Rebooted
Jump to navigation Jump to search
Clean up Markdown artifacts from DokuWiki migration
Unify block and component API pages
Line 1: Line 1:
= 3D Printer =
= Overview =


3D Printers are a block that allows you to print any block of any shape, with any type of texture. To get started with 3D Printers, you will need to place down a 3D Printer block next to a computer. This will give access to the [[Component/3d printer|printer3d component]] API, allowing you to set up and print models using the provided functions.
3D Printers are a block that allows you to print any block of any shape, with any type of texture. To get started with 3D Printers, you will need to place down a 3D Printer block next to a computer. This will give access to the <code>printer3d</code> API, allowing you to set up and print models using the provided functions.


A more convenient way to setup 3D Printers is to use [[Tutorial/program/oppm|Open Programs Package Manager (OPPM)]]. Once installed, run the following commands: <code>oppm install print3d</code> followed by <code>oppm install print3d-examples</code>. The examples can be found in <code>/usr/share/models/</code> as <code>.3dm</code> files. Take a look through the example files for available options. (Alternatively, you can download the <code>print3d</code> and <code>print3d-examples</code> programs from [https://openprograms.github.io/ OpenPrograms] using <code>wget</code> and an [[Item/internet card|Internet Card]]).
A more convenient way to setup 3D Printers is to use [[Tutorial/program/oppm|Open Programs Package Manager (OPPM)]]. Once installed, run the following commands: <code>oppm install print3d</code> followed by <code>oppm install print3d-examples</code>. The examples can be found in <code>/usr/share/models/</code> as <code>.3dm</code> files. Take a look through the example files for available options. (Alternatively, you can download the <code>print3d</code> and <code>print3d-examples</code> programs from [https://openprograms.github.io/ OpenPrograms] using <code>wget</code> and an [[Item/internet card|Internet Card]]).
Line 20: Line 20:


[[File:3dprinter.png|200px|3dprinter.png]]
[[File:3dprinter.png|200px|3dprinter.png]]
= Component API =
Component name: <code>printer3d</code>.
Callbacks:
== commit ==
* <code>commit(count:number):boolean</code>
Commit and begin printing the current configuration.
== setLabel ==
* <code>setLabel(value:string)</code>
Set the label for the volume being printed.
== getLabel ==
* <code>getLabel():string</code>
Get the current label for the volume being printed.
== setTooltip ==
* <code>setTooltip(value:string)</code>
Sets the tooltip for the volume being printed.
== getTooltip ==
* <code>getTooltip():string</code>
Gets the current tooltip of the volume being printed.
== setButtonMode ==
* <code>setButtonMode(value:boolean)</code>
Set whether the printed block should automatically return to its off state.
== isButtonMode ==
* <code>isButtonMode():boolean</code>
Gets whether the printed block should automatically return to its off state.
== setRedstoneEmitter ==
* <code>setRedstoneEmitter(value:boolean)</code>
Sets whether the printed block should emit a redstone signal while in its active
state.
== isRedstoneEmitter ==
* <code>isRedstoneEmitter():boolean</code>
Gets whether the printed block should emit a redstone signal while in its active
state.
== addShape ==
* <code>addShape(minX:number, minY:number, minZ:number, maxX:number,
  maxY:number, maxZ:number, texture:string [,state:boolean = false]
  [,tint:number])</code>
Adds the shape to the printer's current configuration, optionally specifying
whether it is for the off or on state.
== getShapeCount ==
* <code>getShapeCount():number</code>
Gets the number of shapes in the current configuration.
== getMaxShapeCount ==
* <code>getMaxShapeCount():number</code>
Gets the maximum allowed number of shapes.
== status ==
* <code>status():string, number or boolean</code>
The current state of the printer, 'busy' or 'idle' (string), followed by the
progress (number) or model validity (boolean), respectively.
== reset ==
* <code>reset()</code>
Resets the current job for the printer and stops printing (current job being
printed will finish).


== Contents ==
== Contents ==


{{:Block/contents}}
{{:Block/contents}}

Revision as of 04:39, 28 August 2026

Overview

3D Printers are a block that allows you to print any block of any shape, with any type of texture. To get started with 3D Printers, you will need to place down a 3D Printer block next to a computer. This will give access to the printer3d API, allowing you to set up and print models using the provided functions.

A more convenient way to setup 3D Printers is to use Open Programs Package Manager (OPPM). Once installed, run the following commands: oppm install print3d followed by oppm install print3d-examples. The examples can be found in /usr/share/models/ as .3dm files. Take a look through the example files for available options. (Alternatively, you can download the print3d and print3d-examples programs from OpenPrograms using wget and an Internet Card).

In order to be able to print the models, a 3D Printer block needs to be connected to an existing computer. Once connected, you will also need to provide an Ink Cartridge and some Chamelium. The amount of chamelium used depends on the volume of the 3D print, while the amount of ink used depends on the surface area of the printed item.

To print an item, use the following command: print3d /path/to/file.3dm providing the path to the .3dm file.

Documentation pertaining to creating your own models can be found in /usr/share/models/example.3dm.

The 3D Printer can be crafted using the following recipe:

3dprinter.png

Component API

Component name: printer3d.

Callbacks:

commit

  • commit(count:number):boolean

Commit and begin printing the current configuration.

setLabel

  • setLabel(value:string)

Set the label for the volume being printed.

getLabel

  • getLabel():string

Get the current label for the volume being printed.

setTooltip

  • setTooltip(value:string)

Sets the tooltip for the volume being printed.

getTooltip

  • getTooltip():string

Gets the current tooltip of the volume being printed.

setButtonMode

  • setButtonMode(value:boolean)

Set whether the printed block should automatically return to its off state.

isButtonMode

  • isButtonMode():boolean

Gets whether the printed block should automatically return to its off state.

setRedstoneEmitter

  • setRedstoneEmitter(value:boolean)

Sets whether the printed block should emit a redstone signal while in its active state.

isRedstoneEmitter

  • isRedstoneEmitter():boolean

Gets whether the printed block should emit a redstone signal while in its active state.

addShape

  • addShape(minX:number, minY:number, minZ:number, maxX:number,
 maxY:number, maxZ:number, texture:string [,state:boolean = false]
 [,tint:number])

Adds the shape to the printer's current configuration, optionally specifying whether it is for the off or on state.

getShapeCount

  • getShapeCount():number

Gets the number of shapes in the current configuration.

getMaxShapeCount

  • getMaxShapeCount():number

Gets the maximum allowed number of shapes.

status

  • status():string, number or boolean

The current state of the printer, 'busy' or 'idle' (string), followed by the progress (number) or model validity (boolean), respectively.

reset

  • reset()

Resets the current job for the printer and stops printing (current job being printed will finish).

Contents

Blocks
Computers Computer Case - Server Rack - Microcontrollers
Display Hologram Projector - Keyboard - Screen
Power and Networking Capacitor - Net Splitter - Power Converter - Power Distributor - Relay
Extensions Adapter - Cable - Disassembler - Disk Drive - Geolyzer - Motion Sensor - Redstone I/O - Transposer - 3D Printer
Robotics Assembler - Charger - Drone - Robot - Waypoint