Content

[TOC]

Overview

2020.08.11

document formatis the standard version of EasyEDA of thefile source format, divided into two types:

+sch typedocument
+pcb typedocument

The document is a string of the strict ‘JSON’ type. The following is explained in JSON formatby the different fields.

The format of the two document types is very similar. The maindifference is the difference between theprimitive and some special attribute values. For the same part, please refer to theGeneral Document Formatsection.

General Document Format

Among different types of documents, some formats are common, or some are document-specific, as summarized below.

separator

//Compressed format separator
var SP = '~',
SEG = '^^',
NEWLINE = '#@$',
PARASP = '`',//Separation marks for individual parameters para SP
SHEET = '#sheet#';//Load multiple files from the server, Eagle imports + netlistHandle

The file header head

Field name: ‘head’. Type Json, which contains the basic information for the entire document.

Examples and data formats:

{
"docType": "1", // [Document Type] - string
"editorVersion": "6.3.0", // [Document Version Number] - string
"c_para": {}, // [Custom attribute] - josn
"x": "4000", // [Document the origin X coordinates] - string
"y": "3000", // [Document the origin Y coordinates] - string
"hasIdFlag": true, // [The component whether if binding with the library's uuid] - boolean
"newgId": true, // [The component whether if has unique id] - boolean
"importFlag": 0, // [Marking for importing eagle] - number
"transformList": "", // [The offset data] - string(abandoned)
"c_spiceCmd": "", // [Simulation command] - string(Only for schematic document)(abandoned)
"isSheet": true, // [is drawing symbol or not] - boolean
"importedFrom": '' // [importedFrom] - already abandoned
}

The canvas configuration canvas

The field name: canvas, Type string, Use the separator ‘~’ to separate. Used to identify canvas related properties.

for example:

"CA~1000~1000~#000000~yes~#FFFFFF~10~1000~1000~line~0.5~mm~1~45~~0.5~4000~3000~0~none"

Format specification:

schematic:

1.[CA]:  Fixed identity, canvas
2.[viewWidth]: The width attribute value of an SVG element, the larger the zoom, the larger the value. (Used in previous versions)
3.[viewHeight]: The height attribute value of an SVG element, the larger the zoom, the larger the value. (Used in previous versions)
4.[backGround]: background color
5.[gridVisible]: grid visible or not
6.[gridColor]: grid color
7.[gridSize]: grid size
8.[canvasWidth]: The logical width of the canvas, that is, the width in the SVG viewBox, does not change with ZOOM (used in previous versions)
9.[canvasHeight]: The logical height of the canvas, that is, the width in the SVG viewBox, does not change with ZOOM (used in previous versions)
10.[gridStyle]: grid style
11.[snapSize]: snap size for snap
12.[unit]: unit
13.[altSnapSize]: snap size for ALT snap
14.[originX]: the origin X coordinates for canvas
15.[originY]: the origin Y coordinates for canvas

pcb:

1.[CA]:  Fixed identity, canvas
2.[viewWidth]: The width attribute value of an SVG element, the larger the zoom, the larger the value. (Used in previous versions)
3.[viewHeight]: The height attribute value of an SVG element, the larger the zoom, the larger the value. (Used in previous versions)
4.[backGround]: background color
5.[gridVisible]: grid visible or not
6.[gridColor]: grid color
7.[gridSize]: grid size
8.[canvasWidth]: The logical width of the canvas, that is, the width in the SVG viewBox, does not change with ZOOM (used in previous versions)
9.[canvasHeight]: The logical height of the canvas, that is, the width in the SVG viewBox, does not change with ZOOM (used in previous versions)
10.[gridStyle]: grid style
11.[snapSize]: snap size for snap
12.[unit]: unit
13.[routingWidth]: routing width
14.[routingAngle]: routing Angle
15.[copperAreaDisplay]: copper area fill date visible or not
16.[altSnapSize]: snap size for ALT snap
17.[originX]: the origin X coordinates for canvas
18.[originY]: the origin Y coordinates for canvas
19.[routeConflict]: routing Conflict(Ignore | TrackAround | Block)
20.[removeLoop]: Whether to remove the loop

Primitive data shape

The field name:shape. String array type. Each piece of data corresponds to the compressed data of each graph element.

The schematic contains data for rectangles, text, and ellipses

for example:

[
"R~440~300~~~50~110~#000000~1~0~none~gge5~0~",
"T~L~360~300~0~#0000FF~~9pt~~~~comment~Text~1~start~gge8~0~pinpart",
"E~410~355~10~25~#000000~1~0~none~gge12~0"
]

Refer to the single data structure of the primitive format: Primitive format.

Bounding box data BBox

field name BBOX. Type json. Box model data for the entire document.

for example:

{
"x": 4033.1, // The abscissa of the upper left corner of the document canvas boundary
"y": 3282.1, // The ordinate of the upper left corner of the document canvas boundary
"width": 113.3, // Document canvas border width
"height": 147.8 // Document canvas border height
}

Layer configuration layers(PCB)

The field name:layers. String array type. Layer configuration information is only in the PCB type document, The display and activation of layer tools are recorded.

for example:

[
"1~TopLayer~#FF0000~true~true~true~",
"2~BottomLayer~#0000FF~true~false~true~",
"3~TopSilkLayer~#FFCC00~true~false~true~",
"4~BottomSilkLayer~#66CC33~true~false~true~",
"21~Inner1~#999966~true~false~true~0~Plane",
]

数组中每条数据表示对应层的相关层信息,使用间隔符~分开,数据格式为:

1.[layerid]:层的id标识
2.[name]:层名称
3.[color]:层颜色
4.[visible]:层是否可见
5.[active]:是否为当前激活层
6.[config]:是否配置当前层
7.[transparency]:层透明度
8.[type]:层类型(内电层 | 信号层),内层专有配置

