Skip to content

Commit

Permalink
refactor(geom): remove obsolete/migrated fns, update deps, readme
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Jan 25, 2019
1 parent 3774108 commit df8332d
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 136 deletions.
1 change: 1 addition & 0 deletions packages/geom/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ This package acts as a higher-level front end for the following related packages
- [@thi.ng/geom-arc](https://github.com/thi-ng/umbrella/tree/master/packages/geom-arc) - elliptic arc utils
- [@thi.ng/geom-clip-convex](https://github.com/thi-ng/umbrella/tree/master/packages/geom-clip-convex) - Sutherland-Hodgeman / Liang-Barsky clipping
- [@thi.ng/geom-closest-point](https://github.com/thi-ng/umbrella/tree/master/packages/geom-closest-point) - line-point proximity queries
- [@thi.ng/geom-hull](https://github.com/thi-ng/umbrella/tree/master/packages/geom-hull) - convex hull functions
- [@thi.ng/geom-isec](https://github.com/thi-ng/umbrella/tree/master/packages/geom-isec) - shape intersection tests
- [@thi.ng/geom-poly-utils](https://github.com/thi-ng/umbrella/tree/master/packages/geom-poly-utils) - 2D polygon helpers
- [@thi.ng/geom-resample](https://github.com/thi-ng/umbrella/tree/master/packages/geom-resample) - nD polyline resampling
Expand Down
1 change: 1 addition & 0 deletions packages/geom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@thi.ng/geom-arc": "^0.0.1",
"@thi.ng/geom-clip-convex": "^0.0.1",
"@thi.ng/geom-closest-point": "^0.0.1",
"@thi.ng/geom-hull": "^0.0.1",
"@thi.ng/geom-isec": "^0.0.1",
"@thi.ng/geom-poly-utils": "^0.0.1",
"@thi.ng/geom-resample": "^0.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/geom/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export * from "./ops/with-attribs";

export * from "./internal/coll-bounds";
export * from "./internal/edges";
export * from "./internal/graham-scan";
export * from "./internal/split";
export * from "./internal/transform-points";
export * from "./internal/translate-points";
export * from "./internal/union-bounds";
29 changes: 0 additions & 29 deletions packages/geom/src/internal/barycentric.ts

This file was deleted.

87 changes: 0 additions & 87 deletions packages/geom/src/internal/graham-scan.ts

This file was deleted.

16 changes: 0 additions & 16 deletions packages/geom/src/internal/poly-area.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/geom/src/ops/area.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defmulti, MultiFn1O } from "@thi.ng/defmulti";
import { IShape, Type } from "@thi.ng/geom-api";
import { polyArea2 } from "@thi.ng/geom-poly-utils";
import { PI } from "@thi.ng/math";
import { signedArea2, Vec } from "@thi.ng/vectors";
import {
Expand All @@ -13,7 +14,6 @@ import {
Triangle
} from "../api";
import { dispatch } from "../internal/dispatch";
import { polyArea } from "../internal/poly-area";

/**
* Returns the possibly signed (unsigned by default) surface area of given
Expand Down Expand Up @@ -75,7 +75,7 @@ area.addAll({

[Type.POLYGON]:
($: Polygon, signed?) => {
const area = polyArea($.points);
const area = polyArea2($.points);
return signed ? area : Math.abs(area);
},

Expand Down
2 changes: 1 addition & 1 deletion packages/geom/src/ops/convex-hull.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { defmulti } from "@thi.ng/defmulti";
import { IShape, PCLike, Type } from "@thi.ng/geom-api";
import { grahamScan2 } from "@thi.ng/geom-hull";
import { Polygon } from "../api";
import { dispatch } from "../internal/dispatch";
import { grahamScan2 } from "../internal/graham-scan";
import { vertices } from "./vertices";

export const convexHull = defmulti<IShape, IShape>(dispatch);
Expand Down

0 comments on commit df8332d

Please sign in to comment.