Audit PCB assembly placement coordinates, register them against anchors and cross-check them with Gerber copper.
git clone https://github.com/huahai29/moonplacement.git
cd moonplacement
moon build --target js
node _build/js/debug/build/cmd/main/main.js examples/baseline.csv examples/delivery-ok.csv examples/policy.jsonnode _build/js/debug/build/cmd/main/main.js examples/baseline.csv examples/delivery-ok.csv examples/policy.json examples/top-copper.gbr --html _build/report.html| 退出码 | 状态 | 含义 |
|---|---|---|
| 0 | pass | 已完成所要求的核对,未发现差异 |
| 1 | different | 已确认差异 |
| 2 | indeterminate | 对齐或铜层证据不足,需复查 |
| 64 | input_error | 输入文件、参数或数据无效 |
pub(all) suberror GerberError {
InvalidGerber(String, String)
}pub struct GerberDocument {
features : Array[GerberFeature]
warnings : Array[String]
repeated_refs : Map[String, Bool]
panel_grids : Array[GerberGrid]
panel_cell : PanelCell?
}pub struct GerberFeature {
kind : GerberKind
dark : Bool
refdes : String?
pin : String?
statement_number : Int
block_instance : Int?
}pub struct Point {
x : Double
y : Double
}pub struct Registration {
model : TransformModel
transform : Transform2D
rotation_deg : Double
scale : Double
rms_mm : Double
max_mm : Double
inlier_mask : Array[Bool]
residuals_mm : Array[Double]
}pub enum Shape {
Circle(Double)
Rectangle(Double, Double)
Obround(Double, Double)
Polygon(Double, Int)
Transformed(Shape, Transform2D)
RoundedOutline(Array[Point], Double)
RoundHole(Shape, Point, Point, Double)
Outline(Array[Point])
Thermal(Double, Double, Double)
Punched(Shape, Point, Array[(Point, Double)])
}pub struct Transform2D {
a : Double
b : Double
c : Double
d : Double
e : Double
f : Double
}pub enum TransformModel {
Rigid
Similarity
Affine
}let REPORT_SCHEMA_VERSION : Intfn audit(baseline_table : PlacementTable, delivery_table : PlacementTable, policy : Policy, top_gerber? : GerberDocument?, bottom_gerber? : GerberDocument?) -> AuditResultfn register(source : Array[Point], target : Array[Point], model : TransformModel, threshold_mm : Double) -> Registration?fn select_panel_cell(document : GerberDocument, row~ : Int, column~ : Int, source~ : String, reference? : GerberDocument) -> GerberDocument raise GerberErrorInstall
Download zipAudit PCB assembly placement coordinates, register them against anchors and cross-check them with Gerber copper.