GridBlockSupport

class pyslm.support.GridBlockSupport(supportObject=None, supportVolume=None, supportSurface=None, intersectsPart=False)

Bases: BlockSupportBase

Represents a block support that internally generates a grid truss structure representing the support structure. The grid is generated by taking a sequence of cross-sections at a fixed distance (gridSpacing) from the generated support volume (supportVolume).

The 2D slices along the grid are generated in generateSupportSlices() and produce a 2D grid of cross-sections as polygons. Each polygon slice can be designed to include patterns such as perforation holes or a truss network. Potentially the 2D slices may be extruded and offset to increase the support strength, if required. A surrounding border with a conformal truss grid is also generated using generateSupportSkins().

A truss network is generated to reduce the amount of support material processed, but additionally provides internal perforations which aid powder support removal after production. The truss network in 2D is generated along with supporting functions for creating a mesh. The generation of the truss grid is relatively expensive to generated compared to the polygon intersection and may be disabled by setting generateTrussGrid).

Furthermore, penetrating teeth located at the upper and lower intersection of the support volume can be generated to ease support removal for metal AM processes. A variety of configurable options are included to vary the geometry. The tooth sizes may be specified using supportTeethHeight, supportTeethTopLength, supportTeethBottomLength, supportTeethBaseInterval and an additional self-penetration distance ( supportTeethUpperPenetration and supportTeethLowerPenetration) to enhance the strength of the support by over- scanning material within the solid part internally. The tooth profile is repeated across the upper edge of the intersected support volume using an internal overrideable function toothProfile(). The generation of support teeth on the upper and lower surfaces may be individually toggled by setting useUpperSupportTeeth and useLowerSupportTeeth respectively. If the user desires to strengthen the support near the upper and lower surfaces near the support teeth, and additional offsetting can be applied using supportWallThickness.

The truss is designed to self-intersect at set distance based on both the trussAngle and the gridSpacing so that they combine as a consistently connected support mesh. Upon generating a polygon for each support slice, this is triangulated via triangulatePolygon() to create a mesh which may be sliced and hatched later. Optionally these may be combined into a single mesh, for exporting externally.

Attributes Summary

borderGeometry

The support skin (around the boundary) for the support volume

generateTrussGrid

Set to True to generate the truss grid, otherwise the support volume.

gridSpacing

The spacing of the grid truss structure within the block support .

mergeMesh

Determines if the support truss geometry should be merged together into a connected unified mesh"

numSkinMeshSubdivideIterations

Number of times to subdivide the exterior skin of the support mesh to increase the resolution to improve the quality of output mesh in order for this to conform with the boundary of the support block volume.

sliceGeometry

The grid composed of trusses in both the X and Y orientations.

supportBorderDistance

The offset used when generating a border or support skin for each truss slice in the support block.

supportTeethBaseInterval

The gap between the base of the tooth.

supportTeethBottomLength

The bottom span or length of the perforated support teeth

supportTeethHeight

The height of the perforated support teeth

supportTeethTopLength

The upper span or length of the perforated support teeth

supportTeethUpperPenetration

Vertical (\(+Z\)) penetration of the support teeth into the intersecting part mesh.

supportWallThickness

An offset thickness applied to the lower and upper edges adjacent to the perforated teeth of the supports to provide additional strength

trussAngle

The angle (degrees) used for generating the truss structures used in the support structure.

trussWidth

The width of a strut in the truss network

useLowerSupportTeeth

Determines if the penetrating support teeth should be generated on the lower surface of the support volume

useSupportBorder

Generates a border around the each truss grid

useSupportSkin

Generates a support skin around the extruded boundary of the support

useUpperSupportTeeth

Determines if the penetrating support teeth should be generated on the upper surface of the support volume

Methods Summary

clipLines(paths, lines)

Clips a series of lines (hatches) across a closed polygon or set of paths.

concatenateMeshes(meshList)

Utility function which concatenates a list of truss meshes into a single mesh

generateGridSlices()

Slices the support volume (supportVolume) in a grid based on gridSpacing.

