@thi.ng/geom 7.0.1 → 8.0.1
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/CHANGELOG.md +196 -1
- package/README.md +357 -114
- package/aabb.d.ts +26 -1
- package/api/aabb.d.ts +5 -4
- package/api/aabb.js +10 -7
- package/api/apc.d.ts +5 -3
- package/api/arc.d.ts +6 -5
- package/api/arc.js +3 -4
- package/api/bpatch.d.ts +6 -3
- package/api/bpatch.js +5 -3
- package/api/circle.d.ts +4 -3
- package/api/circle.js +9 -6
- package/api/complex-polygon.d.ts +7 -3
- package/api/complex-polygon.js +14 -4
- package/api/cubic.d.ts +8 -5
- package/api/cubic.js +12 -6
- package/api/cubic3.d.ts +15 -0
- package/api/cubic3.js +38 -0
- package/api/ellipse.d.ts +4 -3
- package/api/ellipse.js +7 -8
- package/api/extra.d.ts +15 -0
- package/api/extra.js +19 -0
- package/api/group.d.ts +12 -11
- package/api/group.js +4 -5
- package/api/group3.d.ts +30 -0
- package/api/group3.js +48 -0
- package/api/line.d.ts +8 -5
- package/api/line.js +8 -8
- package/api/line3.d.ts +15 -0
- package/api/line3.js +29 -0
- package/api/path.d.ts +14 -11
- package/api/path.js +17 -12
- package/api/path3.d.ts +28 -0
- package/api/path3.js +91 -0
- package/api/plane.d.ts +4 -3
- package/api/plane.js +7 -4
- package/api/points.d.ts +8 -10
- package/api/points.js +7 -20
- package/api/points3.d.ts +13 -0
- package/api/points3.js +21 -0
- package/api/polygon.d.ts +7 -4
- package/api/polygon.js +5 -3
- package/api/polygon3.d.ts +14 -0
- package/api/polygon3.js +24 -0
- package/api/polyline.d.ts +18 -4
- package/api/polyline.js +8 -5
- package/api/polyline3.d.ts +28 -0
- package/api/polyline3.js +31 -0
- package/api/quad.d.ts +7 -4
- package/api/quad.js +5 -3
- package/api/quad3.d.ts +7 -4
- package/api/quad3.js +6 -4
- package/api/quadratic.d.ts +8 -5
- package/api/quadratic.js +12 -6
- package/api/quadratic3.d.ts +15 -0
- package/api/quadratic3.js +38 -0
- package/api/ray.d.ts +4 -3
- package/api/ray.js +6 -7
- package/api/ray3.d.ts +14 -0
- package/api/ray3.js +33 -0
- package/api/rect.d.ts +5 -3
- package/api/rect.js +11 -8
- package/api/sphere.d.ts +4 -3
- package/api/sphere.js +8 -5
- package/api/text.d.ts +4 -3
- package/api/text.js +8 -5
- package/api/triangle.d.ts +7 -4
- package/api/triangle.js +5 -3
- package/api/triangle3.d.ts +14 -0
- package/api/triangle3.js +26 -0
- package/api.d.ts +193 -0
- package/api.js +10 -0
- package/apply-transforms.d.ts +33 -11
- package/apply-transforms.js +24 -4
- package/arc-length.d.ts +18 -4
- package/arc-length.js +18 -3
- package/arc.d.ts +1 -1
- package/area.d.ts +6 -10
- package/area.js +3 -3
- package/as-cubic.d.ts +31 -5
- package/as-cubic.js +86 -24
- package/as-path.d.ts +14 -7
- package/as-path.js +49 -24
- package/as-polygon.d.ts +20 -5
- package/as-polygon.js +46 -12
- package/as-polyline.d.ts +18 -5
- package/as-polyline.js +29 -23
- package/as-sector.d.ts +13 -0
- package/as-sector.js +18 -0
- package/as-svg.d.ts +31 -9
- package/as-svg.js +21 -18
- package/bounds.d.ts +12 -2
- package/bounds.js +15 -0
- package/bpatch.d.ts +26 -1
- package/center-of-weight.d.ts +22 -0
- package/center-of-weight.js +23 -0
- package/center.d.ts +11 -5
- package/center.js +9 -4
- package/centroid-of-bounds.d.ts +12 -0
- package/centroid-of-bounds.js +9 -0
- package/centroid.d.ts +14 -4
- package/centroid.js +16 -17
- package/circle.d.ts +1 -1
- package/classify-point.d.ts +3 -1
- package/classify-point.js +7 -4
- package/clip-convex.d.ts +27 -8
- package/clip-convex.js +52 -17
- package/closest-point.d.ts +1 -1
- package/complex-polygon-from-path.d.ts +1 -1
- package/complex-polygon.d.ts +1 -1
- package/convex-hull.d.ts +9 -2
- package/convex-hull.js +3 -3
- package/convolve.d.ts +72 -0
- package/convolve.js +33 -0
- package/cubic.d.ts +1 -1
- package/cubic.js +7 -7
- package/cubic3.d.ts +8 -0
- package/cubic3.js +14 -0
- package/edges.d.ts +2 -2
- package/ellipse.d.ts +1 -1
- package/extra.d.ts +14 -0
- package/extra.js +5 -0
- package/fit-into-bounds.d.ts +14 -4
- package/fit-into-bounds.js +6 -6
- package/flip.d.ts +21 -5
- package/flip.js +19 -12
- package/from-tessellation.d.ts +81 -0
- package/from-tessellation.js +27 -0
- package/group.d.ts +2 -2
- package/group3.d.ts +16 -0
- package/group3.js +5 -0
- package/index.d.ts +36 -1
- package/index.js +36 -1
- package/internal/bounds.d.ts +3 -4
- package/internal/copy.d.ts +8 -7
- package/internal/copy.js +3 -7
- package/internal/dispatch.d.ts +1 -1
- package/internal/error.d.ts +3 -0
- package/internal/error.js +6 -0
- package/internal/pclike.d.ts +3 -2
- package/internal/pclike.js +6 -0
- package/internal/points-as-shape.d.ts +11 -2
- package/internal/points-as-shape.js +10 -1
- package/internal/split.d.ts +2 -2
- package/internal/split.js +13 -8
- package/internal/transform.d.ts +6 -22
- package/internal/transform.js +2 -21
- package/internal/vertices.d.ts +3 -2
- package/internal/vertices.js +3 -1
- package/intersects.d.ts +5 -4
- package/intersects.js +6 -4
- package/line.d.ts +1 -1
- package/line3.d.ts +6 -0
- package/line3.js +9 -0
- package/map-point.d.ts +1 -1
- package/normalized-path.d.ts +17 -0
- package/normalized-path.js +23 -0
- package/offset.d.ts +16 -2
- package/offset.js +2 -2
- package/package.json +149 -35
- package/path-builder.d.ts +42 -13
- package/path-builder.js +68 -42
- package/path-from-cubics.d.ts +26 -0
- package/path-from-cubics.js +39 -0
- package/path-from-svg.d.ts +1 -1
- package/path-from-svg.js +29 -29
- package/path.d.ts +2 -52
- package/path.js +1 -58
- package/path3.d.ts +16 -0
- package/path3.js +5 -0
- package/plane.d.ts +11 -1
- package/plane.js +3 -0
- package/point-at.d.ts +1 -1
- package/point-inside.d.ts +3 -1
- package/point-inside.js +4 -1
- package/points.d.ts +2 -3
- package/points.js +2 -4
- package/points3.d.ts +5 -0
- package/points3.js +5 -0
- package/polygon.d.ts +5 -5
- package/polygon3.d.ts +5 -0
- package/polygon3.js +5 -0
- package/polyline.d.ts +2 -2
- package/polyline3.d.ts +5 -0
- package/polyline3.js +5 -0
- package/proximity.d.ts +5 -3
- package/proximity.js +2 -2
- package/quad.d.ts +2 -7
- package/quad.js +1 -29
- package/quad3.d.ts +8 -0
- package/quad3.js +30 -0
- package/quadratic.d.ts +1 -1
- package/quadratic3.d.ts +7 -0
- package/quadratic3.js +11 -0
- package/ray.d.ts +1 -1
- package/ray.js +2 -2
- package/ray3.d.ts +5 -0
- package/ray3.js +6 -0
- package/rect.d.ts +1 -1
- package/resample.d.ts +45 -4
- package/resample.js +26 -16
- package/rotate-around-axis.d.ts +33 -0
- package/rotate-around-axis.js +57 -0
- package/rotate.d.ts +15 -2
- package/rotate.js +47 -45
- package/rounded-rect.d.ts +25 -0
- package/rounded-rect.js +18 -0
- package/scale-with-center.d.ts +2 -2
- package/scale.d.ts +24 -2
- package/scale.js +59 -43
- package/scatter.d.ts +1 -1
- package/simplify.d.ts +8 -2
- package/simplify.js +7 -4
- package/smooth-poly.d.ts +27 -0
- package/smooth-poly.js +11 -0
- package/sphere.d.ts +1 -1
- package/split-arclength.d.ts +6 -2
- package/split-at.d.ts +18 -2
- package/split-at.js +66 -34
- package/split-near.d.ts +13 -2
- package/split-near.js +23 -27
- package/subdiv-curve.d.ts +81 -27
- package/subdiv-curve.js +44 -28
- package/tangent-at.d.ts +1 -1
- package/tessellate.d.ts +72 -18
- package/tessellate.js +53 -8
- package/text.d.ts +1 -1
- package/transform-vertices.d.ts +30 -6
- package/transform-vertices.js +36 -38
- package/transform.d.ts +30 -2
- package/transform.js +54 -40
- package/translate.d.ts +12 -2
- package/translate.js +42 -43
- package/triangle.d.ts +1 -1
- package/triangle3.d.ts +6 -0
- package/triangle3.js +8 -0
- package/union.d.ts +11 -2
- package/union.js +6 -7
- package/unmap-point.d.ts +1 -1
- package/vertices.d.ts +3 -3
- package/vertices.js +14 -4
- package/volume.d.ts +1 -1
- package/warp-points.d.ts +35 -4
- package/warp-points.js +2 -0
- package/with-attribs.d.ts +4 -5
- package/internal/rotate.d.ts +0 -5
- package/internal/rotate.js +0 -8
- package/internal/scale.d.ts +0 -5
- package/internal/scale.js +0 -12
- package/internal/translate.d.ts +0 -5
- package/internal/translate.js +0 -8
package/with-attribs.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type { Attribs, IShape } from "
|
|
1
|
+
import type { Attribs, IShape } from "./api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Returns a shallow copy of given shape with new `attribs` assigned (using
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* (if any).
|
|
4
|
+
* {@link IAttributed.withAttribs}). If `replace` is false, the new attribs will
|
|
5
|
+
* be merged with the existing ones (if any).
|
|
7
6
|
*
|
|
8
7
|
* @param shape
|
|
9
8
|
* @param attribs
|
|
10
9
|
* @param replace
|
|
11
10
|
*/
|
|
12
|
-
export declare const withAttribs: <T extends IShape
|
|
11
|
+
export declare const withAttribs: <T extends IShape>(shape: T, attribs?: Attribs, replace?: boolean) => T;
|
|
13
12
|
//# sourceMappingURL=with-attribs.d.ts.map
|
package/internal/rotate.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { PCLike, PCLikeConstructor } from "@thi.ng/geom-api";
|
|
2
|
-
import type { ReadonlyVec } from "@thi.ng/vectors";
|
|
3
|
-
export declare const __rotatedPoints: (pts: ReadonlyVec[], delta: number) => import("@thi.ng/vectors").Vec[];
|
|
4
|
-
export declare const __rotatedShape: (ctor: PCLikeConstructor) => ($: PCLike, delta: number) => PCLike;
|
|
5
|
-
//# sourceMappingURL=rotate.d.ts.map
|
package/internal/rotate.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { rotate } from "@thi.ng/vectors/rotate";
|
|
2
|
-
import { __copyAttribs } from "./copy.js";
|
|
3
|
-
const __rotatedPoints = (pts, delta) => pts.map((x) => rotate([], x, delta));
|
|
4
|
-
const __rotatedShape = (ctor) => ($, delta) => new ctor(__rotatedPoints($.points, delta), __copyAttribs($));
|
|
5
|
-
export {
|
|
6
|
-
__rotatedPoints,
|
|
7
|
-
__rotatedShape
|
|
8
|
-
};
|
package/internal/scale.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { PCLike, PCLikeConstructor } from "@thi.ng/geom-api";
|
|
2
|
-
import type { ReadonlyVec } from "@thi.ng/vectors";
|
|
3
|
-
export declare const __scaledPoints: (pts: ReadonlyVec[], delta: number | ReadonlyVec) => import("@thi.ng/vectors").Vec[];
|
|
4
|
-
export declare const __scaledShape: (ctor: PCLikeConstructor) => ($: PCLike, delta: number | ReadonlyVec) => PCLike;
|
|
5
|
-
//# sourceMappingURL=scale.d.ts.map
|
package/internal/scale.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { isNumber } from "@thi.ng/checks/is-number";
|
|
2
|
-
import { mul } from "@thi.ng/vectors/mul";
|
|
3
|
-
import { mulN } from "@thi.ng/vectors/muln";
|
|
4
|
-
import { __copyAttribs } from "./copy.js";
|
|
5
|
-
const __scaledPoints = (pts, delta) => pts.map(
|
|
6
|
-
isNumber(delta) ? (x) => mulN([], x, delta) : (x) => mul([], x, delta)
|
|
7
|
-
);
|
|
8
|
-
const __scaledShape = (ctor) => ($, delta) => new ctor(__scaledPoints($.points, delta), __copyAttribs($));
|
|
9
|
-
export {
|
|
10
|
-
__scaledPoints,
|
|
11
|
-
__scaledShape
|
|
12
|
-
};
|
package/internal/translate.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { PCLike, PCLikeConstructor } from "@thi.ng/geom-api";
|
|
2
|
-
import type { ReadonlyVec } from "@thi.ng/vectors";
|
|
3
|
-
export declare const __translatedPoints: (pts: ReadonlyVec[], delta: ReadonlyVec) => import("@thi.ng/vectors").Vec[];
|
|
4
|
-
export declare const __translatedShape: (ctor: PCLikeConstructor) => ($: PCLike, delta: ReadonlyVec) => PCLike;
|
|
5
|
-
//# sourceMappingURL=translate.d.ts.map
|
package/internal/translate.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { add } from "@thi.ng/vectors/add";
|
|
2
|
-
import { __copyAttribs } from "./copy.js";
|
|
3
|
-
const __translatedPoints = (pts, delta) => pts.map((x) => add([], x, delta));
|
|
4
|
-
const __translatedShape = (ctor) => ($, delta) => new ctor(__translatedPoints($.points, delta), __copyAttribs($));
|
|
5
|
-
export {
|
|
6
|
-
__translatedPoints,
|
|
7
|
-
__translatedShape
|
|
8
|
-
};
|