state_enums
state_enums ¶
All state-defining enumerations.
_to_region_variant_map
module-attribute
¶
_to_region_variant_map = {
Polarity.Clear: Polarity.ClearRegion,
Polarity.Dark: Polarity.DarkRegion,
}
_polarity_invert_map
module-attribute
¶
_polarity_invert_map = {
Polarity.Clear: Polarity.Dark,
Polarity.Dark: Polarity.Clear,
Polarity.ClearRegion: Polarity.DarkRegion,
Polarity.DarkRegion: Polarity.ClearRegion,
Polarity.DEBUG: Polarity.DEBUG2,
Polarity.DEBUG2: Polarity.DEBUG,
}
_2d_rasterized_color_map
module-attribute
¶
_2d_rasterized_color_map = {
"RESERVED_BLACK": 0,
"RESERVED_WHITE": 255,
Polarity.Dark: 240,
Polarity.Clear: 15,
Polarity.DarkRegion: 230,
Polarity.ClearRegion: 30,
Polarity.Background: 0,
Polarity.DEBUG: 127,
Polarity.DEBUG2: 75,
}
EnumFormatValue ¶
DrawMode ¶
Bases: EnumFormatValue
Drawing mode.
Source code in src/pygerber/gerberx3/state_enums.py
Linear
class-attribute
instance-attribute
¶
In linear plot mode a D01 operation generates a linear segment, from the current point to the (X, Y) coordinates in the command. The current point is then set to the (X, Y) coordinates.Outside a region statement the segment is stroked with the current aperture to create a draw graphical object. In a region statement the segment is added to the contour under construction.
ClockwiseCircular
class-attribute
instance-attribute
¶
In circular plot mode a D01 operation generates an arc segment, from the current point to the (X, Y) coordinates in the command. The current point is then set to the (X, Y) coordinates. Outside a region statement the segment is stroked with the current aperture to create an arc graphical object. In a region statement the segment is added to the contour under construction. For compatibility with older versions of the Gerber format, a G75* must be issued before the first D01 in circular mode.
CounterclockwiseCircular
class-attribute
instance-attribute
¶
In circular plot mode a D01 operation generates an arc segment, from the current point to the (X, Y) coordinates in the command. The current point is then set to the (X, Y) coordinates. Outside a region statement the segment is stroked with the current aperture to create an arc graphical object. In a region statement the segment is added to the contour under construction. For compatibility with older versions of the Gerber format, a G75* must be issued before the first D01 in circular mode.
Polarity ¶
Bases: EnumFormatValue
Aperture polarity.
Source code in src/pygerber/gerberx3/state_enums.py
Mirroring ¶
Unit ¶
ImagePolarityEnum ¶
Bases: EnumFormatValue
Image polarity.
Image Polarity (IP)¶
Note: The IP command is deprecated.
The IP command is responsible for setting the polarity for the entire image. It is
designed to be used only once, preferably at the very beginning of the file.
7.1.3.1 Positive Image Polarity¶
Under the positive image polarity: - The image is generated in accordance with the specifications provided elsewhere in this document. - It's worth noting that, by default, image generation has always assumed a positive image polarity.
7.1.3.2 Negative Image Polarity¶
When the negative image polarity is in use: - The intent is to produce an image that portrays clear areas against a dark backdrop. - The initial state of the entire image plane is dark, as opposed to being clear. - The polarity effects between dark and clear regions are interchanged. Essentially, what was dark becomes white and vice-versa. - For negative image polarity, the very first graphics object that gets produced must possess a dark polarity. As a result, it takes on the role of clearing the dark backdrop.