Piece

@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class Piece(val about: String = "", val slice: String = "", val print: String = "", val printable: Boolean = true, val picture: Boolean = false)

Add this annotation to build methods of a Model. The method must take no parameters, and return a Shape3d.

When you save the script, the application will look for all methods with @Piece annotations, as well as the default build() method, and place them in a pull down menu. You can then choose which of these you wish to build or print.

Properties

Link copied to clipboard

Appears as a tooltip in PiecesDock

Link copied to clipboard
val picture: Boolean = false

If true, then images and thumbnails will use this piece, rather than the default.

Link copied to clipboard

For pieces which are for display-only, but can be printed via a different piece name. For example, you design a piece the right way up, but which needs to be rotated before printing.

Link copied to clipboard
val printable: Boolean = true

If this is set to false, then FooCAD will refuse to upload or print this piece. Useful for pieces which are for display-only,

Link copied to clipboard

The @Piece annotation can optionally have a slice string, which lets you override the slicer settings. e.g.

Functions

Link copied to clipboard