ScanIterator

class pyslm.analysis.ScanIterator(models, layers)

Bases: pyslm.analysis.iterator.Iterator

The Scan Iterator class provides a method to iterate at a variable timestep across a BuildFile consisting of list of Layer and Model provided as the input. Typically this is used in numerical simulation of powder-bed fusion processes and also its temporal visualisation. Properties include the current position are available via getCurrentLaserPosition() and the current laser parameters in getCurrentBuildStyle() and if the laser is currently active isLaserOn().

Note

The Iterator classes assumes that the laser position during rastering is linearly interpolated across each scan vector, based on the timestep, which can be modulated during the iterator.

ScanIterator builds upon Iterator and utilises the TimeTree cache generated for each Layer and its set of LayerGeometry objects respectively. If the current time is within the current LayerGeometry the current point is interpolated across the individual scan vectors depending on its type in getPointInLayerGeometry() using the current BuildStyle associated with the LayerGeometry.

Attributes Summary

timestep

The current timestep [s] for the Scan Iterator

Methods Summary

getCurrentBuildStyle()

Gets the current BuildStyle

getCurrentLaserPosition()

Returns the current position of the point exposure at the current time.

getPointInLayerGeometry(timeOffset, layerGeom)

Interpolates the current laser point based on a timeoffset from the start of the selected LayerGeometry.

isLaserOn()

Determines if the laser is currently on.

Attributes Documentation

timestep

The current timestep [s] for the Scan Iterator

Return type:

float

Methods Documentation

getCurrentBuildStyle()

Gets the current BuildStyle

Return type:

BuildStyle

Returns:

The current BuildStyle

getCurrentLaserPosition()

Returns the current position of the point exposure at the current time.

Return type:

Tuple[float, float]

Returns:

A tuple representing the exposure point \((x,y)\)

getPointInLayerGeometry(timeOffset, layerGeom)

Interpolates the current laser point based on a timeoffset from the start of the selected LayerGeometry. It iterates across each scan vector based on a total distance accumulated and locates the scan vector to interpolate the position.

Parameters:
  • timeOffset (object) – Time offset within the LayerGeometry

  • layerGeom (object) – The LayerGeometry to interpolate the laser point across

Return type:

Tuple[float, float]

Returns:

The current position of the laser of the time

isLaserOn()

Determines if the laser is currently on.

Return type:

bool

Returns:

Status of the laser