1
0

Add key-level orient

This commit is contained in:
Bán Dénes 2021-12-25 21:22:37 +01:00
parent f2bd0d23a1
commit e48631fac8
10 changed files with 74 additions and 28 deletions

View File

@ -10,11 +10,12 @@
- Merge, generalize, and uniform-ize footprints
- Template for creating them, built-in variables they can use, documentation, external links, etc.
- Also considering how (or, on which layer) they define their silks, universal mirroring behaviour, etc.
- https://en.wikipedia.org/wiki/Reference_designator#Designators
### Minor
- Key-level orient
- 3D orient for cases
- Post-process anchor for global (post-mirror!) orient/shift/rotate for everything
- Allow shift/rotate for outlines (via `anchor_def`, probably)
- More generic anchors or distances?
- Intersect support for anchor affects clauses, which (combined with the math formulas and possible trigonometric functions) should allow for every use case we've discussed so far

View File

@ -91,6 +91,7 @@ const render_zone = exports._render_zone = (zone_name, zone, anchor, global_key,
spread: first_col ? 0 : units.$default_spread,
splay: units.$default_splay,
origin: [0, 0],
orient: 0,
shift: [0, 0],
rotate: 0,
width: units.$default_width,
@ -118,6 +119,7 @@ const render_zone = exports._render_zone = (zone_name, zone, anchor, global_key,
key.spread = a.sane(key.spread, `${key.name}.spread`, 'number')(units)
key.splay = a.sane(key.splay, `${key.name}.splay`, 'number')(units)
key.origin = a.xy(key.origin, `${key.name}.origin`)(units)
key.orient = a.sane(key.orient, `${key.name}.orient`, 'number')(units)
key.shift = a.xy(key.shift, `${key.name}.shift`)(units)
key.rotate = a.sane(key.rotate, `${key.name}.rotate`, 'number')(units)
key.width = a.sane(key.width, `${key.name}.width`, 'number')(units)
@ -151,6 +153,7 @@ const render_zone = exports._render_zone = (zone_name, zone, anchor, global_key,
for (const r of rotations) {
point.rotate(r.angle, r.origin)
}
point.r += key.orient
point.shift(key.shift)
point.r += key.rotate
point.meta = key

View File

@ -9,6 +9,7 @@ matrix_col_row:
origin:
- 0
- 0
orient: 0
shift:
- 0
- 0

View File

@ -9,6 +9,7 @@ matrix_col_row:
origin:
- 0
- 0
orient: 0
shift:
- 0
- 0

View File

@ -3,11 +3,17 @@ points:
matrix:
columns:
left:
right.key:
stagger: 5
spread: 25
splay: 5
origin: [-9, -9]
right:
key:
stagger: 5
spread: 25
splay: 5
origin: [-9, -9]
rows:
top:
orient: -90
shift: [0, 10]
rotate: 90
rows:
bottom:
top:

View File

@ -193,49 +193,49 @@ LINE
8
0
10
12.7752375
22.7371845
20
32.8592038
33.7307612
11
30.7067421
40.6686891
21
34.4280072
35.2995646
0
LINE
8
0
10
30.7067421
40.6686891
20
34.4280072
35.2995646
11
32.2755455
42.2374925
21
16.4965026
17.36806
0
LINE
8
0
10
32.2755455
42.2374925
20
16.4965026
17.36806
11
14.3440409
24.3059879
21
14.9276992
15.7992566
0
LINE
8
0
10
14.3440409
24.3059879
20
14.9276992
15.7992566
11
12.7752375
22.7371845
21
32.8592038
33.7307612
0
ENDSEC
0

View File

@ -11,6 +11,7 @@
0,
0
],
"orient": 0,
"shift": [
0,
0
@ -43,6 +44,7 @@
0,
0
],
"orient": 0,
"shift": [
0,
0
@ -75,6 +77,7 @@
-9,
-9
],
"orient": 0,
"shift": [
0,
0
@ -96,7 +99,16 @@
-9
]
},
"rows": {},
"rows": {
"top": {
"orient": -90,
"shift": [
0,
10
],
"rotate": 90
}
},
"name": "right"
},
"row": "bottom",
@ -104,8 +116,8 @@
}
},
"matrix_right_top": {
"x": 22.525391499999998,
"y": 24.6778532,
"x": 32.4873385,
"y": 25.5494106,
"r": 5,
"meta": {
"stagger": 5,
@ -115,11 +127,12 @@
-9,
-9
],
"orient": -90,
"shift": [
0,
0
10
],
"rotate": 0,
"rotate": 90,
"width": 18,
"height": 18,
"padding": 19,
@ -136,7 +149,16 @@
-9
]
},
"rows": {},
"rows": {
"top": {
"orient": -90,
"shift": [
0,
10
],
"rotate": 90
}
},
"name": "right"
},
"row": "top",

View File

@ -11,6 +11,7 @@
0,
0
],
"orient": 0,
"shift": [
0,
0
@ -43,6 +44,7 @@
0,
0
],
"orient": 0,
"shift": [
0,
0
@ -75,6 +77,7 @@
0,
0
],
"orient": 0,
"shift": [
0,
0
@ -107,6 +110,7 @@
0,
0
],
"orient": 0,
"shift": [
0,
0

View File

@ -11,6 +11,7 @@
0,
0
],
"orient": 0,
"shift": [
0,
0

View File

@ -11,6 +11,7 @@
0,
0
],
"orient": 0,
"shift": [
0,
0
@ -43,6 +44,7 @@
0,
0
],
"orient": 0,
"shift": [
0,
0
@ -75,6 +77,7 @@
0,
0
],
"orient": 0,
"shift": [
0,
0
@ -109,6 +112,7 @@
0,
0
],
"orient": 0,
"shift": [
0,
0
@ -143,6 +147,7 @@
0,
0
],
"orient": 0,
"shift": [
0,
0
@ -177,6 +182,7 @@
0,
0
],
"orient": 0,
"shift": [
0,
0
@ -215,6 +221,7 @@
0,
0
],
"orient": 0,
"shift": [
0,
0