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 Layer

getLayerGeomTotalJumps(layerGeom)

Returns the number of 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

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.

Iterator(models, layers)

Basic Iterator which parses through both 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.

Layer([z, id])

Slice Layer is a simple class structure for containing a set of SLM LayerGeometry including specific derivatives including: ContourGeometry, HatchGeometry, PointsGeometry types stored in geometry and also the current slice or layer position in z.

LayerGeometry([mid, bid, coords])

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

LayerGeometryIterator(models, layers)

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.

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})]\) .

ScanIterator(models, layers)

The Scan Iterator class provides a method to iterate at a variable timestep across a BuildFile consisting of list of Layer and Model provided as the input.

ScanVectorIterator(layers)

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.

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

ConvexHull(points[, incremental, qhull_options])

Convex hulls in N dimensions.

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 id.

getLayerById(layers, layerId)

Finds the Layer within a list given an id

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.

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])

Slice Layer is a simple class structure for containing a set of SLM LayerGeometry including specific derivatives including: ContourGeometry, HatchGeometry, PointsGeometry types stored in geometry and also the current slice or layer position in z.

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 pyslm.geometry data structures such as a list of Layer and Model and validates their input for consistency when utilised together to form a 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.

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

pathsToClosedPolygons(paths)

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

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.

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()

BasicIslandHatcher 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.

Hatcher()

Provides a generic SLM Hatcher ‘recipe’ with standard parameters 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()

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 standard Hatcher but generates a set of stripe 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.

boolDiff(meshA, meshB)

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

boolIntersect(meshA, meshB)

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

boolUnion(meshA, meshB)

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

createPath2DfromPaths(paths)

A static helper function that converts PyClipper Paths into a single trimesh.path.Path2D object.

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.

generatePolygonBoundingBox(bbox)

Generates a Shapely Polygon based on the extents of the bounding box of the object passed

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.

path2DToPathList(shapes)

Returns the list of paths and coordinates from a cross-section (i.e.

projectHeightMap(mesh[, resolution, …])

resolveIntersection(meshA)

Resolves all self-intersections within a meshn using the pycork library.

sortExteriorInteriorRings(polyNode[, …])

A recursive function that sorts interior and exterior rings or paths from PyClipper (pylcipper.PyPolyNode)` objects.

translate(offset[, dtype])

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

triangulate(tri[, opts])

Perform triangulation on the input data tri.

triangulatePolygon(section[, closed])

Function triangulates polygons generated natively by PyClipper, from pyclipper.PyPolyNode objects.

triangulatePolygonFromPaths(exterior, interiors)

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

triangulateShapelyPolygon(polygon[, …])

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

triangulate_float32(arg0, arg1)

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 region, that may intersect with the build platform (\(z=0\)) or self-intersect with 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.

staticmethod(function)

Convert a function to be a static method.

pyslm.visualise Module

Functions

getContoursFromShapelyPolygon(poly[, mergeRings])

rtype:

Tuple[ndarray, ndarray]

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.