@tscircuit/rectdiff 0.0.29 → 0.0.30

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.
@@ -2,7 +2,7 @@ import RBush from "rbush"
2
2
  import type { RectDiffExpansionSolverInput } from "../solvers/RectDiffExpansionSolver/RectDiffExpansionSolver"
3
3
  import type { SimpleRouteJson } from "../types/srj-types"
4
4
  import type { XYRect } from "../rectdiff-types"
5
- import type { RTreeRect } from "lib/types/capacity-mesh-types"
5
+ import type { RTreeRect } from "../types/capacity-mesh-types"
6
6
  import { buildZIndexMap } from "../solvers/RectDiffSeedingSolver/layers"
7
7
 
8
8
  /**
@@ -1,5 +1,5 @@
1
1
  import { BaseSolver } from "@tscircuit/solver-utils"
2
- import type { CapacityMeshNode } from "lib/types/capacity-mesh-types"
2
+ import type { CapacityMeshNode } from "../../types/capacity-mesh-types"
3
3
  import type { SegmentWithAdjacentEmptySpace } from "./FindSegmentsWithAdjacentEmptySpaceSolver"
4
4
  import type { GraphicsObject } from "graphics-debug"
5
5
  import RBush from "rbush"
@@ -7,7 +7,7 @@ import { EDGE_MAP, EDGES } from "./edge-constants"
7
7
  import { getBoundsFromCorners } from "./getBoundsFromCorners"
8
8
  import type { Bounds } from "@tscircuit/math-utils"
9
9
  import { midpoint, segmentToBoxMinDistance } from "@tscircuit/math-utils"
10
- import type { XYRect } from "lib/rectdiff-types"
10
+ import type { XYRect } from "../../rectdiff-types"
11
11
 
12
12
  const EPS = 1e-4
13
13
 
@@ -212,6 +212,8 @@ export class ExpandEdgesToEmptySpaceSolver extends BaseSolver {
212
212
  rects: [],
213
213
  points: [],
214
214
  lines: [],
215
+ infiniteLines: [],
216
+ polygons: [],
215
217
  circles: [],
216
218
  arrows: [],
217
219
  texts: [],
@@ -1,7 +1,7 @@
1
1
  import { BaseSolver } from "@tscircuit/solver-utils"
2
2
  import Flatbush from "flatbush"
3
3
  import type { GraphicsObject, NinePointAnchor } from "graphics-debug"
4
- import type { CapacityMeshNode } from "lib/types/capacity-mesh-types"
4
+ import type { CapacityMeshNode } from "../../types/capacity-mesh-types"
5
5
  import { projectToUncoveredSegments } from "./projectToUncoveredSegments"
6
6
  import { EDGES } from "./edge-constants"
7
7
  import { visuallyOffsetLine } from "./visuallyOffsetLine"
@@ -139,6 +139,8 @@ export class FindSegmentsWithAdjacentEmptySpaceSolver extends BaseSolver {
139
139
  rects: [],
140
140
  points: [],
141
141
  lines: [],
142
+ infiniteLines: [],
143
+ polygons: [],
142
144
  circles: [],
143
145
  arrows: [],
144
146
  texts: [],
@@ -3,11 +3,11 @@ import {
3
3
  definePipelineStep,
4
4
  type PipelineStep,
5
5
  } from "@tscircuit/solver-utils"
6
- import type { CapacityMeshNode } from "lib/types/capacity-mesh-types"
6
+ import type { CapacityMeshNode } from "../../types/capacity-mesh-types"
7
7
  import type { GraphicsObject } from "graphics-debug"
8
8
  import { FindSegmentsWithAdjacentEmptySpaceSolver } from "./FindSegmentsWithAdjacentEmptySpaceSolver"
9
9
  import { ExpandEdgesToEmptySpaceSolver } from "./ExpandEdgesToEmptySpaceSolver"
10
- import type { XYRect } from "lib/rectdiff-types"
10
+ import type { XYRect } from "../../rectdiff-types"
11
11
 
12
12
  type GapFillSolverInput = {
13
13
  meshNodes: CapacityMeshNode[]
@@ -73,6 +73,8 @@ export class GapFillSolverPipeline extends BasePipelineSolver<GapFillSolverInput
73
73
  rects: [],
74
74
  points: [],
75
75
  lines: [],
76
+ infiniteLines: [],
77
+ polygons: [],
76
78
  circles: [],
77
79
  arrows: [],
78
80
  texts: [],
@@ -103,6 +105,8 @@ export class GapFillSolverPipeline extends BasePipelineSolver<GapFillSolverInput
103
105
  rects: [],
104
106
  points: [],
105
107
  lines: [],
108
+ infiniteLines: [],
109
+ polygons: [],
106
110
  circles: [],
107
111
  arrows: [],
108
112
  texts: [],
@@ -1,12 +1,15 @@
1
1
  import { BaseSolver } from "@tscircuit/solver-utils"
2
2
  import type { GraphicsObject } from "graphics-debug"
3
- import type { CapacityMeshNode, RTreeRect } from "lib/types/capacity-mesh-types"
3
+ import type {
4
+ CapacityMeshNode,
5
+ RTreeRect,
6
+ } from "../../types/capacity-mesh-types"
4
7
  import { expandRectFromSeed } from "../../utils/expandRectFromSeed"
5
8
  import { finalizeRects } from "../../utils/finalizeRects"
6
9
  import { resizeSoftOverlaps } from "../../utils/resizeSoftOverlaps"
7
10
  import { rectsToMeshNodes } from "./rectsToMeshNodes"
8
11
  import type { XYRect, Candidate3D, Placed3D } from "../../rectdiff-types"
9
- import type { Obstacle } from "lib/types/srj-types"
12
+ import type { Obstacle } from "../../types/srj-types"
10
13
  import RBush from "rbush"
11
14
  import { rectToTree } from "../../utils/rectToTree"
12
15
  import { sameTreeRect } from "../../utils/sameTreeRect"
@@ -7,11 +7,14 @@ import type {
7
7
  Obstacle,
8
8
  SimpleRouteConnection,
9
9
  SimpleRouteJson,
10
- } from "lib/types/srj-types"
11
- import type { GridFill3DOptions, XYRect } from "lib/rectdiff-types"
12
- import type { CapacityMeshNode, RTreeRect } from "lib/types/capacity-mesh-types"
13
- import { RectDiffSeedingSolver } from "lib/solvers/RectDiffSeedingSolver/RectDiffSeedingSolver"
14
- import { RectDiffExpansionSolver } from "lib/solvers/RectDiffExpansionSolver/RectDiffExpansionSolver"
10
+ } from "../../types/srj-types"
11
+ import type { GridFill3DOptions, XYRect } from "../../rectdiff-types"
12
+ import type {
13
+ CapacityMeshNode,
14
+ RTreeRect,
15
+ } from "../../types/capacity-mesh-types"
16
+ import { RectDiffSeedingSolver } from "../RectDiffSeedingSolver/RectDiffSeedingSolver"
17
+ import { RectDiffExpansionSolver } from "../RectDiffExpansionSolver/RectDiffExpansionSolver"
15
18
  import type { GraphicsObject } from "graphics-debug"
16
19
  import RBush from "rbush"
17
20
  import { buildObstacleIndexesByLayer } from "./buildObstacleIndexes"
@@ -1,14 +1,14 @@
1
- import type { SimpleRouteJson } from "lib/types/srj-types"
1
+ import type { SimpleRouteJson } from "../../types/srj-types"
2
2
  import RBush from "rbush"
3
- import { computeInverseRects } from "lib/solvers/RectDiffSeedingSolver/computeInverseRects"
3
+ import { computeInverseRects } from "../RectDiffSeedingSolver/computeInverseRects"
4
4
  import {
5
5
  buildZIndexMap,
6
6
  obstacleToXYRect,
7
7
  obstacleZs,
8
- } from "lib/solvers/RectDiffSeedingSolver/layers"
9
- import type { XYRect } from "lib/rectdiff-types"
10
- import type { RTreeRect } from "lib/types/capacity-mesh-types"
11
- import { padRect } from "lib/utils/padRect"
8
+ } from "../RectDiffSeedingSolver/layers"
9
+ import type { XYRect } from "../../rectdiff-types"
10
+ import type { RTreeRect } from "../../types/capacity-mesh-types"
11
+ import { padRect } from "../../utils/padRect"
12
12
 
13
13
  export const buildObstacleIndexesByLayer = (params: {
14
14
  srj: SimpleRouteJson
@@ -16,12 +16,12 @@ import { computeCandidates3D } from "./computeCandidates3D"
16
16
  import { computeEdgeCandidates3D } from "./computeEdgeCandidates3D"
17
17
  import { longestFreeSpanAroundZ } from "./longestFreeSpanAroundZ"
18
18
  import { allLayerNode } from "../../utils/buildHardPlacedByLayer"
19
- import { isFullyOccupiedAtPoint } from "lib/utils/isFullyOccupiedAtPoint"
19
+ import { isFullyOccupiedAtPoint } from "../../utils/isFullyOccupiedAtPoint"
20
20
  import { resizeSoftOverlaps } from "../../utils/resizeSoftOverlaps"
21
- import { getColorForZLayer } from "lib/utils/getColorForZLayer"
21
+ import { getColorForZLayer } from "../../utils/getColorForZLayer"
22
22
  import RBush from "rbush"
23
- import type { RTreeRect } from "lib/types/capacity-mesh-types"
24
- import { rectToTree } from "lib/utils/rectToTree"
23
+ import type { RTreeRect } from "../../types/capacity-mesh-types"
24
+ import { rectToTree } from "../../utils/rectToTree"
25
25
 
26
26
  export type RectDiffSeedingSolverInput = {
27
27
  simpleRouteJson: SimpleRouteJson
@@ -3,7 +3,7 @@ import { EPS, distancePointToRectEdges } from "../../utils/rectdiff-geometry"
3
3
  import { isFullyOccupiedAtPoint } from "../../utils/isFullyOccupiedAtPoint"
4
4
  import { longestFreeSpanAroundZ } from "./longestFreeSpanAroundZ"
5
5
  import type RBush from "rbush"
6
- import type { RTreeRect } from "lib/types/capacity-mesh-types"
6
+ import type { RTreeRect } from "../../types/capacity-mesh-types"
7
7
  const quantize = (value: number, precision = 1e-6) =>
8
8
  Math.round(value / precision) * precision
9
9
 
@@ -3,7 +3,7 @@ import { EPS, distancePointToRectEdges } from "../../utils/rectdiff-geometry"
3
3
  import { isFullyOccupiedAtPoint } from "../../utils/isFullyOccupiedAtPoint"
4
4
  import { longestFreeSpanAroundZ } from "./longestFreeSpanAroundZ"
5
5
  import type RBush from "rbush"
6
- import type { RTreeRect } from "lib/types/capacity-mesh-types"
6
+ import type { RTreeRect } from "../../types/capacity-mesh-types"
7
7
  const quantize = (value: number, precision = 1e-6) =>
8
8
  Math.round(value / precision) * precision
9
9
 
@@ -1,4 +1,4 @@
1
- import type { RTreeRect } from "lib/types/capacity-mesh-types"
1
+ import type { RTreeRect } from "../../types/capacity-mesh-types"
2
2
  import type { XYRect } from "../../rectdiff-types"
3
3
  import { clamp, containsPoint } from "../../utils/rectdiff-geometry"
4
4
  import type RBush from "rbush"
@@ -1,4 +1,4 @@
1
- import type { XYRect } from "lib/rectdiff-types"
1
+ import type { XYRect } from "../rectdiff-types"
2
2
 
3
3
  export type CapacityMeshNodeId = string
4
4
 
@@ -1,7 +1,7 @@
1
1
  import type RBush from "rbush"
2
2
  import type { XYRect } from "../rectdiff-types"
3
3
  import { EPS, gt, gte, lt, lte, overlaps } from "./rectdiff-geometry"
4
- import type { RTreeRect } from "lib/types/capacity-mesh-types"
4
+ import type { RTreeRect } from "../types/capacity-mesh-types"
5
5
  import { isSelfRect } from "./isSelfRect"
6
6
  import {
7
7
  searchStripDown,
@@ -1,4 +1,4 @@
1
- import type { Obstacle } from "lib/types/srj-types"
1
+ import type { Obstacle } from "../types/srj-types"
2
2
  import type { Placed3D, Rect3d, XYRect } from "../rectdiff-types"
3
3
  import {
4
4
  obstacleToXYRect,
@@ -1,4 +1,4 @@
1
- import type { RTreeRect } from "lib/types/capacity-mesh-types"
1
+ import type { RTreeRect } from "../types/capacity-mesh-types"
2
2
  import RBush from "rbush"
3
3
 
4
4
  export type OccupancyParams = {
@@ -1,4 +1,4 @@
1
- import type { XYRect } from "lib/rectdiff-types"
1
+ import type { XYRect } from "../rectdiff-types"
2
2
 
3
3
  const EPS = 1e-9
4
4
 
@@ -1,5 +1,5 @@
1
- import type { XYRect } from "lib/rectdiff-types"
2
- import type { RTreeRect } from "lib/types/capacity-mesh-types"
1
+ import type { XYRect } from "../rectdiff-types"
2
+ import type { RTreeRect } from "../types/capacity-mesh-types"
3
3
 
4
4
  export const rectToTree = (
5
5
  rect: XYRect,
@@ -1,4 +1,4 @@
1
- import type { SimpleRouteJson } from "lib/types/srj-types"
1
+ import type { SimpleRouteJson } from "../types/srj-types"
2
2
  import type { GraphicsObject } from "graphics-debug"
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import type { RTreeRect } from "lib/types/capacity-mesh-types"
1
+ import type { RTreeRect } from "../types/capacity-mesh-types"
2
2
  import type { Placed3D } from "../rectdiff-types"
3
3
  import { overlaps, subtractRect2D, EPS } from "./rectdiff-geometry"
4
4
  import type RBush from "rbush"
@@ -1,4 +1,4 @@
1
- import type { RTreeRect } from "lib/types/capacity-mesh-types"
1
+ import type { RTreeRect } from "../types/capacity-mesh-types"
2
2
 
3
3
  export const sameTreeRect = (a: RTreeRect, b: RTreeRect) =>
4
4
  a.minX === b.minX &&
@@ -1,4 +1,4 @@
1
- import type { XYRect } from "lib/rectdiff-types"
1
+ import type { XYRect } from "../rectdiff-types"
2
2
 
3
3
  export const searchStripRight = ({
4
4
  rect,
package/package.json CHANGED
@@ -1,8 +1,13 @@
1
1
  {
2
2
  "name": "@tscircuit/rectdiff",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "type": "module",
5
- "main": "dist/index.js",
5
+ "main": "./lib/index.ts",
6
+ "module": "./lib/index.ts",
7
+ "types": "./lib/index.ts",
8
+ "exports": {
9
+ ".": "./lib/index.ts"
10
+ },
6
11
  "scripts": {
7
12
  "start": "cosmos",
8
13
  "build": "tsup-node ./lib/index.ts --format esm --dts",
@@ -14,8 +19,6 @@
14
19
  "devDependencies": {
15
20
  "@biomejs/biome": "^2.3.5",
16
21
  "@react-hook/resize-observer": "^2.0.2",
17
- "@tscircuit/math-utils": "^0.0.29",
18
- "@tscircuit/solver-utils": "^0.0.9",
19
22
  "@types/bun": "latest",
20
23
  "@types/rbush": "^4.0.0",
21
24
  "@types/react": "^18",
@@ -24,8 +27,6 @@
24
27
  "@vitejs/plugin-react": "^4",
25
28
  "biome": "^0.3.3",
26
29
  "bun-match-svg": "^0.0.14",
27
- "graphics-debug": "^0.0.76",
28
- "rbush": "^4.0.1",
29
30
  "react": "18",
30
31
  "react-cosmos": "^6.2.3",
31
32
  "react-cosmos-plugin-vite": "^6.2.0",
@@ -39,6 +40,10 @@
39
40
  },
40
41
  "dependencies": {
41
42
  "D": "^1.0.0",
42
- "flatbush": "^4.5.0"
43
+ "flatbush": "^4.5.1",
44
+ "@tscircuit/math-utils": "^0.0.36",
45
+ "@tscircuit/solver-utils": "^0.0.19",
46
+ "graphics-debug": "^0.0.91",
47
+ "rbush": "^4.0.1"
43
48
  }
44
49
  }