[Sub-PCB][Added] KiCad 5 workaround
- The GetBoundingBox member returns values with 1 IU of error (1 fm) - So now we use at least 2 fm of tolerance
This commit is contained in:
parent
16cb739ae4
commit
cfee399110
|
|
@ -2,7 +2,7 @@
|
|||
|
||||

|
||||
|
||||
[](https://github.com/INTI-CMNB/KiBot/actions)
|
||||
[](https://github.com/INTI-CMNB/KiBot/actions)
|
||||
[](https://coveralls.io/github/INTI-CMNB/KiBot?branch=master)
|
||||
[](https://pypi.org/project/kibot/)
|
||||
[](https://www.paypal.com/donate/?hosted_button_id=K2T86GDTTMRPL)
|
||||
|
|
@ -1072,6 +1072,7 @@ Note that the **_kibom_...** filters uses a field named `Config`, but you can cu
|
|||
- `tlx`: [number|string] The X position of the top left corner for the rectangle that contains the sub-PCB.
|
||||
- `tly`: [number|string] The Y position of the top left corner for the rectangle that contains the sub-PCB.
|
||||
- `tolerance`: [number|string] Used to enlarge the selected rectangle to include elements outside the board.
|
||||
KiCad 5: To avoid rounding issues this value is set to 0.000002 mm when 0 is specified.
|
||||
- `tool`: [string='internal'] [internal,kikit] Tool used to extract the sub-PCB..
|
||||
- *top_left_x*: Alias for tlx.
|
||||
- *top_left_y*: Alias for tly.
|
||||
|
|
@ -1125,6 +1126,7 @@ Note that the **_kibom_...** filters uses a field named `Config`, but you can cu
|
|||
- `tlx`: [number|string] The X position of the top left corner for the rectangle that contains the sub-PCB.
|
||||
- `tly`: [number|string] The Y position of the top left corner for the rectangle that contains the sub-PCB.
|
||||
- `tolerance`: [number|string] Used to enlarge the selected rectangle to include elements outside the board.
|
||||
KiCad 5: To avoid rounding issues this value is set to 0.000002 mm when 0 is specified.
|
||||
- `tool`: [string='internal'] [internal,kikit] Tool used to extract the sub-PCB..
|
||||
- *top_left_x*: Alias for tlx.
|
||||
- *top_left_y*: Alias for tly.
|
||||
|
|
@ -1180,6 +1182,7 @@ Note that the **_kibom_...** filters uses a field named `Config`, but you can cu
|
|||
- `tlx`: [number|string] The X position of the top left corner for the rectangle that contains the sub-PCB.
|
||||
- `tly`: [number|string] The Y position of the top left corner for the rectangle that contains the sub-PCB.
|
||||
- `tolerance`: [number|string] Used to enlarge the selected rectangle to include elements outside the board.
|
||||
KiCad 5: To avoid rounding issues this value is set to 0.000002 mm when 0 is specified.
|
||||
- `tool`: [string='internal'] [internal,kikit] Tool used to extract the sub-PCB..
|
||||
- *top_left_x*: Alias for tlx.
|
||||
- *top_left_y*: Alias for tly.
|
||||
|
|
|
|||
|
|
@ -103,7 +103,8 @@ class SubPCBOptions(PanelOptions):
|
|||
self.tool = 'internal'
|
||||
""" [internal,kikit] Tool used to extract the sub-PCB. """
|
||||
self.tolerance = 0
|
||||
""" [number|string] Used to enlarge the selected rectangle to include elements outside the board """
|
||||
""" [number|string] Used to enlarge the selected rectangle to include elements outside the board.
|
||||
KiCad 5: To avoid rounding issues this value is set to 0.000002 mm when 0 is specified """
|
||||
self.strip_annotation = False
|
||||
""" Remove the annotation footprint. Note that KiKit will remove all annotations,
|
||||
but the internal implementation just the one indicated by `ref`.
|
||||
|
|
@ -125,6 +126,9 @@ class SubPCBOptions(PanelOptions):
|
|||
raise KiPlotConfigurationError('No reference or rectangle specified for {} sub-PCB'.format(self.name))
|
||||
self.add_units(('tlx', 'tly', 'brx', 'bry', 'tolerance'), self.units, convert=True)
|
||||
self.board_rect = GS.create_eda_rect(self._tlx, self._tly, self._brx, self._bry)
|
||||
if not self._tolerance and GS.ki5:
|
||||
# KiCad 5 workaround: rounding issues generate 1 fm of error. So we change to 2 fm tolerance.
|
||||
self._tolerance = 2
|
||||
self.board_rect.Inflate(int(self._tolerance))
|
||||
|
||||
def get_separate_source(self):
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ variants:
|
|||
tly: 52
|
||||
brx: 146
|
||||
bry: 88
|
||||
tolerance: 1
|
||||
# tolerance: 1
|
||||
|
||||
outputs:
|
||||
- name: 'pcb_charger'
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ variants:
|
|||
tly: 52
|
||||
brx: 146
|
||||
bry: 88
|
||||
tolerance: 1
|
||||
# tolerance: 1
|
||||
|
||||
outputs:
|
||||
- name: draw_charger
|
||||
|
|
|
|||
Loading…
Reference in New Issue