Shape Primitives
RECT Rectangle
A rectangle is defined by two diagonal points, and its rotation is around point1.
json
{ "type": "RECT", "id": "UUID", "ticket": 1 }||
{
"partId": "",
"groupId": 0,
"locked": false,
"zIndex": 7.35,
"dotX1": 340,
"dotY1": 210,
"dotX2": 100,
"dotY2": 200,
"radiusX": 40,
"radiusY": 30,
"rotation": 90,
"strokeColor": null,
"strokeStyle": 0,
"fillColor": "",
"strokeWidth": null,
"fillStyle": 1,
}|1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
- type primitive name: RECT.
- id ID, unique within the file.
- ticket logical clock.
- partId sub-library ID, exclusive to symbol pages; ignored on schematics.
- groupId group ID, cannot be 0, empty by default when none.
- locked whether locked.
- zIndex Z-axis height.
- dotX1 point 1 X.
- dotY1 point 1 Y.
- dotX2 point 2 X.
- dotY2 point 2 Y.
- radiusX corner radius X:
0means no rounding. - radiusY corner radius Y:
0means no rounding. - rotation rotation angle, around
point1. - strokeColor color, null for default.
- strokeStyle style: 0 solid, 1 dashed, 2 dotted, 3 dash-dot.
- fillColor fill color:
""no fill; if filled, start and end points are automatically closed. - strokeWidth width, null for default.
- fillStyle fill style: 0 none, 1 solid, 2 grid, 3 horizontal line, 4 vertical line, 5 diamond, 6 left slash, 7 right slash.
POLY Polygon
json
{ "type": "POLY", "id": "UUID", "ticket": 1 }||
{
"partId": "",
"groupId": 0,
"locked": false,
"zIndex": 7.35,
"points": [390, 260, 450, 300, 560, 280, 540, 320],
"closed": false,
"strokeColor": null,
"strokeStyle": 0,
"fillColor": "",
"strokeWidth": null,
"fillStyle": 1,
}|1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
- type primitive name: POLY.
- id ID, unique within the file.
- ticket logical clock.
- partId sub-library ID, exclusive to symbol pages; ignored on schematics.
- groupId group ID, cannot be 0, empty by default when none.
- locked whether locked.
- zIndex Z-axis height.
- points point set coordinates: X Y X Y X Y ...
- closed whether to auto-close: if auto-closed, the end point will automatically connect to the start point.
- strokeColor color, null for default.
- strokeStyle style: 0 solid, 1 dashed, 2 dotted, 3 dash-dot.
- fillColor fill color:
""no fill; if filled, start and end points are automatically closed. - strokeWidth width, null for default.
- fillStyle fill style: 0 none, 1 solid, 2 grid, 3 horizontal line, 4 vertical line, 5 diamond, 6 left slash, 7 right slash.
CIRCLE Circle
json
{ "type": "CIRCLE", "id": "UUID", "ticket": 1 }||
{
"partId": "",
"groupId": 0,
"locked": false,
"zIndex": 2.332,
"centerX": 430,
"centerY": 200,
"radius": 21,
"strokeColor": null,
"strokeStyle": 0,
"fillColor": "",
"strokeWidth": null,
"fillStyle": 1,
}|1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
- type primitive name: CIRCLE.
- id ID, unique within the file.
- ticket logical clock.
- partId sub-library ID, exclusive to symbol pages; ignored on schematics.
- groupId group ID, cannot be 0, empty by default when none.
- locked whether locked.
- zIndex Z-axis height.
- centerX circle center X.
- centerY circle center Y.
- radius radius r.
- strokeColor color, null for default.
- strokeStyle style: 0 solid, 1 dashed, 2 dotted, 3 dash-dot.
- fillColor fill color:
""no fill; if filled, start and end points are automatically closed. - strokeWidth width, null for default.
- fillStyle fill style: 0 none, 1 solid, 2 grid, 3 horizontal line, 4 vertical line, 5 diamond, 6 left slash, 7 right slash.
ARC Arc
json
{ "type": "ARC", "id": "UUID", "ticket": 1 }||
{
"partId": "",
"groupId": 0,
"locked": false,
"zIndex": 0.8689,
"startX": -10,
"startY": 0,
"referX": 0,
"referY": 10,
"endX": 10,
"endY": 0,
"strokeColor": null,
"strokeStyle": 0,
"fillColor": "",
"strokeWidth": null,
"fillStyle": 1,
}|1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
- type primitive name: ARC.
- id ID, unique within the file.
- ticket logical clock.
- partId sub-library ID, exclusive to symbol pages; ignored on schematics.
- groupId group ID, cannot be 0, empty by default when none.
- locked whether locked.
- zIndex Z-axis height.
- startX start X.
- startY start Y.
- referX reference X.
- referY reference Y.
- endX end X.
- endY end Y.
- strokeColor color, null for default.
- strokeStyle style: 0 solid, 1 dashed, 2 dotted, 3 dash-dot.
- fillColor fill color:
""no fill; if filled, start and end points are automatically closed. - strokeWidth width, null for default.
- fillStyle fill style: 0 none, 1 solid, 2 grid, 3 horizontal line, 4 vertical line, 5 diamond, 6 left slash, 7 right slash.
BEZIER Cubic Bezier Curve
json
{ "type": "BEZIER", "id": "UUID", "ticket": 1 }||
{
"partId": "",
"groupId": 0,
"locked": false,
"zIndex": 2.1002,
"controls": [10, 10, 30, 20, 100, 30, 50, 70],
"strokeColor": null,
"strokeStyle": 0,
"fillColor": "",
"strokeWidth": null,
"fillStyle": 1,
}|1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
- type primitive name: BEZIER.
- id ID, unique within the file.
- ticket logical clock.
- partId sub-library ID, exclusive to symbol pages; ignored on schematics.
- groupId group ID, cannot be 0, empty by default when none.
- locked whether locked.
- zIndex Z-axis height.
- controls control points: X1 Y1 X2 Y2 X3 Y3 X4 Y4 ...
- strokeColor color, null for default.
- strokeStyle style: 0 solid, 1 dashed, 2 dotted, 3 dash-dot.
- fillColor fill color:
""no fill; if filled, start and end points are automatically closed. - strokeWidth width, null for default.
- fillStyle fill style: 0 none, 1 solid, 2 grid, 3 horizontal line, 4 vertical line, 5 diamond, 6 left slash, 7 right slash.
ELLIPSE Ellipse
json
{ "type": "ELLIPSE", "id": "UUID", "ticket": 1 }||
{
"partId": "",
"groupId": 0,
"locked": false,
"zIndex": 6.23,
"centerX": 670,
"centerY": 325,
"radiusX": 220,
"radiusY": 20,
"rotation": 0,
"strokeColor": null,
"strokeStyle": 0,
"fillColor": "",
"strokeWidth": null,
"fillStyle": 1,
}|1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
- type primitive name: ELLIPSE.
- id ID, unique within the file.
- ticket logical clock.
- partId sub-library ID, exclusive to symbol pages; ignored on schematics.
- groupId group ID, cannot be 0, empty by default when none.
- locked whether locked.
- zIndex Z-axis height.
- centerX center cx.
- centerY center cy.
- radiusX horizontal radius rx.
- radiusY vertical radius ry.
- rotation rotation angle rot.
- strokeColor color, null for default.
- strokeStyle style: 0 solid, 1 dashed, 2 dotted, 3 dash-dot.
- fillColor fill color:
""no fill; if filled, start and end points are automatically closed. - strokeWidth width, null for default.
- fillStyle fill style: 0 none, 1 solid, 2 grid, 3 horizontal line, 4 vertical line, 5 diamond, 6 left slash, 7 right slash.