@tscircuit/core 0.0.934 → 0.0.936
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 +32 -9
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3047,9 +3047,11 @@ var Hole = class extends PrimitiveComponent2 {
|
|
|
3047
3047
|
const position = this._getGlobalPcbPositionBeforeLayout();
|
|
3048
3048
|
const soldermaskMargin = props.solderMaskMargin;
|
|
3049
3049
|
const isCoveredWithSolderMask = props.coveredWithSolderMask ?? false;
|
|
3050
|
+
const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id;
|
|
3050
3051
|
if (props.shape === "pill") {
|
|
3051
3052
|
if (props.pcbRotation && props.pcbRotation !== 0) {
|
|
3052
3053
|
const inserted_hole = db.pcb_hole.insert({
|
|
3054
|
+
pcb_component_id,
|
|
3053
3055
|
type: "pcb_hole",
|
|
3054
3056
|
hole_shape: "rotated_pill",
|
|
3055
3057
|
hole_width: props.width,
|
|
@@ -3065,6 +3067,7 @@ var Hole = class extends PrimitiveComponent2 {
|
|
|
3065
3067
|
this.pcb_hole_id = inserted_hole.pcb_hole_id;
|
|
3066
3068
|
} else {
|
|
3067
3069
|
const inserted_hole = db.pcb_hole.insert({
|
|
3070
|
+
pcb_component_id,
|
|
3068
3071
|
type: "pcb_hole",
|
|
3069
3072
|
hole_shape: "pill",
|
|
3070
3073
|
hole_width: props.width,
|
|
@@ -3080,6 +3083,7 @@ var Hole = class extends PrimitiveComponent2 {
|
|
|
3080
3083
|
}
|
|
3081
3084
|
} else if (props.shape === "rect") {
|
|
3082
3085
|
const inserted_hole = db.pcb_hole.insert({
|
|
3086
|
+
pcb_component_id,
|
|
3083
3087
|
type: "pcb_hole",
|
|
3084
3088
|
hole_shape: "rect",
|
|
3085
3089
|
hole_width: props.width,
|
|
@@ -3094,6 +3098,7 @@ var Hole = class extends PrimitiveComponent2 {
|
|
|
3094
3098
|
this.pcb_hole_id = inserted_hole.pcb_hole_id;
|
|
3095
3099
|
} else {
|
|
3096
3100
|
const inserted_hole = db.pcb_hole.insert({
|
|
3101
|
+
pcb_component_id,
|
|
3097
3102
|
type: "pcb_hole",
|
|
3098
3103
|
hole_shape: "circle",
|
|
3099
3104
|
hole_diameter: props.diameter,
|
|
@@ -4978,6 +4983,8 @@ import { decomposeTSR as decomposeTSR4 } from "transformation-matrix";
|
|
|
4978
4983
|
// lib/components/base-components/NormalComponent/utils/getFileExtension.ts
|
|
4979
4984
|
var getFileExtension = (filename) => {
|
|
4980
4985
|
if (!filename) return null;
|
|
4986
|
+
const fragmentMatch = filename.match(/#ext=(\w+)$/);
|
|
4987
|
+
if (fragmentMatch) return fragmentMatch[1].toLowerCase();
|
|
4981
4988
|
const withoutQuery = filename.split("?")[0];
|
|
4982
4989
|
const sanitized = withoutQuery.split("#")[0];
|
|
4983
4990
|
const lastSegment = sanitized.split("/").pop() ?? sanitized;
|
|
@@ -5053,20 +5060,36 @@ var CadModel = class extends PrimitiveComponent2 {
|
|
|
5053
5060
|
const zOffsetFromSurface = props.zOffsetFromSurface !== void 0 ? distance4.parse(props.zOffsetFromSurface) : 0;
|
|
5054
5061
|
const layer = parent.props.layer === "bottom" ? "bottom" : "top";
|
|
5055
5062
|
const ext = props.modelUrl ? getFileExtension(props.modelUrl) : void 0;
|
|
5063
|
+
const modelUrlWithoutExtFragment = props.modelUrl?.replace(/#ext=\w+$/, "");
|
|
5056
5064
|
const urlProps = {};
|
|
5057
5065
|
if (ext === "stl")
|
|
5058
|
-
urlProps.model_stl_url = this._addCachebustToModelUrl(
|
|
5066
|
+
urlProps.model_stl_url = this._addCachebustToModelUrl(
|
|
5067
|
+
modelUrlWithoutExtFragment
|
|
5068
|
+
);
|
|
5059
5069
|
else if (ext === "obj")
|
|
5060
|
-
urlProps.model_obj_url = this._addCachebustToModelUrl(
|
|
5070
|
+
urlProps.model_obj_url = this._addCachebustToModelUrl(
|
|
5071
|
+
modelUrlWithoutExtFragment
|
|
5072
|
+
);
|
|
5061
5073
|
else if (ext === "gltf")
|
|
5062
|
-
urlProps.model_gltf_url = this._addCachebustToModelUrl(
|
|
5074
|
+
urlProps.model_gltf_url = this._addCachebustToModelUrl(
|
|
5075
|
+
modelUrlWithoutExtFragment
|
|
5076
|
+
);
|
|
5063
5077
|
else if (ext === "glb")
|
|
5064
|
-
urlProps.model_glb_url = this._addCachebustToModelUrl(
|
|
5078
|
+
urlProps.model_glb_url = this._addCachebustToModelUrl(
|
|
5079
|
+
modelUrlWithoutExtFragment
|
|
5080
|
+
);
|
|
5065
5081
|
else if (ext === "step" || ext === "stp")
|
|
5066
|
-
urlProps.model_step_url = this._addCachebustToModelUrl(
|
|
5082
|
+
urlProps.model_step_url = this._addCachebustToModelUrl(
|
|
5083
|
+
modelUrlWithoutExtFragment
|
|
5084
|
+
);
|
|
5067
5085
|
else if (ext === "wrl" || ext === "vrml")
|
|
5068
|
-
urlProps.model_wrl_url = this._addCachebustToModelUrl(
|
|
5069
|
-
|
|
5086
|
+
urlProps.model_wrl_url = this._addCachebustToModelUrl(
|
|
5087
|
+
modelUrlWithoutExtFragment
|
|
5088
|
+
);
|
|
5089
|
+
else
|
|
5090
|
+
urlProps.model_stl_url = this._addCachebustToModelUrl(
|
|
5091
|
+
modelUrlWithoutExtFragment
|
|
5092
|
+
);
|
|
5070
5093
|
if (props.stepUrl) {
|
|
5071
5094
|
const transformed = this._addCachebustToModelUrl(props.stepUrl);
|
|
5072
5095
|
if (transformed) urlProps.model_step_url = transformed;
|
|
@@ -19667,7 +19690,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
19667
19690
|
var package_default = {
|
|
19668
19691
|
name: "@tscircuit/core",
|
|
19669
19692
|
type: "module",
|
|
19670
|
-
version: "0.0.
|
|
19693
|
+
version: "0.0.935",
|
|
19671
19694
|
types: "dist/index.d.ts",
|
|
19672
19695
|
main: "dist/index.js",
|
|
19673
19696
|
module: "dist/index.js",
|
|
@@ -19725,7 +19748,7 @@ var package_default = {
|
|
|
19725
19748
|
"bun-match-svg": "0.0.12",
|
|
19726
19749
|
"calculate-elbow": "^0.0.12",
|
|
19727
19750
|
"chokidar-cli": "^3.0.0",
|
|
19728
|
-
"circuit-json": "^0.0.
|
|
19751
|
+
"circuit-json": "^0.0.336",
|
|
19729
19752
|
"circuit-json-to-bpc": "^0.0.13",
|
|
19730
19753
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
19731
19754
|
"circuit-json-to-gltf": "^0.0.31",
|
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.936",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"bun-match-svg": "0.0.12",
|
|
60
60
|
"calculate-elbow": "^0.0.12",
|
|
61
61
|
"chokidar-cli": "^3.0.0",
|
|
62
|
-
"circuit-json": "^0.0.
|
|
62
|
+
"circuit-json": "^0.0.336",
|
|
63
63
|
"circuit-json-to-bpc": "^0.0.13",
|
|
64
64
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
65
65
|
"circuit-json-to-gltf": "^0.0.31",
|