Layer

class pyslm.geometry.Layer(z=0, id=0)

Bases: object

A Layer represents a slice in the printing process for L-PBF. Usually a build is composed of a series of Layers which include additional laser parameters referenced in a Model. This is a simple class structure for containing a set of LayerGeometry including specific derivatives including:

These geometry objects are stored in geometry. Other properties for the layer include the current Z encoded position in layerId or absolute layer position in z. The layer z position is stored in an integer format to remove any specific rounding - typically this is specified as the number of microns.

Attributes Summary

geometry

LayerGeometry sections that are stored in the layer.

layerFilePosition

The position of the layer in the build file, when available.

layerId

The layer id for the Layer.

name

The name of the Layer

z

The Z Position of the Layer is given as an integer to ensure that no rounding errors are given to the slm systen.

Methods Summary

appendGeometry(geom)

Complimentary method to match libSLM API.

getContourGeometry()

Returns a list of all ContourGeometry stored in the layer.

getGeometry([scanMode])

Contains all the layer geometry groups in the layer.

getHatchGeometry()

Returns a list of all HatchGeometry stored in the layer.

getPointsGeometry()

Returns a list of all PointsGeometry stored in the layer.

isLoaded()

Indicates if the layer is loaded.

Attributes Documentation

geometry

LayerGeometry sections that are stored in the layer.

layerFilePosition

The position of the layer in the build file, when available.

layerId

The layer id for the Layer. This corresponds to a position in z based on a uniform layer thickness defined in the header of the machine build file (Header.zUnit)

name

The name of the Layer

z

The Z Position of the Layer is given as an integer to ensure that no rounding errors are given to the slm systen. Under most situations this should correspond as the product of the layer id (Layer.layerId) and the zUnit - layer thickness (Header.zUnit).

Methods Documentation

appendGeometry(geom)

Complimentary method to match libSLM API. This appends any LayerGeometry and derived classes into the Layer in sequential order.

Parameters:

geom (LayerGeometry) – The LayerGeometry to add to the layer

getContourGeometry()

Returns a list of all ContourGeometry stored in the layer.

Return type:

List[HatchGeometry]

getGeometry(scanMode=0)

Contains all the layer geometry groups in the layer.

Return type:

List[Any]

getHatchGeometry()

Returns a list of all HatchGeometry stored in the layer.

Return type:

List[HatchGeometry]

getPointsGeometry()

Returns a list of all PointsGeometry stored in the layer.

Return type:

List[PointsGeometry]

isLoaded()

Indicates if the layer is loaded.

Return type:

bool