fibomat.curve_tools.rasterize module¶
Provide rasterization routines.
- fibomat.curve_tools.rasterize.rasterize(curve: fibomat.shapes.shape.Shape, pitch: float) fibomat.shapes.rasterizedpoints.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: fibomat.shapes.arc_spline.ArcSpline, error: float) Union[fibomat.shapes.polyline.Polyline, fibomat.shapes.polygon.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: Union[fibomat.shapes.arc_spline.ArcSpline, fibomat.shapes.hollow_arc_spline.HollowArcSpline], pitch: float, alpha: float, invert: bool, seed: Optional[Union[fibomat.linalg.vectors.vector.Vector, Iterable[float]]] = None) List[List[fibomat.shapes.line.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.