pyslm.analysis Package¶
Functions¶

Returns the effective laser speed given a BuildStyle using the point distance and point exposure time. 
Returns the intralayer geometry jump length across the 


Returns the number of jumps across a 

Calculates the jump distance of the laser between adjacent exposure points and hatches, principally used for 

Calculates the total path length scanned by the laser across a single 

Returns the total time taken to scan across a 

Returns the total jump length across the 

Returns the total path length across the 

Returns the total time taken to scan across a 
Classes¶

A 

ContourGeometry represents a 

HatchGeometry represents a 

Basic Iterator which parses through both 
The LaserState Class is a simple structure used for storing the state of the current exposure point at time \(t\) including the position and the active 


Slice Layer is a simple class structure for containing a set of SLM 

A Layer Geometry is the base class type used for storing a group of scan vectors or exposures. 



A Model represents a parametric group or in practice a part which contains a set unique and assignable 

PointsGeometry represents a 

The Scan Iterator class provides a method to iterate at a variable 

ScanVectorIterator provides an iterator that will traverse across every scan vector (linear) across both hatch and contour scan vectors for all layers passed into the constructor. 

The TimeNode class provides a structure for storing the precalculated time of a Layer or LayerGeometry structure, which is stored in 
pyslm.core Module¶
Classes¶

Convex hulls in N dimensions. 





Part represents a solid geometry within the document object tree. 
pyslm.geometry Package¶
Functions¶

Create a dict from a list of Layers with a key (LayerId) and the corresponding 

Returns the 

Finds the Layer within a list given an id 

Returns the Model found from a list of 

Merges a list of Layers  typically from separate parts into a unified layer. 
Classes¶
A 


ContourGeometry represents a 

HatchGeometry represents a 

The Header provides basic information about the machine build file, such as the name of the file ( 

Slice Layer is a simple class structure for containing a set of SLM 

A Layer Geometry is the base class type used for storing a group of scan vectors or exposures. 

A Model represents a parametric group or in practice a part which contains a set unique and assignable 
ModelValidator takes the pyslm.geometry data structures such as a list of 


PointsGeometry represents a 
pyslm.hatching Package¶
Functions¶

Approximate a polygonal chain with the specified tolerance. 

Utility to reshape a 3D hatch vector array of shape (n,2,2) into a flat 2D array to allow manipulation of individual vectors. 

A utility method to return a list of exposure points given a 

Utility method to check if the numpy array is a valid hatch array 

Converts closed paths to Shapely polygons with both exterior and interior boundaries. 

Simplify the boundaries of paths using DouglasPeucker algorithm provided by the scikitimage library or an internal method within shapely. 

Utility to reshape a flat 2D hatch vector array into a 3D array to allow manipulation of individual vectors 
Classes¶
Sort method flips pairs of scan vectors so that their direction alternates across adjacent vectors. 

The BaseHatcher class provides common methods used for generating the ‘contour’ and infill ‘hatch’ scan vectors for a geometry slice typically a multipolygon region. 

BasicIslandHatcher extends the standard 


Sort method flips all pairs of scan vectors so that their direction alternates across the input 

The greedy sort approach is a heuristic approach to sorting the scan vectors based on the current hatch angle specified in 

Provides a generic SLM Hatcher ‘recipe’ with standard parameters for defining the hatch across regions. 
The InnerHatchRegion class provides a representation for a single subregion used for efficiently generating various subscale hatch infills. 


Island represents a square subregion containing a series of orthogonal hatches which represents a typically a checkerboard scan strategy. 
IslandHatcher extends the standard 

A linear sort approaches to sorting the scan vectors based on the current hatch angle specified in 

The Stripe Hatcher extends the standard 

Method simply passes the hatch vectors in their current form. 
pyslm.support Package¶
Functions¶

Provides a support structure cost using ray projection from the overhang regions which allows for selfintersection checks. 

This method to approximate the surface area, projects a single ray \((0,0,1)\), form each triangle in the overhang mesh originating from the centroid or optionally each triangle vertex by setting the 

The support moment area is a metric, which projects the distance from the baseplate (\(z=0\)) for each support surface multiplied by the area. 

Performs a Boolean CSG difference operation using the pycork library between two meshes. 

Performs a Boolean CSG intersection operation using the pycork library between two meshes. 

Performs a Boolean CSG union operation using the pycork library between two meshes. 

A static helper function that converts PyClipper Paths into a single 

Extrudes a set of connected triangle faces into a prism. 

Generates the height map of the upper and lower depths. 

Generates the height map of the upper and lower depths. 
Generates a Shapely Polygon based on the extents of the bounding box of the object passed 


Returns a list of connected faces :type mesh: 

The support area is a metric of the total area of support surfaces, including the flattened or projected area. 

Utility which returns the inverse projection of the faces relative to the +ve Z direction in order to isolate side faces. 

Gets the overhang mesh from a 

Returns the support angles for each triangular face normal. 

Returns the list of paths and coordinates from a crosssection (i.e. 



Resolves all selfintersections within a meshn using the pycork library. 

A recursive function that sorts interior and exterior rings or paths from PyClipper ( 

Translate by an offset (x, y, z) . 

Perform triangulation on the input data tri. 

Function triangulates polygons generated natively by PyClipper, from 

Given a list of exterior and interiors triangulation using a python interface to triangle.c 

Triangulate a Shapely Polygon using a python interface to triangle.c. 

Classes¶
The BaseSupportGeneration class provides common methods used for generating the support structures ( 


The BlockSupportBase is a base class representing a single support volume region constructed by an extruded overhang region, that may intersect with the build platform (\(z=0\)) or selfintersect with 
The BlockSupportGenerator class provides common methods used for generating the ‘support’ structures typically used in Additive Manufacturing. 


Represents a block support that internally generates a grid truss structure representing the support structure. 
The GridBlockSupportGenerator class provides common methods used for generating the ‘support’ structures typically used in Metal Additive Manufacturing for block polygon regions. 


The Support Structure is the base class representing all definitions of support structures used in PySLM. 

Convert a function to be a static method. 
pyslm.visualise Module¶
Functions¶



Plots the all the scan vectors (contours and hatches) and point exposures for each Layer Geometry in a Layer using Matplotlib. 

Plots an effective heat map given the exposure points and at a given z position. 

Plots a list of 

Helper method for plotting polygons (numpy coordinates) and those composed of Python lists. 

Plots sequentially the all the scan vectors (contours and hatches) for all Layer Geometry in a Layer using Matplotlib. 