ModelWithSetup

interface ModelWithSetup : Model

Multi-piece models may wish to implement the setup method, which is called before any piece is built. Some initialisation isn't possible within the init block. For example, anything that using Custom fields (because these fields are set AFTER the class is created, but before setup and build are called.

Functions

Link copied to clipboard
abstract fun build(): Shape3d

Creates the default shape to be built/printed. A Model may be composed of many pieces, in which case, build should create the "main" piece, or possibly all pieces to be printed on a single plate.

Link copied to clipboard
fun Model.buildPiece(pieceName: String?): Shape3d

Builds a piece by looking for a method called pieceName with a Piece annotation.

Link copied to clipboard
Link copied to clipboard
fun Model.pieceAnnotation(pieceName: String? = null): Piece?
Link copied to clipboard

Returns piece names by looking Piece annotations on methods.

Link copied to clipboard

The same as pieceNames, but includes the "default" pieceName of null as the first item in the list.

Link copied to clipboard
fun Model.printPieceName(pieceName: String?): String?
Link copied to clipboard
abstract fun setup()
Link copied to clipboard

Returns SlicerValues by looking for Slice annotations on the build method.

Returns SlicerValues by looking for Slice annotations on the method named pieceName or the build method if pieceName is null.