@tscircuit/core 0.0.933 → 0.0.935
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.d.ts +2 -0
- package/dist/index.js +36 -11
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { Matrix } from 'transformation-matrix';
|
|
|
12
12
|
import { CircuitJsonUtilObjects } from '@tscircuit/circuit-json-util';
|
|
13
13
|
import { PackSolver2 } from 'calculate-packing';
|
|
14
14
|
import { AutoroutingPipelineSolver, AssignableViaAutoroutingPipelineSolver } from '@tscircuit/capacity-autorouter';
|
|
15
|
+
import { CopperPourPipelineSolver } from '@tscircuit/copper-pour-solver';
|
|
15
16
|
import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
|
|
16
17
|
import { GraphicsObject } from 'graphics-debug';
|
|
17
18
|
|
|
@@ -127,6 +128,7 @@ declare const SOLVERS: {
|
|
|
127
128
|
PackSolver2: typeof PackSolver2;
|
|
128
129
|
AutoroutingPipelineSolver: typeof AutoroutingPipelineSolver;
|
|
129
130
|
AssignableViaAutoroutingPipelineSolver: typeof AssignableViaAutoroutingPipelineSolver;
|
|
131
|
+
CopperPourPipelineSolver: typeof CopperPourPipelineSolver;
|
|
130
132
|
};
|
|
131
133
|
type SolverName = keyof typeof SOLVERS;
|
|
132
134
|
|
package/dist/index.js
CHANGED
|
@@ -4978,6 +4978,8 @@ import { decomposeTSR as decomposeTSR4 } from "transformation-matrix";
|
|
|
4978
4978
|
// lib/components/base-components/NormalComponent/utils/getFileExtension.ts
|
|
4979
4979
|
var getFileExtension = (filename) => {
|
|
4980
4980
|
if (!filename) return null;
|
|
4981
|
+
const fragmentMatch = filename.match(/#ext=(\w+)$/);
|
|
4982
|
+
if (fragmentMatch) return fragmentMatch[1].toLowerCase();
|
|
4981
4983
|
const withoutQuery = filename.split("?")[0];
|
|
4982
4984
|
const sanitized = withoutQuery.split("#")[0];
|
|
4983
4985
|
const lastSegment = sanitized.split("/").pop() ?? sanitized;
|
|
@@ -5053,20 +5055,36 @@ var CadModel = class extends PrimitiveComponent2 {
|
|
|
5053
5055
|
const zOffsetFromSurface = props.zOffsetFromSurface !== void 0 ? distance4.parse(props.zOffsetFromSurface) : 0;
|
|
5054
5056
|
const layer = parent.props.layer === "bottom" ? "bottom" : "top";
|
|
5055
5057
|
const ext = props.modelUrl ? getFileExtension(props.modelUrl) : void 0;
|
|
5058
|
+
const modelUrlWithoutExtFragment = props.modelUrl?.replace(/#ext=\w+$/, "");
|
|
5056
5059
|
const urlProps = {};
|
|
5057
5060
|
if (ext === "stl")
|
|
5058
|
-
urlProps.model_stl_url = this._addCachebustToModelUrl(
|
|
5061
|
+
urlProps.model_stl_url = this._addCachebustToModelUrl(
|
|
5062
|
+
modelUrlWithoutExtFragment
|
|
5063
|
+
);
|
|
5059
5064
|
else if (ext === "obj")
|
|
5060
|
-
urlProps.model_obj_url = this._addCachebustToModelUrl(
|
|
5065
|
+
urlProps.model_obj_url = this._addCachebustToModelUrl(
|
|
5066
|
+
modelUrlWithoutExtFragment
|
|
5067
|
+
);
|
|
5061
5068
|
else if (ext === "gltf")
|
|
5062
|
-
urlProps.model_gltf_url = this._addCachebustToModelUrl(
|
|
5069
|
+
urlProps.model_gltf_url = this._addCachebustToModelUrl(
|
|
5070
|
+
modelUrlWithoutExtFragment
|
|
5071
|
+
);
|
|
5063
5072
|
else if (ext === "glb")
|
|
5064
|
-
urlProps.model_glb_url = this._addCachebustToModelUrl(
|
|
5073
|
+
urlProps.model_glb_url = this._addCachebustToModelUrl(
|
|
5074
|
+
modelUrlWithoutExtFragment
|
|
5075
|
+
);
|
|
5065
5076
|
else if (ext === "step" || ext === "stp")
|
|
5066
|
-
urlProps.model_step_url = this._addCachebustToModelUrl(
|
|
5077
|
+
urlProps.model_step_url = this._addCachebustToModelUrl(
|
|
5078
|
+
modelUrlWithoutExtFragment
|
|
5079
|
+
);
|
|
5067
5080
|
else if (ext === "wrl" || ext === "vrml")
|
|
5068
|
-
urlProps.model_wrl_url = this._addCachebustToModelUrl(
|
|
5069
|
-
|
|
5081
|
+
urlProps.model_wrl_url = this._addCachebustToModelUrl(
|
|
5082
|
+
modelUrlWithoutExtFragment
|
|
5083
|
+
);
|
|
5084
|
+
else
|
|
5085
|
+
urlProps.model_stl_url = this._addCachebustToModelUrl(
|
|
5086
|
+
modelUrlWithoutExtFragment
|
|
5087
|
+
);
|
|
5070
5088
|
if (props.stepUrl) {
|
|
5071
5089
|
const transformed = this._addCachebustToModelUrl(props.stepUrl);
|
|
5072
5090
|
if (transformed) urlProps.model_step_url = transformed;
|
|
@@ -9563,10 +9581,12 @@ import {
|
|
|
9563
9581
|
AutoroutingPipelineSolver,
|
|
9564
9582
|
AssignableViaAutoroutingPipelineSolver
|
|
9565
9583
|
} from "@tscircuit/capacity-autorouter";
|
|
9584
|
+
import { CopperPourPipelineSolver } from "@tscircuit/copper-pour-solver";
|
|
9566
9585
|
var SOLVERS = {
|
|
9567
9586
|
PackSolver2,
|
|
9568
9587
|
AutoroutingPipelineSolver,
|
|
9569
|
-
AssignableViaAutoroutingPipelineSolver
|
|
9588
|
+
AssignableViaAutoroutingPipelineSolver,
|
|
9589
|
+
CopperPourPipelineSolver
|
|
9570
9590
|
};
|
|
9571
9591
|
|
|
9572
9592
|
// lib/utils/autorouting/CapacityMeshAutorouter.ts
|
|
@@ -18188,7 +18208,7 @@ var Via = class extends PrimitiveComponent2 {
|
|
|
18188
18208
|
// lib/components/primitive-components/CopperPour/CopperPour.ts
|
|
18189
18209
|
import { copperPourProps } from "@tscircuit/props";
|
|
18190
18210
|
import {
|
|
18191
|
-
CopperPourPipelineSolver,
|
|
18211
|
+
CopperPourPipelineSolver as CopperPourPipelineSolver2,
|
|
18192
18212
|
convertCircuitJsonToInputProblem
|
|
18193
18213
|
} from "@tscircuit/copper-pour-solver";
|
|
18194
18214
|
var CopperPour = class extends PrimitiveComponent2 {
|
|
@@ -18229,7 +18249,12 @@ var CopperPour = class extends PrimitiveComponent2 {
|
|
|
18229
18249
|
board_edge_margin: props.boardEdgeMargin ?? clearance,
|
|
18230
18250
|
cutout_margin: props.cutoutMargin ?? clearance
|
|
18231
18251
|
});
|
|
18232
|
-
const solver = new
|
|
18252
|
+
const solver = new CopperPourPipelineSolver2(inputProblem);
|
|
18253
|
+
this.root.emit("solver:started", {
|
|
18254
|
+
solverName: "CopperPourPipelineSolver",
|
|
18255
|
+
solverParams: inputProblem,
|
|
18256
|
+
componentName: this.props.name
|
|
18257
|
+
});
|
|
18233
18258
|
const { brep_shapes } = solver.getOutput();
|
|
18234
18259
|
const coveredWithSolderMask = props.coveredWithSolderMask ?? false;
|
|
18235
18260
|
for (const brep_shape of brep_shapes) {
|
|
@@ -19660,7 +19685,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
19660
19685
|
var package_default = {
|
|
19661
19686
|
name: "@tscircuit/core",
|
|
19662
19687
|
type: "module",
|
|
19663
|
-
version: "0.0.
|
|
19688
|
+
version: "0.0.934",
|
|
19664
19689
|
types: "dist/index.d.ts",
|
|
19665
19690
|
main: "dist/index.js",
|
|
19666
19691
|
module: "dist/index.js",
|