fibomat.default_backends.bitmap_backend module#

class fibomat.default_backends.bitmap_backend.BitmapBackend(pixel_size: ~pint.util.Quantity = <Quantity(2, 'nanometer')>, description: str | None = None)[source]#

Bases: BackendBase

__init__(pixel_size: ~pint.util.Quantity = <Quantity(2, 'nanometer')>, description: str | None = None)[source]#
Args:
**kwargs: optional parameters for the backend given by **kwargs in

fibomat.project.Project.export()

save(filename: str)[source]#

Saves the exported project to file. Args:

filename (PathLike): filename

Returns:

None

image()[source]#
process_site(new_site: Site) None[source]#

Adds a fibomat.site.Site to 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

rect(ptn: Pattern[Rect]) None[source]#

Adds pattern with Rect as shape to the backend.

Args:

ptn (Pattern): pattern with Rect as shape

Returns:

None

arc(ptn: Pattern[Arc]) None#

Adds pattern with Arc as shape to the backend.

Args:

ptn (Pattern): pattern with Arc as shape

Returns:

None

arc_spline(ptn: Pattern[ArcSpline]) None#

Adds pattern with ArcSpline as shape to the backend.

Args:

ptn (Pattern): pattern with ArcSpline as shape

Returns:

None

circle(ptn: Pattern[Circle]) None#

Adds pattern with Ellipse as shape to the backend.

Args:

ptn (Pattern): pattern with Ellipse as shape

Returns:

None

ellipse(ptn: Pattern[Ellipse]) None#

Adds pattern with Ellipse as shape to the backend.

Args:

ptn (Pattern): pattern with Ellipse as shape

Returns:

None

hollow_arc_spline(ptn: Pattern[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[Shape, Callable]#

Dict[Shape, str]: implemented shape methods of backend

line(ptn: Pattern[Line]) None#

Adds pattern with Line as shape to the backend.

Args:

ptn (Pattern): pattern with Line as shape

Returns:

None

parametric_curve(ptn: Pattern[ParametricCurve]) None#

Adds pattern with Curve as shape to the backend.

Args:

ptn (Pattern): pattern with Curve as shape

Returns:

None

polygon(ptn: Pattern[Polygon]) None#

Adds pattern with Ellipse as shape to the backend.

Args:

ptn (Pattern): pattern with Ellipse as shape

Returns:

None

polyline(ptn: Pattern[Polyline]) None#

Adds pattern with Ellipse as shape to the backend.

Args:

ptn (Pattern): pattern with Ellipse as shape

Returns:

None

process_pattern(ptn: 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: 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

rasterized_pattern(ptn: Pattern[RasterizedPattern])#

Adds pattern with RasterizedPattern as shape to the backend.

Args:

ptn (Pattern): pattern with RasterizedPattern as shape

Returns:

None

rasterized_points(ptn: Pattern[RasterizedPoints])#

Adds pattern with RasterizedPoints as shape to the backend.

Args:

ptn (Pattern): pattern with RasterizedPoints as shape

Returns:

None

property shape_methods: Dict[Shape, Callable]#

Dict[Shape, str]: all (abstract) shape methods

spot(ptn: Pattern[Spot]) None#

Adds pattern with Spot as shape to the backend.

Args:

ptn (Pattern): pattern with Spot as shape

Returns:

None