元素的可选与显示配置objects(PCB)

字段:objects。字符串数组类型。记录层工具的元素可选与显示设置信息(pcb类型文档专用)。

示例:

[
"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"
]

数据格式:

1.[key]:元素关键字标识符(不能包含空格,会用_替换带有空格的key)
2.[selected]:是否可选中
3.[visible]:是否显示

偏好设置preference(PCB)

字段:preference。json类型。记录文档的一些偏好设置(pcb类型文档专用)。

示例:

{
"hideFootprints": "",
"hideNets": ""
}

drc检测规则DRCRULE(PCB)

字段:DRCRULE。json类型。记录drc检测规则配置信息(pcb类型文档专用)。

示例:

{
"Default": { // 默认配置
"trackWidth": 1, // 线宽
"clearance": 0.6, // 检测间距
"viaHoleDiameter": 2.4, // 孔外径
"viaHoleD": 1.2 // 孔内径
},
"isRealtime": false, // 是否实时检测
"isDrcOnRoutingOrPlaceVia": false, // 是否在布线与放置过孔时应用设计规则
"checkObjectToCopperarea": true, // 是否检测元素到铺铜的距离
"showDRCRangeLine": true // 是否在布线时显示DRC安全边界
}

自动布线规则routerRule(PCB)

字段:routerRule。json类型。记录布线规则的配置信息(pcb类型文档专用)。

{
"unit": "mil", // 单位
"trackWidth": 6, // 线宽
"trackClearance": 6, // 间距
"viaHoleD": 12, // 孔内径
"viaDiameter": 24, // 孔外径
"routerLayers": [ // 布线层配置
1,
2
],
"smdClearance": 6, // 贴片和器件的间距
"specialNets": [ // 特殊网络配置
{
"net": "AAA", // 网络
"width": "15mil", // 线宽
"clearance": "11mil" // 间距
}
],
"nets": [ // 所有网络
"AAA"
],
"padsCount": 1, // 焊盘数量
"skipNets": [], // 忽略的网络配置
"realtime": true // 实时检测
}

网络颜色netColors(PCB)

字段:netColors。json类型。记录网络颜色配置信息(pcb类型文档专用)。

示例:

{
"DSA": {
"color": "#339933"
},
"FSADFDSA": {
"color": "#FF0000"
}
}

仿真数据(波形图)waveForm

字段:waveForm。json字符串类型。仿真波形图专用字段,用于存储波形图数据。

图元格式

基础图元组合起来就是一个完整的器件(封装),比如最基本的矩形、圆这种简单图元,复杂一点的图元如引脚、网络标签、焊盘等。复杂图元其实也是简单基本图元组成的。

原理图的基础图元和pcb的基础图元基本都不一致。

两种文档类型的基础图元都有一种特殊图元,特殊图元独立存在,不再组成其他元素,比如原理图的schlib和pcb的FOOTPRINT,即原理图器件和pcb封装,这两种图元基本都由其他基础图元组成,但不允许有本身图元组成。

数据类型:string。基本数据以分隔符~隔开。

原理图部分

1.简单图元

折线polyline

示例:

"PL~230 290 430 180 550 340~#000000~1~0~none~gge5~0"

数据格式:

1.[cmdKey]:图元标识符,默认为"PL"。
2.[pointerStr]:折线polyline的points数据字符串
3.[strokeColor]:线条颜色
4.[strokeWidth]:线条宽度
5.[strokeStyle]:线条样式
6.[fillColor]:填充颜色
7.[gId]:元素id
8.[locked]:是否锁定

导线wire

示例:

"W~495 -580 495 -475 580 -475~#008800~1~0~none~gge79~0"

导线的数据格式除了首位标识符为W,其余结构同polyline一致。

总线bus

示例:

"B~410 -565 400 -455~#008800~2~0~none~gge80~0"

总线的数据格式除了首位标识符为B,其余结构同polyline一致。

多边形polygon

示例:

"PG~290 260 340 350 440 230 390 200 390 200~#000000~1~0~none~gge5~0"

多边形的数据格式除了首位标识符为PG,其余结构同polyline一致。

矩形rect

示例:

"R~360~250~~~70~80~#000000~1~0~none~gge6~0~"

数据格式:

1.[cmdKey]:图元标识符,R
2.[x]:横坐标
3.[y]:纵坐标
4.[rx]:水平轴向的圆角半径尺寸
5.[ry]:垂直轴向的圆角半径尺寸
6.[width]:矩形宽度
7.[height]:矩形高度
8.[strokeColor]:线条颜色
9.[strokeWidth]:线条宽度
10.[strokeStyle]:线条样式
11.[fillColor]:填充颜色
12.[gId]:元素id
13.[locked]:是否锁定
14:[c_etype]:c_etype属性值(自定义的用于细分图元类型的属性)

图片image

示例:

"I~360~290~104~26~0~data:image/png;base64,iVBORw......TkSuQmCC~gge11~0~"

数据格式:

1.[cmdKey]:图元标识符,I
2.[x]:x坐标
3.[y]:y坐标
4.[width]:图片宽度
5.[height]:图片高度
6.[rotate]:旋转角度
7.[href]:图片的数据信息
8.[gId]:元素id
9.[locked]:是否锁定
10.[transform]:偏移属性

circle

注:新版本已弃用(椭圆可代替)。

示例:

"C~685~315~35~#000000~1~0~none~gge21~0"

数据格式:

