From 876d49ebb4c9dc756a97b3671bb8e33c223a99ee Mon Sep 17 00:00:00 2001 From: "U. Bruhin" Date: Fri, 15 Nov 2024 17:26:54 +0100 Subject: [PATCH] dfn: Add hole polygon for SHT2x --- dfn_configs.py | 22 +++++++++++++++++++++- uuid_cache_dfn.csv | 1 + 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/dfn_configs.py b/dfn_configs.py index 4115ab4..1b5abb2 100644 --- a/dfn_configs.py +++ b/dfn_configs.py @@ -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 @@ -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 @@ -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, diff --git a/uuid_cache_dfn.csv b/uuid_cache_dfn.csv index 8338e5e..0d4f3cd 100644 --- a/uuid_cache_dfn.csv +++ b/uuid_cache_dfn.csv @@ -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