Skip to content

Commit

Permalink
[fix] Removal of BaseHatcher._getChildPaths
Browse files Browse the repository at this point in the history
Depreciated function with the transition to pyclipr
  • Loading branch information
drlukeparry committed Dec 10, 2023
1 parent 7ac9e4f commit f63169f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 30 deletions.
28 changes: 2 additions & 26 deletions pyslm/hatching/hatching.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,29 +199,6 @@ def error(cls) -> float:
"""
return 1. / cls.PYCLIPPER_SCALEFACTOR

@staticmethod
def _getChildPaths(poly):

offsetPolys = []

# Create single closed polygons for each polygon
paths = [path.Contour for path in poly.Childs] # Polygon holes
paths.append(poly.Contour) # Path holes

# Append the first point to the end of each path to close loop
for path in paths:
path.append(path[0])

paths = BaseHatcher.scaleFromClipper(paths)

offsetPolys.append(paths)

for polyChild in poly.Childs:
if len(polyChild.Childs) > 0:
for polyChild2 in polyChild.Childs:
offsetPolys += BaseHatcher._getChildPaths(polyChild2)

return offsetPolys

@staticmethod
def offsetPolygons(polygons, offset: float):
Expand Down Expand Up @@ -366,7 +343,6 @@ def clipContourLines(paths, contourPaths: List[np.ndarray]):

return outPaths


def generateHatching(self, paths, hatchSpacing: float, hatchAngle: Optional[float] = 90.0) -> np.ndarray:
"""
Generates un-clipped hatches which is guaranteed to cover the entire polygon region base on the maximum extent
Expand Down Expand Up @@ -1005,11 +981,11 @@ class BasicIslandHatcher(Hatcher):
(:attr:`.islandWidth`) which covers a region. This a common scan strategy adopted across SLM systems.
This has the effect of limiting the max length of the scan whilst by orientating the scan vectors orthogonal
to each other mitigating any preferential distortion or curling in a single direction and any
effects to micro-structure.
effects to microstructure.
:note:
This method is not optimal and is provided as a reference for the user to improve their own understand and
This method is not optimal and is provided as a reference for the user to improve their own understanding and
develop their own island scan strategies. For optimal performance, the user should refer instead to
:class:`IslandHatcher`
Expand Down
8 changes: 4 additions & 4 deletions pyslm/hatching/islandHatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ def hatch(self) -> np.ndarray:

class IslandHatcher(Hatcher):
"""
IslandHatcher extends the standard :class:`Hatcher` but generates a set of islands of fixed size (:attr:`~.islandWidth`)
which covers a region. This a common scan strategy adopted across SLM systems. This has the effect of limiting the
maximum length of the scan whilst by orientating the scan vectors orthogonal to each other mitigating any
preferential distortion or curling in a single direction and any effects to micro-structure.
IslandHatcher extends the standard :class:`Hatcher` but generates a set of islands of fixed size
(:attr:`islandWidth`) which covers a region. This a common scan strategy adopted across SLM systems.
This has the effect of limiting the maximum length of the scan vectors whilst by orientating the scan vectors
orthogonal to each other mitigating any preferential distortion or curling due to residual in a single direction and any effects to the microstructure.
"""

def __init__(self):
Expand Down

0 comments on commit f63169f

Please sign in to comment.