ab_block_aperture
ab_block_aperture
¶
Block Aperture (AB) logic.
BlockApertureBegin
¶
Bases: CommandToken
4.11 Block Aperture (AB).¶
4.11.1 Overview of block apertures¶
The AB command creates a block aperture. The command stream between the opening and closing AB command defines a block aperture which is stored in the aperture dictionary. Thus the AB commands add an aperture to the dictionary directly, without needing an AD command. The LM, LR, LS and LP commands affect the flashes of block apertures as any other aperture: when a block aperture is flashed, it is first transformed according to the transformation parameters in the graphics state and then added to the object stream.
The origin of the block aperture is the (0,0) point of the file.
A block aperture is not a single graphical object but a set of objects. While a standard or macro aperture always adds a single graphical object to the stream, a block aperture can add any number of objects, each with their own polarity. Standard and macro apertures always have a single polarity while block apertures can contain both dark and clear objects.
If the polarity is dark (LPD) when the block is flashed then the block aperture is inserted as is. If the polarity is clear (LPC) then the polarity of all objects in the block is toggled (clear becomes dark, and dark becomes clear). This toggle propagates through all nesting levels. In the following example the polarity of objects in the flash of block D12 will be toggled.
A D03 of a block aperture updates the current point but otherwise leaves the graphics state unmodified, as with any other aperture.
See section 4.11 of The Gerber Layer Format Specification
Source code in src/pygerber/gerberx3/tokenizer/tokens/ab_block_aperture.py
new
classmethod
¶
Create instance of this class.
Created to be used as callback in ParserElement.set_parse_action()
.
Source code in src/pygerber/gerberx3/tokenizer/tokens/ab_block_aperture.py
update_drawing_state
¶
Update drawing state.
Source code in src/pygerber/gerberx3/tokenizer/tokens/ab_block_aperture.py
parser2_visit_token
¶
Perform actions on the context implicated by this token.
Source code in src/pygerber/gerberx3/tokenizer/tokens/ab_block_aperture.py
get_gerber_code
¶
Get gerber code represented by this token.
BlockApertureEnd
¶
Bases: CommandToken
4.11 Block Aperture (AB).¶
4.11.1 Overview of block apertures¶
The AB command creates a block aperture. The command stream between the opening and closing AB command defines a block aperture which is stored in the aperture dictionary. Thus the AB commands add an aperture to the dictionary directly, without needing an AD command. The LM, LR, LS and LP commands affect the flashes of block apertures as any other aperture: when a block aperture is flashed, it is first transformed according to the transformation parameters in the graphics state and then added to the object stream.
The origin of the block aperture is the (0,0) point of the file.
A block aperture is not a single graphical object but a set of objects. While a standard or macro aperture always adds a single graphical object to the stream, a block aperture can add any number of objects, each with their own polarity. Standard and macro apertures always have a single polarity while block apertures can contain both dark and clear objects.
If the polarity is dark (LPD) when the block is flashed then the block aperture is inserted as is. If the polarity is clear (LPC) then the polarity of all objects in the block is toggled (clear becomes dark, and dark becomes clear). This toggle propagates through all nesting levels. In the following example the polarity of objects in the flash of block D12 will be toggled.
A D03 of a block aperture updates the current point but otherwise leaves the graphics state unmodified, as with any other aperture.
See section 4.11 of The Gerber Layer Format Specification
Source code in src/pygerber/gerberx3/tokenizer/tokens/ab_block_aperture.py
parser2_visit_token
¶
Perform actions on the context implicated by this token.
Source code in src/pygerber/gerberx3/tokenizer/tokens/ab_block_aperture.py
get_gerber_code
¶
Get gerber code represented by this token.