Skip to content

Commit

Permalink
refactor(geom-axidraw): remove geom-api dep, update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Jun 9, 2024
1 parent 3182726 commit da2b13b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
1 change: 0 additions & 1 deletion packages/geom-axidraw/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ Package sizes (brotli'd, pre-treeshake): ESM: 1.55 KB
- [@thi.ng/defmulti](https://github.com/thi-ng/umbrella/tree/develop/packages/defmulti)
- [@thi.ng/geom](https://github.com/thi-ng/umbrella/tree/develop/packages/geom)
- [@thi.ng/geom-accel](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-accel)
- [@thi.ng/geom-api](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-api)
- [@thi.ng/geom-clip-line](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-clip-line)
- [@thi.ng/geom-isec](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-isec)
- [@thi.ng/transducers](https://github.com/thi-ng/umbrella/tree/develop/packages/transducers)
Expand Down
1 change: 0 additions & 1 deletion packages/geom-axidraw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"@thi.ng/defmulti": "^3.0.39",
"@thi.ng/geom": "^7.0.1",
"@thi.ng/geom-accel": "^3.6.4",
"@thi.ng/geom-api": "^4.0.10",
"@thi.ng/geom-clip-line": "^2.3.89",
"@thi.ng/geom-isec": "^3.1.0",
"@thi.ng/transducers": "^9.0.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/geom-axidraw/src/api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Fn } from "@thi.ng/api";
import type { DrawCommand } from "@thi.ng/axidraw";
import type { IShape2, SamplingOpts } from "@thi.ng/geom-api";
import type { IShape2, SamplingOpts } from "@thi.ng/geom";
import type { ReadonlyVec } from "@thi.ng/vectors";

/**
Expand Down Expand Up @@ -76,7 +76,7 @@ export interface AsAxiDrawOpts {
*
* @remarks
* References:
* - https://docs.thi.ng/umbrella/geom-api/interfaces/SamplingOpts.html
* - https://docs.thi.ng/umbrella/geom-resample/interfaces/SamplingOpts.html
* - https://docs.thi.ng/umbrella/geom/functions/vertices.html
*/
samples: number | Partial<SamplingOpts>;
Expand Down
12 changes: 10 additions & 2 deletions packages/geom-axidraw/src/as-axidraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ import { DOWN, MOVE, UP } from "@thi.ng/axidraw/commands";
import { polyline } from "@thi.ng/axidraw/polyline";
import type { MultiFn1O } from "@thi.ng/defmulti";
import { defmulti } from "@thi.ng/defmulti/defmulti";
import type { Circle, ComplexPolygon, Group, Polyline } from "@thi.ng/geom";
import type { Attribs, IHiccupShape2, IShape2, PCLike } from "@thi.ng/geom-api";
import type {
Attribs,
Circle,
ComplexPolygon,
Group,
IHiccupShape2,
IShape2,
PCLike,
Polyline,
} from "@thi.ng/geom";
import { clipPolylinePoly } from "@thi.ng/geom-clip-line/clip-poly";
import { pointInPolygon2 } from "@thi.ng/geom-isec/point";
import { applyTransforms } from "@thi.ng/geom/apply-transforms";
Expand Down
2 changes: 1 addition & 1 deletion packages/geom-axidraw/src/as-geometry.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { DrawCommand } from "@thi.ng/axidraw";
import type { Attribs } from "@thi.ng/geom-api";
import type { Attribs } from "@thi.ng/geom";
import { group } from "@thi.ng/geom/group";
import { points } from "@thi.ng/geom/points";
import { polyline } from "@thi.ng/geom/polyline";
Expand Down
8 changes: 4 additions & 4 deletions packages/geom-axidraw/src/sort.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { sortByCachedKey } from "@thi.ng/arrays/sort-cached";
import { compareNumAsc } from "@thi.ng/compare/numeric";
import { KdTreeSet } from "@thi.ng/geom-accel/kd-tree-set";
import type { IShape2 } from "@thi.ng/geom";
import type {
IRegionQuery,
IShape2,
ISpatialMap,
ISpatialSet,
} from "@thi.ng/geom-api";
} from "@thi.ng/geom-accel";
import { KdTreeSet } from "@thi.ng/geom-accel/kd-tree-set";
import { centroid } from "@thi.ng/geom/centroid";
import { ZERO2, type ReadonlyVec } from "@thi.ng/vectors/api";
import { distSq2 } from "@thi.ng/vectors/distsq";
Expand Down Expand Up @@ -77,7 +77,7 @@ export const shapesByProximity =
/**
* Similar to {@link pointsByNearestNeighbor}, however for shapes and requiring
* an
* [`ISpatialMap`](https://docs.thi.ng/umbrella/geom-api/interfaces/ISpatialMap.html)
* [`ISpatialMap`](https://docs.thi.ng/umbrella/geom-accel/interfaces/ISpatialMap.html)
* implementation and is using shape centroid (auto-computed) to perform
* indexing and nearest neighbor queries.
*
Expand Down

0 comments on commit da2b13b

Please sign in to comment.