BlockSupportGenerator

class pyslm.support.BlockSupportGenerator

Bases: pyslm.support.support.BaseSupportGenerator

The BlockSupportGenerator class provides common methods used for generating the ‘support’ structures typically used in Additive Manufacturing. Derived classes can build directly upon this by either using existing BlockSupports generated or redefining the overall support geometry created underneath overhang regions.

After passing the geometry and setting the required parameters, the user is required to call identifySupportRegions() in order to generate the support volumes.

In summary, the technique identifies first overhang surface regions on the mesh geometry provided based on the chosen overhangAngle. From these identified overhang surfaces, extruded prisms are generated and are then intersected with the original part in both \(+Z\) and \(-Z\) directions using the Cork library. This provides a method to approximately isolate regions and fundamentally decide if the supports are self-intersecting (SupportStructure.intersectsPart). Non-intersecting regions are connected to the build-plate only and are excluded from further processsing.

Each of these regions are then ray traced using an OpenGL depth technique to identify the support regions using the private method _identifySelfIntersectionHeightMap().

Intersecting regions with the part are identified and these can be more smartly separated based on a tolerance (gradThreshold()) calculated from the equivalent ray or rasterised projection resolution rayProjectionResolution and overhangAngle previously defined. Regions identified are simplified from a calculated heightMap image and then approximate support extrusions are generated that intersect with the originating part by adding Z-offsets (lowerProjectionOffset and upperProjectedOffset).

Finally, these exturded regions are intersected with the part using the Cork library to produce the final BlockSupportBase that precisely conforms the boundary of the part if there are self-intersections.

Attributes Summary

innerSupportEdgeGap

The inner support gap is the distance between adjacent supports regions that are identified as separated by a significant vertical extent.

lowerProjectionOffset

The offset applied to the lower projection used to provide a clean intersection when performing the final boolean intersection between the original geometry and the extruded support volume geometry.

minimumAreaThreshold

The minimum support area threshold (\(mm^2\)) used to identify disconnected support regions.

outerSupportEdgeGap

The offset applied to the projected boundary of the support volume.

overhangAngle

The overhang angle (degrees) used for identifying support surfaces on the Part

rayProjectionResolution

The equivalent ray projection resolution used to discretise the projected support region using the OpenGL rasterisation.

simplifyPolygonFactor

The simplification factor used for simplifying the boundary polygon generated from the rasterisation process.

splineSimplificationFactor

The simplification factor using a spline approximation approach for smoothening the support volume boundary

triangulationSpacing

The spacing factor used whilst triangulating the support polygon region.

upperProjectionOffset

An internal parameter used for defining an offset applied to the upper projection used to provide a clean intersection when performing the final boolean intersection between the original geometry and the extruded support volume geometry.

Methods Summary

filterSupportRegion(region)

Not implemented

generateIntersectionHeightMap()

Not implemented

gradThreshold(rayProjectionDistance, …)

A static method which defines the threshold applied to the gradient generated from the support depth map, which separates each support volume region.

identifySupportRegions(part, overhangAngle)

Extracts the overhang mesh and generates block regions given a part and target overhang angle.

Attributes Documentation

innerSupportEdgeGap

The inner support gap is the distance between adjacent supports regions that are identified as separated by a significant vertical extent.

Return type:

float

lowerProjectionOffset

The offset applied to the lower projection used to provide a clean intersection when performing the final boolean intersection between the original geometry and the extruded support volume geometry.

Return type:

float

minimumAreaThreshold

The minimum support area threshold (\(mm^2\)) used to identify disconnected support regions. Support regions with a smaller area will be excluded and not generated.

Return type:

float

outerSupportEdgeGap

The offset applied to the projected boundary of the support volume.

Return type:

float

overhangAngle

The overhang angle (degrees) used for identifying support surfaces on the Part

Return type:

float

rayProjectionResolution

The equivalent ray projection resolution used to discretise the projected support region using the OpenGL rasterisation. This can be adjusted accordingly depending on the overall scale and size of the Part, although this is mostly insignificant due to the relatively high performance using OpenGL.

The resolution should be selected to appropriately capture the complexity of the features within the part.

Note

There is a restriction based on the maximum framebuffer size available in OpenGL.

Return type:

float

simplifyPolygonFactor

The simplification factor used for simplifying the boundary polygon generated from the rasterisation process. This has the effect of reducing the complexity of the extruded support volume generated that is intersected with the Part.

Return type:

float

splineSimplificationFactor

The simplification factor using a spline approximation approach for smoothening the support volume boundary

Return type:

float

triangulationSpacing

The spacing factor used whilst triangulating the support polygon region.

Return type:

float

upperProjectionOffset

An internal parameter used for defining an offset applied to the upper projection used to provide a clean intersection when performing the final boolean intersection between the original geometry and the extruded

support volume geometry.

Return type:

float

Methods Documentation

filterSupportRegion(region)

Not implemented

generateIntersectionHeightMap()

Not implemented

static gradThreshold(rayProjectionDistance, overhangAngle)

A static method which defines the threshold applied to the gradient generated from the support depth map, which separates each support volume region. This is based on a combination of the ray projection resolution, the overhang angle and an arbitrary constant to ensure discrete regions are isolated.

Parameters:
  • rayProjectionDistance (float) – The ray projection resolution used

  • overhangAngle (float) – The overhang angle [degrees]

Return type:

float

Returns:

The gradient threshold used.

identifySupportRegions(part, overhangAngle, findSelfIntersectingSupport=True)

Extracts the overhang mesh and generates block regions given a part and target overhang angle. The algorithm uses a combination of boolean operations and ray intersection/projection to discriminate support regions. If findSelfIntersectingSupport is to set True (default), the algorithm will process and separate overhang regions that by downward projection self-intersect with the part. This provides more refined behavior than simply projected support material downwards into larger support block regions and separates an overhang surface between intersecting and non-intersecting regions.

Parameters:
  • part (Part) – Part for generating support structures for

  • overhangAngle (float) – Overhang angle (degrees)

  • findSelfIntersectingSupport (Optional[bool]) – Generates supports that intersect with the part

Return type:

List[BlockSupportBase]

Returns:

A list of BlockSupports