1.[cmdKey]:图元标识符,C
2.[cx]:圆心x坐标
3.[cy]:圆心y坐标
4.[r]:半径
5.[strokeColor]:线条颜色
6.[strokeWidth]:线条宽度
7.[strokeStyle]:线条样式
8.[fillColor]:填充颜色
9.[gId]:元素id
10.[locked]:是否锁定

椭圆ellipse

示例:

"E~420~295~40~25~#000000~1~0~none~gge22~0"

数据格式:

1.[cmdKey]:图元标识符,E
2.[cx]:圆心x坐标
3.[cy]:圆心y坐标
4.[rx]:x轴上椭圆的半径
5.[ry]:y轴上椭圆的半径
6.[strokeColor]:线条颜色
7.[strokeWidth]:线条宽度
8.[strokeStyle]:线条样式
9.[fillColor]:填充颜色
10.[gId]:元素id
11.[locked]:是否锁定

直线line

示例:

"L~0~470~-765~480~-775~gge105~0"

数据格式:

1.[cmdKey]:图元标识符,L
2.[x1]:起点横坐标
3.[y1]:起点纵坐标
4.[x2]:终点横坐标
5.[y2]:终点纵坐标
6.[strokeColor]:线条颜色
7.[strokeWidth]:线条宽度
8.[strokeStyle]:线条样式
9.[fillColor]:填充颜色
10.[gId]:元素id
11.[locked]:是否锁定

路径path

示例:

"PT~M370 280 C410 380 490 300 440 240~#000000~1~0~none~gge23~0~"

数据格式:

1.[cmdKey]:图元标识符,PT
2.[pathString]:path路径
3.[strokeColor]:线条颜色
4.[strokeWidth]:线条宽度
5.[strokeStyle]:线条样式
6.[fillColor]:填充颜色
7.[gId]:元素id
8.[locked]:是否锁定

圆弧arc

示例:

"A~M 459.9983 319.997 A 70 170 0 1 1 461.2807 267.9875~~#000000~1~0~none~gge26~0"

数据格式:

1.[cmdKey]:图元标识符,A
2.[pathString]:path路径
3.[helperDots]:已移除,占位。
4.[strokeColor]:线条颜色
5.[strokeWidth]:线条宽度
6.[strokeStyle]:线条样式
7.[fillColor]:填充颜色
8.[gId]:元素id
9.[locked]:是否锁定

文本annotation

示例:

"T~L~390~300~0~#0000FF~~9pt~~~~comment~Text~1~start~gge27~0~pinpart"

数据格式:

1.[cmdKey]:图元标识符,A
2.[mark]:文本标记,可选值:L(普通文本) | N(器件名称) | P(器件编号) | PK(封装名)
3.[x]:横坐标
4.[y]:纵坐标
5.[rotation]:旋转角度
6.[fillColor]:填充颜色
7.[fontFamily]:字体
8.[fontSize]:文字大小
9.[fontWeight]:文字粗细
10.[fontStyle]:文字样式(自动 | 正常 | 斜体)
11.[dominantBaseline]:文字的dominant-baseline属性
12.[type]:文本类型(注释 | 仿真)
13.[value]:文本值
14.[visible]:是否可见
15.[textAnchor]:文字的text-anchor属性
16.[gId]:元素id
17.[locked]:是否锁定
18.[c_etype]:c_etype属性值(c_etype是自定义的用于细分图元类型的属性)

表格图片pimage

注:目前只用于表格内的图片,为了与普通图片做区分使用的一种新类型图元表示。

示例:

"Pimage~L~1~gge74~0~gge75~694.99995~-38~104~26~data:image/png;base64,iVBORw0KG......pCvHNepOOktyLeC61RcZ3JlkHPt9dXiX4IAntNzzH4CAAAAAElFTkSuQmCC"

数据格式:

1.[cmdKey]:图元标识符,Pimage
2.[mark]:特殊标记(未使用)
3.[visible]:是否可见(未使用)
4.[locked]:是否锁定
5.[imgid]:元素id
6.[imgx]:x坐标
7.[imgy]:y坐标
8.[imgwidth]:图片宽度
9.[imgheight]:图片高度
10.[imghref]:图片base64数据信息

2.复杂图元

引脚pin

注:引脚的数据格式使用了两种分隔符,外层整体数据使用^^,内层单一数据再使用~分隔。

示例:

"P~show~0~1~420~300~~gge31~0^^420~300^^M 420 300 h -20~#880000^^1~398~303~0~1~end~~~#0000FF^^1~405~299~0~1~start~~~#0000FF^^0~403~300^^0~M 400 297 L 397 300 L 400 303"

数据格式:

#1.[configure] - 配置信息
1.[cmdKey]:图元标识符,P
2.[dispaly]:是否显示
3.[electric]:电气属性
4.[spicePin]:仿真编号
5.[x]:横坐标 //弃用,参考path
6.[y]:纵坐标 //弃用,参考path
7.[rotation]:旋转角度
8.[gId]:元素id
9.[locked]:是否锁定

#2.[pinDot] - 引脚吸附点(起点)信息
1.[x]:起点横坐标 //弃用,参考path
2.[y]:起点纵坐标 //弃用,参考path

#3.[path] - 引脚路径信息
1.[pathString]:路径数据
2.[pinColor]:引脚颜色

#4.[name] - 引脚名称信息
1.[visible]:是否可见
2.[x]:横坐标
3.[y]:纵坐标
4.[rotation]:旋转角度
5.[text]:文本值
6.[textAnchor]:文字的text-anchor属性
7.[fontFamily]:字体
8.[fontSize]:文本大小
9.[fillColor]:文本填充颜色

#5.[num] - 引脚编号信息
1.[visible]:是否可见
2.[x]:横坐标
3.[y]:纵坐标
4.[rotation]:旋转角度
5.[text]:文本值
6.[textAnchor]:文字的text-anchor属性
7.[fontFamily]:字体
8.[fontSize]:文本大小
9.[fillColor]:文本填充颜色

