gl-draw 0.16.10 → 0.17.0-beta.2

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.
@@ -1,13 +1,12 @@
1
- type Coordinate = [number, number] | number[];
2
- export interface ConicLineOptions {
3
- coordinatesArr: Coordinate[][];
1
+ import { type GetCoordinatesArrOptions } from './getCoordinatesArr';
2
+ export interface ConicLineOptions extends GetCoordinatesArrOptions {
4
3
  lineWidth: number[];
5
4
  start: number[];
6
5
  useGroups?: 0 | 1 | 2;
7
6
  projection?: any;
8
7
  splitPolygons?: number;
9
8
  }
10
- declare const getAttributes: ({ coordinatesArr, lineWidth, start, useGroups, }: ConicLineOptions) => {
9
+ declare const getAttributes: ({ coordinates, lengths, lineWidth, start, useGroups, }: ConicLineOptions) => {
11
10
  message: Record<string, import("three").GeometryGroup[] | {
12
11
  array: ArrayLike<number>;
13
12
  itemSize: number;
@@ -1,7 +1,6 @@
1
- import { ProjectionOptions } from "../../../utils";
2
- type Coordinate = [number, number] | number[];
3
- export interface ConicPolygonOptions {
4
- coordinatesArr: Coordinate[][];
1
+ import { type ProjectionOptions } from "../../../utils";
2
+ import { type GetCoordinatesArrOptions } from './getCoordinatesArr';
3
+ export interface ConicPolygonOptions extends GetCoordinatesArrOptions {
5
4
  start?: number[];
6
5
  depth: number[];
7
6
  useGroups?: 0 | 1 | 2;
@@ -15,7 +14,7 @@ export interface ConicPolygonOptions {
15
14
  bbox?: number[];
16
15
  splitPolygons?: number;
17
16
  }
18
- declare const getAttributes: ({ coordinatesArr, start, depth, useGroups, hasTop, topFirst, hasBottom, hasSide, cartesian, projection: projectionOptions, curvatureResolution, bbox, }: ConicPolygonOptions) => {
17
+ declare const getAttributes: ({ coordinates, lengths, start, depth, useGroups, hasTop, topFirst, hasBottom, hasSide, cartesian, projection: projectionOptions, curvatureResolution, bbox, }: ConicPolygonOptions) => {
19
18
  message: Record<string, import("three").GeometryGroup[] | {
20
19
  array: ArrayLike<number>;
21
20
  itemSize: number;
@@ -1,11 +1,11 @@
1
- import { ProjectionOptions } from "../../../utils";
2
- type Coordinate = [number, number] | number[];
3
- export interface ExtrudePolygonOptions {
4
- coordinatesArr: Coordinate[][];
1
+ import { type ProjectionOptions } from "../../../utils";
2
+ import { type GetCoordinatesArrOptions } from './getCoordinatesArr';
3
+ export interface ExtrudePolygonOptions extends GetCoordinatesArrOptions {
5
4
  split?: number;
6
- sideRepeat?: number;
5
+ sideRepeat?: number[];
7
6
  bbox?: number[];
8
7
  depth: number[];
8
+ z?: number[];
9
9
  projection?: ProjectionOptions;
10
10
  useGroups?: 0 | 1 | 2;
11
11
  hasTop?: boolean;
@@ -14,7 +14,7 @@ export interface ExtrudePolygonOptions {
14
14
  splitPolygons?: number;
15
15
  topSegments?: number;
16
16
  }
17
- declare const getAttributes: ({ coordinatesArr, split, sideRepeat, bbox, depth, projection: projectionOptions, useGroups, hasTop, hasBottom, hasSide, splitPolygons, topSegments, }: ExtrudePolygonOptions) => {
17
+ declare const getAttributes: ({ coordinates, lengths, split, sideRepeat, bbox, depth, z, projection: projectionOptions, useGroups, hasTop, hasBottom, hasSide, splitPolygons, topSegments, }: ExtrudePolygonOptions) => {
18
18
  message: Record<string, import("three").GeometryGroup[] | {
19
19
  array: ArrayLike<number>;
20
20
  itemSize: number;
@@ -0,0 +1,8 @@
1
+ type Coordinate = [number, number] | number[];
2
+ export interface GetCoordinatesArrOptions {
3
+ coordinates?: Float32Array;
4
+ lengths?: number[];
5
+ dimension?: number;
6
+ }
7
+ export declare const getCoordinatesArr: ({ coordinates, lengths, dimension, }: GetCoordinatesArrOptions) => Coordinate[][];
8
+ export {};
@@ -1,13 +1,12 @@
1
- import { ProjectionOptions } from "../../../utils";
2
- type Coordinate = [number, number] | number[];
3
- export interface LineOptions {
4
- coordinatesArr: Coordinate[][];
1
+ import { type ProjectionOptions } from "../../../utils";
2
+ import { type GetCoordinatesArrOptions } from './getCoordinatesArr';
3
+ export interface LineOptions extends GetCoordinatesArrOptions {
5
4
  lineWidth: number[];
6
5
  projection?: ProjectionOptions;
7
6
  useGroups?: 0 | 1 | 2;
8
7
  splitPolygons?: number;
9
8
  }
10
- declare const getAttributes: ({ coordinatesArr, projection: projectionOptions, lineWidth, useGroups, splitPolygons, }: LineOptions) => {
9
+ declare const getAttributes: ({ coordinates, lengths, projection: projectionOptions, lineWidth, useGroups, splitPolygons, }: LineOptions) => {
11
10
  message: Record<string, import("three").GeometryGroup[] | {
12
11
  array: ArrayLike<number>;
13
12
  itemSize: number;
@@ -1,13 +1,12 @@
1
- import { ProjectionOptions } from "../../../utils";
2
- type Coordinate = [number, number] | number[];
3
- export interface LineOptions {
4
- coordinatesArr: Coordinate[][];
1
+ import { type ProjectionOptions } from "../../../utils";
2
+ import { type GetCoordinatesArrOptions } from './getCoordinatesArr';
3
+ export interface LineOptions extends GetCoordinatesArrOptions {
5
4
  lineWidth: number[];
6
5
  projection?: ProjectionOptions;
7
6
  useGroups?: 0 | 1 | 2;
8
7
  splitPolygons?: number;
9
8
  }
10
- declare const getAttributes: ({ coordinatesArr, projection: projectionOptions, lineWidth, useGroups, splitPolygons, }: LineOptions) => {
9
+ declare const getAttributes: ({ coordinates, lengths, projection: projectionOptions, lineWidth, useGroups, splitPolygons, }: LineOptions) => {
11
10
  message: Record<string, import("three").GeometryGroup[] | {
12
11
  array: ArrayLike<number>;
13
12
  itemSize: number;
@@ -1,19 +1,20 @@
1
- import { UseStore } from 'idb-keyval';
2
- import { BufferGeometry, BufferGeometryLoader } from 'three';
3
- import Pencil from "../../core/Pencil";
4
1
  import { WorkerPool } from 'esus-lite';
5
- import type { LineOptions } from './getAttributes/line';
6
- import type { LineOptions as Line2Options } from './getAttributes/line2';
2
+ import { type UseStore } from 'idb-keyval';
3
+ import { type BufferGeometry, BufferGeometryLoader } from 'three';
4
+ import type Pencil from "../../core/Pencil";
5
+ import createGeometry from './createGeometry';
7
6
  import type { ConicLineOptions } from './getAttributes/conicLine';
8
7
  import type { ConicPolygonOptions } from './getAttributes/conicPolygon';
9
8
  import type { ExtrudePolygonOptions } from './getAttributes/extrudePolygon';
10
- import createGeometry from './createGeometry';
9
+ import type { LineOptions } from './getAttributes/line';
10
+ import type { LineOptions as Line2Options } from './getAttributes/line2';
11
11
  interface Options {
12
12
  maxWorkers?: number;
13
13
  dbName?: string;
14
14
  cacheVersion?: string;
15
15
  }
16
16
  interface GeoGeometryOptions extends Options {
17
+ coordinatesArr: number[][][];
17
18
  cacheKey?: string;
18
19
  userData?: Record<string, any>;
19
20
  cb?: (geometry: BufferGeometry) => void;
@@ -48,6 +49,10 @@ export default class {
48
49
  }): Promise<BufferGeometry>;
49
50
  getCachedGeometry(options: Pick<GeoGeometryOptions, 'cacheKey' | 'cacheVersion'>): Promise<ReturnType<typeof createGeometry>[]>;
50
51
  saveCache(): void;
52
+ flattenCoordinates(coordinatesArr: number[][][], dimension?: number): {
53
+ coordinates: Float32Array;
54
+ lengths: number[];
55
+ };
51
56
  _dispose: boolean;
52
57
  dispose(): void;
53
58
  }