Hatcher
- class pyslm.hatching.Hatcher
Bases:
BaseHatcherThe class provides a generic Hatcher ‘recipe’ with standard parameters specified for defining the hatch across regions. This includes generating multiple contour offsets and then a generic hatch infill pattern by re-implementing the
BaseHatcher.hatch()method in a subclass. This class may be derived from in order to provide additional or customised behavior.Firstly, the boundaries are offset based on first spot compensation factor (
spotCompensation) and then subsequent interior offsets into the boundary provided (controlled by (numOuterContoursandnumInnerContours). This is done via an internaloffsetBoundary()method which requires an offset distance.offsetBoundary = self.offsetBoundary(boundaryFeature, offsetDelta)
These offsets are then simplified and transformed into contour scans (
ContourGeometry).Once the final offset has been obtained, the interior is then infilled with scan vectors. The default infill or scan strategy employed in this class is the usual meander or serpentine whereby scan vectors cover the boundary interior produced in
generateHatching()with the following key parameters:Hatch distance (
hatchDistance)Hatch angle (
hatchAngle)
The hatch angle is incremented by changing
layerAngleIncrement. The produced scan vectors are clipped within the boundary internally as follows:# Clip the hatch fill to the boundary clippedPaths = self.clipLines(paths, hatches)
The clipped scan vectors can be sorted seperately via (
FlipSort) then added sequentially to a list of scan vectors within a group (:class:`~pyslm.geometry.HatchGeometry’).Attributes Summary
The contour offset is the distance between the contour or border scans.
The base hatch angle used for hatching the region expressed in degrees \([-180,180].\)
The distance between adjacent hatch scan vectors.
The hatch sort method used once the hatch vectors have been generated
If the internal hatch region should be processed (default: True).
An additional offset used to increment the hatch angle between layers in degrees.
The total number of inner contour offsets to generate from the boundary region.
The total number of outer contours offsets to generate from the boundary region.
Determines if the contour/border vectors
LayerGeometryare scanned first before the hatch vectors.The spot (laser point) compensation factor is the distance to offset the outer-boundary and other internal hatch features in order to factor in the exposure radius of the laser.
An additional offset may be added (positive or negative) between the contour/border scans and the internal hatching for the bulk volume.
Methods Summary
hatch(boundaryFeature)Generates a series of contour or boundary offsets along with a basic full region internal hatch.
Attributes Documentation
- contourOffset
The contour offset is the distance between the contour or border scans.
- hatchAngle
The base hatch angle used for hatching the region expressed in degrees \([-180,180].\)
- hatchDistance
The distance between adjacent hatch scan vectors.
- hatchSortMethod
The hatch sort method used once the hatch vectors have been generated
- hatchingEnabled
If the internal hatch region should be processed (default: True).
- layerAngleIncrement
An additional offset used to increment the hatch angle between layers in degrees. This is typically set to 66.6 \(^\circ\) per layer to provide additional uniformity of the scan vectors across multiple layers. By default this is set to 0.0.
- numInnerContours
The total number of inner contour offsets to generate from the boundary region.
- numOuterContours
The total number of outer contours offsets to generate from the boundary region.
- scanContourFirst
Determines if the contour/border vectors
LayerGeometryare scanned first before the hatch vectors. By default this is set toFalse.
- spotCompensation
The spot (laser point) compensation factor is the distance to offset the outer-boundary and other internal hatch features in order to factor in the exposure radius of the laser.
- volumeOffsetHatch
An additional offset may be added (positive or negative) between the contour/border scans and the internal hatching for the bulk volume.
Methods Documentation
- hatch(boundaryFeature)
Generates a series of contour or boundary offsets along with a basic full region internal hatch.
- Parameters:
boundaryFeature – The collection of boundaries of closed polygons within a layer.
- Return type:
Optional[Layer]- Returns:
A
Layerobject containing a list ofLayerGeometryobjects generated