generateMeshGrid(poly[, hatchSpacing, ...])

Generates a grid mesh i.e. a series of hatches to fill a polygon region in order to generate a truss network used as part of a support truss structure.

generateSliceBoundingBoxPolygon(section)

Generates an equivalent 2D Polygon bounding box of the support geometry volume transformed correctly into the local coordinate system of each grid slice by inversion of the internally stored transformation matrix in trimesh.path.Path2D.

generateSliceGeometry(section)

Generates a truss grid used as a 2D slice used for generating a section as part of a support structures.

generateSliceGeometryDepr(section)

Exists as a reference to how this can be performed using Shapely.Geometry.Polygon Objects

generateSupportSkinInfill(myPolyVerts[, ...])

Generates a standard truss grid infill for a support border boundary has been previously flattened prior to applying a 'wrapping' transformation projecting the 2D skin into the 3D support

generateSupportSkins()

Generates the border or boundary wall of a block support structure with a truss structure for perforations for material removal.

generateSupportSlices()

Generates the XY Grid of Support truss slice meshes for generating the interior of each support.

geometry()

The geometry for the support structure.

holeGeometry()

Depreciated function

section_multiplane(volume, plane_origin, ...)

slice(meshSupports, z)

Slices the Grid Truss Structure including boundaries and the internal truss grid at a given Z position.

toothProfile()

The 2D profile of a tooth used along the edge profile when generating the profile for the skin and the planar truss structure.

Attributes Documentation

borderGeometry

The support skin (around the boundary) for the support volume

generateTrussGrid

Set to True to generate the truss grid, otherwise the support volume.

gridSpacing

The spacing of the grid truss structure within the block support .

mergeMesh

Determines if the support truss geometry should be merged together into a connected unified mesh”

numSkinMeshSubdivideIterations

Number of times to subdivide the exterior skin of the support mesh to increase the resolution to improve the quality of output mesh in order for this to conform with the boundary of the support block volume. The default value is 2.

sliceGeometry

The grid composed of trusses in both the X and Y orientations.

supportBorderDistance

The offset used when generating a border or support skin for each truss slice in the support block.

supportTeethBaseInterval

The gap between the base of the tooth.

supportTeethBottomLength

The bottom span or length of the perforated support teeth

supportTeethHeight

The height of the perforated support teeth

supportTeethTopLength

The upper span or length of the perforated support teeth

supportTeethUpperPenetration

Vertical (\(+Z\)) penetration of the support teeth into the intersecting part mesh.

supportWallThickness

An offset thickness applied to the lower and upper edges adjacent to the perforated teeth of the supports to provide additional strength

trussAngle

The angle (degrees) used for generating the truss structures used in the support structure.

trussWidth

The width of a strut in the truss network

useLowerSupportTeeth

Determines if the penetrating support teeth should be generated on the lower surface of the support volume

useSupportBorder

Generates a border around the each truss grid

useSupportSkin

Generates a support skin around the extruded boundary of the support

useUpperSupportTeeth

Determines if the penetrating support teeth should be generated on the upper surface of the support volume

Methods Documentation

static clipLines(paths, lines)

Clips a series of lines (hatches) across a closed polygon or set of paths. It is an overloaded function for internally clipping hatches according to a pyclipr supported path.

Parameters:
  • paths (Any) – The set of boundary paths for trimming the lines

  • lines (ndarray) – The un-trimmed lines to clip from the boundary

Return type:

List[ndarray]

Returns:

A list of trimmed lines (open paths)

concatenateMeshes(meshList)

Utility function which concatenates a list of truss meshes into a single mesh

Parameters:

meshList (List[Trimesh]) – A list of meshes to concatenate

Return type:

Trimesh

Returns:

generateGridSlices()

Slices the support volume (supportVolume) in a grid based on gridSpacing.

Return type:

Tuple[List[Path2D], List[Path2D]]

Returns:

Returns a tuple of the X and Y Grid Slice

