@tscircuit/core 0.0.1868 → 0.0.1870
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 +22 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -121,7 +121,7 @@ __export(components_exports, {
|
|
|
121
121
|
|
|
122
122
|
// lib/components/base-components/NormalComponent/NormalComponent.ts
|
|
123
123
|
import { fp } from "@tscircuit/footprinter";
|
|
124
|
-
import { normalizeDegrees as
|
|
124
|
+
import { normalizeDegrees as normalizeDegrees3 } from "@tscircuit/math-utils";
|
|
125
125
|
import {
|
|
126
126
|
distance as distance8,
|
|
127
127
|
pcb_component_invalid_layer_error,
|
|
@@ -13097,6 +13097,7 @@ var constructAssetUrl = (targetUrl, baseUrl) => {
|
|
|
13097
13097
|
};
|
|
13098
13098
|
|
|
13099
13099
|
// lib/components/primitive-components/CadModel.ts
|
|
13100
|
+
import { normalizeDegrees as normalizeDegrees2 } from "@tscircuit/math-utils";
|
|
13100
13101
|
var rotation = z9.union([z9.number(), z9.string()]);
|
|
13101
13102
|
var rotation3 = z9.object({ x: rotation, y: rotation, z: rotation });
|
|
13102
13103
|
var CadModel = class extends PrimitiveComponent2 {
|
|
@@ -13183,13 +13184,16 @@ var CadModel = class extends PrimitiveComponent2 {
|
|
|
13183
13184
|
rotation: {
|
|
13184
13185
|
x: Number(rotationOffset.x),
|
|
13185
13186
|
y: (layer === "top" ? 0 : 180) + Number(rotationOffset.y),
|
|
13186
|
-
z:
|
|
13187
|
+
z: normalizeDegrees2(
|
|
13188
|
+
layer === "bottom" ? -(accumulatedRotation + Number(rotationOffset.z)) : accumulatedRotation + Number(rotationOffset.z)
|
|
13189
|
+
)
|
|
13187
13190
|
},
|
|
13188
13191
|
pcb_component_id: parent.pcb_component_id,
|
|
13189
13192
|
model_board_normal_direction: props.modelBoardNormalDirection,
|
|
13190
13193
|
model_origin_alignment: "center_of_component_on_board_surface",
|
|
13191
13194
|
anchor_alignment: "center_of_component_on_board_surface",
|
|
13192
13195
|
model_origin_position: props.modelOriginPosition,
|
|
13196
|
+
size: props.size ? point3.parse(props.size) : void 0,
|
|
13193
13197
|
source_component_id: parent.source_component_id,
|
|
13194
13198
|
model_unit_to_mm_scale_factor: typeof props.modelUnitToMmScale === "number" ? props.modelUnitToMmScale : void 0,
|
|
13195
13199
|
show_as_translucent_model: props.showAsTranslucentModel ?? parent._parsedProps.showAsTranslucentModel,
|
|
@@ -15546,7 +15550,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
15546
15550
|
width: 0,
|
|
15547
15551
|
height: 0,
|
|
15548
15552
|
layer: componentLayer === "top" || componentLayer === "bottom" ? componentLayer : "top",
|
|
15549
|
-
rotation:
|
|
15553
|
+
rotation: normalizeDegrees3(globalTransformRotation),
|
|
15550
15554
|
insertion_direction: this._getPcbComponentInsertionDirection(
|
|
15551
15555
|
componentLayer,
|
|
15552
15556
|
globalTransformRotation
|
|
@@ -16227,7 +16231,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
16227
16231
|
rotation: {
|
|
16228
16232
|
x: 0,
|
|
16229
16233
|
y: isBottomLayer ? 180 : 0,
|
|
16230
|
-
z:
|
|
16234
|
+
z: normalizeDegrees3(isBottomLayer ? -totalRotation : totalRotation)
|
|
16231
16235
|
},
|
|
16232
16236
|
pcb_component_id: this.pcb_component_id,
|
|
16233
16237
|
source_component_id: this.source_component_id,
|
|
@@ -16240,7 +16244,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
16240
16244
|
return;
|
|
16241
16245
|
}
|
|
16242
16246
|
const rotationWithOffset = totalRotation + (rotationOffset.z ?? 0);
|
|
16243
|
-
const cadRotationZ =
|
|
16247
|
+
const cadRotationZ = normalizeDegrees3(rotationWithOffset);
|
|
16244
16248
|
let footprinterStringForCadComponent;
|
|
16245
16249
|
if (!cadModel && footprintIsFootprinterString) {
|
|
16246
16250
|
footprinterStringForCadComponent = footprintString;
|
|
@@ -16255,7 +16259,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
16255
16259
|
rotation: {
|
|
16256
16260
|
x: rotationOffset.x,
|
|
16257
16261
|
y: rotationOffset.y + (isBottomLayer ? 180 : 0),
|
|
16258
|
-
z:
|
|
16262
|
+
z: normalizeDegrees3(isBottomLayer ? -cadRotationZ : cadRotationZ)
|
|
16259
16263
|
},
|
|
16260
16264
|
pcb_component_id: this.pcb_component_id,
|
|
16261
16265
|
source_component_id: this.source_component_id,
|
|
@@ -16920,7 +16924,7 @@ function inflateSourceCapacitor(sourceElm, inflatorContext) {
|
|
|
16920
16924
|
}
|
|
16921
16925
|
|
|
16922
16926
|
// lib/components/normal-components/Chip.ts
|
|
16923
|
-
import { normalizeDegrees as
|
|
16927
|
+
import { normalizeDegrees as normalizeDegrees4 } from "@tscircuit/math-utils";
|
|
16924
16928
|
import { chipProps } from "@tscircuit/props";
|
|
16925
16929
|
import { pcb_component_invalid_layer_error as pcb_component_invalid_layer_error2 } from "circuit-json";
|
|
16926
16930
|
|
|
@@ -17079,7 +17083,7 @@ var Chip = class extends NormalComponent3 {
|
|
|
17079
17083
|
height: 3,
|
|
17080
17084
|
// Default height, adjust as needed
|
|
17081
17085
|
layer: componentLayer === "top" || componentLayer === "bottom" ? componentLayer : "top",
|
|
17082
|
-
rotation:
|
|
17086
|
+
rotation: normalizeDegrees4(globalTransformRotation),
|
|
17083
17087
|
insertion_direction: this._getPcbComponentInsertionDirection(
|
|
17084
17088
|
componentLayer,
|
|
17085
17089
|
globalTransformRotation
|
|
@@ -42812,7 +42816,9 @@ var getSimpleRouteJsonFromCircuitJson = ({
|
|
|
42812
42816
|
const additionalIds = obstacle.connectedTo.flatMap(
|
|
42813
42817
|
(id) => sharedConnMap.getIdsConnectedToNet(id)
|
|
42814
42818
|
);
|
|
42815
|
-
obstacle.connectedTo
|
|
42819
|
+
obstacle.connectedTo = [
|
|
42820
|
+
.../* @__PURE__ */ new Set([...obstacle.connectedTo, ...additionalIds])
|
|
42821
|
+
];
|
|
42816
42822
|
}
|
|
42817
42823
|
const internalConnections = db.source_component_internal_connection.list();
|
|
42818
42824
|
const sourcePortIdToInternalConnectionId = /* @__PURE__ */ new Map();
|
|
@@ -44923,7 +44929,7 @@ import {
|
|
|
44923
44929
|
findBoundsAndCenter,
|
|
44924
44930
|
transformPCBElements as transformPCBElements2
|
|
44925
44931
|
} from "@tscircuit/circuit-json-util";
|
|
44926
|
-
import { normalizeDegrees as
|
|
44932
|
+
import { normalizeDegrees as normalizeDegrees5 } from "@tscircuit/math-utils";
|
|
44927
44933
|
import { compose as compose10, rotate as rotate4, translate as translate9 } from "transformation-matrix";
|
|
44928
44934
|
var updateCadRotation = ({
|
|
44929
44935
|
db,
|
|
@@ -44941,7 +44947,7 @@ var updateCadRotation = ({
|
|
|
44941
44947
|
const currentRotationZ = cadComponent.rotation?.z ?? 0;
|
|
44942
44948
|
const nextRotation = {
|
|
44943
44949
|
...cadComponent.rotation ?? { x: 0, y: 0, z: 0 },
|
|
44944
|
-
z:
|
|
44950
|
+
z: normalizeDegrees5(currentRotationZ + delta)
|
|
44945
44951
|
};
|
|
44946
44952
|
db.cad_component.update(cadComponent.cad_component_id, {
|
|
44947
44953
|
rotation: nextRotation
|
|
@@ -51431,7 +51437,7 @@ function Group_getRoutingPhasePlans(group) {
|
|
|
51431
51437
|
var package_default = {
|
|
51432
51438
|
name: "@tscircuit/core",
|
|
51433
51439
|
type: "module",
|
|
51434
|
-
version: "0.0.
|
|
51440
|
+
version: "0.0.1869",
|
|
51435
51441
|
types: "dist/index.d.ts",
|
|
51436
51442
|
main: "dist/index.js",
|
|
51437
51443
|
module: "dist/index.js",
|
|
@@ -58838,7 +58844,7 @@ var Fuse = class extends NormalComponent3 {
|
|
|
58838
58844
|
|
|
58839
58845
|
// lib/components/normal-components/Jumper.ts
|
|
58840
58846
|
import { jumperProps } from "@tscircuit/props";
|
|
58841
|
-
import { normalizeDegrees as
|
|
58847
|
+
import { normalizeDegrees as normalizeDegrees6 } from "@tscircuit/math-utils";
|
|
58842
58848
|
var Jumper = class extends NormalComponent3 {
|
|
58843
58849
|
schematicDimensions = null;
|
|
58844
58850
|
get config() {
|
|
@@ -58887,7 +58893,7 @@ var Jumper = class extends NormalComponent3 {
|
|
|
58887
58893
|
height: 3,
|
|
58888
58894
|
// Default height, adjust as needed
|
|
58889
58895
|
layer: props.layer ?? "top",
|
|
58890
|
-
rotation:
|
|
58896
|
+
rotation: normalizeDegrees6(globalTransformRotation),
|
|
58891
58897
|
insertion_direction: this._getPcbComponentInsertionDirection(
|
|
58892
58898
|
props.layer ?? "top",
|
|
58893
58899
|
globalTransformRotation
|
|
@@ -59017,7 +59023,7 @@ var Interconnect = class extends NormalComponent3 {
|
|
|
59017
59023
|
|
|
59018
59024
|
// lib/components/normal-components/SolderJumper.ts
|
|
59019
59025
|
import { solderjumperProps } from "@tscircuit/props";
|
|
59020
|
-
import { normalizeDegrees as
|
|
59026
|
+
import { normalizeDegrees as normalizeDegrees7 } from "@tscircuit/math-utils";
|
|
59021
59027
|
var SolderJumper = class extends NormalComponent3 {
|
|
59022
59028
|
schematicDimensions = null;
|
|
59023
59029
|
_getPinCountFromFootprintString(footprint) {
|
|
@@ -59174,7 +59180,7 @@ var SolderJumper = class extends NormalComponent3 {
|
|
|
59174
59180
|
height: 3,
|
|
59175
59181
|
// Default height, adjust as needed
|
|
59176
59182
|
layer: props.layer ?? "top",
|
|
59177
|
-
rotation:
|
|
59183
|
+
rotation: normalizeDegrees7(globalTransformRotation),
|
|
59178
59184
|
insertion_direction: this._getPcbComponentInsertionDirection(
|
|
59179
59185
|
props.layer ?? "top",
|
|
59180
59186
|
globalTransformRotation
|