pyslm.analysis Package

Functions

getEffectiveLaserSpeed(bstyle)

Returns the effective laser speed given a BuildStyle using the point distance and point exposure time.

getIntraLayerGeometryJumpLength(layer)

Returns the intra-layer geometry jump length across the entire Layer

getLayerGeomTotalJumps(layerGeom)

Returns the total number of scan jumps across a LayerGeometry.

getLayerGeometryJumpDistance(layerGeom)

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

getLayerGeometryPathLength(layerGeom)

Calculates the total path length scanned by the laser across a single LayerGeometry and is used for 1D geometry types i.e. HatchGeometry and ContourGeometry.

getLayerGeometryTime(layerGeom, models[, ...])

Returns the total time taken to scan across a LayerGeometry.

getLayerJumpLength(layer)

Returns the total jump length across the Layer

getLayerPathLength(layer)

Returns the total path length across the Layer

getLayerTime(layer, models[, ...])

Returns the total time taken to scan across a Layer.

Classes

Iterator(models, layers)

Basic Iterator which parses through both a list of Layer and LayerGeometry groups and incrementally goes through the geometry based on time values generated in conjunction with the associated Model.

LaserState()

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 BuildStyle and whether it is active/firing which may happen during the layer dwell time.

LayerGeometryIterator(models, layers)

ScanIterator(models, layers)

The Scan Iterator class provides funtionality to iterate at a variable timestep across a build file consisting of a Layer list and Model provided as its input.

ScanVectorIterator(layers)

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

TimeNode([parent, id, value])

The TimeNode class provides a structure for storing the pre-calculated time of a Layer or LayerGeometry structure, which is stored in TimeNode.time.

pyslm.core Module

Classes

Any(*args, **kwargs)

Special type indicating an unconstrained type.

Document()

DocumentObject(name)

Part(name)

Part represents a solid geometry within the document object tree.

pyslm.geometry Package

Functions

createLayerDict(layerList)

Create a dict from a list of Layers with a key (LayerId) and the corresponding Layer as a value.

getBuildStyleById(models, mid, bid)

Returns the BuildStyle found from a list of Model given a model id and buildstyle BuildStyle.bid.

getLayerById(layers, layerId)

Convenience function that locates the Layer within a list given a provided layer id by searching across Layer.layerId

getModel(models, mid)

Returns the Model found from a list of Model given a model id and build id.

mergeLayers(layerLists)

Merges a list of Layers - typically from separate parts into a unified layer.

transformLayerGeoms(layerGeoms, transform)

Apply a transformation in-situ to LayerGeometry objects

translateLayerGeoms(layerGeoms, translation)

Apply a translation in-situ to LayerGeometry objects

Classes

BuildStyle()

A BuildStyle represents a collection of laser parameters used for scanning across a single LayerGeometry.

ContourGeometry([mid, bid, coords])

ContourGeometry represents a LayerGeometry consisting of a series of connected coordinates \([(x_0,y_0), ..., (x_{n-1},x_{n-1})]\) representing a continuous line.

HatchGeometry([mid, bid, coords])

HatchGeometry represents a LayerGeometry consisting of a series coordinates pairs \([(x_0,y_0), (x_1,x_2)]\) representing the start and end points of a scan vectors.

Header()

The Header provides basic information about the machine build file, such as the name of the file (filename), version and the zUnit used for calculating the actual Layer z position in the machine.

LaserMode()

Layer([z, id])

A Layer represents a slice in the printing process for L-PBF.

LayerGeometry([mid, bid, coords])

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

Model([mid])

A Model represents a parametric group or in practice a part which contains a set unique and assignable BuildStyle used a specific LayerGeometry.

ModelValidator()

ModelValidator takes the data structures in pyslm.geometry such as a list of Layer and Model and validates their input for consistency when utilised together to form a machine build file prior to exporting using libSLM.

PointsGeometry([mid, bid, coords])

PointsGeometry represents a LayerGeometry consisting of a series of discrete or disconnected exposure points \([(x_0,y_0), ..., (x_{n-1},x_{n-1})]\) .

pyslm.hatching Package

Functions

approximate_polygon(coords, tolerance)

Approximate a polygonal chain with the specified tolerance.

clipper2Paths(paths, scaleFactor[, close])

Returns scaled closed paths from clipper paths

from3DHatchArray(hatchVectors)

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

getExposurePoints(layer, models[, ...])

A utility method to return a list of exposure points given a Layer with an associated Model which contains the BuildStyle that provides the point exposure distance or an effective laser speed to spatially discretise the scan vectors into a series of points.

isValidHatchArray(hatchVectors)

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

paths2clipper(paths)

Converts a list of paths to clipper format input

pathsToClosedPolygons(paths)

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

poly2Paths(polygons)

Converts a Shapely Polygon or MultiPolygon to a list of paths

