@tscircuit/core 0.0.1868 → 0.0.1869
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 +19 -15
- 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
|
|
@@ -44923,7 +44927,7 @@ import {
|
|
|
44923
44927
|
findBoundsAndCenter,
|
|
44924
44928
|
transformPCBElements as transformPCBElements2
|
|
44925
44929
|
} from "@tscircuit/circuit-json-util";
|
|
44926
|
-
import { normalizeDegrees as
|
|
44930
|
+
import { normalizeDegrees as normalizeDegrees5 } from "@tscircuit/math-utils";
|
|
44927
44931
|
import { compose as compose10, rotate as rotate4, translate as translate9 } from "transformation-matrix";
|
|
44928
44932
|
var updateCadRotation = ({
|
|
44929
44933
|
db,
|
|
@@ -44941,7 +44945,7 @@ var updateCadRotation = ({
|
|
|
44941
44945
|
const currentRotationZ = cadComponent.rotation?.z ?? 0;
|
|
44942
44946
|
const nextRotation = {
|
|
44943
44947
|
...cadComponent.rotation ?? { x: 0, y: 0, z: 0 },
|
|
44944
|
-
z:
|
|
44948
|
+
z: normalizeDegrees5(currentRotationZ + delta)
|
|
44945
44949
|
};
|
|
44946
44950
|
db.cad_component.update(cadComponent.cad_component_id, {
|
|
44947
44951
|
rotation: nextRotation
|
|
@@ -51431,7 +51435,7 @@ function Group_getRoutingPhasePlans(group) {
|
|
|
51431
51435
|
var package_default = {
|
|
51432
51436
|
name: "@tscircuit/core",
|
|
51433
51437
|
type: "module",
|
|
51434
|
-
version: "0.0.
|
|
51438
|
+
version: "0.0.1868",
|
|
51435
51439
|
types: "dist/index.d.ts",
|
|
51436
51440
|
main: "dist/index.js",
|
|
51437
51441
|
module: "dist/index.js",
|
|
@@ -58838,7 +58842,7 @@ var Fuse = class extends NormalComponent3 {
|
|
|
58838
58842
|
|
|
58839
58843
|
// lib/components/normal-components/Jumper.ts
|
|
58840
58844
|
import { jumperProps } from "@tscircuit/props";
|
|
58841
|
-
import { normalizeDegrees as
|
|
58845
|
+
import { normalizeDegrees as normalizeDegrees6 } from "@tscircuit/math-utils";
|
|
58842
58846
|
var Jumper = class extends NormalComponent3 {
|
|
58843
58847
|
schematicDimensions = null;
|
|
58844
58848
|
get config() {
|
|
@@ -58887,7 +58891,7 @@ var Jumper = class extends NormalComponent3 {
|
|
|
58887
58891
|
height: 3,
|
|
58888
58892
|
// Default height, adjust as needed
|
|
58889
58893
|
layer: props.layer ?? "top",
|
|
58890
|
-
rotation:
|
|
58894
|
+
rotation: normalizeDegrees6(globalTransformRotation),
|
|
58891
58895
|
insertion_direction: this._getPcbComponentInsertionDirection(
|
|
58892
58896
|
props.layer ?? "top",
|
|
58893
58897
|
globalTransformRotation
|
|
@@ -59017,7 +59021,7 @@ var Interconnect = class extends NormalComponent3 {
|
|
|
59017
59021
|
|
|
59018
59022
|
// lib/components/normal-components/SolderJumper.ts
|
|
59019
59023
|
import { solderjumperProps } from "@tscircuit/props";
|
|
59020
|
-
import { normalizeDegrees as
|
|
59024
|
+
import { normalizeDegrees as normalizeDegrees7 } from "@tscircuit/math-utils";
|
|
59021
59025
|
var SolderJumper = class extends NormalComponent3 {
|
|
59022
59026
|
schematicDimensions = null;
|
|
59023
59027
|
_getPinCountFromFootprintString(footprint) {
|
|
@@ -59174,7 +59178,7 @@ var SolderJumper = class extends NormalComponent3 {
|
|
|
59174
59178
|
height: 3,
|
|
59175
59179
|
// Default height, adjust as needed
|
|
59176
59180
|
layer: props.layer ?? "top",
|
|
59177
|
-
rotation:
|
|
59181
|
+
rotation: normalizeDegrees7(globalTransformRotation),
|
|
59178
59182
|
insertion_direction: this._getPcbComponentInsertionDirection(
|
|
59179
59183
|
props.layer ?? "top",
|
|
59180
59184
|
globalTransformRotation
|