diff --git a/lib/fixtures/twoNodeExpansionFixture.ts b/lib/fixtures/twoNodeExpansionFixture.ts index 8da9553..f6e24d5 100644 --- a/lib/fixtures/twoNodeExpansionFixture.ts +++ b/lib/fixtures/twoNodeExpansionFixture.ts @@ -2,7 +2,7 @@ import RBush from "rbush" import type { RectDiffExpansionSolverInput } from "../solvers/RectDiffExpansionSolver/RectDiffExpansionSolver" import type { SimpleRouteJson } from "../types/srj-types" import type { XYRect } from "../rectdiff-types" -import type { RTreeRect } from "lib/types/capacity-mesh-types" +import type { RTreeRect } from "../types/capacity-mesh-types" import { buildZIndexMap } from "../solvers/RectDiffSeedingSolver/layers" /** diff --git a/lib/solvers/GapFillSolver/ExpandEdgesToEmptySpaceSolver.ts b/lib/solvers/GapFillSolver/ExpandEdgesToEmptySpaceSolver.ts index fb21c92..e54dde0 100644 --- a/lib/solvers/GapFillSolver/ExpandEdgesToEmptySpaceSolver.ts +++ b/lib/solvers/GapFillSolver/ExpandEdgesToEmptySpaceSolver.ts @@ -1,5 +1,5 @@ import { BaseSolver } from "@tscircuit/solver-utils" -import type { CapacityMeshNode } from "lib/types/capacity-mesh-types" +import type { CapacityMeshNode } from "../../types/capacity-mesh-types" import type { SegmentWithAdjacentEmptySpace } from "./FindSegmentsWithAdjacentEmptySpaceSolver" import type { GraphicsObject } from "graphics-debug" import RBush from "rbush" @@ -7,7 +7,7 @@ import { EDGE_MAP, EDGES } from "./edge-constants" import { getBoundsFromCorners } from "./getBoundsFromCorners" import type { Bounds } from "@tscircuit/math-utils" import { midpoint, segmentToBoxMinDistance } from "@tscircuit/math-utils" -import type { XYRect } from "lib/rectdiff-types" +import type { XYRect } from "../../rectdiff-types" const EPS = 1e-4 @@ -212,6 +212,8 @@ export class ExpandEdgesToEmptySpaceSolver extends BaseSolver { rects: [], points: [], lines: [], + infiniteLines: [], + polygons: [], circles: [], arrows: [], texts: [], diff --git a/lib/solvers/GapFillSolver/FindSegmentsWithAdjacentEmptySpaceSolver.ts b/lib/solvers/GapFillSolver/FindSegmentsWithAdjacentEmptySpaceSolver.ts index a6280aa..cb2c91f 100644 --- a/lib/solvers/GapFillSolver/FindSegmentsWithAdjacentEmptySpaceSolver.ts +++ b/lib/solvers/GapFillSolver/FindSegmentsWithAdjacentEmptySpaceSolver.ts @@ -1,7 +1,7 @@ import { BaseSolver } from "@tscircuit/solver-utils" import Flatbush from "flatbush" import type { GraphicsObject, NinePointAnchor } from "graphics-debug" -import type { CapacityMeshNode } from "lib/types/capacity-mesh-types" +import type { CapacityMeshNode } from "../../types/capacity-mesh-types" import { projectToUncoveredSegments } from "./projectToUncoveredSegments" import { EDGES } from "./edge-constants" import { visuallyOffsetLine } from "./visuallyOffsetLine" @@ -139,6 +139,8 @@ export class FindSegmentsWithAdjacentEmptySpaceSolver extends BaseSolver { rects: [], points: [], lines: [], + infiniteLines: [], + polygons: [], circles: [], arrows: [], texts: [], diff --git a/lib/solvers/GapFillSolver/GapFillSolverPipeline.ts b/lib/solvers/GapFillSolver/GapFillSolverPipeline.ts index cb2e231..b2655c2 100644 --- a/lib/solvers/GapFillSolver/GapFillSolverPipeline.ts +++ b/lib/solvers/GapFillSolver/GapFillSolverPipeline.ts @@ -3,11 +3,11 @@ import { definePipelineStep, type PipelineStep, } from "@tscircuit/solver-utils" -import type { CapacityMeshNode } from "lib/types/capacity-mesh-types" +import type { CapacityMeshNode } from "../../types/capacity-mesh-types" import type { GraphicsObject } from "graphics-debug" import { FindSegmentsWithAdjacentEmptySpaceSolver } from "./FindSegmentsWithAdjacentEmptySpaceSolver" import { ExpandEdgesToEmptySpaceSolver } from "./ExpandEdgesToEmptySpaceSolver" -import type { XYRect } from "lib/rectdiff-types" +import type { XYRect } from "../../rectdiff-types" type GapFillSolverInput = { meshNodes: CapacityMeshNode[] @@ -73,6 +73,8 @@ export class GapFillSolverPipeline extends BasePipelineSolver Math.round(value / precision) * precision diff --git a/lib/solvers/RectDiffSeedingSolver/computeEdgeCandidates3D.ts b/lib/solvers/RectDiffSeedingSolver/computeEdgeCandidates3D.ts index 7500c55..f106d59 100644 --- a/lib/solvers/RectDiffSeedingSolver/computeEdgeCandidates3D.ts +++ b/lib/solvers/RectDiffSeedingSolver/computeEdgeCandidates3D.ts @@ -3,7 +3,7 @@ import { EPS, distancePointToRectEdges } from "../../utils/rectdiff-geometry" import { isFullyOccupiedAtPoint } from "../../utils/isFullyOccupiedAtPoint" import { longestFreeSpanAroundZ } from "./longestFreeSpanAroundZ" import type RBush from "rbush" -import type { RTreeRect } from "lib/types/capacity-mesh-types" +import type { RTreeRect } from "../../types/capacity-mesh-types" const quantize = (value: number, precision = 1e-6) => Math.round(value / precision) * precision diff --git a/lib/solvers/RectDiffSeedingSolver/longestFreeSpanAroundZ.ts b/lib/solvers/RectDiffSeedingSolver/longestFreeSpanAroundZ.ts index 9e08f84..acd8db8 100644 --- a/lib/solvers/RectDiffSeedingSolver/longestFreeSpanAroundZ.ts +++ b/lib/solvers/RectDiffSeedingSolver/longestFreeSpanAroundZ.ts @@ -1,4 +1,4 @@ -import type { RTreeRect } from "lib/types/capacity-mesh-types" +import type { RTreeRect } from "../../types/capacity-mesh-types" import type { XYRect } from "../../rectdiff-types" import { clamp, containsPoint } from "../../utils/rectdiff-geometry" import type RBush from "rbush" diff --git a/lib/types/capacity-mesh-types.ts b/lib/types/capacity-mesh-types.ts index 2beae8b..dc4bdd4 100644 --- a/lib/types/capacity-mesh-types.ts +++ b/lib/types/capacity-mesh-types.ts @@ -1,4 +1,4 @@ -import type { XYRect } from "lib/rectdiff-types" +import type { XYRect } from "../rectdiff-types" export type CapacityMeshNodeId = string diff --git a/lib/utils/expandRectFromSeed.ts b/lib/utils/expandRectFromSeed.ts index 34dd1c8..9285330 100644 --- a/lib/utils/expandRectFromSeed.ts +++ b/lib/utils/expandRectFromSeed.ts @@ -1,7 +1,7 @@ import type RBush from "rbush" import type { XYRect } from "../rectdiff-types" import { EPS, gt, gte, lt, lte, overlaps } from "./rectdiff-geometry" -import type { RTreeRect } from "lib/types/capacity-mesh-types" +import type { RTreeRect } from "../types/capacity-mesh-types" import { isSelfRect } from "./isSelfRect" import { searchStripDown, diff --git a/lib/utils/finalizeRects.ts b/lib/utils/finalizeRects.ts index 2cf12a5..da3dd55 100644 --- a/lib/utils/finalizeRects.ts +++ b/lib/utils/finalizeRects.ts @@ -1,4 +1,4 @@ -import type { Obstacle } from "lib/types/srj-types" +import type { Obstacle } from "../types/srj-types" import type { Placed3D, Rect3d, XYRect } from "../rectdiff-types" import { obstacleToXYRect, diff --git a/lib/utils/isFullyOccupiedAtPoint.ts b/lib/utils/isFullyOccupiedAtPoint.ts index 988e5e1..c90d8ca 100644 --- a/lib/utils/isFullyOccupiedAtPoint.ts +++ b/lib/utils/isFullyOccupiedAtPoint.ts @@ -1,4 +1,4 @@ -import type { RTreeRect } from "lib/types/capacity-mesh-types" +import type { RTreeRect } from "../types/capacity-mesh-types" import RBush from "rbush" export type OccupancyParams = { diff --git a/lib/utils/isSelfRect.ts b/lib/utils/isSelfRect.ts index 2eb841f..55be7fb 100644 --- a/lib/utils/isSelfRect.ts +++ b/lib/utils/isSelfRect.ts @@ -1,4 +1,4 @@ -import type { XYRect } from "lib/rectdiff-types" +import type { XYRect } from "../rectdiff-types" const EPS = 1e-9 diff --git a/lib/utils/rectToTree.ts b/lib/utils/rectToTree.ts index e191a6c..6b68f76 100644 --- a/lib/utils/rectToTree.ts +++ b/lib/utils/rectToTree.ts @@ -1,5 +1,5 @@ -import type { XYRect } from "lib/rectdiff-types" -import type { RTreeRect } from "lib/types/capacity-mesh-types" +import type { XYRect } from "../rectdiff-types" +import type { RTreeRect } from "../types/capacity-mesh-types" export const rectToTree = ( rect: XYRect, diff --git a/lib/utils/renderObstacleClearance.ts b/lib/utils/renderObstacleClearance.ts index b780fdd..e9ea4d0 100644 --- a/lib/utils/renderObstacleClearance.ts +++ b/lib/utils/renderObstacleClearance.ts @@ -1,4 +1,4 @@ -import type { SimpleRouteJson } from "lib/types/srj-types" +import type { SimpleRouteJson } from "../types/srj-types" import type { GraphicsObject } from "graphics-debug" /** diff --git a/lib/utils/resizeSoftOverlaps.ts b/lib/utils/resizeSoftOverlaps.ts index ce52ad5..87a19e5 100644 --- a/lib/utils/resizeSoftOverlaps.ts +++ b/lib/utils/resizeSoftOverlaps.ts @@ -1,4 +1,4 @@ -import type { RTreeRect } from "lib/types/capacity-mesh-types" +import type { RTreeRect } from "../types/capacity-mesh-types" import type { Placed3D } from "../rectdiff-types" import { overlaps, subtractRect2D, EPS } from "./rectdiff-geometry" import type RBush from "rbush" diff --git a/lib/utils/sameTreeRect.ts b/lib/utils/sameTreeRect.ts index ecf2fec..508fd1c 100644 --- a/lib/utils/sameTreeRect.ts +++ b/lib/utils/sameTreeRect.ts @@ -1,4 +1,4 @@ -import type { RTreeRect } from "lib/types/capacity-mesh-types" +import type { RTreeRect } from "../types/capacity-mesh-types" export const sameTreeRect = (a: RTreeRect, b: RTreeRect) => a.minX === b.minX && diff --git a/lib/utils/searchStrip.ts b/lib/utils/searchStrip.ts index d7adecd..45f6882 100644 --- a/lib/utils/searchStrip.ts +++ b/lib/utils/searchStrip.ts @@ -1,4 +1,4 @@ -import type { XYRect } from "lib/rectdiff-types" +import type { XYRect } from "../rectdiff-types" export const searchStripRight = ({ rect, diff --git a/package.json b/package.json index 6965712..9d379f8 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,11 @@ "name": "@tscircuit/rectdiff", "version": "0.0.25", "type": "module", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "./lib/index.ts", + "types": "./lib/index.ts", + "exports": { + ".": "./lib/index.ts" + }, "scripts": { "start": "cosmos", "build": "tsup-node ./lib/index.ts --format esm --dts", @@ -16,7 +19,7 @@ "@biomejs/biome": "^2.3.5", "@react-hook/resize-observer": "^2.0.2", "@tscircuit/math-utils": "^0.0.29", - "@tscircuit/solver-utils": "^0.0.9", + "@tscircuit/solver-utils": "^0.0.16", "@types/bun": "latest", "@types/rbush": "^4.0.0", "@types/react": "^18", @@ -25,7 +28,7 @@ "@vitejs/plugin-react": "^4", "biome": "^0.3.3", "bun-match-svg": "^0.0.14", - "graphics-debug": "^0.0.76", + "graphics-debug": "^0.0.90", "rbush": "^4.0.1", "react": "18", "react-cosmos": "^6.2.3",