simplifyBoundaries(paths[, tolerance, method])

Simplify the boundaries of paths using Douglas-Peucker algorithm provided by the scikit-image library or an internal method within shapely.

to3DHatchArray(hatchVectors)

Utility to reshape a flat 2D hatch vector array into a 3D array to allow manipulation of individual vectors

Classes

AlternateSort()

Sort method flips pairs of scan vectors so that their direction alternates across adjacent vectors.

Any(*args, **kwargs)

Special type indicating an unconstrained type.

BaseHatcher()

The BaseHatcher class provides common methods used for generating the 'contour' and infill 'hatch' scan vectors for a geometry slice typically a multi-polygon region.

BasicIslandHatcher()

The class extends the standard Hatcher but generates a set of islands of fixed size ( islandWidth) which covers a region.

FlipSort()

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

GreedySort([hatchAngle, hatchTol])

The greedy sort approach is a heuristic approach to sorting the scan vectors based on the current hatch angle specified in pyslm.hatching.sorting.LinearSort.hatchAngle and clustering vectors together based on the hatch group distance - pyslm.hatching.sorting.LinearSort.hatchTol.

HatchDirectionalSort()

Sort method flips pairs of scan vectors so that their direction alternates across adjacent vectors.

Hatcher()

The class provides a generic Hatcher 'recipe' with standard parameters specified for defining the hatch across regions.

InnerHatchRegion()

The InnerHatchRegion class provides a representation for a single sub-region used for efficiently generating various sub-scale hatch infills.

Island([origin, orientation, islandWidth, ...])

Island represents a square sub-region containing a series of orthogonal hatches which represents a typically a checkerboard scan strategy.

IslandHatcher()

IslandHatcher extends the standard Hatcher but generates a set of islands of fixed size (islandWidth) which covers a region.

LinearSort([hatchAngle])

A linear sort approaches to sorting the scan vectors based on the current hatch angle specified in pyslm.hatching.sorting.LinearSort.hatchAngle.

StripeHatcher()

The Stripe Hatcher extends the behavior of the standard Hatcher for generating a 'stripe' scan strategy, which generates a set of an infill of hatches of a fixed width (stripeWidth) to cover a region.

UnidirectionalSort()

Method simply passes the hatch vectors in their current form.

pyslm.support Package

Functions

approximateProjectionSupportCost(part, ...)

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

approximateSupportMapByCentroid(part, ...[, ...])

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 includeTriangleVertices parameter.

approximateSupportMomentArea(part, overhangAngle)

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

extrudeFace(extrudeMesh[, height, heightArray])

Extrudes a set of connected triangle faces into a prism.

generateHeightMap(mesh[, upVec, resolution, ...])

Generates the height map of the upper and lower depths.

generateHeightMap2(mesh[, upVec, ...])

Generates the height map of the upper and lower depths.

getAdjacentFaces(mesh)

Returns a list of connected faces :type mesh: Trimesh :param mesh: A Trimesh mesh for locating the connected faces

getApproximateSupportArea(part, overhangAngle)

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

getFaceZProjectionWeight(mesh[, useConnectivity])

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

getOverhangMesh(part, overhangAngle[, ...])

Gets the overhang mesh from a Part.

getSupportAngles(part[, unitNormal, ...])

Returns the support angles for each triangular face normal.

projectHeightMap(mesh[, resolution, ...])

translate(offset[, dtype])

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

Classes

BaseSupportGenerator()

The BaseSupportGeneration class provides common methods used for generating the support structures (SupportStructure) typically used in Additive Manufacturing.

BlockSupportBase([supportObject, ...])

The BlockSupportBase is a base class representing a single support volume region constructed by an extruded overhang surface region, that may intersect with the build platform (\(z=0\)) or self-intersect with the original mesh of the Part.

BlockSupportGenerator()

The BlockSupportGenerator class provides common methods used for generating the 'support' structures typically used in Additive Manufacturing.

GridBlockSupport([supportObject, ...])

Represents a block support that internally generates a grid truss structure representing the support structure.

GridBlockSupportGenerator()

The GridBlockSupportGenerator class provides common methods used for generating the 'support' structures typically used in Metal Additive Manufacturing for block polygon regions.

SupportStructure([supportObject, ...])

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

pyslm.visualise Module

Functions

getContoursFromShapelyPolygon(poly[, mergeRings])

Returns the contours from boundaries extracted from exterior and interior paths of shapely geometry.

plot(layer[, zPos, plotContours, ...])

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

plotHeatMap(part, z, exposurePoints[, ...])

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

plotLayers(layers[, plotContours, ...])

Plots a list of Layer, specifically the scan vectors (contours and hatches) and point exposures for each LayerGeometry using Matplotlib.

plotPolygon(polygons[, zPos, lineColor, ...])

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

plotSequential(layer[, plotArrows, ...])

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