#6.[num] - 引脚终点信息
1.[visible]: 终点是否可见
2.[x]:终点横坐标
3.[y]:终点纵坐标

#7.[clock] - 引脚时钟信息
1.[visible]: 时钟是否显示
2.[pathString]:时钟路径信息

连接点junction

示例:

"J~425~-170~2.5~#CC0000~gge130~0"

数据格式:

1.[cmdKey]:图元标识符,J
2.[x]:横坐标
3.[y]:纵坐标
4.[r]:半径
5.[fillColor]:填充颜色
6.[gId]:元素id
7.[locked]:是否锁定

标识符netflag

注:同引脚的数据格式类似,使用了两种分隔符,外层整体数据使用^^,内层单一数据再使用~分隔。

示例:

"F~part_netLabel_+5V~425~-170~270~gge124~~0^^425~-170^^+5V~#000000~435.5~-166~0~start~1~Times New Roman~9pt~gge126^^PL~435 -170 425 -170~#000000~1~0~none~gge128~0^^PL~435 -175 435 -165~#000000~1~0~transparent~gge129~0"

数据格式:

#1.[configure] - 配置信息
1.[cmdKey]:图元标识符,F
2.[partId]:标识符类型以及文本信息
3.[x]:横坐标
4.[y]:纵坐标
5.[rotation]:旋转角度
6.[gId]:元素id
7.[transform]:偏移信息(旧版本)
8.[locked]:是否锁定

#2.[pinDot] - 吸附点信息
1.[x]:吸附点横坐标
2.[y]:吸附点纵坐标

#3.[mark] - 标识符文本信息
1.[netFlagString]:文本值
2.[fillColor]:填充颜色
3.[x]:横坐标
4.[y]:纵坐标
5.[rotation]:旋转角度
6.[textAnchor]:文字的text-anchor属性
7.[visible]:是否可见
8.[fontFamily]:字体
9.[fontSize]:文本大小
10.[gId]:文本元素id

网络标签netlabel

示例:

"N~515~-430~0~#0000ff~netLabel1~gge78~start~517~-432.5~Times New Roman~7pt~0"

数据格式:

1.[cmdKey]:图元标识符,N
2.[x]:横坐标
3.[y]:纵坐标
4.[rotation]:旋转角度
5.[fillColor]:填充颜色
6.[textAnchor]:文字的text-anchor属性
7.[visible]:是否可见
8.[fontFamily]:字体
9.[fontSize]:文本大小
10.[gId]:文本元素id

总线分支busentry

示例:

"BE~0~495~-405~505~-415~gge78~0"

数据格式:

1.[cmdKey]:图元标识符,BE
2.[x1]:起点横坐标
3.[y1]:起点纵坐标
4.[x2]:终点横坐标
5.[y2]:终点纵坐标
6.[gId]:元素id
7.[locked]:是否锁定

箭头arrowhead

示例:

"AR~part_arrowhead~410~300~gge5~0~M 410 300 L 395 307.5 L 398.75 300 L 395 292.5 Z ~#000000~0~3~15"

数据格式:

1.[cmdKey]:图元标识符,AR
2.[partType]:放置类型,固定为"part_arrowhead"
3.[x]:横坐标
4.[y]:纵坐标
5.[gId]:文本元素id
6.[rotation]:旋转角度
7.[pathString]:箭头路径数据
8.[fillColor]:填充颜色
9.[locked]:是否锁定
10.[arrowtype]:箭头类型(1 | 2 | 3)
11.[arrowsize]:箭头尺寸

无连接标志noconnectflag

示例:

"O~0~0~gge86~M-4 -4L4 4M4 -4L-4 4~#33cc33~0"

数据格式:

1.[cmdKey]:图元标识符,O
2.[x]:横坐标
3.[y]:纵坐标
4.[gId]:文本元素id
5.[pathString]:路径数据
6.[strokeColor]:线条颜色
7.[locked]:是否锁定

3.特殊图元

形状SHEET

这里的形状可以理解为自由格式的组合,可以自定义数据格式,目前原理图没有使用入口,主要在pcb中使用,例如pcb文档中的图形3D模型等都使用的svgnode图元进行构建。更多细节请参考基础图元格式 > PCB部分 > 特殊图元 > 形状svgnode

器件schlib

原理图的schlib即原理图器件(库文件),库文件可以由其他图元组成,但不能由库本身组成库,原理图库只能放置在原理图中。

在原理图中,schlib压缩数据同其他图元一样会放到shape字段下,schlib格式分为两部分组成:

  • 器件的头部数据:头部数据以分隔符~隔开。
  • 器件的内部图元数据:图元之间将会以分隔符#@$隔开。

两部分数据再以分隔符号#@$隔开。

示例:

