diff --git a/lib/convert-easyeda-json-to-tscircuit-soup-json.ts b/lib/convert-easyeda-json-to-tscircuit-soup-json.ts index 76986f3e..c25a6e80 100644 --- a/lib/convert-easyeda-json-to-tscircuit-soup-json.ts +++ b/lib/convert-easyeda-json-to-tscircuit-soup-json.ts @@ -21,7 +21,6 @@ import { import * as Soup from "circuit-json" import { applyToPoint, compose, scale, translate } from "transformation-matrix" import type { z } from "zod" -import { DEFAULT_PCB_THICKNESS_MM } from "./constants" import { generateArcFromSweep, generateArcPathWithMid } from "./math/arc-utils" import type { BetterEasyEdaJson } from "./schemas/easy-eda-json-schema" import type { @@ -36,6 +35,7 @@ import type { import { mil10ToMm } from "./utils/easyeda-unit-to-mm" import { normalizePinLabels } from "./utils/normalize-pin-labels" import { normalizeSymbolName } from "./utils/normalize-symbol-name" +import { DEFAULT_PCB_THICKNESS_MM } from "./constants" const EASYEDA_STEP_MODEL_URL = "https://modules.easyeda.com/qAxj6KHrDKw4blvCG8QJPs7Y" @@ -206,6 +206,7 @@ interface Options { useModelCdn?: boolean shouldRecenter?: boolean cadPositionZMm?: number + showDesignator?: boolean } const getCadPositionZMmFromMetadata = (easyEdaJson: BetterEasyEdaJson) => { @@ -226,7 +227,12 @@ const getCadPositionZMmFromMetadata = (easyEdaJson: BetterEasyEdaJson) => { export const convertEasyEdaJsonToCircuitJson = ( easyEdaJson: BetterEasyEdaJson, - { useModelCdn, shouldRecenter = true, cadPositionZMm }: Options = {}, + { + useModelCdn, + shouldRecenter = true, + cadPositionZMm, + showDesignator = false, + }: Options = {}, ): AnyCircuitElement[] => { const resolvedCadPositionZMm = cadPositionZMm ?? getCadPositionZMmFromMetadata(easyEdaJson) @@ -492,6 +498,7 @@ export const convertEasyEdaJsonToCircuitJson = ( }) // Add silkscreen paths, arcs and text + let hasFoundDesignator = false easyEdaJson.packageDetail.dataStr.shape.forEach((shape, index) => { if (shape.type === "TRACK") { if (!isCourtyardLayer(shape.layer)) { @@ -503,28 +510,67 @@ export const convertEasyEdaJsonToCircuitJson = ( } } else if (shape.type === "TEXT") { if (isCourtyardLayer(shape.layer)) return + + let text = shape.text + const designatorPrefix = easyEdaJson.dataStr.head.c_para.pre || "U" + const NormalizedPrefix = designatorPrefix.replace("?", "") + const isDesignator = + text === designatorPrefix || + text === `${NormalizedPrefix}?` || + text === NormalizedPrefix + + if (isDesignator) { + if (!showDesignator) return + text = "{NAME}" + hasFoundDesignator = true + } + circuitElements.push( Soup.pcb_silkscreen_text.parse({ type: "pcb_silkscreen_text", pcb_silkscreen_text_id: `pcb_silkscreen_text_${index + 1}`, pcb_component_id: "pcb_component_1", - text: normalizeSymbolName(shape.text), + text, anchor_position: { x: mil2mm(shape.x), y: mil2mm(shape.y), }, - anchor_alignment: { - L: "bottom_left", - C: "center", - R: "bottom_right", - }[shape.textAnchor ?? "L"], - font_size: shape.size_mm ? shape.size_mm : undefined, + anchor_alignment: ( + { + L: "bottom_left", + C: "center", + R: "bottom_right", + } as const + )[shape.textAnchor ?? "L"], + font_size: shape.size_mm || 1.0, layer: "top", } as Soup.PcbSilkscreenTextInput), ) } }) + // Add a fallback designator if none was found in the shapes + if (!hasFoundDesignator && showDesignator) { + const bbox = easyEdaJson.packageDetail.dataStr.BBox + circuitElements.push( + Soup.pcb_silkscreen_text.parse({ + type: "pcb_silkscreen_text", + pcb_silkscreen_text_id: `pcb_silkscreen_text_designator_fallback`, + pcb_component_id: "pcb_component_1", + text: "{NAME}", + anchor_position: { + x: milx10(bbox.x + bbox.width / 2), + y: milx10(bbox.y) - 1.0, // 1mm above top edge + }, + anchor_alignment: "center", + font_size: 1.0, + layer: "top", + } as Soup.PcbSilkscreenTextInput), + ) + } + + // Only add designator if found in EasyEDA + // Calculate pcb_component bounds from all PCB elements const pcbElements = circuitElements.filter( (e) => diff --git a/lib/websafe/convert-to-typescript-component/index.tsx b/lib/websafe/convert-to-typescript-component/index.tsx index 7ea30dc2..44cd235a 100644 --- a/lib/websafe/convert-to-typescript-component/index.tsx +++ b/lib/websafe/convert-to-typescript-component/index.tsx @@ -26,6 +26,7 @@ export const convertBetterEasyToTsx = async ({ useModelCdn: true, shouldRecenter: true, cadPositionZMm: cadPlacement?.positionZMm, + showDesignator: true, }) const [cadComponent] = su(circuitJson).cad_component.list() if (cadComponent) { diff --git a/lib/websafe/generate-footprint-tsx.ts b/lib/websafe/generate-footprint-tsx.ts index 07f7bf44..47ecf410 100644 --- a/lib/websafe/generate-footprint-tsx.ts +++ b/lib/websafe/generate-footprint-tsx.ts @@ -75,8 +75,15 @@ export const generateFootprintTsx = ( } for (const silkscreenText of silkscreenTexts) { + const isReferenceDesignator = silkscreenText.text === "{NAME}" + let text: string + if (isReferenceDesignator) { + text = "{props.name}" + } else { + text = silkscreenText.text + } elementStrings.push( - ``, + ``, ) } diff --git a/tests/assets/C2652953.raweasy.json b/tests/assets/C2652953.raweasy.json new file mode 100644 index 00000000..6d7129d3 --- /dev/null +++ b/tests/assets/C2652953.raweasy.json @@ -0,0 +1,272 @@ +{ + "uuid": "b70b0b9f17d34a5bb3a8336a639eb2ed", + "title": "TXS0104EQPWRQ1", + "description": "", + "docType": 2, + "type": 3, + "thumb": "//image.lceda.cn/components/b70b0b9f17d34a5bb3a8336a639eb2ed.png", + "lcsc": { + "id": 2744862, + "number": "C2652953" + }, + "szlcsc": { + "id": 2744862, + "number": "C2652953" + }, + "owner": { + "uuid": "0819f05c4eef4c71ace90d822a990e87", + "username": "LCSC", + "nickname": "LCSC", + "avatar": "//image.lceda.cn/avatars/2018/6/kFlrasi7W06gTdBLAqW3fkrqbDhbowynuSzkjqso.png" + }, + "tags": [ + "Translators / Level Shifters" + ], + "updateTime": 1692584885, + "updated_at": "2026-03-14 13:04:43", + "dataStr": { + "head": { + "docType": "2", + "editorVersion": "6.5.23", + "x": 400, + "y": 300, + "c_para": { + "pre": "U?", + "name": "TXS0104EQPWRQ1", + "package": "TSSOP-14_L5.0-W4.4-P0.65-LS6.4-TL", + "Contributor": "LCSC", + "Supplier": "LCSC", + "Supplier Part": "C2652953", + "Manufacturer": "TI(德州仪器)", + "Manufacturer Part": "TXS0104EQPWRQ1", + "JLCPCB Part Class": "Extended Part" + }, + "uuid": "b70b0b9f17d34a5bb3a8336a639eb2ed", + "puuid": "63518f84d4f74a209ec6f7e74a2d9cb2", + "importFlag": 0, + "c_spiceCmd": null, + "hasIdFlag": true, + "utime": 1672830821 + }, + "canvas": "CA~1000~1000~#FFFFFF~yes~#CCCCCC~10~1000~1000~line~10~pixel~5~400~300", + "shape": [ + "E~365~263~1.5~1.5~#880000~1~0~#880000~gge7~0", + "R~360~258~2~2~80~84~#880000~1~0~none~gge10~0~", + "E~365~263~1.5~1.5~#880000~1~0~#880000~gge13~0", + "P~show~0~1~350~270~180~gge16~0^^350~270^^M 350 270 h 10~#FF0000^^1~363.7~274~0~VCCA~start~~~#FF0000^^1~359.5~269~0~1~end~~~#FF0000^^0~357~270^^0~M 360 273 L 363 270 L 360 267", + "P~show~0~2~350~280~180~gge37~0^^350~280^^M 350 280 h 10~#880000^^1~363.7~284~0~A1~start~~~#0000FF^^1~359.5~279~0~2~end~~~#0000FF^^0~357~280^^0~M 360 283 L 363 280 L 360 277", + "P~show~0~3~350~290~180~gge58~0^^350~290^^M 350 290 h 10~#880000^^1~363.7~294~0~A2~start~~~#0000FF^^1~359.5~289~0~3~end~~~#0000FF^^0~357~290^^0~M 360 293 L 363 290 L 360 287", + "P~show~0~4~350~300~180~gge79~0^^350~300^^M 350 300 h 10~#880000^^1~363.7~304~0~A3~start~~~#0000FF^^1~359.5~299~0~4~end~~~#0000FF^^0~357~300^^0~M 360 303 L 363 300 L 360 297", + "P~show~0~5~350~310~180~gge100~0^^350~310^^M 350 310 h 10~#880000^^1~363.7~314~0~A4~start~~~#0000FF^^1~359.5~309~0~5~end~~~#0000FF^^0~357~310^^0~M 360 313 L 363 310 L 360 307", + "P~show~0~6~350~320~180~gge121~0^^350~320^^M 350 320 h 10~#880000^^1~363.7~324~0~NC~start~~~#0000FF^^1~359.5~319~0~6~end~~~#0000FF^^0~357~320^^0~M 360 323 L 363 320 L 360 317", + "P~show~0~7~350~330~180~gge142~0^^350~330^^M 350 330 h 10~#000000^^1~363.7~334~0~GND~start~~~#000000^^1~359.5~329~0~7~end~~~#000000^^0~357~330^^0~M 360 333 L 363 330 L 360 327", + "P~show~0~8~450~330~0~gge163~0^^450~330^^M 450 330 h -10~#880000^^1~436.3~334~0~OE~end~~~#0000FF^^1~440.5~329~0~8~start~~~#0000FF^^0~443~330^^0~M 440 327 L 437 330 L 440 333", + "P~show~0~9~450~320~0~gge184~0^^450~320^^M 450 320 h -10~#880000^^1~436.3~324~0~NC~end~~~#0000FF^^1~440.5~319~0~9~start~~~#0000FF^^0~443~320^^0~M 440 317 L 437 320 L 440 323", + "P~show~0~10~450~310~0~gge205~0^^450~310^^M 450 310 h -10~#880000^^1~436.3~314~0~B4~end~~~#0000FF^^1~440.5~309~0~10~start~~~#0000FF^^0~443~310^^0~M 440 307 L 437 310 L 440 313", + "P~show~0~11~450~300~0~gge226~0^^450~300^^M 450 300 h -10~#880000^^1~436.3~304~0~B3~end~~~#0000FF^^1~440.5~299~0~11~start~~~#0000FF^^0~443~300^^0~M 440 297 L 437 300 L 440 303", + "P~show~0~12~450~290~0~gge247~0^^450~290^^M 450 290 h -10~#880000^^1~436.3~294~0~B2~end~~~#0000FF^^1~440.5~289~0~12~start~~~#0000FF^^0~443~290^^0~M 440 287 L 437 290 L 440 293", + "P~show~0~13~450~280~0~gge268~0^^450~280^^M 450 280 h -10~#880000^^1~436.3~284~0~B1~end~~~#0000FF^^1~440.5~279~0~13~start~~~#0000FF^^0~443~280^^0~M 440 277 L 437 280 L 440 283", + "P~show~0~14~450~270~0~gge289~0^^450~270^^M 450 270 h -10~#FF0000^^1~436.3~274~0~VCCB~end~~~#FF0000^^1~440.5~269~0~14~start~~~#FF0000^^0~443~270^^0~M 440 267 L 437 270 L 440 273" + ], + "BBox": { + "x": 348.8, + "y": 258, + "width": 103.6, + "height": 84 + }, + "colors": [] + }, + "jlcOnSale": 0, + "datastrid": "d9f6011e012f416ebf8e17435fd19aae", + "verify": true, + "SMT": true, + "writable": false, + "isFavorite": false, + "packageDetail": { + "uuid": "63518f84d4f74a209ec6f7e74a2d9cb2", + "title": "TSSOP-14_L5.0-W4.4-P0.65-LS6.4-TL", + "docType": 4, + "updateTime": 1675329713, + "owner": { + "uuid": "0819f05c4eef4c71ace90d822a990e87", + "username": "lcsc", + "nickname": "LCSC", + "avatar": "//image.lceda.cn/avatars/2018/6/kFlrasi7W06gTdBLAqW3fkrqbDhbowynuSzkjqso.png" + }, + "datastrid": "708f31e730ea4f4e83015747ace1e46c", + "writable": false, + "dataStr": { + "head": { + "docType": "4", + "editorVersion": "6.5.23", + "c_para": { + "pre": "U?", + "package": "TSSOP-14_L5.0-W4.4-P0.65-LS6.4-TL", + "link": "https://item.szlcsc.com/8137.html", + "Contributor": "lcsc", + "3DModel": "TSSOP-14_L5.0-W4.4-H1.0-LS6.4-P0.65" + }, + "x": 398.4077, + "y": 300.7921, + "uuid": "63518f84d4f74a209ec6f7e74a2d9cb2", + "utime": 1675329713, + "importFlag": 0, + "transformList": "", + "hasIdFlag": true, + "newgId": true + }, + "canvas": "CA~1000~1000~black~yes~#ffffff~10~1000~1000~line~0.03937~mm~1~45~visible~0.1~398.4077~300.7921~0~yes", + "shape": [ + "CIRCLE~385.809~290.95~0.118~0.2362~101~gge166~0~~", + "CIRCLE~384.628~292.918~0.591~1.1811~12~gge144~0~~", + "SOLIDREGION~99~~M 389.7463 290.9496 L 407.0691 290.9496 L 407.0691 310.6346 L 389.7463 310.6346 Z ~solid~gge83~~~~0", + "TRACK~1~3~~392.1077 290.8921 395.7077 290.8921~gge68~0", + "TRACK~1~3~~401.1077 290.8921 404.7077 290.8921~gge67~0", + "TRACK~1~3~~407.266 290.9496 407.266 291.4049~gge66~0", + "TRACK~1~3~~407.266 310.1793 407.266 310.6346 389.5494 310.6346 389.5494 310.1793~gge65~0", + "TRACK~1~3~~389.5494 291.4049 389.5494 290.9496~gge64~0", + "TRACK~1~3~~404.7077 290.8921 407.266 290.8921~gge63~0", + "TRACK~1~3~~392.1077 290.8921 389.5494 290.8921~gge62~0", + "ARC~1~3~~M 401.1077 290.8921 A 2.7 2.7 0 0 1 395.7077 290.8921~~gge31~0", + "CIRCLE~386.597~289.965~0.591~1.1811~3~gge25~0~~", + "PAD~RECT~387.384~293.115~6.6929~1.5748~1~~1~0~384.0376 292.3277 390.7305 292.3277 390.7305 293.9025 384.0376 293.9025~0~gge2~0~~Y~0~0~0.2~387.384,293.1149", + "PAD~RECT~387.384~295.674~6.6929~1.5748~1~~2~0~384.0376 294.8867 390.7305 294.8867 390.7305 296.4615 384.0376 296.4615~0~gge3~0~~Y~0~0~0.2~387.384,295.674", + "PAD~RECT~387.384~298.233~6.6929~1.5748~1~~3~0~384.0376 297.4457 390.7305 297.4457 390.7305 299.0205 384.0376 299.0205~0~gge4~0~~Y~0~0~0.2~387.384,298.233", + "PAD~RECT~387.384~300.792~6.6929~1.5748~1~~4~0~384.0376 300.0047 390.7305 300.0047 390.7305 301.5795 384.0376 301.5795~0~gge5~0~~Y~0~0~0.2~387.384,300.7921", + "PAD~RECT~387.384~303.351~6.6929~1.5748~1~~5~0~384.0376 302.5637 390.7305 302.5637 390.7305 304.1385 384.0376 304.1385~0~gge6~0~~Y~0~0~0.2~387.384,303.3512", + "PAD~RECT~387.384~305.91~6.6929~1.5748~1~~6~0~384.0376 305.1227 390.7305 305.1227 390.7305 306.6975 384.0376 306.6975~0~gge7~0~~Y~0~0~0.2~387.384,305.9102", + "PAD~RECT~387.384~308.469~6.6929~1.5748~1~~7~0~384.0376 307.6817 390.7305 307.6817 390.7305 309.2565 384.0376 309.2565~0~gge8~0~~Y~0~0~0.2~387.3841,308.4693", + "PAD~RECT~409.431~308.469~6.6929~1.5748~1~~8~0~406.0849 307.6817 412.7778 307.6817 412.7778 309.2565 406.0849 309.2565~0~gge9~0~~Y~0~0~0.2~409.4313,308.4693", + "PAD~RECT~409.431~305.91~6.6929~1.5748~1~~9~0~406.0849 305.1227 412.7778 305.1227 412.7778 306.6975 406.0849 306.6975~0~gge10~0~~Y~0~0~0.2~409.4314,305.9102", + "PAD~RECT~409.431~303.351~6.6929~1.5748~1~~10~0~406.0849 302.5637 412.7778 302.5637 412.7778 304.1385 406.0849 304.1385~0~gge11~0~~Y~0~0~0.2~409.4314,303.3512", + "PAD~RECT~409.431~300.792~6.6929~1.5748~1~~11~0~406.0849 300.0047 412.7778 300.0047 412.7778 301.5795 406.0849 301.5795~0~gge12~0~~Y~0~0~0.2~409.4314,300.7921", + "PAD~RECT~409.431~298.233~6.6929~1.5748~1~~12~0~406.0849 297.4457 412.7778 297.4457 412.7778 299.0205 406.0849 299.0205~0~gge13~0~~Y~0~0~0.2~409.4314,298.233", + "PAD~RECT~409.431~295.674~6.6929~1.5748~1~~13~0~406.0849 294.8867 412.7778 294.8867 412.7778 296.4615 406.0849 296.4615~0~gge14~0~~Y~0~0~0.2~409.4314,295.674", + "PAD~RECT~409.431~293.115~6.6929~1.5748~1~~14~0~406.0849 292.3277 412.7778 292.3277 412.7778 293.9025 406.0849 293.9025~0~gge15~0~~Y~0~0~0.2~409.4314,293.1149", + "SOLIDREGION~100~~M 407.0297 293.5973 L 407.0297 292.6327 L 408.5849 292.6327 L 408.5849 293.5973 Z~cutout~gge116~~~~0", + "SOLIDREGION~100~~M 408.5455 293.5973 L 408.5455 292.6327 L 411.0061 292.6327 L 411.0061 293.5973 Z~solid~gge117~~~~0", + "SOLIDREGION~100~~M 407.0297 296.1563 L 407.0297 295.1917 L 408.5849 295.1917 L 408.5849 296.1563 Z~cutout~gge118~~~~0", + "SOLIDREGION~100~~M 408.5455 296.1563 L 408.5455 295.1917 L 411.0061 295.1917 L 411.0061 296.1563 Z~solid~gge119~~~~0", + "SOLIDREGION~100~~M 407.0297 298.7153 L 407.0297 297.7507 L 408.5849 297.7507 L 408.5849 298.7153 Z~cutout~gge120~~~~0", + "SOLIDREGION~100~~M 408.5455 298.7153 L 408.5455 297.7507 L 411.0061 297.7507 L 411.0061 298.7153 Z~solid~gge121~~~~0", + "SOLIDREGION~100~~M 407.0297 301.2743 L 407.0297 300.3097 L 408.5849 300.3097 L 408.5849 301.2743 Z~cutout~gge122~~~~0", + "SOLIDREGION~100~~M 408.5455 301.2743 L 408.5455 300.3097 L 411.0061 300.3097 L 411.0061 301.2743 Z~solid~gge123~~~~0", + "SOLIDREGION~100~~M 407.0297 303.8333 L 407.0297 302.8687 L 408.5849 302.8687 L 408.5849 303.8333 Z~cutout~gge124~~~~0", + "SOLIDREGION~100~~M 408.5455 303.8333 L 408.5455 302.8687 L 411.0061 302.8687 L 411.0061 303.8333 Z~solid~gge125~~~~0", + "SOLIDREGION~100~~M 407.0297 306.3923 L 407.0297 305.4277 L 408.5849 305.4277 L 408.5849 306.3923 Z~cutout~gge126~~~~0", + "SOLIDREGION~100~~M 408.5455 306.3923 L 408.5455 305.4277 L 411.0061 305.4277 L 411.0061 306.3923 Z~solid~gge127~~~~0", + "SOLIDREGION~100~~M 407.0297 308.9513 L 407.0297 307.9867 L 408.5849 307.9867 L 408.5849 308.9513 Z~cutout~gge128~~~~0", + "SOLIDREGION~100~~M 408.5455 308.9513 L 408.5455 307.9867 L 411.0061 307.9867 L 411.0061 308.9513 Z~solid~gge129~~~~0", + "SOLIDREGION~100~~M 388.2305 308.9513 L 388.2305 307.9867 L 389.7857 307.9867 L 389.7857 308.9513 Z~cutout~gge130~~~~0", + "SOLIDREGION~100~~M 385.8093 308.9513 L 385.8093 307.9867 L 388.2699 307.9867 L 388.2699 308.9513 Z~solid~gge131~~~~0", + "SOLIDREGION~100~~M 388.2305 306.3923 L 388.2305 305.4277 L 389.7857 305.4277 L 389.7857 306.3923 Z~cutout~gge132~~~~0", + "SOLIDREGION~100~~M 385.8093 306.3923 L 385.8093 305.4277 L 388.2699 305.4277 L 388.2699 306.3923 Z~solid~gge133~~~~0", + "SOLIDREGION~100~~M 388.2305 303.8333 L 388.2305 302.8687 L 389.7857 302.8687 L 389.7857 303.8333 Z~cutout~gge134~~~~0", + "SOLIDREGION~100~~M 385.8093 303.8333 L 385.8093 302.8687 L 388.2699 302.8687 L 388.2699 303.8333 Z~solid~gge135~~~~0", + "SOLIDREGION~100~~M 388.2305 301.2743 L 388.2305 300.3097 L 389.7857 300.3097 L 389.7857 301.2743 Z~cutout~gge136~~~~0", + "SOLIDREGION~100~~M 385.8093 301.2743 L 385.8093 300.3097 L 388.2699 300.3097 L 388.2699 301.2743 Z~solid~gge137~~~~0", + "SOLIDREGION~100~~M 388.2305 298.7153 L 388.2305 297.7507 L 389.7857 297.7507 L 389.7857 298.7153 Z~cutout~gge138~~~~0", + "SOLIDREGION~100~~M 385.8093 298.7153 L 385.8093 297.7507 L 388.2699 297.7507 L 388.2699 298.7153 Z~solid~gge139~~~~0", + "SOLIDREGION~100~~M 388.2305 296.1563 L 388.2305 295.1917 L 389.7857 295.1917 L 389.7857 296.1563 Z~cutout~gge140~~~~0", + "SOLIDREGION~100~~M 385.8093 296.1563 L 385.8093 295.1917 L 388.2699 295.1917 L 388.2699 296.1563 Z~solid~gge141~~~~0", + "SOLIDREGION~100~~M 388.2305 293.5973 L 388.2305 292.6327 L 389.7857 292.6327 L 389.7857 293.5973 Z~cutout~gge142~~~~0", + "SOLIDREGION~100~~M 385.8093 293.5973 L 385.8093 292.6327 L 388.2699 292.6327 L 388.2699 293.5973 Z~solid~gge143~~~~0", + "SVGNODE~{\"gId\":\"g1_outline\",\"nodeName\":\"g\",\"nodeType\":1,\"layerid\":\"19\",\"attrs\":{\"c_width\":\"23.7007\",\"c_height\":\"19.685\",\"c_rotation\":\"0,0,0\",\"z\":\"0\",\"c_origin\":\"398.4077,300.7921\",\"uuid\":\"5377177da492449fa1a3111d646cac17\",\"c_etype\":\"outline3D\",\"id\":\"g1_outline\",\"title\":\"TSSOP-14_L5.0-W4.4-H1.0-LS6.4-P0.65\",\"layerid\":\"19\",\"transform\":\"scale(1) translate(0, 0)\"},\"childNodes\":[{\"gId\":\"g1_outline_line0\",\"nodeName\":\"polyline\",\"nodeType\":1,\"attrs\":{\"fill\":\"none\",\"id\":\"g1_outline_line0\",\"c_shapetype\":\"line\",\"points\":\"386.5574 292.7606 386.5574 293.4693 386.6361 293.5087 386.6755 293.5087 387.3842 293.5087 387.4629 293.5087 387.5416 293.5087 387.6204 293.5087 387.6991 293.5087 387.8172 293.5087 387.896 293.5087 388.0141 293.5087 388.0928 293.5087 388.1716 293.5087 388.2503 293.5087 388.329 293.5087 388.3684 293.5087 388.4078 293.5087 388.5259 293.5087 388.6046 293.5087 388.6834 293.5087 388.7621 293.5087 388.8408 293.5087 388.9196 293.5087 388.9983 293.5087 389.0377 293.5087 389.1164 293.5087 389.7464 293.5087 389.7464 295.2803 389.4314 295.2803 389.1164 295.2803 389.0377 295.2803 388.959 295.2803 388.8802 295.2803 388.8015 295.2803 388.7227 295.2803 388.6834 295.2803 388.5653 295.2803 388.4865 295.2803 388.4078 295.2803 388.329 295.2803 388.2897 295.2803 388.2109 295.2803 388.1322 295.2803 388.0534 295.2803 387.9747 295.2803 387.896 295.2803 387.8172 295.2803 387.7385 295.2803 387.6597 295.2803 387.581 295.2803 387.5023 295.2803 387.4235 295.2803 387.3448 295.2803 386.6755 295.2803 386.5968 295.2803 386.5968 295.3197 386.5574 295.3197 386.5574 296.0283 386.6361 296.0677 386.6755 296.0677 387.3842 296.0677 387.4629 296.0677 387.5416 296.0677 387.6204 296.0677 387.6991 296.0677 387.7779 296.0677 387.8172 296.0677 387.896 296.0677 388.0141 296.0677 388.0928 296.0677 388.1716 296.0677 388.2503 296.0677 388.329 296.0677 388.3684 296.0677 388.4078 296.0677 388.5259 296.0677 388.6046 296.0677 388.6834 296.0677 388.7621 296.0677 388.8408 296.0677 388.9196 296.0677 388.9983 296.0677 389.0771 296.0677 389.1164 296.0677 389.7464 296.0677 389.7464 297.8394 389.4314 297.8394 389.1164 297.8394 389.0377 297.8394 388.959 297.8394 388.8802 297.8394 388.8015 297.8394 388.7227 297.8394 388.6834 297.8394 388.5653 297.8394 388.4865 297.8394 388.4078 297.8394 388.329 297.8394 388.2897 297.8394 388.2109 297.8394 388.1322 297.8394 388.0534 297.8394 387.9747 297.8394 387.896 297.8394 387.8566 297.8394 387.8172 297.8787 387.8172 297.8394 387.896 297.8394 387.896 297.8787 387.8172 297.8787 387.8566 297.8394 387.896 297.8394 387.9747 297.8394 387.896 297.8787 387.896 297.8394 387.8172 297.8394 387.7385 297.8394 387.6597 297.8394 387.581 297.8394 387.5023 297.8394 387.4235 297.8394 387.3448 297.8394 386.6755 297.8394 386.5968 297.8394 386.5968 297.8787 386.5574 297.8787 386.5574 298.5874 386.6361 298.6268 386.6755 298.6268 387.3842 298.6268 387.4629 298.6268 387.5416 298.6268 387.6204 298.6268 387.6991 298.6268 387.8172 298.6268 387.896 298.6268 388.0141 298.6268 388.0928 298.6268 388.1716 298.6268 388.2503 298.6268 388.329 298.6268 388.3684 298.6268 388.4078 298.6268 388.5259 298.6268 388.6046 298.6268 388.6834 298.6268 388.7621 298.6268 388.8408 298.6268 388.9196 298.6268 388.9983 298.6268 389.0377 298.6268 389.1164 298.6268 389.7464 298.6268 389.7464 300.3984 389.4314 300.3984 389.1164 300.3984 389.0377 300.3984 388.959 300.3984 388.8802 300.3984 388.8015 300.3984 388.7227 300.3984 388.6834 300.3984 388.5653 300.3984 388.4865 300.3984 388.4078 300.3984 388.329 300.3984 388.2897 300.3984 388.2109 300.3984 388.1322 300.3984 388.0534 300.3984 387.9747 300.3984 387.896 300.3984 387.8172 300.3984 387.7385 300.3984 387.6597 300.3984 387.581 300.3984 387.5023 300.3984 387.4235 300.3984 387.3448 300.3984 386.6755 300.3984 386.5968 300.3984 386.5968 300.4378 386.5574 300.4378 386.5574 301.1464 386.6361 301.1858 386.6755 301.1858 387.3842 301.1858 387.4629 301.1858 387.5416 301.1858 387.6204 301.1858 387.6991 301.1858 387.8172 301.1858 387.896 301.1858 388.0141 301.1858 388.0928 301.1858 388.1716 301.1858 388.2503 301.1858 388.329 301.1858 388.3684 301.1858 388.4078 301.1858 388.5259 301.1858 388.6046 301.1858 388.6834 301.1858 388.7621 301.1858 388.8408 301.1858 388.9196 301.1858 388.9983 301.1858 389.0771 301.1858 389.1164 301.1858 389.7464 301.1858 389.7464 302.9575 389.1164 302.9575 389.0377 302.9575 388.9983 302.9575 388.8802 302.9575 388.8015 302.9575 388.7227 302.9575 388.6834 302.9575 388.6046 302.9575 388.4865 302.9575 388.4078 302.9575 388.329 302.9575 388.2897 302.9575 388.2109 302.9575 388.1322 302.9575 388.0534 302.9575 387.9747 302.9575 387.896 302.9575 387.8172 302.9575 387.7385 302.9575 387.6597 302.9575 387.581 302.9575 387.5023 302.9575 387.4235 302.9575 387.3448 302.9575 386.6755 302.9575 386.5968 302.9575 386.5968 302.9968 386.5574 302.9968 386.5574 303.7055 386.6361 303.7449 386.6755 303.7449 387.3842 303.7449 387.4629 303.7449 387.5416 303.7449 387.6204 303.7449 387.6991 303.7449 387.7779 303.7449 387.8172 303.7449 387.896 303.7449 388.0141 303.7449 388.0928 303.7449 388.1716 303.7449 388.2503 303.7449 388.329 303.7449 388.3684 303.7449 388.4078 303.7449 388.5259 303.7449 388.6046 303.7449 388.6834 303.7449 388.7621 303.7449 388.8408 303.7449 388.9196 303.7449 388.9983 303.7449 389.0771 303.7449 389.1164 303.7449 389.7464 303.7449 389.7464 305.5165 389.4314 305.5165 389.1164 305.5165 389.0377 305.5165 388.959 305.5165 388.8802 305.5165 388.8015 305.5165 388.7227 305.5165 388.6834 305.5165 388.5653 305.5165 388.4865 305.5165 388.4078 305.5165 388.329 305.5165 388.2897 305.5165 388.2109 305.5165 388.1322 305.5165 388.0534 305.5165 387.9747 305.5165 387.896 305.5165 387.8172 305.5165 387.7385 305.5165 387.6597 305.5165 387.581 305.5165 387.5023 305.5165 387.4235 305.5165 387.3448 305.5165 386.6755 305.5165 386.5968 305.5165 386.5968 305.5559 386.5574 305.5559 386.5574 306.2645 386.6361 306.3039 386.6755 306.3039 387.3842 306.3039 387.4629 306.3039 387.5416 306.3039 387.6204 306.3039 387.6991 306.3039 387.8172 306.3039 387.896 306.3039 388.0141 306.3039 388.0928 306.3039 388.1716 306.3039 388.2503 306.3039 388.329 306.3039 388.3684 306.3039 388.4078 306.3039 388.5259 306.3039 388.6046 306.3039 388.6834 306.3039 388.7621 306.3039 388.8408 306.3039 388.9196 306.3039 388.9983 306.3039 389.0771 306.3039 389.1164 306.3039 389.7464 306.3039 389.7464 308.0756 389.1164 308.0756 389.0377 308.0756 388.959 308.0756 388.8802 308.0756 388.8015 308.0756 388.7621 308.0756 388.6834 308.0756 388.5653 308.0756 388.4865 308.0756 388.4078 308.0756 388.329 308.0756 388.2897 308.0756 388.2109 308.0756 388.1322 308.0756 388.0534 308.0756 387.9747 308.0756 387.896 308.0756 387.8172 308.0756 387.7385 308.0756 387.6597 308.0756 387.581 308.0756 387.5023 308.0756 387.4235 308.0756 387.3448 308.0756 386.6755 308.0756 386.5968 308.0756 386.5968 308.1149 386.5574 308.1149 386.5574 308.8236 386.6361 308.863 386.6755 308.863 387.3842 308.863 387.4629 308.863 387.5416 308.863 387.6204 308.863 387.6991 308.863 387.7779 308.863 387.8172 308.863 387.896 308.863 388.0141 308.863 388.0928 308.863 388.1716 308.863 388.2503 308.863 388.329 308.863 388.3684 308.863 388.4078 308.863 388.5259 308.863 388.6046 308.863 388.6834 308.863 388.7621 308.863 388.8408 308.863 388.9196 308.863 388.9983 308.863 389.0377 308.863 389.1164 308.863 389.7464 308.863 389.7464 310.5559 389.7464 310.5952 389.7857 310.6346 389.8251 310.6346 389.8645 310.6346 406.951 310.6346 407.0298 310.6346 407.0298 310.5952 407.0692 310.5952 407.0692 310.5165 407.0692 308.863 407.6991 308.863 407.7778 308.863 407.8172 308.863 407.9353 308.863 408.014 308.863 408.0928 308.863 408.1321 308.863 408.2109 308.863 408.329 308.863 408.4077 308.863 408.4865 308.863 408.5258 308.863 408.6046 308.863 408.6833 308.863 408.7621 308.863 408.8408 308.863 408.9195 308.863 408.9983 308.863 409.077 308.863 409.1558 308.863 409.2345 308.863 409.3132 308.863 409.392 308.863 409.4707 308.863 410.14 308.863 410.2188 308.863 410.2188 308.8236 410.2581 308.8236 410.2581 308.1149 410.1794 308.0756 410.14 308.0756 409.4314 308.0756 409.3526 308.0756 409.2739 308.0756 409.1951 308.0756 409.1164 308.0756 408.9983 308.0756 408.9195 308.0756 408.8014 308.0756 408.7227 308.0756 408.644 308.0756 408.5652 308.0756 408.4865 308.0756 408.4471 308.0756 408.4077 308.0756 408.2896 308.0756 408.2109 308.0756 408.1321 308.0756 408.0534 308.0756 407.9747 308.0756 407.8959 308.0756 407.8172 308.0756 407.7778 308.0756 407.6991 308.0756 407.3841 308.0756 407.0692 308.0756 407.0692 306.3039 407.6991 306.3039 407.7778 306.3039 407.8172 306.3039 407.9353 306.3039 408.014 306.3039 408.0928 306.3039 408.1321 306.3039 408.2109 306.3039 408.329 306.3039 408.4077 306.3039 408.4865 306.3039 408.5258 306.3039 408.6046 306.3039 408.6833 306.3039 408.7621 306.3039 408.8408 306.3039 408.9195 306.3039 408.9983 306.3039 409.077 306.3039 409.1558 306.3039 409.2345 306.3039 409.3132 306.3039 409.392 306.3039 409.4707 306.3039 410.14 306.3039 410.2188 306.3039 410.2188 306.2645 410.2581 306.2645 410.2581 305.5559 410.1794 305.5165 410.14 305.5165 409.8251 305.5165 409.4314 305.5165 409.3526 305.5165 409.2739 305.5165 409.1951 305.5165 409.1164 305.5165 409.0377 305.5165 408.9589 305.5165 408.9195 305.5559 408.9195 305.5165 408.9983 305.5165 408.9983 305.5559 408.9195 305.5559 408.9983 305.5165 409.077 305.5165 409.1164 305.5165 408.9983 305.5559 408.9983 305.5165 409.1164 305.5165 409.1164 305.5559 408.9983 305.5559 409.1164 305.5165 409.1164 305.5559 409.1558 305.5165 409.1558 305.5559 409.1164 305.5165 408.9983 305.5165 408.9195 305.5165 408.8014 305.5165 408.7227 305.5165 408.644 305.5165 408.5652 305.5165 408.4865 305.5165 408.4471 305.5165 408.4077 305.5165 408.2896 305.5165 408.2503 305.5165 408.1321 305.5165 408.0534 305.5165 407.9747 305.5165 407.8959 305.5165 407.8172 305.5165 407.7384 305.5165 407.6991 305.5165 407.3841 305.5165 407.0692 305.5165 407.0692 303.7449 407.6991 303.7449 407.7778 303.7449 407.8172 303.7449 407.9353 303.7449 408.014 303.7449 408.0928 303.7449 408.1321 303.7449 408.2109 303.7449 408.329 303.7449 408.4077 303.7449 408.4865 303.7449 408.5258 303.7449 408.6046 303.7449 408.6833 303.7449 408.7621 303.7449 408.8408 303.7449 408.9195 303.7449 408.9589 303.7449 408.9983 303.7055 408.9983 303.7449 408.9195 303.7449 408.9195 303.7055 408.9983 303.7055 409.1164 303.7055 408.9983 303.7449 408.9983 303.7055 408.9983 303.2724 409.0377 303.1937 409.1164 303.7055 408.9983 303.7055 408.9589 303.3512 408.9983 303.2724 408.9983 303.7055 408.9195 303.7055 408.9195 303.4299 408.9589 303.3512 408.9589 303.7055 408.9589 303.7449 408.9195 303.7449 408.8408 303.7449 408.9195 303.7055 408.9195 303.7449 408.9983 303.7449 409.077 303.7449 409.1558 303.7449 409.2345 303.7449 409.3132 303.7449 409.392 303.7449 409.4707 303.7449 410.14 303.7449 410.2188 303.7449 410.2188 303.7055 410.2581 303.7055 410.2581 302.9968 410.1794 302.9575 410.14 302.9575 409.4314 302.9575 409.3526 302.9575 409.2739 302.9575 409.1951 302.9575 409.1164 302.9575 408.9983 302.9575 408.9195 302.9575 408.8014 302.9575 408.7227 302.9575 408.644 302.9575 408.5652 302.9575 408.4865 302.9575 408.4471 302.9575 408.4077 302.9575 408.2896 302.9575 408.2109 302.9575 408.1321 302.9575 408.0534 302.9575 407.9747 302.9575 407.8959 302.9575 407.8172 302.9575 407.7778 302.9575 407.6991 302.9575 407.0692 302.9575 407.0692 301.1858 407.6991 301.1858 407.7778 301.1858 407.8172 301.1858 407.9353 301.1858 408.014 301.1858 408.0928 301.1858 408.1321 301.1858 408.2109 301.1858 408.329 301.1858 408.4077 301.1858 408.4865 301.1858 408.5258 301.1858 408.6046 301.1858 408.6833 301.1858 408.7621 301.1858 408.8408 301.1858 408.9195 301.1858 408.9983 301.1858 409.077 301.1858 409.1558 301.1858 409.2345 301.1858 409.3132 301.1858 409.392 301.1858 409.4707 301.1858 410.14 301.1858 410.2188 301.1858 410.2188 301.1464 410.2581 301.1464 410.2581 300.4378 410.1794 300.3984 410.14 300.3984 409.8251 300.3984 409.4314 300.3984 409.3526 300.3984 409.2739 300.3984 409.1951 300.3984 409.1164 300.3984 408.9983 300.3984 408.9195 300.3984 408.8014 300.3984 408.7227 300.3984 408.644 300.3984 408.5652 300.3984 408.4865 300.3984 408.4471 300.3984 408.4077 300.3984 408.2896 300.3984 408.2503 300.3984 408.1321 300.3984 408.0534 300.3984 407.9747 300.3984 407.8959 300.3984 407.8172 300.3984 407.7384 300.3984 407.6991 300.3984 407.3841 300.3984 407.0692 300.3984 407.0692 298.6268 407.6991 298.6268 407.7778 298.6268 407.8172 298.6268 407.9353 298.6268 408.014 298.6268 408.0928 298.6268 408.1321 298.6268 408.2109 298.6268 408.329 298.6268 408.4077 298.6268 408.4865 298.6268 408.5258 298.6268 408.6046 298.6268 408.6833 298.6268 408.7621 298.6268 408.8408 298.6268 408.9195 298.6268 408.9983 298.6268 409.077 298.6268 409.1558 298.6268 409.2345 298.6268 409.3132 298.6268 409.392 298.6268 409.4707 298.6268 410.14 298.6268 410.2188 298.6268 410.2188 298.5874 410.2581 298.5874 410.2581 297.8787 410.1794 297.8394 410.14 297.8394 409.4314 297.8394 409.3526 297.8394 409.2739 297.8394 409.1951 297.8394 409.1164 297.8394 409.0377 297.8394 408.9589 297.8394 408.9589 297.8787 408.9195 297.8787 408.9195 297.8394 408.9983 297.8394 408.9983 297.8787 408.9195 297.8787 408.8408 297.8787 408.9195 297.8394 408.9195 297.8787 408.9195 298.3118 408.8802 298.3905 408.8408 297.8787 408.9195 297.8787 408.9589 298.2331 408.9195 298.3118 408.9195 297.8787 408.9589 297.8787 408.9983 297.8394 409.077 297.8394 409.1164 297.8394 408.9983 297.8787 408.9983 297.8394 409.1164 297.8394 409.1164 297.8787 408.9983 297.8787 409.1164 297.8394 409.1164 297.8787 409.1558 297.8394 409.1558 297.8787 409.1164 297.8394 408.9983 297.8394 408.9195 297.8394 408.8014 297.8394 408.7227 297.8394 408.644 297.8394 408.5652 297.8394 408.4865 297.8394 408.4471 297.8394 408.4077 297.8394 408.2896 297.8394 408.2503 297.8394 408.1321 297.8394 408.0534 297.8394 407.9747 297.8394 407.8959 297.8394 407.8172 297.8394 407.7384 297.8394 407.6991 297.8394 407.3841 297.8394 407.0692 297.8394 407.0692 296.0677 407.6991 296.0677 407.7778 296.0677 407.8172 296.0677 407.9353 296.0677 408.014 296.0677 408.0928 296.0677 408.1321 296.0677 408.2109 296.0677 408.329 296.0677 408.4077 296.0677 408.4865 296.0677 408.5258 296.0677 408.6046 296.0677 408.6833 296.0677 408.7621 296.0677 408.8408 296.0677 408.9195 296.0677 408.9983 296.0677 409.077 296.0677 409.1558 296.0677 409.2345 296.0677 409.3132 296.0677 409.392 296.0677 409.4707 296.0677 410.14 296.0677 410.2188 296.0677 410.2188 296.0283 410.2581 296.0283 410.2581 295.3197 410.1794 295.2803 410.14 295.2803 409.8251 295.2803 409.4314 295.2803 409.3526 295.2803 409.2739 295.2803 409.1951 295.2803 409.1164 295.2803 408.9589 295.2803 408.9195 295.3197 408.9195 295.2803 408.9983 295.2803 408.9983 295.3197 408.9195 295.3197 408.9983 295.2803 409.077 295.2803 409.1164 295.2803 408.9983 295.3197 408.9983 295.2803 409.1164 295.2803 409.1164 295.3197 408.9983 295.3197 409.1164 295.2803 409.1164 295.3197 409.1558 295.2803 409.1558 295.3197 409.1164 295.2803 409.0377 295.2803 408.9983 295.2803 408.9195 295.2803 408.8014 295.2803 408.7227 295.2803 408.644 295.2803 408.5652 295.2803 408.4865 295.2803 408.4471 295.2803 408.4077 295.2803 408.2896 295.2803 408.2503 295.2803 408.1321 295.2803 408.0534 295.2803 407.9747 295.2803 407.8959 295.2803 407.8172 295.2803 407.7384 295.2803 407.6991 295.2803 407.3841 295.2803 407.0692 295.2803 407.0692 293.5087 407.6991 293.5087 407.7778 293.5087 407.8172 293.5087 407.9353 293.5087 408.014 293.5087 408.0928 293.5087 408.1321 293.5087 408.2109 293.5087 408.329 293.5087 408.4077 293.5087 408.4865 293.5087 408.5258 293.5087 408.6046 293.5087 408.6833 293.5087 408.7621 293.5087 408.8408 293.5087 408.9195 293.5087 408.9983 293.5087 409.077 293.5087 409.1558 293.5087 409.2345 293.5087 409.3132 293.5087 409.392 293.5087 409.4707 293.5087 410.14 293.5087 410.2188 293.5087 410.2188 293.4693 410.2581 293.4693 410.2581 292.7606 410.1794 292.7213 410.14 292.7213 409.8251 292.7213 409.4314 292.7213 409.3526 292.7213 409.2739 292.7213 409.1951 292.7213 409.1164 292.7213 409.0377 292.7213 408.9983 292.7213 408.9195 292.7213 408.8014 292.7213 408.7227 292.7213 408.644 292.7213 408.5652 292.7213 408.4865 292.7213 408.4471 292.7213 408.4077 292.7213 408.2896 292.7213 408.2109 292.7213 408.1321 292.7213 408.0534 292.7213 407.9747 292.7213 407.8959 292.7213 407.8172 292.7213 407.7778 292.7213 407.6991 292.7213 407.3841 292.7213 407.0692 292.7213 407.0692 291.0283 407.0692 290.989 407.0298 290.9496 406.9904 290.9496 406.951 290.9496 389.8645 290.9496 389.7857 290.9496 389.7857 290.989 389.7464 290.989 389.7464 291.0677 389.7464 292.7213 389.1164 292.7213 389.0377 292.7213 388.959 292.7213 388.8802 292.7213 388.8015 292.7213 388.7621 292.7213 388.6834 292.7213 388.5653 292.7213 388.4865 292.7213 388.4078 292.7213 388.329 292.7213 388.2897 292.7213 388.2109 292.7213 388.1322 292.7213 388.0534 292.7213 387.9747 292.7213 387.896 292.7213 387.8172 292.7213 387.7385 292.7213 387.6597 292.7213 387.581 292.7213 387.5023 292.7213 387.4235 292.7213 387.3448 292.7213 386.6755 292.7213 386.5968 292.7213 386.5968 292.7606 386.5574 292.7606 386.5574 292.7606\"}}]}" + ], + "layers": [ + "1~TopLayer~#FF0000~true~false~true~", + "2~BottomLayer~#0000FF~true~false~true~", + "3~TopSilkLayer~#FFCC00~true~false~true~", + "4~BottomSilkLayer~#66CC33~true~false~true~", + "5~TopPasteMaskLayer~#808080~true~false~true~", + "6~BottomPasteMaskLayer~#800000~true~false~true~", + "7~TopSolderMaskLayer~#800080~true~false~true~0.3", + "8~BottomSolderMaskLayer~#AA00FF~true~false~true~0.3", + "9~Ratlines~#6464FF~true~false~true~", + "10~BoardOutLine~#FF00FF~true~false~true~", + "11~Multi-Layer~#FFFFFF~true~false~true~0.5", + "12~Document~#FFFFFF~true~false~true~", + "13~TopAssembly~#33CC99~true~false~true~", + "14~BottomAssembly~#5555FF~true~false~true~", + "15~Mechanical~#F022F0~true~false~true~", + "19~3DModel~#66CCFF~true~false~true~", + "21~Inner1~#800000~false~false~false~~", + "22~Inner2~#008000~false~false~false~~", + "23~Inner3~#00FF00~false~false~false~~", + "24~Inner4~#BC8E00~false~false~false~~", + "25~Inner5~#70DBFA~false~false~false~~", + "26~Inner6~#00CC66~false~false~false~~", + "27~Inner7~#9966FF~false~false~false~~", + "28~Inner8~#800080~false~false~false~~", + "29~Inner9~#008080~false~false~false~~", + "30~Inner10~#15935F~false~false~false~~", + "31~Inner11~#000080~false~false~false~~", + "32~Inner12~#00B400~false~false~false~~", + "33~Inner13~#2E4756~false~false~false~~", + "34~Inner14~#99842F~false~false~false~~", + "35~Inner15~#FFFFAA~false~false~false~~", + "36~Inner16~#99842F~false~false~false~~", + "37~Inner17~#2E4756~false~false~false~~", + "38~Inner18~#3535FF~false~false~false~~", + "39~Inner19~#8000BC~false~false~false~~", + "40~Inner20~#43AE5F~false~false~false~~", + "41~Inner21~#C3ECCE~false~false~false~~", + "42~Inner22~#728978~false~false~false~~", + "43~Inner23~#39503F~false~false~false~~", + "44~Inner24~#0C715D~false~false~false~~", + "45~Inner25~#5A8A80~false~false~false~~", + "46~Inner26~#2B937E~false~false~false~~", + "47~Inner27~#23999D~false~false~false~~", + "48~Inner28~#45B4E3~false~false~false~~", + "49~Inner29~#215DA1~false~false~false~~", + "50~Inner30~#4564D7~false~false~false~~", + "51~Inner31~#6969E9~false~false~false~~", + "52~Inner32~#9069E9~false~false~false~~", + "99~ComponentShapeLayer~#00CCCC~true~false~true~0.4", + "100~LeadShapeLayer~#CC9999~true~true~true~", + "101~ComponentPolarityLayer~#66FFCC~true~false~true~", + "Hole~Hole~#222222~false~false~true~", + "DRCError~DRCError~#FAD609~false~false~true~" + ], + "objects": [ + "All~true~false", + "Component~true~true", + "Prefix~true~true", + "Name~true~false", + "Track~true~true", + "Pad~true~true", + "Via~true~true", + "Hole~true~true", + "Copper_Area~true~true", + "Circle~true~true", + "Arc~true~true", + "Solid_Region~true~true", + "Text~true~true", + "Image~true~true", + "Rect~true~true", + "Dimension~true~true", + "Protractor~true~true" + ], + "BBox": { + "x": 384, + "y": 289.4, + "width": 28.7, + "height": 21.3 + } + } + }, + "_objMetadata": { + "bounds": { + "min": { + "x": -3.006278, + "y": -2.5, + "z": -0.069083 + }, + "max": { + "x": 3.006278, + "y": 2.5, + "z": 1.03 + } + } + } +} \ No newline at end of file diff --git a/tests/convert-to-ts/C1046-to-ts-with-stepModel.test.ts b/tests/convert-to-ts/C1046-to-ts-with-stepModel.test.ts index e63bdaab..3f3c7bf7 100644 --- a/tests/convert-to-ts/C1046-to-ts-with-stepModel.test.ts +++ b/tests/convert-to-ts/C1046-to-ts-with-stepModel.test.ts @@ -38,6 +38,7 @@ it("should include both obj and step cad model urls", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C1046-to-ts.test.ts b/tests/convert-to-ts/C1046-to-ts.test.ts index c741e66d..cb66a45f 100644 --- a/tests/convert-to-ts/C1046-to-ts.test.ts +++ b/tests/convert-to-ts/C1046-to-ts.test.ts @@ -42,6 +42,7 @@ it("should convert C1046 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C105419-to-ts.test.ts b/tests/convert-to-ts/C105419-to-ts.test.ts index 73e54b7a..6385065b 100644 --- a/tests/convert-to-ts/C105419-to-ts.test.ts +++ b/tests/convert-to-ts/C105419-to-ts.test.ts @@ -75,6 +75,7 @@ it("should convert C105419 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C128415-to-ts.test.ts b/tests/convert-to-ts/C128415-to-ts.test.ts index 3ec39b25..c88c6eed 100644 --- a/tests/convert-to-ts/C128415-to-ts.test.ts +++ b/tests/convert-to-ts/C128415-to-ts.test.ts @@ -53,6 +53,7 @@ it("should convert C128415 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C131337-to-ts.test.ts b/tests/convert-to-ts/C131337-to-ts.test.ts index b056aa44..f11d0c29 100644 --- a/tests/convert-to-ts/C131337-to-ts.test.ts +++ b/tests/convert-to-ts/C131337-to-ts.test.ts @@ -45,6 +45,7 @@ it("should convert C131337 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C14877-to-ts.test.ts b/tests/convert-to-ts/C14877-to-ts.test.ts index f2b19c55..55f072ce 100644 --- a/tests/convert-to-ts/C14877-to-ts.test.ts +++ b/tests/convert-to-ts/C14877-to-ts.test.ts @@ -105,6 +105,7 @@ it("should convert C14877 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C157929-to-ts.test.ts b/tests/convert-to-ts/C157929-to-ts.test.ts index 72605071..06f2a17a 100644 --- a/tests/convert-to-ts/C157929-to-ts.test.ts +++ b/tests/convert-to-ts/C157929-to-ts.test.ts @@ -50,6 +50,7 @@ it("should convert C157929 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C158012-to-ts.test.ts b/tests/convert-to-ts/C158012-to-ts.test.ts index e426c900..c745ed58 100644 --- a/tests/convert-to-ts/C158012-to-ts.test.ts +++ b/tests/convert-to-ts/C158012-to-ts.test.ts @@ -49,6 +49,7 @@ it("should convert C158012 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C160354-to-ts.test.ts b/tests/convert-to-ts/C160354-to-ts.test.ts index 005c4017..99bc1284 100644 --- a/tests/convert-to-ts/C160354-to-ts.test.ts +++ b/tests/convert-to-ts/C160354-to-ts.test.ts @@ -55,6 +55,7 @@ it("should convert C160354 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C165948-to-ts.test.ts b/tests/convert-to-ts/C165948-to-ts.test.ts index 5867fc6b..c7984727 100644 --- a/tests/convert-to-ts/C165948-to-ts.test.ts +++ b/tests/convert-to-ts/C165948-to-ts.test.ts @@ -74,6 +74,7 @@ it("should convert C165948 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C19076967-to-ts.test.ts b/tests/convert-to-ts/C19076967-to-ts.test.ts index 435fbfa2..e2fc2129 100644 --- a/tests/convert-to-ts/C19076967-to-ts.test.ts +++ b/tests/convert-to-ts/C19076967-to-ts.test.ts @@ -61,6 +61,7 @@ it("should convert C19076967 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C19795120-to-ts.test.ts b/tests/convert-to-ts/C19795120-to-ts.test.ts index ce75febe..77e79686 100644 --- a/tests/convert-to-ts/C19795120-to-ts.test.ts +++ b/tests/convert-to-ts/C19795120-to-ts.test.ts @@ -50,6 +50,7 @@ it("should convert C19795120 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C2040-to-ts.test.ts b/tests/convert-to-ts/C2040-to-ts.test.ts index f55f9dd6..667eabca 100644 --- a/tests/convert-to-ts/C2040-to-ts.test.ts +++ b/tests/convert-to-ts/C2040-to-ts.test.ts @@ -164,6 +164,7 @@ it("should convert C2040 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C22446580-to-ts.test.ts b/tests/convert-to-ts/C22446580-to-ts.test.ts index 6508a85a..792481ac 100644 --- a/tests/convert-to-ts/C22446580-to-ts.test.ts +++ b/tests/convert-to-ts/C22446580-to-ts.test.ts @@ -75,6 +75,7 @@ it("should convert C22446580 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C22446580.test.ts b/tests/convert-to-ts/C22446580.test.ts index 6cd50550..52c9006d 100644 --- a/tests/convert-to-ts/C22446580.test.ts +++ b/tests/convert-to-ts/C22446580.test.ts @@ -72,6 +72,7 @@ it("should convert C22446580 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C265111-to-ts.test.ts b/tests/convert-to-ts/C265111-to-ts.test.ts index 6377c61f..bcd7bcc6 100644 --- a/tests/convert-to-ts/C265111-to-ts.test.ts +++ b/tests/convert-to-ts/C265111-to-ts.test.ts @@ -66,6 +66,7 @@ it("should convert C265111 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C2652953-to-ts.test.ts b/tests/convert-to-ts/C2652953-to-ts.test.ts new file mode 100644 index 00000000..c86ba17b --- /dev/null +++ b/tests/convert-to-ts/C2652953-to-ts.test.ts @@ -0,0 +1,107 @@ +import { it, expect } from "bun:test" +import chipRawEasy from "../assets/C2652953.raweasy.json" +import { convertBetterEasyToTsx } from "lib/websafe/convert-to-typescript-component" +import { EasyEdaJsonSchema } from "lib/schemas/easy-eda-json-schema" +import { su } from "@tscircuit/circuit-json-util" +import { runTscircuitCode } from "tscircuit" +import { wrapTsxWithBoardFor3dSnapshot } from "../fixtures/wrap-tsx-with-board-for-3d-snapshot" +import { convertCircuitJsonToPcbSvg } from "circuit-to-svg" + +it("should convert C2652953 into typescript file", async () => { + const betterEasy = EasyEdaJsonSchema.parse(chipRawEasy) + const result = await convertBetterEasyToTsx({ + betterEasy, + }) + const circuitJson = await runTscircuitCode( + ` + ${result} + export default () => ( + + + + ) + `, + ) + expect( + su(circuitJson) + .pcb_silkscreen_text.list() + .some((t) => t.text === "U_LC1"), + ).toBe(true) + expect(result).not.toContain("milmm") + expect(result).not.toContain("NaNmm") + + // const circuitJson = await runTscircuitCode( + // wrapTsxWithBoardFor3dSnapshot(result), + // ) + await expect(circuitJson).toMatch3dSnapshot(import.meta.path) + + expect(result).toMatchInlineSnapshot(` + "import type { ChipProps } from "@tscircuit/props" + + const pinLabels = { + pin1: ["VCCA"], + pin2: ["A1"], + pin3: ["A2"], + pin4: ["A3"], + pin5: ["A4"], + pin6: ["NC1"], + pin7: ["GND"], + pin8: ["OE"], + pin9: ["NC2"], + pin10: ["B4"], + pin11: ["B3"], + pin12: ["B2"], + pin13: ["B1"], + pin14: ["VCCB"] + } as const + + export const TXS0104EQPWRQ1 = (props: ChipProps) => { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + } + cadModel={{ + objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C2652953.obj?uuid=5377177da492449fa1a3111d646cac17", + stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C2652953.step?uuid=5377177da492449fa1a3111d646cac17", + pcbRotationOffset: 0, + modelOriginPosition: { x: 0, y: 0, z: -0.069083 }, + }} + {...props} + /> + ) + }" + `) + const pcbSvg = convertCircuitJsonToPcbSvg(circuitJson) + expect(pcbSvg).toMatchSvgSnapshot(import.meta.path) +}, 20000) diff --git a/tests/convert-to-ts/C281113-to-ts.test.ts b/tests/convert-to-ts/C281113-to-ts.test.ts index 9f0a4d39..f5adeeab 100644 --- a/tests/convert-to-ts/C281113-to-ts.test.ts +++ b/tests/convert-to-ts/C281113-to-ts.test.ts @@ -42,6 +42,7 @@ it("should convert C281113 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C2848306-to-ts.test.ts b/tests/convert-to-ts/C2848306-to-ts.test.ts index fe421a25..aa046ad5 100644 --- a/tests/convert-to-ts/C2848306-to-ts.test.ts +++ b/tests/convert-to-ts/C2848306-to-ts.test.ts @@ -48,6 +48,7 @@ it("should convert C2848306 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C2886621-to-ts.test.ts b/tests/convert-to-ts/C2886621-to-ts.test.ts index 5cb37610..ea4306c7 100644 --- a/tests/convert-to-ts/C2886621-to-ts.test.ts +++ b/tests/convert-to-ts/C2886621-to-ts.test.ts @@ -107,6 +107,7 @@ it("should convert C2886621 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C2913206-to-ts.test.ts b/tests/convert-to-ts/C2913206-to-ts.test.ts index 8002a65d..cea355ca 100644 --- a/tests/convert-to-ts/C2913206-to-ts.test.ts +++ b/tests/convert-to-ts/C2913206-to-ts.test.ts @@ -186,6 +186,7 @@ it("should convert C2913206 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C2998002-to-ts.test.ts b/tests/convert-to-ts/C2998002-to-ts.test.ts index 049302ff..e9f90053 100644 --- a/tests/convert-to-ts/C2998002-to-ts.test.ts +++ b/tests/convert-to-ts/C2998002-to-ts.test.ts @@ -52,6 +52,7 @@ it("should convert C2998002 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C3178291-to-ts.test.ts b/tests/convert-to-ts/C3178291-to-ts.test.ts index e3996c24..7d4889a9 100644 --- a/tests/convert-to-ts/C3178291-to-ts.test.ts +++ b/tests/convert-to-ts/C3178291-to-ts.test.ts @@ -60,6 +60,7 @@ it("should convert C3178291 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C410353-to-ts.test.ts b/tests/convert-to-ts/C410353-to-ts.test.ts index 6a4832d7..3cffb7ec 100644 --- a/tests/convert-to-ts/C410353-to-ts.test.ts +++ b/tests/convert-to-ts/C410353-to-ts.test.ts @@ -78,6 +78,7 @@ it("should convert C410353 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C46497-to-ts.test.ts b/tests/convert-to-ts/C46497-to-ts.test.ts index 7829e47a..33fda4a1 100644 --- a/tests/convert-to-ts/C46497-to-ts.test.ts +++ b/tests/convert-to-ts/C46497-to-ts.test.ts @@ -112,6 +112,7 @@ it("should convert C46497 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C46749-to-ts.test.ts b/tests/convert-to-ts/C46749-to-ts.test.ts index a57edbb0..3f786d70 100644 --- a/tests/convert-to-ts/C46749-to-ts.test.ts +++ b/tests/convert-to-ts/C46749-to-ts.test.ts @@ -56,6 +56,7 @@ it("should convert C46749 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C472489-to-ts.test.ts b/tests/convert-to-ts/C472489-to-ts.test.ts index 57f634b6..b301be01 100644 --- a/tests/convert-to-ts/C472489-to-ts.test.ts +++ b/tests/convert-to-ts/C472489-to-ts.test.ts @@ -173,6 +173,7 @@ it("should convert C472489 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C490691-to-ts.test.ts b/tests/convert-to-ts/C490691-to-ts.test.ts index b0d93ef6..a6fe6078 100644 --- a/tests/convert-to-ts/C490691-to-ts.test.ts +++ b/tests/convert-to-ts/C490691-to-ts.test.ts @@ -98,6 +98,7 @@ it("should convert C490691 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C5248081-to-ts.test.ts b/tests/convert-to-ts/C5248081-to-ts.test.ts index cf96003f..6c7b1f2e 100644 --- a/tests/convert-to-ts/C5248081-to-ts.test.ts +++ b/tests/convert-to-ts/C5248081-to-ts.test.ts @@ -46,6 +46,7 @@ it("should convert C5248081 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C5830143-to-ts.test.ts b/tests/convert-to-ts/C5830143-to-ts.test.ts index dd1f57db..86a76fd6 100644 --- a/tests/convert-to-ts/C5830143-to-ts.test.ts +++ b/tests/convert-to-ts/C5830143-to-ts.test.ts @@ -48,6 +48,7 @@ it("should convert C5830143 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C6186-to-ts.test.ts b/tests/convert-to-ts/C6186-to-ts.test.ts index 0a775c44..d07507ca 100644 --- a/tests/convert-to-ts/C6186-to-ts.test.ts +++ b/tests/convert-to-ts/C6186-to-ts.test.ts @@ -45,6 +45,7 @@ it("should convert C6186 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C7203002-to-ts.test.ts b/tests/convert-to-ts/C7203002-to-ts.test.ts index 8e5decbb..cb49cdf8 100644 --- a/tests/convert-to-ts/C7203002-to-ts.test.ts +++ b/tests/convert-to-ts/C7203002-to-ts.test.ts @@ -182,6 +182,7 @@ it("should convert C7203002 into typescript file", async () => { + } diff --git a/tests/convert-to-ts/C75749-to-ts.test.ts b/tests/convert-to-ts/C75749-to-ts.test.ts index dc2c7072..e895b3a4 100644 --- a/tests/convert-to-ts/C75749-to-ts.test.ts +++ b/tests/convert-to-ts/C75749-to-ts.test.ts @@ -71,6 +71,7 @@ it("should convert C75749 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C8465-to-ts.test.ts b/tests/convert-to-ts/C8465-to-ts.test.ts index 789d30cc..366872c5 100644 --- a/tests/convert-to-ts/C8465-to-ts.test.ts +++ b/tests/convert-to-ts/C8465-to-ts.test.ts @@ -50,6 +50,7 @@ it("should convert C8465 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C88224-to-ts.test.ts b/tests/convert-to-ts/C88224-to-ts.test.ts index e7d2c07f..a1a6d657 100644 --- a/tests/convert-to-ts/C88224-to-ts.test.ts +++ b/tests/convert-to-ts/C88224-to-ts.test.ts @@ -85,6 +85,7 @@ it("should convert C88224 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/C9900017879-to-ts.test.ts b/tests/convert-to-ts/C9900017879-to-ts.test.ts index 82084e62..f48b6d8e 100644 --- a/tests/convert-to-ts/C9900017879-to-ts.test.ts +++ b/tests/convert-to-ts/C9900017879-to-ts.test.ts @@ -176,6 +176,7 @@ it("should convert C9900017879 into typescript file", async () => { + } cadModel={{ diff --git a/tests/convert-to-ts/__snapshots__/C2652953-to-ts-simple-3d.snap.png b/tests/convert-to-ts/__snapshots__/C2652953-to-ts-simple-3d.snap.png new file mode 100644 index 00000000..50a3bdae Binary files /dev/null and b/tests/convert-to-ts/__snapshots__/C2652953-to-ts-simple-3d.snap.png differ diff --git a/tests/convert-to-ts/__snapshots__/C2652953-to-ts.snap.svg b/tests/convert-to-ts/__snapshots__/C2652953-to-ts.snap.svg new file mode 100644 index 00000000..479b2c4d --- /dev/null +++ b/tests/convert-to-ts/__snapshots__/C2652953-to-ts.snap.svg @@ -0,0 +1 @@ +U_LC1 \ No newline at end of file