schematic-symbols 0.0.61 → 0.0.62

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "schematic-symbols",
3
3
  "main": "./dist/index.js",
4
- "version": "0.0.61",
4
+ "version": "0.0.62",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -0,0 +1,33 @@
1
+ import { defineSymbol } from "drawing/defineSymbol"
2
+ import svgJson from "assets/generated/crystal.json"
3
+
4
+ const { paths, texts, bounds, refblocks, circles } = svgJson
5
+
6
+ export default defineSymbol({
7
+ primitives: [
8
+ ...Object.values(paths),
9
+ ...Object.values(circles),
10
+ // { ...texts.top1, anchor: "middle_left" },
11
+ // { ...texts.bottom1, anchor: "middle_left" },
12
+ {
13
+ type: "text",
14
+ text: "{REF}",
15
+ x: -0.012864500000000056,
16
+ y: -0.4150086999999978,
17
+ anchor: "middle_bottom",
18
+ },
19
+ {
20
+ type: "text",
21
+ text: "{VAL}",
22
+ x: -0.003850500000000423,
23
+ y: 0.4250087000000011,
24
+ anchor: "middle_top",
25
+ },
26
+ ] as any,
27
+ ports: [
28
+ { ...refblocks.left1, labels: ["1"] }, // TODO add more "standard" labels
29
+ { ...refblocks.right1, labels: ["2"] }, // TODO add more "standard" labels
30
+ ],
31
+ size: { width: bounds.width, height: bounds.height },
32
+ center: { x: bounds.centerX, y: bounds.centerY },
33
+ })
@@ -0,0 +1,10 @@
1
+ import { rotateSymbol } from "drawing/rotateSymbol"
2
+ import crystal_horz from "./crystal_horz"
3
+
4
+ const rotatedSymbol = rotateSymbol(crystal_horz)
5
+ const texts = rotatedSymbol.primitives.filter((p) => p.type === "text")
6
+ const ref = texts.find((t) => t.text === "{REF}")!
7
+ const val = texts.find((t) => t.text === "{VAL}")!
8
+ val.x = -0.4
9
+ ref.x = 0.35
10
+ export default rotatedSymbol