compat module#

Opt-in output adjustments for readers that deviate from the specification.

Every adjustment is off by default, and the default output is the one the specification describes. Adjustments are named for what they change in the output, never for a fabricator: which house needs which is that house’s library’s business.

class Compat(bake_macro_rotation=False)[source]#

Bases: object

The set of adjustments in effect for one export.

Parameters:

bake_macro_rotation (bool) – write rotated pads as macros with the rotation applied to the primitive coordinates and no rotation parameter, for readers that mishandle the macro rotation argument. Each distinct angle of a shape becomes its own macro.

bake_macro_rotation: bool = False#
classmethod from_names(names)[source]#

The adjustments named, as on the command line (bake-macro-rotation).

Raises:

ValueError – a name is not a known adjustment, listing the known ones.

Return type:

Compat

Parameters:

names (Iterable[str])

property names: tuple[str, ...]#

The command-line names of the adjustments in effect, sorted.

DEFAULT = Compat(bake_macro_rotation=False)#

the output the specification describes.

Type:

No adjustments