"LIB~0~0~package`R0201`nameAlias`Value(Ω)`BOM_Supplier Part``BOM_Supplier``Contributor`LCEDA_Lib`spicePre`R`spiceSymbolName`R_0201_US`BOM_Manufacturer Part``~~0~gge3fb2f834261e887c~b600ab0518154c0c9d2ed5ca96244c69~36be002046ee442daec3a30b0f22c9fe~0~~yes~yes#@$T~N~-5.96875~-8~0~#000080~Arial~~~~~comment~1k~1~start~gge167~0~#@$T~P~-5.96875~-17.15625~0~#000080~Arial~~~~~comment~R1~1~start~gge169~0~#@$PL~15 0 12 5~#A00000~1~0~none~gge171~0#@$PL~7 -5 2 5~#A00000~1~0~none~gge172~0#@$PL~12 5 7 -5~#A00000~1~0~none~gge173~0#@$P~show~0~2~20~0~0~gge174~0^^20~0^^M 20 0 h -5~#800^^0~11~0~0~2~end~~~#800^^0~19~-4~0~2~start~~~#800^^0~18~0^^0~M 15 -3 L 12 0 L 15 3#@$PL~-7 5 -12 -5~#A00000~1~0~none~gge181~0#@$PL~2 5 -2 -5~#A00000~1~0~none~gge182~0#@$PL~-2 -5 -7 5~#A00000~1~0~none~gge183~0#@$PL~-12 -5 -15 0~#A00000~1~0~none~gge184~0#@$P~show~0~1~-20~0~180~gge185~0^^-20~0^^M -20 0 h 5~#800^^0~-11~0~0~1~start~~~#800^^0~-19~-4~0~1~end~~~#800^^0~-18~0^^0~M -15 3 L -12 0 L -15 -3"

数据格式:

