@tscircuit/core 0.0.112 → 0.0.113
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 +10 -4
- package/package.json +1 -1
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,12 +2232,18 @@ 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
|
+
});
|
|
2235
2241
|
const cad_model = db.cad_component.insert({
|
|
2236
2242
|
// TODO z maybe depends on layer
|
|
2237
2243
|
position: {
|
|
2238
|
-
x: bounds.center.x,
|
|
2239
|
-
y: bounds.center.y,
|
|
2240
|
-
z: this.props.layer === "bottom" ? -boardThickness / 2 : boardThickness / 2
|
|
2244
|
+
x: bounds.center.x + positionOffset.x,
|
|
2245
|
+
y: bounds.center.y + positionOffset.y,
|
|
2246
|
+
z: (this.props.layer === "bottom" ? -boardThickness / 2 : boardThickness / 2) + positionOffset.z
|
|
2241
2247
|
},
|
|
2242
2248
|
rotation: {
|
|
2243
2249
|
x: rotationOffset.x,
|