fibomat.curve_tools.rasterize module#
Provide rasterization routines.
- fibomat.curve_tools.rasterize.rasterize(curve: Shape, pitch: float) RasterizedPoints[source]#
Rasterize the outline of a Shape with a given pitch uniformly.
For this, the shape must be convertible to an ArcSpline or must have a rasterize method expecting the pitch as input.
- Args:
curve (Shape): curve pitch (float): pitch (spacing of points)
- Returns:
RasterizedPoints
- Raises:
ValueError: Raised if curve is no ArcSpline, ArcSplineCompatible or not have a rasterize method.
- fibomat.curve_tools.rasterize.rasterize_with_const_error(curve: ArcSpline, error: float) Polyline | Polygon[source]#
Convert a arc spline to polygon or polyline.
- Args:
curve: arc spline error: maximum distance between curve an returned polyine/polygon
- Returns:
Polygon if arc spline is closed and polyline otherwise
- fibomat.curve_tools.rasterize.fill_with_lines(shape: ArcSpline | HollowArcSpline, pitch: float, alpha: float, invert: bool, seed: Vector | Iterable[float] | None = None) List[List[Line]][source]#
Fill a closed shape with lines which are rotated by alpha-
- Args:
shape (Union[ArcSpline, HollowArcSpline]): closed curve to be filled pitch (float): distance between lines alpha (float): rotation angle of lines with respect to x-axis invert (bool):
- Returns:
List[ArcSpline]
- Raises:
ValueError: Raised if angle < 0 or angle > pi. NotImplementedError: Raised if some kind of singularities occur. This can be fixed (probably) if the shape is
rotated.