#1.[器件头部数据]
1.[cmdKey]:图元标识符,LIB
2.[x]:横坐标
3.[y]:纵坐标
4.[c_para]:自定义属性
5.[rotation]:旋转角度
6.[importFlag:eagle导入标记
7.[gId]:元素id
8.[puuid]:绑定的pcb封装uuid
9.[uuid]:器件的uuid
10.[locked]:是否锁定
11.[bind_pcb_id]:绑定的pcb封装的id(弃用)
12.[convert_to_pcb]:是否更新到pcb
13.[add_into_bom]:是否加入bom表单

#2.[器件内部图元数据]:即其他基本图元的压缩格式。

PCB部分

1.简单图元

导线TRACK

示例:

"TRACK~1~1~~4055.5 3348 4055.5 3346 4131.5 3270 4096 3270~gge5~0"

数据格式:

1.[cmdKey]:图元标识符,TRACK
2.[strokeWidth]:线宽
3.[layerid]:所属层
4.[net]:网络
5.[pointArr]:坐标点数据
6.[gId]:元素id
7.[locked]:是否锁定

矩形RECT

示例:

"RECT~4065.5~3293.25~63~45.5~1~gge6~0~0~~~~"

数据格式:

1.[cmdKey]:图元标识符,RECT
2.[x]:横坐标
3.[y]:纵坐标
4.[width]:宽度
5.[height]:高度
6.[layerid]:所属层
7.[gId]:元素id
8.[locked]:是否锁定
9.[strokeWidth]:线宽
10.[fill]:填充颜色
11.[transform]:偏移数据
12.[net]:网络
13.[c_etype]:c_etype属性值(自定义的用于细分图元类型的属性)

CIRCLE

示例:

"CIRCLE~4193.5~3148~45.6426~1~1~gge5~0~~circle_gge8,circle_gge9"

数据格式:

1.[cmdKey]:图元标识符,CIRCLE
2.[cx]:圆心x坐标
3.[cy]:圆心y坐标
4.[r]:半径
5.[strokeWidth]:线宽
6.[layerid]:所属层
7.[gId]:元素id
8.[locked]:是否锁定
9.[net]:网络
10.[transformarc]:由圆转换的两个半圆的id信息

文本TEXT

示例:

"TEXT~L~4081~3306.5~0.8~0~0~1~~8~TEXT~M 4083.55 3298.44 L 4083.55 3306.07 M 4081 3298.44 L 4086.09 3298.44 M 4088.49 3298.44 L 4088.49 3306.07 M 4088.49 3298.44 L 4093.22 3298.44 M 4088.49 3302.07 L 4091.4 3302.07 M 4088.49 3306.07 L 4093.22 3306.07 M 4095.62 3298.44 L 4100.71 3306.07 M 4100.71 3298.44 L 4095.62 3306.07 M 4105.65 3298.44 L 4105.65 3306.07 M 4103.11 3298.44 L 4108.2 3298.44~~gge13~~0~pinpart"

数据格式:

1.[cmdKey]:图元标识符,TEXT
2.[type]:文本标记,可选值:L(普通文本) | N(器件名称) | P(器件编号) | PK(封装名)
3.[x]:横坐标 //弃用,参考pathStr
4.[y]:纵坐标 //弃用,参考pathStr
5.[strokeWidth]:线宽
6.[rotation]:旋转角度 //弃用,参考pathStr
7.[mirror]:是否镜像 //弃用,参考pathStr
8.[layerid]:所属层
9.[net]:网络
10.[fontSize]:文字大小
11.[text]:文本值 //弃用,参考pathStr
12.[pathStr]:路径数据
13.[display]:是否显示
14.[gId]:元素id
15.[fontFamily]:字体
16.[locked]:是否锁定
17.[c_etype]:c_etype属性值(c_etype是自定义的用于细分图元类型的属性)

圆弧ARC

示例:

"ARC~1~1~~M 4108.3572 3265.4999 A 53.7587 53.7587 0 1 0 4130.4018 3353.4528~~gge16~0"

数据格式:

1.[cmdKey]:图元标识符,ARC
2.[strokeWidth]:线宽
3.[layerid]:所属层
4.[net]:网络
5.[d]:路径数据
6.[c_helper_dots]:辅助线路径数据
7.[gId]:元素id
8.[locked]:是否锁定

2.复杂图元

焊盘PAD

示例:

"PAD~ELLIPSE~4020~3308.5~6~6~11~~1~1.8~~0~gge5~0~~Y~0~~~4020,3308.5",

数据格式:

1.[cmdKey]:图元标识符,PAD
2.[shape]:焊盘形状
3.[x]:横坐标
4.[y]:纵坐标
5.[width]:宽度
6.[height]:高度
7.[layerid]:所属层
8.[net]:网络
9.[number]:编号
10.[holeR]:孔直径
11.[pointArr]:坐标点数据
12.[rotation]:旋转角度
13.[gId]:元素id
14.[holeLength]:孔长度
15.[slotPointArr]:孔的坐标点数据
16.[plated]:是否金属化
17.[locked]:是否锁定
18.[pasteexpansion]:助焊扩展
19.[solderexpansion]:阻焊扩展
20.[holeCenter]:孔中心坐标

过孔VIA

示例:

"VIA~4030~3308.5~2.4~~0.6~gge11~0",

数据格式:

1.[cmdKey]:图元标识符,VIA
2.[x]:横坐标
3.[y]:纵坐标
4.[diameter]:过孔直径
5.[net]:网络
6.[holeR]:过孔内径
7.[gId]:元素id
8.[locked]:是否锁定

通孔HOLE

示例:

"HOLE~4041.5~3309~4~gge15~0"

数据格式:

1.[cmdKey]:图元标识符,HOLE
2.[x]:横坐标
3.[y]:纵坐标
4.[holeR]:孔直径
5.[gId]:元素id
6.[locked]:是否锁定

铺铜COPPERAREA

示例:

"COPPERAREA~1~1~GND~M 4055 3023.5 L 4055 3060.5 L 4060 3065.5 L 4108.5 3065.5 L 4115.5 3058.5 L4115.5,3025 L4114,3023.5 Z~1~solid~gge83~spoke~none~~0~~1~1~1~1~yes~0",

数据格式:

1.[cmdKey]:图元标识符,COPPERAREA
2.[strokeWidth]:线宽
3.[layerid]:所属层
4.[net]:网络
5.[pathStr]:路径数据
6.[clearanceWidth]:间距
7.[fillStyle]:填充样式
8.[gId]:元素id
9.[thermal]:焊盘连接方式(发散 | 直连)
10.[keepIsland]:是否保留孤岛
11.[compressData]:铺铜压缩数据
12.[locked]:是否锁定
13.[name]:名称
14.[order]:顺序
15.[gridTrackWidth]:网格线宽
16.[gridClearance]:网格间距
17.[toBoardOutline]:到边框间距
18.[fabricationImprove]:是否制造优化
19.[spoke_width]:发散线宽

实心填充SOLIDREGION

示例:

"SOLIDREGION~1~~M 4012 3300.5 L 4012 3317.5 L 4019.5 3325 L 4034 3325 L 4040 3319 L 4040 3308 L 4031 3299 L4019.5,3299 L4018.5,3298 Z~solid~gge20~~~~0"

数据格式:

1.[cmdKey]:图元标识符,SOLIDREGION
2.[layerid]:所属层
3.[net]:网络
4.[pathStr]:路径数据
5.[type]:类型
6.[gId]:元素id
7.[teardrop]:泪滴
8.[targetPad]:目标焊盘
9.[targetWire]:目标导线
10.[locked]:是否锁定

尺寸DIMENSION

示例:

"DIMENSION~12~M4015.9632,3321.9632L4038.4632,3299.4632M......M 4035.5 3296.5 4045.5342 3306.5342~gge21~~0~straight~0.4"

数据格式:

1.[cmdKey]:图元标识符,DIMENSION
2.[layerid]:所属层
3.[d]:路径数据
4.[gId]:元素id
5.[fontSize]:尺寸高度
6.[locked]:是否锁定
7.[measuring_type]:尺寸类型
8.[font_width]:尺寸宽度

量角器PROTRACTOR

示例:

"PROTRACTOR~12~M4051.5 3328 L4051.5 3299.4825M4051.5 3328...... L4069.39 3309.77 ~0.4~gge22~4.5~0~0"

数据格式:

1.[cmdKey]:图元标识符,PROTRACTOR
2.[layerid]:所属层
3.[d]:路径数据
4.[strokeWidth]:线宽
5.[gId]:元素id
6.[fontSize]:文字大小
7.[precision]:精度
8.[locked]:是否锁定

3.特殊图元

形状SVGNODE

这里的形状可以理解为自由格式的组合,可以自定义数据格式,主要在pcb中使用,例如pcb文档中的图形3D模型等都使用的svgnode图元进行构建。

比如导入的图形:

"SVGNODE~{\"gId\":\"gge65\",\"nodeName\":\"path\",\"nodeType\":1,\"layerid\":\"1\",\"attrs\":{\"d\":\"M 4002.49 2996.53 L 4001.2451 2998.03 L 3999.3676 2998.03 L 3997.49 2998.03 L 3997.49 2999.471 C 3997.49 3000.2635 3997.9693 3001.2082 3998.5551 3001.5703 L 3999.6203 3002.2286 L 3997.8946 3004.1354 L 3996.1689 3006.0423 L 3996.8233 3006.6967 L 3997.4777 3007.3511 L 3999.3405 3005.6653 L 4001.2032 3003.9795 L 4002.4599 3005.4938 L 4003.7166 3007.008 L 4004.6033 3006.46 C 4005.091 3006.1586 4005.49 3005.1083 4005.49 3004.126 L 4005.49 3002.34 L 4007.4981 3000.5227 L 4009.5062 2998.7054 L 4007.8431 2996.8677 C 4005.8255 2994.6383 4004.1478 2994.5324 4002.49 2996.53\",\"id\":\"gge65\",\"stroke\":\"none\",\"layerid\":\"1\"}}"

数据格式:

SVGNODE的格式由两部分组成,第一部分只有图元标识符”SVGNODE”,第二部分为形状的组成数据,数据格式为JSON数据字符串。

内电层PLANEZONE

示例:

"PLANEZONE~21~GND~solid~planeL21B0#@$planeL21B0I0~M4342.5,3232 4342.5,3169 4420.5,3169 4420.5,3232zM4375.6222,3223.2077 4375.6314,3223.2077 4376.0759,3223.2015 4376.0852,3223.2012 4376.5294,3223.1869z"

数据格式:

压缩数据同其他图元一样会放到shape字段下,格式由两部分组成:

  • 内电层的基本信息:数据以分隔符~隔开。
  • 内电层路径数据:包含若干路径数据,数据以分隔符~隔开。

两部分数据再以分隔符号#@$隔开。

#1.[内电层基本信息]
1.[cmdKey]:图元标识符,PLANEZONE
2.[layerid]:所属层
3.[net]:网络
4.[fillStyle]:填充类型
5.[gId]:元素id

#2.[内电层路径数据]
1.[gId]:路径元素id
2.[pathStr]:路径数据

封装FOOTPRINT

pcbd的FOOTPRINT同原理图的schlib类似,即PCB库文件。库文件可以由其他图元组成,但不能由库本身组成库,pcb库只能放置在PCB中。

在PCB中,FOOTPRINT压缩数据同其他图元一样会放到shape字段下,FOOTPRINT格式分为两部分组成:

  • 封装的头部数据:头部数据以分隔符~隔开。
  • 封装的内部图元数据:图元之间将会以分隔符#@$隔开。

两部分数据再以分隔符号#@$隔开。

示例:

"LIB~4058.9147~3070~package`R0201`~~~gge929a3f9f08f43af9~1~b600ab0518154c0c9d2ed5ca96244c69~1565922186~0~#@$TEXT~N~4057.97~3060~0.6~0~~3~~4.5~1k~M 4057.97 3056.28 L 4058.38 3056.07 L 4058.99 3055.46 L 4058.99 3059.75 M 4060.34 3055.46 L 4060.34 3059.75 M 4062.39 3056.89 L 4060.34 3058.94 M 4061.16 3058.12 L 4062.59 3059.75~none~gge3~~0~#@$TEXT~P~4057.97~3067~0.6~0~~3~~4.5~R1~M 4057.97 3062.46 L 4057.97 3066.75 M 4057.97 3062.46 L 4059.81 3062.46 L 4060.42 3062.66 L 4060.63 3062.87 L 4060.83 3063.28 L 4060.83 3063.69 L 4060.63 3064.1 L 4060.42 3064.3 L 4059.81 3064.5 L 4057.97 3064.5 M 4059.4 3064.5 L 4060.83 3066.75 M 4062.18 3063.28 L 4062.59 3063.07 L 4063.21 3062.46 L 4063.21 3066.75~~gge5~~0~#@$TRACK~0.3937~3~~4056.5525 3068.5039 4058.521 3068.5039~gge7~0#@$TRACK~0.3937~3~~4056.5525 3068.5039 4056.5525 3071.4961~gge8~0#@$TRACK~0.3937~3~~4056.5525 3071.4961 4058.521 3071.4961~gge9~0#@$TRACK~0.3937~3~~4059.3084 3071.4961 4061.2769 3071.4961~gge10~0#@$TRACK~0.3937~3~~4061.2769 3068.5039 4061.2769 3071.4961~gge11~0#@$TRACK~0.3937~3~~4059.3084 3068.5039 4061.2769 3068.5039~gge12~0#@$PAD~RECT~4059.997~3070~1.1811~1.5748~1~R1_2~2~0~4059.4065 3069.2126 4060.5876 3069.2126 4060.5876 3070.7874 4059.4065 3070.7874~0~gge13~0~~Y~0~0~0.4~4059.9969,3070#@$PAD~RECT~4057.832~3070~1.1811~1.5748~1~R1_1~1~0~4057.2415 3069.2126 4058.4226 3069.2126 4058.4226 3070.7874 4057.2415 3070.7874~0~gge18~0~~Y~0~0~0.4~4057.8323,3070"

数据结构:

#1.[封装头部数据]
1.[cmdKey]:图元标识符,LIB
2.[x]:横坐标
3.[y]:纵坐标
4.[c_para]:自定义属性
5.[rotation]:旋转角度
6.[importFlag:eagle导入标记
7.[gId]:元素id
8.[layerid]:所属层
9.[uuid]:封装的uuid
10.[utime]:更新时间
11.[locked]:是否锁定
12.[bind_sch_id]:绑定的原理图器件的id(弃用)

#2.[封装内部图元数据]:即其他基本图元的压缩格式。

图纸SHEET

原理图的图纸是一种特殊的器件,PCB中的图纸也可以理解为特殊的封装,但PCB使用的单独的图元来表示PCB图纸,所以图纸的结构也同封装结构一致,分为两部分:

  • 图纸的头部数据:头部数据以分隔符~隔开。
  • 图纸的内部图元数据:图元之间将会以分隔符#@$隔开。

两部分数据再以分隔符号#@$隔开。

数据格式:

#1.[图纸头部数据]
1.[cmdKey]:图元标识符,SHEET
2.[x]:横坐标
3.[y]:纵坐标
4.[locked]:是否锁定
5.[layerid]:所属层
6.[gId]:元素id

#2.[图纸内部图元数据]:即其他基本图元的压缩格式。

原理图文件格式

一个原理图可以包含多个图页,每个图页都可以作为一份独立原理图文档,所以这里的原理图可以理解为原理图工程,可以包含若干原理图页,在压缩格式中使用schematics字段来标识改工程下的所有原理图页,类型为JSON数组

示例如下:

{
"editorVersion": "6.3.0", // 版本号
"docType": "5", // 文档类型
"title": "New Project", // 文档标题
"description": "", // 文档描述
"colors": {}, // 文档颜色配置(弃用)
"schematics": [
{
"docType": "1",
"title": "Sheet_1",
"description": "",
"dataStr": "{\"head\":{\"docType\":\"1\",\"editorVersion\":\"6.3.0\",\"newgId\":true,\"c_para\":{\"Prefix Start\":\"1\"},\"c_spiceCmd\":null},\"canvas\":\"CA~1000~1000~#FFFFFF~yes~#CCCCCC~5~1000~1000~line~5~pixel~5~0~0\",\"shape\":[\"LIB~0~-5~package`RES-ADJ-TH_3386P`BOM_Supplier Part``BOM_Supplier`LCSC`BOM_Manufacturer Part``nameAlias`Value`Contributor`LCEDA_Lib`BOM_value(Ω)`10K`spicePre`R`spiceSymbolName`R_3386P_US`~~0~gge348eb5222b2937f0~ce6e0cc9b0684cd986edbf86d7075dfd~e0b0d01b6e0d44dbab9db0ad79a427bc~0~~yes~yes#@$T~N~-9.15625~15.34375~0~#000080~Arial~~~~~comment~R_3386P_US~1~start~gge103~0~#@$T~P~-9.15625~7~0~#000080~Arial~~~~~comment~RP1~1~start~gge105~0~#@$P~show~0~2~0~-25~90~gge107~0^^0~-25^^M 0 -25 v 10~#880000^^0~3~-13~270~2~end~~~#0000FF^^0~-1~-20~270~2~start~~~#0000FF^^0~0~-18^^0~M -3 -15 L 0 -12 L 3 -15#@$E~11~-8~1~1~#A00000~1~0~none~gge114~0#@$PG~-2 -15 0 -11 2 -15~#880000~1~0~none~gge115~0#@$P~show~0~1~20~-5~0~gge116~0^^20~-5^^M 20 -5 h -10~#8D2323^^0~7~-2~0~1~end~~~#8D2323^^0~14~-6~0~1~start~~~#8D2323^^0~13~-5^^0~M 10 -8 L 7 -5 L 10 -2#@$P~show~0~3~-20~-5~180~gge123~0^^-20~-5^^M -20 -5 h 10~#8D2323^^0~-6~-2~0~3~start~~~#8D2323^^0~-14~-6~0~3~end~~~#8D2323^^0~-13~-5^^0~M -10 -2 L -7 -5 L -10 -8#@$PL~0 -15 0 -11~#880000~1~0~none~gge130~0#@$PL~9 -1 10 -5~#8D2323~1~0~none~gge131~0#@$PL~6 -9 9 -1~#8D2323~1~0~none~gge132~0#@$PL~4 -1 6 -9~#8D2323~1~0~none~gge133~0#@$PL~1 -9 4 -1~#8D2323~1~0~none~gge134~0#@$PL~-1 -1 1 -9~#8D2323~1~0~none~gge135~0#@$PL~-3 -9 -1 -1~#8D2323~1~0~none~gge136~0#@$PL~-6 -1 -3 -9~#8D2323~1~0~none~gge137~0#@$PL~-8 -9 -6 -1~#8D2323~1~0~none~gge138~0#@$PL~-10 -5 -8 -9~#8D2323~1~0~none~gge139~0\"],\"BBox\":{\"x\":-22,\"y\":-27,\"width\":70.4,\"height\":43.7},\"colors\":{}}"
},
{
"docType": "1",
"title": "Sheet_2",
"description": "",
"dataStr": "{\"head\":{\"docType\":\"1\",\"editorVersion\":\"6.3.0\",\"newgId\":true,\"c_para\":{\"Prefix Start\":\"1\"},\"c_spiceCmd\":null},\"canvas\":\"CA~1000~1000~#FFFFFF~yes~#CCCCCC~5~1000~1000~line~5~pixel~5~0~0\",\"shape\":[\"F~part_netLabel_netPort~15~0~0~gge78~~0^^15~0^^netPort1~#0000FF~-6.5~5~0~end~1~Times New Roman~8pt~gge80^^PL~15 0 10 5 -5 5 -5 -5 10 -5 15 0~#0000FF~1~0~transparent~gge82~0\"],\"BBox\":{\"x\":-44,\"y\":-5,\"width\":61,\"height\":12.7},\"colors\":{}}"
}
]
}

PCB文件格式

PCB不像原理图一样包含多页,所以PCB的文件格式和PCB库无结构上的差异。

示例:

{
"head": {
"docType": "3",
"editorVersion": "6.3.0",
"newgId": true,
"c_para": {},
"hasIdFlag": true
},
"canvas": "CA~1000~1000~#000000~yes~#FFFFFF~10~1000~1000~line~0.5~mil~1~45~~0.5~4087.5~3308.5~0~yes",
"shape": [
"TRACK~1~1~~4076.5 3290.5 4076.5 3296.5 4115.5 3335.5~gge5~0",
"PAD~ELLIPSE~4095~3304.5~6~6~11~~1~1.8~~0~gge6~0~~Y~0~~~4095,3304.5"
],
"layers": [
"1~TopLayer~#FF0000~true~true~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",
],
"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": 4076.5,
"y": 3290.5,
"width": 39,
"height": 45
},
"preference": {
"hideFootprints": "",
"hideNets": ""
},
"DRCRULE": {
"Default": {
"trackWidth": 1,
"clearance": 0.6,
"viaHoleDiameter": 2.4,
"viaHoleD": 1.2
},
"isRealtime": false,
"isDrcOnRoutingOrPlaceVia": false,
"checkObjectToCopperarea": true,
"showDRCRangeLine": true
},
"netColors": {}
}

更新日志

暂无


goToTop