Skip to content

Commit

Permalink
dfn: Add hole polygon for SHT2x
Browse files Browse the repository at this point in the history
  • Loading branch information
ubruhin committed Nov 15, 2024
1 parent c562bea commit 876d49e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
22 changes: 21 additions & 1 deletion dfn_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Callable, List, Optional

from common import format_float as ff
from entities.common import Circle, Diameter, Fill, GrabArea, Layer, Position, Width
from entities.common import Angle, Circle, Diameter, Fill, GrabArea, Layer, Polygon, Position, Vertex, Width
from entities.package import Footprint

# Maximal lead width as a function of pitch, Table 4 in the JEDEC
Expand Down Expand Up @@ -286,6 +286,25 @@ def _draw(config: DfnConfig, uuid: Callable[[str], str], footprint: Footprint) -
return _draw


def draw_rect(x: float, y: float, width: float, height: float) -> Callable[[DfnConfig, Callable[[str], str], Footprint], None]:
def _draw(config: DfnConfig, uuid: Callable[[str], str], footprint: Footprint) -> None:
footprint.add_polygon(Polygon(
uuid=uuid('hole-polygon-doc'),
layer=Layer('top_documentation'),
width=Width(0),
fill=Fill(True),
grab_area=GrabArea(False),
vertices=[
Vertex(Position(x - width / 2, y + height / 2), Angle(0)),
Vertex(Position(x + width / 2, y + height / 2), Angle(0)),
Vertex(Position(x + width / 2, y - height / 2), Angle(0)),
Vertex(Position(x - width / 2, y - height / 2), Angle(0)),
Vertex(Position(x - width / 2, y + height / 2), Angle(0)),
],
))
return _draw


THIRD_CONFIGS = [
# length, width, pitch, pin_count, height_nominal, height_max, lead_length, exposed_width, exposed_length, keywords

Expand Down Expand Up @@ -326,6 +345,7 @@ def _draw(config: DfnConfig, uuid: Callable[[str], str], footprint: Footprint) -
library="Sensirion.lplib",
no_exp=False,
pin1_corner_dx_dy=0.2,
extended_doc_fn=draw_rect(x=0, y=-0.7, width=2.2, height=0.6),
),
DfnConfig(
length=2.45,
Expand Down
1 change: 1 addition & 0 deletions uuid_cache_dfn.csv
Original file line number Diff line number Diff line change
Expand Up @@ -9895,6 +9895,7 @@ pkg-sensirion_sht2x-circle-silkscreen-reflow,43cc877d-700b-4849-a591-8fd56562e83
pkg-sensirion_sht2x-exposed,57a25240-5688-4966-858b-c896110b189f
pkg-sensirion_sht2x-footprint-hand-soldering,aa717618-140a-459e-89d0-8d6becef577e
pkg-sensirion_sht2x-footprint-reflow,7b05587f-2094-4ae4-8bc4-d2f082fd7591
pkg-sensirion_sht2x-hole-polygon-doc,372f6165-8416-4ced-8e42-31dd7a41799a
pkg-sensirion_sht2x-lead-1,7fb3407e-aa0c-4896-8ca3-69e94302bd29
pkg-sensirion_sht2x-lead-2,2d65cdfa-c0bf-4013-a74f-4ddfc89ee233
pkg-sensirion_sht2x-lead-3,9629ad51-f9a7-4424-bae5-a754fcf2f34c
Expand Down

0 comments on commit 876d49e

Please sign in to comment.