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 ofLayer
andModel
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 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
Iterator
and utilises the TimeTree cache generated for eachLayer
and its set ofLayerGeometry
objects respectively. If the currenttime
is within the currentLayerGeometry
the current point is interpolated across the individual scan vectors depending on its type ingetPointInLayerGeometry()
using the current BuildStyle associated with the LayerGeometry.Attributes Summary
The current timestep [s] for the Scan Iterator
Methods Summary
Gets the current
BuildStyle
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
.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 LayerGeometrylayerGeom (
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
-