GridBlockSupport

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

Bases: pyslm.support.support.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 truss is designed to self-intersect at set distance based on both the trussAngle and the gridSpacing so that they combine together 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

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”

supportBorderDistance

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

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

useSupportBorder

Generates a border around the each truss grid

useSupportSkin

Generates a support skin around the extruded boundary of the support

Methods Summary

clipLines(paths, lines)

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

generateGridSlices()

Slices the support volume (supportVolume) in an 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 a support border boundary has has been previously flattened prior to a ‘wrapping’ transformation back into 3D.

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

Depreceated function

Attributes Documentation

gridSpacing

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

Return type:

List[float]

mergeMesh

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

Return type:

bool

supportBorderDistance

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

Return type:

float

trussAngle

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

Return type:

float

trussWidth

The width of a strut in the truss network

Return type:

float

useSupportBorder

Generates a border around the each truss grid

Return type:

bool

useSupportSkin

Generates a support skin around the extruded boundary of the support

Return type:

bool

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

generateGridSlices()

Slices the support volume (supportVolume) in an 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 (Optional[float]) – The hatch spacing using to generate the truss network

  • hatchAngle (Optional[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 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

Returns:

A Trimesh Path2D object of the truss geometry

generateSliceGeometryDepr(section)

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

Parameters:

section

Returns:

generateSupportSkinInfill(myPolyVerts)

Generates a standard truss grid infill a support border boundary has has been previously flattened prior to a ‘wrapping’ transformation back into 3D.

Parameters:

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:

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.

Returns:

A tuple of X,Y grid slices

geometry()

The geometry for the support structure. This resolve sthe 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()

Depreceated function