@tscircuit/core 0.0.1218 → 0.0.1220
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 +77 -2
- package/dist/index.js +71 -16
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as circuit_json from 'circuit-json';
|
|
2
2
|
import { PcbTraceError, PcbPlacementError, PcbManualEditConflictWarning, PcbViaClearanceError, LayerRef, AnyCircuitElement, Size, PcbTraceRoutePoint, AnySourceComponent, PcbComponent, PcbTrace as PcbTrace$1, PcbVia, SchematicPort, SchematicComponent, RouteHintPoint, CircuitJson } from 'circuit-json';
|
|
3
3
|
import * as _tscircuit_props from '@tscircuit/props';
|
|
4
|
-
import { PlatformConfig, traceProps, netProps, subcircuitGroupProps, AutorouterConfig, PcbSx, SupplierPartNumbers, CadModelProp, SchematicPortArrangement, groupProps, boardProps, subcircuitProps, subpanelProps, capacitorProps, chipProps, pinoutProps, diodeProps, fuseProps, jumperProps, interconnectProps, solderjumperProps, ledProps, powerSourceProps, voltageSourceProps, currentSourceProps, resistorProps, constraintProps, fabricationNoteRectProps, fabricationNotePathProps, fabricationNoteTextProps, fabricationNoteDimensionProps, pcbNoteLineProps, pcbNoteRectProps, pcbNoteTextProps, pcbNotePathProps, pcbNoteDimensionProps, footprintProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, cadmodelProps, cadassemblyProps, platedHoleProps, courtyardCircleProps, courtyardOutlineProps, courtyardRectProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, smtPadProps, fiducialProps, traceHintProps, viaProps, copperPourProps, copperTextProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, opampProps, OpAmpPinLabels, switchProps, SwitchProps, testpointProps, schematicTextProps, schematicLineProps, schematicRectProps, schematicArcProps, schematicCircleProps, schematicPathProps, schematicBoxProps, schematicSectionProps, schematicTableProps, schematicRowProps, schematicCellProps, symbolProps, analogSimulationProps, voltageProbeProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
|
|
4
|
+
import { PlatformConfig, traceProps, netProps, AutorouterProp, subcircuitGroupProps, AutorouterConfig, PcbSx, SupplierPartNumbers, CadModelProp, SchematicPortArrangement, groupProps, boardProps, subcircuitProps, subpanelProps, capacitorProps, chipProps, pinoutProps, diodeProps, fuseProps, jumperProps, interconnectProps, solderjumperProps, ledProps, powerSourceProps, voltageSourceProps, currentSourceProps, resistorProps, constraintProps, autoroutingPhaseProps, fabricationNoteRectProps, fabricationNotePathProps, fabricationNoteTextProps, fabricationNoteDimensionProps, pcbNoteLineProps, pcbNoteRectProps, pcbNoteTextProps, pcbNotePathProps, pcbNoteDimensionProps, footprintProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, cadmodelProps, cadassemblyProps, platedHoleProps, courtyardCircleProps, courtyardOutlineProps, courtyardRectProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, smtPadProps, fiducialProps, traceHintProps, viaProps, copperPourProps, copperTextProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, opampProps, OpAmpPinLabels, switchProps, SwitchProps, testpointProps, schematicTextProps, schematicLineProps, schematicRectProps, schematicArcProps, schematicCircleProps, schematicPathProps, schematicBoxProps, schematicSectionProps, schematicTableProps, schematicRowProps, schematicCellProps, symbolProps, analogSimulationProps, voltageProbeProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
|
|
5
5
|
export { kicadFootprintStrings } from '@tscircuit/props';
|
|
6
6
|
import * as react from 'react';
|
|
7
7
|
import react__default, { ReactElement, DetailedHTMLProps, SVGProps } from 'react';
|
|
@@ -1341,6 +1341,7 @@ declare class Net extends PrimitiveComponent<typeof netProps> {
|
|
|
1341
1341
|
|
|
1342
1342
|
interface RoutingPhasePlan {
|
|
1343
1343
|
routingPhaseIndex: number | null;
|
|
1344
|
+
autorouter?: AutorouterProp;
|
|
1344
1345
|
nets: Net[];
|
|
1345
1346
|
traces: Trace[];
|
|
1346
1347
|
}
|
|
@@ -71004,6 +71005,79 @@ declare class Constraint extends PrimitiveComponent<typeof constraintProps> {
|
|
|
71004
71005
|
};
|
|
71005
71006
|
}
|
|
71006
71007
|
|
|
71008
|
+
declare class AutoroutingPhase extends PrimitiveComponent<typeof autoroutingPhaseProps> {
|
|
71009
|
+
get config(): {
|
|
71010
|
+
componentName: string;
|
|
71011
|
+
zodProps: zod.ZodEffects<zod.ZodObject<{
|
|
71012
|
+
key: zod.ZodOptional<zod.ZodAny>;
|
|
71013
|
+
autorouter: zod.ZodOptional<zod.ZodType<_tscircuit_props.AutorouterProp, zod.ZodTypeDef, _tscircuit_props.AutorouterProp>>;
|
|
71014
|
+
phaseIndex: zod.ZodOptional<zod.ZodNumber>;
|
|
71015
|
+
region: zod.ZodOptional<zod.ZodObject<{
|
|
71016
|
+
minX: zod.ZodNumber;
|
|
71017
|
+
maxX: zod.ZodNumber;
|
|
71018
|
+
minY: zod.ZodNumber;
|
|
71019
|
+
maxY: zod.ZodNumber;
|
|
71020
|
+
}, "strip", zod.ZodTypeAny, {
|
|
71021
|
+
minX: number;
|
|
71022
|
+
maxX: number;
|
|
71023
|
+
minY: number;
|
|
71024
|
+
maxY: number;
|
|
71025
|
+
}, {
|
|
71026
|
+
minX: number;
|
|
71027
|
+
maxX: number;
|
|
71028
|
+
minY: number;
|
|
71029
|
+
maxY: number;
|
|
71030
|
+
}>>;
|
|
71031
|
+
reroute: zod.ZodOptional<zod.ZodBoolean>;
|
|
71032
|
+
}, "strip", zod.ZodTypeAny, {
|
|
71033
|
+
key?: any;
|
|
71034
|
+
autorouter?: _tscircuit_props.AutorouterProp | undefined;
|
|
71035
|
+
phaseIndex?: number | undefined;
|
|
71036
|
+
region?: {
|
|
71037
|
+
minX: number;
|
|
71038
|
+
maxX: number;
|
|
71039
|
+
minY: number;
|
|
71040
|
+
maxY: number;
|
|
71041
|
+
} | undefined;
|
|
71042
|
+
reroute?: boolean | undefined;
|
|
71043
|
+
}, {
|
|
71044
|
+
key?: any;
|
|
71045
|
+
autorouter?: _tscircuit_props.AutorouterProp | undefined;
|
|
71046
|
+
phaseIndex?: number | undefined;
|
|
71047
|
+
region?: {
|
|
71048
|
+
minX: number;
|
|
71049
|
+
maxX: number;
|
|
71050
|
+
minY: number;
|
|
71051
|
+
maxY: number;
|
|
71052
|
+
} | undefined;
|
|
71053
|
+
reroute?: boolean | undefined;
|
|
71054
|
+
}>, {
|
|
71055
|
+
key?: any;
|
|
71056
|
+
autorouter?: _tscircuit_props.AutorouterProp | undefined;
|
|
71057
|
+
phaseIndex?: number | undefined;
|
|
71058
|
+
region?: {
|
|
71059
|
+
minX: number;
|
|
71060
|
+
maxX: number;
|
|
71061
|
+
minY: number;
|
|
71062
|
+
maxY: number;
|
|
71063
|
+
} | undefined;
|
|
71064
|
+
reroute?: boolean | undefined;
|
|
71065
|
+
}, {
|
|
71066
|
+
key?: any;
|
|
71067
|
+
autorouter?: _tscircuit_props.AutorouterProp | undefined;
|
|
71068
|
+
phaseIndex?: number | undefined;
|
|
71069
|
+
region?: {
|
|
71070
|
+
minX: number;
|
|
71071
|
+
maxX: number;
|
|
71072
|
+
minY: number;
|
|
71073
|
+
maxY: number;
|
|
71074
|
+
} | undefined;
|
|
71075
|
+
reroute?: boolean | undefined;
|
|
71076
|
+
}>;
|
|
71077
|
+
};
|
|
71078
|
+
add(_component: PrimitiveComponent): void;
|
|
71079
|
+
}
|
|
71080
|
+
|
|
71007
71081
|
declare class FabricationNoteRect extends PrimitiveComponent<typeof fabricationNoteRectProps> {
|
|
71008
71082
|
fabrication_note_rect_id: string | null;
|
|
71009
71083
|
isPcbPrimitive: boolean;
|
|
@@ -152578,6 +152652,7 @@ interface TscircuitElements {
|
|
|
152578
152652
|
trace: _tscircuit_props.TraceProps;
|
|
152579
152653
|
breakout: _tscircuit_props.BreakoutProps;
|
|
152580
152654
|
breakoutpoint: _tscircuit_props.BreakoutPointProps;
|
|
152655
|
+
autoroutingphase: _tscircuit_props.AutoroutingPhaseProps;
|
|
152581
152656
|
custom: any;
|
|
152582
152657
|
component: _tscircuit_props.ComponentProps;
|
|
152583
152658
|
crystal: _tscircuit_props.CrystalProps;
|
|
@@ -152638,4 +152713,4 @@ declare module "react/jsx-runtime" {
|
|
|
152638
152713
|
}
|
|
152639
152714
|
}
|
|
152640
152715
|
|
|
152641
|
-
export { AnalogSimulation, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, CadAssembly, CadModel, Capacitor, Chip, Circuit, type ComponentWithPins, Connector, Constraint, CopperPour, CopperText, CourtyardCircle, CourtyardOutline, CourtyardRect, Crystal, CurrentSource, Cutout, type DebugLogOutputEvent, Diode, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Fiducial, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IIsolatedCircuit, type IRenderable, type IRootCircuit, Inductor, Interconnect, IsolatedCircuit, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, MountedBoard, Net, NetLabel, NormalComponent, type Obstacle, OpAmp, type PackingEndEvent, type PackingErrorEvent, type PackingStartEvent, Panel, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbNoteText, PcbTrace, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SOLVERS, SchematicArc, SchematicBox, SchematicCell, SchematicCircle, SchematicLine, SchematicPath, SchematicRect, SchematicRow, SchematicSection, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, type SolverName, type SolverStartedEvent, Subcircuit, Subpanel, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, renderPhaseIndexMap, resolveStaticFileImport, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
|
152716
|
+
export { AnalogSimulation, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, AutoroutingPhase, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, CadAssembly, CadModel, Capacitor, Chip, Circuit, type ComponentWithPins, Connector, Constraint, CopperPour, CopperText, CourtyardCircle, CourtyardOutline, CourtyardRect, Crystal, CurrentSource, Cutout, type DebugLogOutputEvent, Diode, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Fiducial, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IIsolatedCircuit, type IRenderable, type IRootCircuit, Inductor, Interconnect, IsolatedCircuit, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, MountedBoard, Net, NetLabel, NormalComponent, type Obstacle, OpAmp, type PackingEndEvent, type PackingErrorEvent, type PackingStartEvent, Panel, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbNoteText, PcbTrace, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SOLVERS, SchematicArc, SchematicBox, SchematicCell, SchematicCircle, SchematicLine, SchematicPath, SchematicRect, SchematicRow, SchematicSection, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, type SolverName, type SolverStartedEvent, Subcircuit, Subpanel, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, renderPhaseIndexMap, resolveStaticFileImport, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ var __export = (target, all) => {
|
|
|
8
8
|
var components_exports = {};
|
|
9
9
|
__export(components_exports, {
|
|
10
10
|
AnalogSimulation: () => AnalogSimulation,
|
|
11
|
+
AutoroutingPhase: () => AutoroutingPhase,
|
|
11
12
|
Battery: () => Battery,
|
|
12
13
|
Board: () => Board,
|
|
13
14
|
Breakout: () => Breakout,
|
|
@@ -18205,7 +18206,7 @@ function getTraceRoutingPhaseIndex(trace) {
|
|
|
18205
18206
|
let routingPhaseIndex = null;
|
|
18206
18207
|
const connectedNets = trace._findConnectedNets().nets;
|
|
18207
18208
|
for (const net of connectedNets) {
|
|
18208
|
-
const netRoutingPhaseIndex = net
|
|
18209
|
+
const netRoutingPhaseIndex = getNetRoutingPhaseIndex(net);
|
|
18209
18210
|
if (typeof netRoutingPhaseIndex === "number") {
|
|
18210
18211
|
if (routingPhaseIndex === null || netRoutingPhaseIndex < routingPhaseIndex) {
|
|
18211
18212
|
routingPhaseIndex = netRoutingPhaseIndex;
|
|
@@ -18214,11 +18215,24 @@ function getTraceRoutingPhaseIndex(trace) {
|
|
|
18214
18215
|
}
|
|
18215
18216
|
return routingPhaseIndex;
|
|
18216
18217
|
}
|
|
18218
|
+
function getAutoroutersByPhaseIndex(group) {
|
|
18219
|
+
const autoroutingPhases = group.selectAll(
|
|
18220
|
+
"autoroutingphase"
|
|
18221
|
+
);
|
|
18222
|
+
const autoroutersByPhaseIndex = /* @__PURE__ */ new Map();
|
|
18223
|
+
for (const autoroutingPhase of autoroutingPhases) {
|
|
18224
|
+
const { phaseIndex, autorouter } = autoroutingPhase._parsedProps;
|
|
18225
|
+
if (autorouter === void 0) continue;
|
|
18226
|
+
autoroutersByPhaseIndex.set(phaseIndex ?? null, autorouter);
|
|
18227
|
+
}
|
|
18228
|
+
return autoroutersByPhaseIndex;
|
|
18229
|
+
}
|
|
18217
18230
|
function Group_getRoutingPhasePlans(group) {
|
|
18218
18231
|
const traces = group.selectAll("trace");
|
|
18219
18232
|
const nets = group.selectAll("net");
|
|
18220
18233
|
if (traces.length === 0 && nets.length === 0) return [];
|
|
18221
18234
|
const plansByPhaseIndex = /* @__PURE__ */ new Map();
|
|
18235
|
+
const autoroutersByPhaseIndex = getAutoroutersByPhaseIndex(group);
|
|
18222
18236
|
for (const net of nets) {
|
|
18223
18237
|
const routingPhaseIndex = getNetRoutingPhaseIndex(net);
|
|
18224
18238
|
getOrCreateRoutingPhasePlan(plansByPhaseIndex, routingPhaseIndex).nets.push(
|
|
@@ -18232,7 +18246,13 @@ function Group_getRoutingPhasePlans(group) {
|
|
|
18232
18246
|
routingPhaseIndex
|
|
18233
18247
|
).traces.push(trace);
|
|
18234
18248
|
}
|
|
18235
|
-
|
|
18249
|
+
const plans = Array.from(plansByPhaseIndex.values()).sort(
|
|
18250
|
+
compareRoutingPhasePlans
|
|
18251
|
+
);
|
|
18252
|
+
for (const plan of plans) {
|
|
18253
|
+
plan.autorouter = autoroutersByPhaseIndex.get(plan.routingPhaseIndex);
|
|
18254
|
+
}
|
|
18255
|
+
return plans;
|
|
18236
18256
|
}
|
|
18237
18257
|
|
|
18238
18258
|
// lib/components/primitive-components/Group/Group_phasedAutoroutingUtils.ts
|
|
@@ -18662,7 +18682,6 @@ function computeCenterFromAnchorPosition(anchorPosition, ctx) {
|
|
|
18662
18682
|
if (!pcbAnchorAlignment) return anchorPosition;
|
|
18663
18683
|
const alignment = pcbAnchorAlignment;
|
|
18664
18684
|
if (typeof width !== "number" || typeof height !== "number") {
|
|
18665
|
-
console.log("width or height is not a number");
|
|
18666
18685
|
return anchorPosition;
|
|
18667
18686
|
}
|
|
18668
18687
|
const ax = anchorPosition.x;
|
|
@@ -18891,13 +18910,31 @@ var Group6 = class extends NormalComponent3 {
|
|
|
18891
18910
|
centerX += (padRight - padLeft) / 2;
|
|
18892
18911
|
centerY += (padTop - padBottom) / 2;
|
|
18893
18912
|
}
|
|
18894
|
-
const
|
|
18913
|
+
const resolvedWidth = Number(props.width ?? width);
|
|
18914
|
+
const resolvedHeight = Number(props.height ?? height);
|
|
18915
|
+
const existingPcbGroup = db.pcb_group.get(this.pcb_group_id);
|
|
18916
|
+
let center = hasExplicitPositioning ? existingPcbGroup?.center ?? {
|
|
18895
18917
|
x: centerX,
|
|
18896
18918
|
y: centerY
|
|
18897
18919
|
} : { x: centerX, y: centerY };
|
|
18920
|
+
if (hasExplicitPositioning && props.pcbAnchorAlignment) {
|
|
18921
|
+
const anchorPosition = this._getGlobalPcbPositionBeforeLayout();
|
|
18922
|
+
const anchorAlignedCenter = computeCenterFromAnchorPosition(
|
|
18923
|
+
anchorPosition,
|
|
18924
|
+
{
|
|
18925
|
+
...this.props,
|
|
18926
|
+
width: resolvedWidth,
|
|
18927
|
+
height: resolvedHeight
|
|
18928
|
+
}
|
|
18929
|
+
);
|
|
18930
|
+
if (Math.abs(anchorAlignedCenter.x - center.x) > 1e-6 || Math.abs(anchorAlignedCenter.y - center.y) > 1e-6) {
|
|
18931
|
+
this._repositionOnPcb(anchorAlignedCenter);
|
|
18932
|
+
}
|
|
18933
|
+
center = anchorAlignedCenter;
|
|
18934
|
+
}
|
|
18898
18935
|
db.pcb_group.update(this.pcb_group_id, {
|
|
18899
|
-
width:
|
|
18900
|
-
height:
|
|
18936
|
+
width: resolvedWidth,
|
|
18937
|
+
height: resolvedHeight,
|
|
18901
18938
|
center
|
|
18902
18939
|
});
|
|
18903
18940
|
}
|
|
@@ -19122,6 +19159,7 @@ var Group6 = class extends NormalComponent3 {
|
|
|
19122
19159
|
const outputTraces = [];
|
|
19123
19160
|
const outputJumpers = [];
|
|
19124
19161
|
for (const routingPhasePlan of routingPhasePlans) {
|
|
19162
|
+
const phaseAutorouterConfig = routingPhasePlan.autorouter ? getPresetAutoroutingConfig(routingPhasePlan.autorouter) : autorouterConfig;
|
|
19125
19163
|
let simpleRouteJson = baseSimpleRouteJson;
|
|
19126
19164
|
if (hasPhasedAutorouting) {
|
|
19127
19165
|
simpleRouteJson = Group_filterSimpleRouteJsonForPhase(
|
|
@@ -19136,10 +19174,12 @@ var Group6 = class extends NormalComponent3 {
|
|
|
19136
19174
|
if (hasPhasedAutorouting && simpleRouteJson.connections.length === 0) {
|
|
19137
19175
|
continue;
|
|
19138
19176
|
}
|
|
19139
|
-
|
|
19177
|
+
const phaseIsAutoJumperPreset = routingPhasePlan.autorouter !== void 0 ? this._isAutoJumperAutorouter(phaseAutorouterConfig) : isAutoJumperPreset;
|
|
19178
|
+
const phaseIsLaserPrefabPreset = routingPhasePlan.autorouter !== void 0 ? this._isLaserPrefabAutorouter(phaseAutorouterConfig) : isLaserPrefabPreset;
|
|
19179
|
+
if (phaseIsAutoJumperPreset) {
|
|
19140
19180
|
simpleRouteJson.allowJumpers = true;
|
|
19141
|
-
if (
|
|
19142
|
-
simpleRouteJson.availableJumperTypes =
|
|
19181
|
+
if (phaseAutorouterConfig.availableJumperTypes) {
|
|
19182
|
+
simpleRouteJson.availableJumperTypes = phaseAutorouterConfig.availableJumperTypes;
|
|
19143
19183
|
}
|
|
19144
19184
|
}
|
|
19145
19185
|
if (debug11.enabled) {
|
|
@@ -19162,18 +19202,18 @@ var Group6 = class extends NormalComponent3 {
|
|
|
19162
19202
|
simpleRouteJson
|
|
19163
19203
|
});
|
|
19164
19204
|
let autorouter;
|
|
19165
|
-
if (
|
|
19166
|
-
autorouter = await
|
|
19205
|
+
if (phaseAutorouterConfig.algorithmFn) {
|
|
19206
|
+
autorouter = await phaseAutorouterConfig.algorithmFn(simpleRouteJson);
|
|
19167
19207
|
} else {
|
|
19168
19208
|
const autorouterVersion2 = this.props.autorouterVersion;
|
|
19169
19209
|
const effortLevel = this.props.autorouterEffortLevel;
|
|
19170
19210
|
const effort = effortLevel ? Number.parseInt(effortLevel.replace("x", ""), 10) : void 0;
|
|
19171
19211
|
autorouter = new TscircuitAutorouter(simpleRouteJson, {
|
|
19172
19212
|
// Optional configuration parameters
|
|
19173
|
-
capacityDepth:
|
|
19174
|
-
targetMinCapacity:
|
|
19175
|
-
useAssignableSolver:
|
|
19176
|
-
useAutoJumperSolver:
|
|
19213
|
+
capacityDepth: phaseAutorouterConfig.capacityDepth,
|
|
19214
|
+
targetMinCapacity: phaseAutorouterConfig.targetMinCapacity,
|
|
19215
|
+
useAssignableSolver: phaseIsLaserPrefabPreset || isSingleLayerBoard,
|
|
19216
|
+
useAutoJumperSolver: phaseIsAutoJumperPreset,
|
|
19177
19217
|
autorouterVersion: autorouterVersion2,
|
|
19178
19218
|
effort,
|
|
19179
19219
|
onSolverStarted: ({ solverName, solverParams }) => this.root?.emit("solver:started", {
|
|
@@ -20436,7 +20476,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
20436
20476
|
var package_default = {
|
|
20437
20477
|
name: "@tscircuit/core",
|
|
20438
20478
|
type: "module",
|
|
20439
|
-
version: "0.0.
|
|
20479
|
+
version: "0.0.1219",
|
|
20440
20480
|
types: "dist/index.d.ts",
|
|
20441
20481
|
main: "dist/index.js",
|
|
20442
20482
|
module: "dist/index.js",
|
|
@@ -23161,6 +23201,20 @@ var Constraint3 = class extends PrimitiveComponent2 {
|
|
|
23161
23201
|
}
|
|
23162
23202
|
};
|
|
23163
23203
|
|
|
23204
|
+
// lib/components/primitive-components/AutoroutingPhase.ts
|
|
23205
|
+
import { autoroutingPhaseProps } from "@tscircuit/props";
|
|
23206
|
+
var AutoroutingPhase = class extends PrimitiveComponent2 {
|
|
23207
|
+
get config() {
|
|
23208
|
+
return {
|
|
23209
|
+
componentName: "AutoroutingPhase",
|
|
23210
|
+
zodProps: autoroutingPhaseProps
|
|
23211
|
+
};
|
|
23212
|
+
}
|
|
23213
|
+
add(_component) {
|
|
23214
|
+
throw new Error("<autoroutingphase> cannot contain children");
|
|
23215
|
+
}
|
|
23216
|
+
};
|
|
23217
|
+
|
|
23164
23218
|
// lib/components/primitive-components/FabricationNoteDimension.ts
|
|
23165
23219
|
import { fabricationNoteDimensionProps } from "@tscircuit/props";
|
|
23166
23220
|
import { applyToPoint as applyToPoint18 } from "transformation-matrix";
|
|
@@ -26916,6 +26970,7 @@ extendCatalogue({
|
|
|
26916
26970
|
});
|
|
26917
26971
|
export {
|
|
26918
26972
|
AnalogSimulation,
|
|
26973
|
+
AutoroutingPhase,
|
|
26919
26974
|
Battery,
|
|
26920
26975
|
Board,
|
|
26921
26976
|
Breakout,
|