webgl2-sdf 0.0.1 → 0.0.3
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/browser/index.min.js +1 -0
- package/node/bezier/bezier-curves-to-line-segs.js +31 -0
- package/node/bezier/bezier-curves-to-line-segs.js.map +1 -0
- package/node/bezier/eval-de-casteljau.js +61 -0
- package/node/bezier/eval-de-casteljau.js.map +1 -0
- package/node/bezier/from-to/from-to-2.js +134 -0
- package/node/bezier/from-to/from-to-2.js.map +1 -0
- package/node/bezier/from-to/from-to-3.js +159 -0
- package/node/bezier/from-to/from-to-3.js.map +1 -0
- package/node/bezier/from-to/from-to.js +21 -0
- package/node/bezier/from-to/from-to.js.map +1 -0
- package/node/bezier/is-cubic-obtuse.js +24 -0
- package/node/bezier/is-cubic-obtuse.js.map +1 -0
- package/node/bezier/is-quad-obtuse.js +20 -0
- package/node/bezier/is-quad-obtuse.js.map +1 -0
- package/node/bezier/is-really-point.js +19 -0
- package/node/bezier/is-really-point.js.map +1 -0
- package/node/bezier/split-by-deviation-from-straight-line-cubic.js +85 -0
- package/node/bezier/split-by-deviation-from-straight-line-cubic.js.map +1 -0
- package/node/bezier/split-by-deviation-from-straight-line-quad.js +50 -0
- package/node/bezier/split-by-deviation-from-straight-line-quad.js.map +1 -0
- package/node/bezier/split-into-line-segments.js +29 -0
- package/node/bezier/split-into-line-segments.js.map +1 -0
- package/node/generate-sdf.js +57 -0
- package/node/generate-sdf.js.map +1 -0
- package/node/index.js +2 -0
- package/node/index.js.map +1 -0
- package/node/main-program.js +100 -0
- package/node/main-program.js.map +1 -0
- package/node/max-aspect-ratio-before-stretch.js +3 -0
- package/node/max-aspect-ratio-before-stretch.js.map +1 -0
- package/node/prepare-buffers.js +114 -0
- package/node/prepare-buffers.js.map +1 -0
- package/node/row-count.js +4 -0
- package/node/row-count.js.map +1 -0
- package/node/shaders/main.fragment.js +149 -0
- package/node/shaders/main.fragment.js.map +1 -0
- package/node/shaders/main.vertex.js +53 -0
- package/node/shaders/main.vertex.js.map +1 -0
- package/node/svg/get-beziers-from-raw-paths.js +91 -0
- package/node/svg/get-beziers-from-raw-paths.js.map +1 -0
- package/node/svg/get-paths-from-str.js +14 -0
- package/node/svg/get-paths-from-str.js.map +1 -0
- package/node/svg/path-data-polyfill/parse-number.js +101 -0
- package/node/svg/path-data-polyfill/parse-number.js.map +1 -0
- package/node/svg/path-data-polyfill/parse-path-data-string.js +21 -0
- package/node/svg/path-data-polyfill/parse-path-data-string.js.map +1 -0
- package/node/svg/path-data-polyfill/source.js +147 -0
- package/node/svg/path-data-polyfill/source.js.map +1 -0
- package/node/svg/path-segment/c.js +29 -0
- package/node/svg/path-segment/c.js.map +1 -0
- package/node/svg/path-segment/h.js +23 -0
- package/node/svg/path-segment/h.js.map +1 -0
- package/node/svg/path-segment/l.js +24 -0
- package/node/svg/path-segment/l.js.map +1 -0
- package/node/svg/path-segment/q.js +23 -0
- package/node/svg/path-segment/q.js.map +1 -0
- package/node/svg/path-segment/s.js +34 -0
- package/node/svg/path-segment/s.js.map +1 -0
- package/node/svg/path-segment/t.js +28 -0
- package/node/svg/path-segment/t.js.map +1 -0
- package/node/svg/path-segment/v.js +23 -0
- package/node/svg/path-segment/v.js.map +1 -0
- package/node/svg/path-segment/z.js +21 -0
- package/node/svg/path-segment/z.js.map +1 -0
- package/node/svg/path-state.js +2 -0
- package/node/svg/path-state.js.map +1 -0
- package/node/tex-width.js +12 -0
- package/node/tex-width.js.map +1 -0
- package/node/types/attribute.js +2 -0
- package/node/types/attribute.js.map +1 -0
- package/node/types/cell.js +2 -0
- package/node/types/cell.js.map +1 -0
- package/node/types/gl-context.js +2 -0
- package/node/types/gl-context.js.map +1 -0
- package/node/types/gl-type.js +2 -0
- package/node/types/gl-type.js.map +1 -0
- package/node/types/gl-usage.js +2 -0
- package/node/types/gl-usage.js.map +1 -0
- package/node/types/program.d.ts +2 -2
- package/node/types/program.js +2 -0
- package/node/types/program.js.map +1 -0
- package/node/types/strip.js +2 -0
- package/node/types/strip.js.map +1 -0
- package/node/types/texture.js +2 -0
- package/node/types/texture.js.map +1 -0
- package/node/utils/calc-circs.js +97 -0
- package/node/utils/calc-circs.js.map +1 -0
- package/node/utils/clip-line-segment-to-grid.d.ts +1 -1
- package/node/utils/clip-line-segment-to-grid.js +98 -0
- package/node/utils/clip-line-segment-to-grid.js.map +1 -0
- package/node/utils/clip-line-segment-to-strips.d.ts +1 -1
- package/node/utils/clip-line-segment-to-strips.js +150 -0
- package/node/utils/clip-line-segment-to-strips.js.map +1 -0
- package/node/utils/create-empty-grid.d.ts +1 -1
- package/node/utils/create-empty-grid.js +24 -0
- package/node/utils/create-empty-grid.js.map +1 -0
- package/node/utils/create-empty-strips.d.ts +1 -1
- package/node/utils/create-empty-strips.js +16 -0
- package/node/utils/create-empty-strips.js.map +1 -0
- package/node/utils/distance-seg-to-p.js +35 -0
- package/node/utils/distance-seg-to-p.js.map +1 -0
- package/node/utils/find-close-cells.d.ts +1 -1
- package/node/utils/find-close-cells.js +130 -0
- package/node/utils/find-close-cells.js.map +1 -0
- package/node/utils/find-crossing-cells.d.ts +1 -1
- package/node/utils/find-crossing-cells.js +31 -0
- package/node/utils/find-crossing-cells.js.map +1 -0
- package/node/utils/get-distance-to-line-function.js +45 -0
- package/node/utils/get-distance-to-line-function.js.map +1 -0
- package/node/utils/jump-idx.js +81 -0
- package/node/utils/jump-idx.js.map +1 -0
- package/node/utils/map-to-viewbox.js +29 -0
- package/node/utils/map-to-viewbox.js.map +1 -0
- package/node/utils/seg-box-x.js +69 -0
- package/node/utils/seg-box-x.js.map +1 -0
- package/node/utils/seg-strip-x.js +58 -0
- package/node/utils/seg-strip-x.js.map +1 -0
- package/node/vector/dot.js +11 -0
- package/node/vector/dot.js.map +1 -0
- package/node/vector/from-to-vec.js +11 -0
- package/node/vector/from-to-vec.js.map +1 -0
- package/node/vector/len.js +9 -0
- package/node/vector/len.js.map +1 -0
- package/node/webgl-utils/compile-shader.js +8 -0
- package/node/webgl-utils/compile-shader.js.map +1 -0
- package/node/webgl-utils/get-gl-context.d.ts +1 -1
- package/node/webgl-utils/get-gl-context.js +43 -0
- package/node/webgl-utils/get-gl-context.js.map +1 -0
- package/node/webgl-utils/set-attribute.d.ts +3 -3
- package/node/webgl-utils/set-attribute.js +52 -0
- package/node/webgl-utils/set-attribute.js.map +1 -0
- package/node/webgl-utils/set-uniform-block.d.ts +1 -1
- package/node/webgl-utils/set-uniform-block.js +31 -0
- package/node/webgl-utils/set-uniform-block.js.map +1 -0
- package/node/webgl-utils/set-uniform.d.ts +2 -2
- package/node/webgl-utils/set-uniform.js +11 -0
- package/node/webgl-utils/set-uniform.js.map +1 -0
- package/node/webgl-utils/uniform-block.js +2 -0
- package/node/webgl-utils/uniform-block.js.map +1 -0
- package/node/webgl-utils/uniform-type.js +2 -0
- package/node/webgl-utils/uniform-type.js.map +1 -0
- package/node/webgl-utils/use-program.d.ts +2 -2
- package/node/webgl-utils/use-program.js +31 -0
- package/node/webgl-utils/use-program.js.map +1 -0
- package/node/webgl-utils/use-texture.js +25 -0
- package/node/webgl-utils/use-texture.js.map +1 -0
- package/package.json +4 -5
- package/src/bezier/is-cubic-obtuse.ts +2 -2
- package/src/bezier/is-quad-obtuse.ts +2 -2
- package/src/bezier/split-by-deviation-from-straight-line-quad.ts +3 -3
- package/src/bezier/split-into-line-segments.ts +3 -3
- package/src/debug-shaders.ts +2 -2
- package/src/shaders/main.fragment.ts +1 -1
- package/src/shaders/main.vertex.ts +1 -1
- package/src/types/program.ts +2 -2
- package/src/utils/calc-circs.ts +3 -3
- package/src/utils/clip-line-segment-to-grid.ts +2 -3
- package/src/utils/clip-line-segment-to-strips.ts +2 -2
- package/src/utils/create-empty-grid.ts +2 -2
- package/src/utils/create-empty-strips.ts +2 -2
- package/src/utils/find-close-cells.ts +5 -5
- package/src/utils/find-crossing-cells.ts +2 -2
- package/src/utils/jump-idx.ts +1 -1
- package/src/webgl-utils/get-gl-context.ts +3 -3
- package/src/webgl-utils/set-attribute.ts +3 -3
- package/src/webgl-utils/set-uniform-block.ts +1 -1
- package/src/webgl-utils/set-uniform.ts +2 -2
- package/src/webgl-utils/use-program.ts +5 -5
- package/node/helpers/calc-circs.d.ts +0 -11
- package/node/helpers/clip-line-segment-to-grid.d.ts +0 -14
- package/node/helpers/clip-line-segment-to-strips.d.ts +0 -13
- package/node/helpers/create-empty-grid.d.ts +0 -8
- package/node/helpers/create-empty-strips.d.ts +0 -7
- package/node/helpers/distance-seg-to-p.d.ts +0 -5
- package/node/helpers/find-close-cells.d.ts +0 -3
- package/node/helpers/find-crossing-cells.d.ts +0 -3
- package/node/helpers/get-distance-to-line-function.d.ts +0 -10
- package/node/helpers/jump-idx.d.ts +0 -2
- package/node/helpers/map-to-viewbox.d.ts +0 -2
- package/node/helpers/seg-box-x.d.ts +0 -10
- package/node/helpers/seg-strip-x.d.ts +0 -9
- package/src/utils/path.ts +0 -137
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Cell } from "../types/cell";
|
|
2
|
-
import { ROW_COUNT } from "../row-count";
|
|
3
|
-
import { circsCache } from "./calc-circs";
|
|
4
|
-
import { distanceSegToP } from "./distance-seg-to-p";
|
|
5
|
-
import { jumpIdx } from "./jump-idx";
|
|
1
|
+
import type { Cell } from "../types/cell.js";
|
|
2
|
+
import { ROW_COUNT } from "../row-count.js";
|
|
3
|
+
import { circsCache } from "./calc-circs.js";
|
|
4
|
+
import { distanceSegToP } from "./distance-seg-to-p.js";
|
|
5
|
+
import { jumpIdx } from "./jump-idx.js";
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
const { min, SQRT2 } = Math;
|
package/src/utils/jump-idx.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Texture } from "../types/texture";
|
|
2
|
-
import type { Program } from "../types/program";
|
|
3
|
-
import type { GlContext } from "../types/gl-context";
|
|
1
|
+
import type { Texture } from "../types/texture.js";
|
|
2
|
+
import type { Program } from "../types/program.js";
|
|
3
|
+
import type { GlContext } from "../types/gl-context.js";
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
const cache = new WeakMap<WebGL2RenderingContext, GlContext>();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Program } from "../types/program";
|
|
2
|
-
import { GLattrType } from "../types/gl-type";
|
|
3
|
-
import { GLusage } from "../types/gl-usage";
|
|
1
|
+
import { Program } from "../types/program.js";
|
|
2
|
+
import { GLattrType } from "../types/gl-type.js";
|
|
3
|
+
import { GLusage } from "../types/gl-usage.js";
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
const {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Program } from "../types/program";
|
|
2
|
-
import type { Attribute } from "../types/attribute";
|
|
3
|
-
import type { UniformBlock } from "./uniform-block";
|
|
4
|
-
import type { GlContext } from "../types/gl-context";
|
|
5
|
-
import { compileShader } from "./compile-shader";
|
|
1
|
+
import type { Program } from "../types/program.js";
|
|
2
|
+
import type { Attribute } from "../types/attribute.js";
|
|
3
|
+
import type { UniformBlock } from "./uniform-block.js";
|
|
4
|
+
import type { GlContext } from "../types/gl-context.js";
|
|
5
|
+
import { compileShader } from "./compile-shader.js";
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents the max distance (in cell side length units) from one corner of
|
|
3
|
-
* the viewbox to the opposing corner.
|
|
4
|
-
*/
|
|
5
|
-
declare const circsCache: Range[];
|
|
6
|
-
interface Range {
|
|
7
|
-
readonly from: number;
|
|
8
|
-
readonly u: number;
|
|
9
|
-
readonly v: number;
|
|
10
|
-
}
|
|
11
|
-
export { circsCache };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Cell } from "../types/cell";
|
|
2
|
-
/**
|
|
3
|
-
* Clips a line segment to grid boundaries and returns multiple segments.
|
|
4
|
-
*
|
|
5
|
-
* * modifies grid by adding line segments to cells
|
|
6
|
-
* * size/count *must* be a power of 2
|
|
7
|
-
*
|
|
8
|
-
* @param count the number of grid cells per dimension
|
|
9
|
-
* @param width
|
|
10
|
-
* @param height
|
|
11
|
-
* @param seg the line segment (array of 2 points)
|
|
12
|
-
*/
|
|
13
|
-
declare function clipLineSegmentToGrid(grid: Cell[][], width: number, height: number, colCount: number, cellSize: number, seg: number[][], padCount: number): void;
|
|
14
|
-
export { clipLineSegmentToGrid };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Strip } from "../types/strip";
|
|
2
|
-
/**
|
|
3
|
-
* Clips a line segment to strip boundaries and returns multiple segments.
|
|
4
|
-
*
|
|
5
|
-
* * modifies strips by adding line segments to each strip
|
|
6
|
-
* * size/count *must* be a power of 2
|
|
7
|
-
*
|
|
8
|
-
* @param count the number of strips
|
|
9
|
-
* @param height the height of a strip
|
|
10
|
-
* @param seg the line segment (array of 2 points)
|
|
11
|
-
*/
|
|
12
|
-
declare function clipLineSegmentToStrips(strips: Strip[], height: number, seg: number[][]): void;
|
|
13
|
-
export { clipLineSegmentToStrips };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns a function that returns the signed distance to the given line from
|
|
3
|
-
* the given point.
|
|
4
|
-
*
|
|
5
|
-
* @param pS a point on the line
|
|
6
|
-
* @param pE a different point on the line; if `pS` is the same as `pE` then
|
|
7
|
-
* the distance to the point `pS` (or `pE`) will be returned.
|
|
8
|
-
*/
|
|
9
|
-
declare function getDistanceToLineFunction(pS: number[], pE: number[]): (p: number[]) => number;
|
|
10
|
-
export { getDistanceToLineFunction };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns the ordered (by t-value) intersection points of the given line
|
|
3
|
-
* segment and square.
|
|
4
|
-
*
|
|
5
|
-
* @param seg a line segment given by its endpoints
|
|
6
|
-
* @param square a square given by its two opposing corner points, min-x, min-y
|
|
7
|
-
* first
|
|
8
|
-
*/
|
|
9
|
-
declare function segBoxX(seg: number[][], square: number[][]): number[][];
|
|
10
|
-
export { segBoxX };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns the ordered (by t-value) intersection points of the given line
|
|
3
|
-
* segment and half-open strip.
|
|
4
|
-
*
|
|
5
|
-
* @param seg a line segment given by its endpoints
|
|
6
|
-
* @param strip a half-open strip given by max-x, min-y, max-y
|
|
7
|
-
*/
|
|
8
|
-
declare function segStripX(seg: number[][], strip: number[]): number[][];
|
|
9
|
-
export { segStripX };
|
package/src/utils/path.ts
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// /**
|
|
3
|
-
// * Find the point on a quadratic bezier curve at t where t is in the range [0, 1]
|
|
4
|
-
// */
|
|
5
|
-
// function pointOnQuadraticBezier (
|
|
6
|
-
// x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, t: number,
|
|
7
|
-
// pointOut: { x: number; y: number }) {
|
|
8
|
-
|
|
9
|
-
// const t2 = 1 - t
|
|
10
|
-
// pointOut.x = t2*t2*x0 + 2*t2*t*x1 + t*t*x2;
|
|
11
|
-
// pointOut.y = t2*t2*y0 + 2*t2*t*y1 + t*t*y2;
|
|
12
|
-
// }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
// /**
|
|
16
|
-
// * Find the point on a cubic bezier curve at t where t is in the range [0, 1]
|
|
17
|
-
// */
|
|
18
|
-
// function pointOnCubicBezier (
|
|
19
|
-
// x0: number, y0: number, x1: number, y1: number,
|
|
20
|
-
// x2: number, y2: number, x3: number, y3: number,
|
|
21
|
-
// t: number,
|
|
22
|
-
// pointOut: { x: number; y: number }) {
|
|
23
|
-
|
|
24
|
-
// const t2 = 1 - t;
|
|
25
|
-
// pointOut.x = t2*t2*t2*x0 + 3*t2*t2*t*x1 + 3*t2*t*t*x2 + t*t*t*x3;
|
|
26
|
-
// pointOut.y = t2*t2*t2*y0 + 3*t2*t2*t*y1 + 3*t2*t*t*y2 + t*t*t*y3;
|
|
27
|
-
// }
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
// /**
|
|
31
|
-
// * Parse a path string into its constituent line/curve commands, invoking a callback for each.
|
|
32
|
-
// * @param {string} pathString - An SVG-like path string to parse; should only contain commands: M/L/Q/C/Z
|
|
33
|
-
// * @param {function(
|
|
34
|
-
// * command: 'L'|'Q'|'C',
|
|
35
|
-
// * startX: number,
|
|
36
|
-
// * startY: number,
|
|
37
|
-
// * endX: number,
|
|
38
|
-
// * endY: number,
|
|
39
|
-
// * ctrl1X?: number,
|
|
40
|
-
// * ctrl1Y?: number,
|
|
41
|
-
// * ctrl2X?: number,
|
|
42
|
-
// * ctrl2Y?: number
|
|
43
|
-
// * )} commandCallback - A callback function that will be called once for each parsed path command, passing the
|
|
44
|
-
// * command identifier (only L/Q/C commands) and its numeric arguments.
|
|
45
|
-
// */
|
|
46
|
-
// export function forEachPathCommand(
|
|
47
|
-
// pathString: string, commandCallback: Function) {
|
|
48
|
-
|
|
49
|
-
// const segmentRE = /([MLQCZ])([^MLQCZ]*)/g
|
|
50
|
-
// let match, firstX, firstY, prevX, prevY
|
|
51
|
-
// while ((match = segmentRE.exec(pathString))) {
|
|
52
|
-
// const args = match[2].split(/[,\s]+/)
|
|
53
|
-
// switch (match[1]) {
|
|
54
|
-
// case 'M':
|
|
55
|
-
// prevX = firstX = +args[0]
|
|
56
|
-
// prevY = firstY = +args[1]
|
|
57
|
-
// break
|
|
58
|
-
// case 'L':
|
|
59
|
-
// if (+args[0] !== prevX || +args[1] !== prevY) { // yup, some fonts have zero-length line commands
|
|
60
|
-
// commandCallback('L', prevX, prevY, (prevX = +args[0]), (prevY = +args[1]))
|
|
61
|
-
// }
|
|
62
|
-
// break
|
|
63
|
-
// case 'Q': {
|
|
64
|
-
// commandCallback('Q', prevX, prevY, (prevX = +args[2]), (prevY = +args[3]), +args[0], +args[1])
|
|
65
|
-
// break
|
|
66
|
-
// }
|
|
67
|
-
// case 'C': {
|
|
68
|
-
// commandCallback('C', prevX, prevY, (prevX = +args[4]), (prevY = +args[5]), +args[0], +args[1], +args[2], +args[3])
|
|
69
|
-
// break
|
|
70
|
-
// }
|
|
71
|
-
// case 'Z':
|
|
72
|
-
// if (prevX !== firstX || prevY !== firstY) {
|
|
73
|
-
// commandCallback('L', prevX, prevY, firstX, firstY)
|
|
74
|
-
// }
|
|
75
|
-
// break
|
|
76
|
-
// }
|
|
77
|
-
// }
|
|
78
|
-
// }
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
// /**
|
|
82
|
-
// * Convert a path string to a series of straight line segments
|
|
83
|
-
// * @param {string} pathString - An SVG-like path string to parse; should only contain commands: M/L/Q/C/Z
|
|
84
|
-
// * @param {function(x1:number, y1:number, x2:number, y2:number)} segmentCallback - A callback
|
|
85
|
-
// * function that will be called once for every line segment
|
|
86
|
-
// * @param {number} [curvePoints] - How many straight line segments to use when approximating a
|
|
87
|
-
// * bezier curve in the path. Defaults to 16.
|
|
88
|
-
// */
|
|
89
|
-
// export function pathToLineSegments (pathString: any, segmentCallback: any, curvePoints = 16) {
|
|
90
|
-
// const tempPoint = { x: 0, y: 0 }
|
|
91
|
-
// forEachPathCommand(
|
|
92
|
-
// pathString,
|
|
93
|
-
// (command: any, startX: any, startY: any, endX: any, endY: any,
|
|
94
|
-
// ctrl1X: any, ctrl1Y: any, ctrl2X: any, ctrl2Y: any) => {
|
|
95
|
-
|
|
96
|
-
// switch (command) {
|
|
97
|
-
// case 'L':
|
|
98
|
-
// segmentCallback(startX, startY, endX, endY);
|
|
99
|
-
// break;
|
|
100
|
-
// case 'Q': {
|
|
101
|
-
// let prevCurveX = startX
|
|
102
|
-
// let prevCurveY = startY
|
|
103
|
-
// for (let i = 1; i < curvePoints; i++) {
|
|
104
|
-
// pointOnQuadraticBezier(
|
|
105
|
-
// startX, startY,
|
|
106
|
-
// ctrl1X, ctrl1Y,
|
|
107
|
-
// endX, endY,
|
|
108
|
-
// i / (curvePoints - 1),
|
|
109
|
-
// tempPoint
|
|
110
|
-
// )
|
|
111
|
-
// segmentCallback(prevCurveX, prevCurveY, tempPoint.x, tempPoint.y)
|
|
112
|
-
// prevCurveX = tempPoint.x
|
|
113
|
-
// prevCurveY = tempPoint.y
|
|
114
|
-
// }
|
|
115
|
-
// break;
|
|
116
|
-
// }
|
|
117
|
-
// case 'C': {
|
|
118
|
-
// let prevCurveX = startX
|
|
119
|
-
// let prevCurveY = startY
|
|
120
|
-
// for (let i = 1; i < curvePoints; i++) {
|
|
121
|
-
// pointOnCubicBezier(
|
|
122
|
-
// startX, startY,
|
|
123
|
-
// ctrl1X, ctrl1Y,
|
|
124
|
-
// ctrl2X, ctrl2Y,
|
|
125
|
-
// endX, endY,
|
|
126
|
-
// i / (curvePoints - 1),
|
|
127
|
-
// tempPoint
|
|
128
|
-
// )
|
|
129
|
-
// segmentCallback(prevCurveX, prevCurveY, tempPoint.x, tempPoint.y)
|
|
130
|
-
// prevCurveX = tempPoint.x
|
|
131
|
-
// prevCurveY = tempPoint.y
|
|
132
|
-
// }
|
|
133
|
-
// break
|
|
134
|
-
// }
|
|
135
|
-
// }
|
|
136
|
-
// });
|
|
137
|
-
// }
|