ScanIterator¶
- class pyslm.analysis.ScanIterator(models, layers)¶
Bases:
IteratorThe Scan Iterator class provides functionality to iterate at a variable
timestepacross a build file consisting of aLayerlist andModelprovided as its 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 viagetCurrentLaserPosition()and the current laser parameters ingetCurrentBuildStyle()and if the laser is currently activeisLaserOn().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
Iteratorand utilises the TimeTree cache generated for eachLayerand its set ofLayerGeometryobjects respectively. If the current time is within the currentLayerGeometrythe current point is interpolated across the individual scan vectors depending on its type ingetPointInLayerGeometry()using the currentBuildStyleassociated with the LayerGeometry.Attributes Summary
The current timestep [s] for the Scan Iterator
Methods Summary
Gets the current
BuildStyleGets the current laser position of the point exposure at the current time.
getPointInLayerGeometry(timeOffset, layerGeom)Interpolates the current laser point based on the
timeOffsetfrom the start of the selectedLayerGeometry.Determines if the laser is currently on at the current iterator time.
Attributes Documentation
- timestep¶
The current timestep [s] for the Scan Iterator
Methods Documentation
- getCurrentBuildStyle()¶
Gets the current
BuildStyle- Return type:
- Returns:
The current BuildStyle
- getCurrentLaserPosition()¶
Gets the current laser 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 the
timeOffsetfrom the start of the selectedLayerGeometry. It iterates across each scan vector based on a total distance accumulated and locates the scan vector to interpolate the position.- Parameters:
timeOffset (
float) – Time offset within the Layer GeometrylayerGeom (
LayerGeometry) – The Layer Geometry 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 at the current iterator time.
- Return type:
bool- Returns:
Status of the laser