@tscircuit/core 0.0.112 → 0.0.114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +13 -6
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -39,7 +39,7 @@ __export(components_exports, {
|
|
|
39
39
|
|
|
40
40
|
// lib/components/base-components/NormalComponent.ts
|
|
41
41
|
import { fp } from "@tscircuit/footprinter";
|
|
42
|
-
import { rotation } from "circuit-json";
|
|
42
|
+
import { point3, rotation } from "circuit-json";
|
|
43
43
|
|
|
44
44
|
// lib/fiber/create-instance-from-react-element.ts
|
|
45
45
|
import ReactReconciler from "react-reconciler";
|
|
@@ -2232,17 +2232,24 @@ var NormalComponent = class extends PrimitiveComponent {
|
|
|
2232
2232
|
z: typeof cadModel?.rotationOffset === "number" ? cadModel.rotationOffset : 0,
|
|
2233
2233
|
...typeof cadModel?.rotationOffset === "object" ? cadModel.rotationOffset ?? {} : {}
|
|
2234
2234
|
});
|
|
2235
|
+
const positionOffset = point3.parse({
|
|
2236
|
+
x: 0,
|
|
2237
|
+
y: 0,
|
|
2238
|
+
z: 0,
|
|
2239
|
+
...typeof cadModel?.positionOffset === "object" ? cadModel.positionOffset : {}
|
|
2240
|
+
});
|
|
2241
|
+
const computedLayer = this.props.layer === "bottom" ? "bottom" : "top";
|
|
2235
2242
|
const cad_model = db.cad_component.insert({
|
|
2236
2243
|
// TODO z maybe depends on layer
|
|
2237
2244
|
position: {
|
|
2238
|
-
x: bounds.center.x,
|
|
2239
|
-
y: bounds.center.y,
|
|
2240
|
-
z:
|
|
2245
|
+
x: bounds.center.x + positionOffset.x,
|
|
2246
|
+
y: bounds.center.y + positionOffset.y,
|
|
2247
|
+
z: (computedLayer === "bottom" ? -boardThickness / 2 : boardThickness / 2) + positionOffset.z
|
|
2241
2248
|
},
|
|
2242
2249
|
rotation: {
|
|
2243
2250
|
x: rotationOffset.x,
|
|
2244
|
-
y: (
|
|
2245
|
-
z: (pcb_component?.rotation ?? 0) + (
|
|
2251
|
+
y: (computedLayer === "top" ? 0 : 180) + rotationOffset.y,
|
|
2252
|
+
z: (pcb_component?.rotation ?? 0) + (computedLayer === "bottom" ? 180 : 0) + rotationOffset.z
|
|
2246
2253
|
},
|
|
2247
2254
|
pcb_component_id: this.pcb_component_id,
|
|
2248
2255
|
source_component_id: this.source_component_id,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.114",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@lume/kiwi": "^0.4.3",
|
|
39
|
+
"@tscircuit/footprinter": "^0.0.70",
|
|
39
40
|
"@tscircuit/infgrid-ijump-astar": "^0.0.21",
|
|
40
41
|
"@tscircuit/math-utils": "^0.0.4",
|
|
41
42
|
"@tscircuit/props": "^0.0.68",
|
|
42
43
|
"@tscircuit/soup-util": "^0.0.33",
|
|
43
44
|
"circuit-json": "^0.0.85",
|
|
44
45
|
"circuit-json-to-connectivity-map": "^0.0.17",
|
|
45
|
-
"@tscircuit/footprinter": "^0.0.66",
|
|
46
46
|
"nanoid": "^5.0.7",
|
|
47
47
|
"performance-now": "^2.1.0",
|
|
48
48
|
"react": "^18.3.1",
|