static generateMeshGrid(poly, hatchSpacing=5.0, hatchAngle=45.0)

Generates a grid mesh i.e. a series of hatches to fill a polygon region in order to generate a truss network used as part of a support truss structure. The mesh grid is offset to create the truss.

The polygon bounding box of the Shapley Polygon is generated, and the a hatch grid with a separation distance of hatchSpacing is generated to guarantee filling this bounding box region at any required hatchAngle.

Parameters:
  • poly (Polygon) – A Shapley Polygon consisting of a polygon or path to fill with hatches

  • hatchSpacing (float) – The hatch spacing using to generate the truss network

  • hatchAngle (float) – The hatch angle to generate truss network with

Return type:

ndarray

Returns:

The hatch lines that completely fills the geometry

generateSliceBoundingBoxPolygon(section)

Generates an equivalent 2D Polygon bounding box of the support geometry volume transformed correctly into the local coordinate system of each grid slice by inversion of the internally stored transformation matrix in trimesh.path.Path2D. This provides a consistent centroid or local origin for generating the truss frame across the entire support volume.

Parameters:

section (Path2D) – A trimesh Path2D cross-section consisting of a 3D transformation matrix

Return type:

Polygon

Returns:

A 2D polygon representing the bounding box of the support geometry volume.

generateSliceGeometry(section)

Generates a truss grid used as a 2D slice used for generating a section as part of a support structures.

Parameters:

section (Path2D) – The polygon section of slice through the geometry

Return type:

Optional[List[ndarray]]

Returns:

The paths of the truss geometry

generateSliceGeometryDepr(section)

Exists as a reference to how this can be performed using Shapely.Geometry.Polygon Objects

Parameters:

section (Polygon)

Return type:

Path2D

Returns:

generateSupportSkinInfill(myPolyVerts, returnPolyNodes=False)

Generates a standard truss grid infill for a support border boundary has been previously flattened prior to applying a ‘wrapping’ transformation projecting the 2D skin into the 3D support

Parameters:
  • returnPolyNodes (bool) – If set to True, the function will return the PolyNode tree structure

  • myPolyVerts (ndarray) – A single boundary of coordinates representing the

Return type:

Tuple[ndarray, ndarray]

Returns:

A mesh (vertices, faces) of the triangulated truss support order.

generateSupportSkins()

Generates the border or boundary wall of a block support structure with a truss structure for perforations for material removal.

Return type:

List[Trimesh]

Returns:

A trimesh.Trimesh object containing the mesh of the generated support boundary

generateSupportSlices()

Generates the XY Grid of Support truss slice meshes for generating the interior of each support.

Return type:

Tuple[Trimesh, Trimesh]

Returns:

A tuple of X,Y grid slices

geometry()

The geometry for the support structure. This resolve the entire connectivity of the support truss meshes used by performing a boolean Union operation on the collection of meshes generated when the attribute mergeMesh option is set True. Otherwise, the truss structure is merged as overlapping and non-connected meshes into a single trimesh.Trimesh mesh..

Return type:

Trimesh

Returns:

The support geometry mesh

static holeGeometry()

Depreciated function

Return type:

Polygon

section_multiplane(volume, plane_origin, plane_normal, heights)
static slice(meshSupports, z)

Slices the Grid Truss Structure including boundaries and the internal truss grid at a given Z position.

Note

Currently, this is a static member requiring the mesh to be generated prior to slicing. The supports are only sorted in the +ve X and Y directions, therefore take care when rotating meshes beyond 45 degrees.

Note

The scan order is not currently filtered or sorted in a predefined way and will be implemented in the future.

Parameters:
  • z (float) – Position to slize the geometry in Z

  • meshSupports (List[Trimesh]) – A list of trimesh.Trimesh objects

Returns:

A tuple of the internal truss grid and the boundary truss grid slices

toothProfile()

The 2D profile of a tooth used along the edge profile when generating the profile for the skin and the planar truss structure. This can be overriden in a derived class to provide a custom pattern or design of tooth for use along the profile of the support generation.

Return type:

array