R2 焊接:丝印临时换成器件值 + 摆放优化 + 1:1 器件值打印稿
2026-09-25 为焊接底板与旧版刀片(BLADE-PCB 3b9c4e39c8d164db): - silk_value.py:隐藏位号、在原位建自由丝印写器件值(Value,没有就用型号), --restore 按 _silk_value_restore.json 删字并恢复位号。⚠ 再出 Gerber / 下单前必须先 --restore。 - silk_value_plan.py:器件值摆放优化(不压焊盘 / 不重叠 / 不出框 / 避开开槽与金手指区; 软代价:压过孔、压他件本体、离本件远、缩字号)。EDA 默认字体实测字宽 ≈0.78×字高。 - print_value.py:两块板背面镜像 1:1 画在同一张 A4,红框标 1 脚; print/print_1to1.ps1 按 210×297 mm 直送打印机(不经 PDF 阅读器缩放)。 - 数据:_silk_value_geom/_extra(板上读回几何)、_dump/_plan(排位结果)。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
这个提交包含在:
@@ -0,0 +1,32 @@
|
||||
# 1:1 打印一张 A4 图(PNG,整页 210x297 mm)—— 不经过 PDF 阅读器,比例由程序定死。
|
||||
# powershell -ExecutionPolicy Bypass -File .claude\r2\print\print_1to1.ps1 -Image .claude\r2\print\blade_1to1.png [-Printer "EPSON3F4E59 (L4260 Series)"]
|
||||
# 做法:System.Drawing.Printing.PrintDocument,Graphics.PageUnit = 毫米,图画成 210x297 mm;
|
||||
# OriginAtMargins=false 时 Graphics 原点在「可打印区」左上角(硬边距处),所以再往回挪一个硬边距,让图的原点落在纸角上。
|
||||
# ⚠ 打印机驱动里如果开了「缩放以适合页面 / 无边距放大」,还是会被缩 —— 打出来量标尺为准。
|
||||
param([Parameter(Mandatory = $true)][string]$Image, [string]$Printer = '')
|
||||
Add-Type -AssemblyName System.Drawing
|
||||
$path = (Resolve-Path $Image).Path
|
||||
$img = [System.Drawing.Image]::FromFile($path)
|
||||
$pd = New-Object System.Drawing.Printing.PrintDocument
|
||||
if ($Printer) { $pd.PrinterSettings.PrinterName = $Printer }
|
||||
if (-not $pd.PrinterSettings.IsValid) { throw "打印机不可用: $($pd.PrinterSettings.PrinterName)" }
|
||||
$pd.DocumentName = 'PhoneRail blade 1to1'
|
||||
$a4 = $pd.PrinterSettings.PaperSizes | Where-Object { $_.Kind -eq [System.Drawing.Printing.PaperKind]::A4 } | Select-Object -First 1
|
||||
if ($a4) { $pd.DefaultPageSettings.PaperSize = $a4 }
|
||||
$pd.DefaultPageSettings.Landscape = $false
|
||||
$pd.OriginAtMargins = $false
|
||||
$script:hm = $null
|
||||
$pd.add_PrintPage({
|
||||
param($s, $e)
|
||||
$g = $e.Graphics
|
||||
$g.PageUnit = [System.Drawing.GraphicsUnit]::Millimeter
|
||||
$g.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic
|
||||
$hx = $e.PageSettings.HardMarginX * 0.254 # 1/100 英寸 -> mm
|
||||
$hy = $e.PageSettings.HardMarginY * 0.254
|
||||
$script:hm = "{0:N2} / {1:N2} mm" -f $hx, $hy
|
||||
$g.DrawImage($img, [single](-$hx), [single](-$hy), [single]210, [single]297)
|
||||
$e.HasMorePages = $false
|
||||
})
|
||||
$pd.Print()
|
||||
$img.Dispose()
|
||||
"已提交打印:$($pd.PrinterSettings.PrinterName),纸 $($pd.DefaultPageSettings.PaperSize.PaperName),硬边距 $script:hm,图按 210x297 mm 画"
|
||||
在新工单中引用
屏蔽一个用户