fibomat.default_backends.spotlist_backend module¶
- class fibomat.default_backends.spotlist_backend.SpotListBackend(save_impl: Optional[Callable] = None, base_dwell_time: Optional[pint.quantity.Quantity] = None, length_unit: Optional[pint.unit.Unit] = None, time_unit: Optional[pint.unit.Unit] = None, description: Optional[str] = None, **kwargs)[source]¶
Bases:
fibomat.backend.backendbase.BackendBase- __init__(save_impl: Optional[Callable] = None, base_dwell_time: Optional[pint.quantity.Quantity] = None, length_unit: Optional[pint.unit.Unit] = None, time_unit: Optional[pint.unit.Unit] = None, description: Optional[str] = None, **kwargs)[source]¶
Spotlist backend.
This backend rasterize all patterns and is able to output list of dwell points in the form of
x1, y1, t1 x2, y2, t2 ...
The exact formatting can be controlled by a custom formatting function.
The formatting function (called save_impl in class parameters) must have the following form
def func(filename: utils.PathLike, dwell_points: np.ndarray, parameters: Dict[str, Any]): # open the file `filename` and save dwell_points there ...
The parameter dictionary holds further metadata. For all available keys, see _default_save_impl in the sourcefile of the spotlist backend.
- Args:
save_impl (Callable, optional): custom formatting function. base_dwell_time (TimeQuantity, optional):
if given, the dwell times are autoamtically expressed as integer multiplicands of base_dwell_time.
length_unit (LengthQuantity, optional): length unit of points. time_unit (TimeQuantity, optional): time unit of dwell times. description (str, optional): description. **kwargs:
- process_site(new_site: fibomat.site.Site)[source]¶
Adds a
fibomat.site.Siteto the backend. Note, that this method processes all patterns contained in the site. Use the following example as reference, if a backend overwrites this method.... def process_site(self, site: Site): # ... # do the backend specific stuff here (e.g. initialize a new patterning site) # call base method to add all patterns automatically super().process_site(site) ...
- Args:
new_site (Site): site to be added.
- Returns:
None
- save(filename: Union[str, pathlib.Path]) None[source]¶
Saves the exported project to file. Args:
filename (PathLike): filename
- Returns:
None
- arc_spline(ptn: fibomat.pattern.Pattern[fibomat.shapes.arc_spline.ArcSpline]) None[source]¶
Adds pattern with ArcSpline as shape to the backend.
- Args:
ptn (Pattern): pattern with ArcSpline as shape
- Returns:
None
- rasterized_points(ptn: fibomat.pattern.Pattern[fibomat.shapes.rasterizedpoints.RasterizedPoints])[source]¶
Adds pattern with RasterizedPoints as shape to the backend.
- Args:
ptn (Pattern): pattern with RasterizedPoints as shape
- Returns:
None
- rasterized_pattern(ptn: fibomat.pattern.Pattern[fibomat.rasterizedpattern.RasterizedPattern])[source]¶
Adds pattern with RasterizedPattern as shape to the backend.
- Args:
ptn (Pattern): pattern with RasterizedPattern as shape
- Returns:
None
- spot(ptn: fibomat.pattern.Pattern[fibomat.shapes.spot.Spot]) None[source]¶
Adds pattern with Spot as shape to the backend.
- Args:
ptn (Pattern): pattern with Spot as shape
- Returns:
None
- line(ptn: fibomat.pattern.Pattern[fibomat.shapes.line.Line]) None[source]¶
Adds pattern with Line as shape to the backend.
- Args:
ptn (Pattern): pattern with Line as shape
- Returns:
None
- polyline(ptn: fibomat.pattern.Pattern[fibomat.shapes.polyline.Polyline]) None[source]¶
Adds pattern with Ellipse as shape to the backend.
- Args:
ptn (Pattern): pattern with Ellipse as shape
- Returns:
None
- polygon(ptn: fibomat.pattern.Pattern[fibomat.shapes.polygon.Polygon]) None[source]¶
Adds pattern with Ellipse as shape to the backend.
- Args:
ptn (Pattern): pattern with Ellipse as shape
- Returns:
None
- arc(ptn: fibomat.pattern.Pattern[fibomat.shapes.arc.Arc]) None[source]¶
Adds pattern with Arc as shape to the backend.
- Args:
ptn (Pattern): pattern with Arc as shape
- Returns:
None
- circle(ptn: fibomat.pattern.Pattern[fibomat.shapes.circle.Circle]) None[source]¶
Adds pattern with Ellipse as shape to the backend.
- Args:
ptn (Pattern): pattern with Ellipse as shape
- Returns:
None
- ellipse(ptn: fibomat.pattern.Pattern[fibomat.shapes.ellipse.Ellipse]) None[source]¶
Adds pattern with Ellipse as shape to the backend.
- Args:
ptn (Pattern): pattern with Ellipse as shape
- Returns:
None
- hollow_arc_spline(ptn: fibomat.pattern.Pattern[fibomat.shapes.hollow_arc_spline.HollowArcSpline]) None¶
Adds pattern with HollowArcSpline as shape to the backend.
- Args:
ptn (Pattern): pattern with HollowArcSpline as shape
- Returns:
None
- property implemented_shape_methods: Dict[fibomat.shapes.shape.Shape, Callable]¶
Dict[Shape, str]: implemented shape methods of backend
- parametric_curve(ptn: fibomat.pattern.Pattern[fibomat.shapes.parametric_curve.ParametricCurve]) None¶
Adds pattern with Curve as shape to the backend.
- Args:
ptn (Pattern): pattern with Curve as shape
- Returns:
None
- process_pattern(ptn: fibomat.pattern.Pattern) None¶
Add a pattern to the backend. The appropriate method is determined by the pattern’s shape class automatically.
If pattern contains a Layout, the contained shapes will be extracted automatically.
- Args:
ptn (Pattern): pattern to be added. on_unknown_shape:
- Returns:
None
- process_unknown(ptn: fibomat.pattern.Pattern) None¶
Process a shape, which do not have a registered shape handler. Raises an exception by default.
- Args:
ptn (Pattern): pattern to be added.
- Returns:
None
- property shape_methods: Dict[fibomat.shapes.shape.Shape, Callable]¶
Dict[Shape, str]: all (abstract) shape methods
- rect(ptn: fibomat.pattern.Pattern[fibomat.shapes.rect.Rect]) None[source]¶
Adds pattern with Rect as shape to the backend.
- Args:
ptn (Pattern): pattern with Rect as shape
- Returns:
None