pattapatta 0.2.0
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 +11 -0
- package/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/circle-BDbKfrdR.d.ts +12 -0
- package/dist/circlePacking/index.d.ts +78 -0
- package/dist/circlePacking/index.js +381 -0
- package/dist/circlePacking/index.js.map +1 -0
- package/dist/cli.js +365 -0
- package/dist/cli.js.map +1 -0
- package/dist/construction/index.d.ts +26 -0
- package/dist/construction/index.js +102 -0
- package/dist/construction/index.js.map +1 -0
- package/dist/contour/index.d.ts +20 -0
- package/dist/contour/index.js +118 -0
- package/dist/contour/index.js.map +1 -0
- package/dist/conversion/index.d.ts +31 -0
- package/dist/conversion/index.js +99 -0
- package/dist/conversion/index.js.map +1 -0
- package/dist/group-BNjVVYSQ.d.ts +13 -0
- package/dist/hatch/index.d.ts +41 -0
- package/dist/hatch/index.js +253 -0
- package/dist/hatch/index.js.map +1 -0
- package/dist/hull/index.d.ts +16 -0
- package/dist/hull/index.js +97 -0
- package/dist/hull/index.js.map +1 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.js +3933 -0
- package/dist/index.js.map +1 -0
- package/dist/meshing/index.d.ts +125 -0
- package/dist/meshing/index.js +1333 -0
- package/dist/meshing/index.js.map +1 -0
- package/dist/morphology/index.d.ts +58 -0
- package/dist/morphology/index.js +268 -0
- package/dist/morphology/index.js.map +1 -0
- package/dist/optimisation/index.d.ts +43 -0
- package/dist/optimisation/index.js +400 -0
- package/dist/optimisation/index.js.map +1 -0
- package/dist/path-0RjhYjJs.d.ts +21 -0
- package/dist/pointSet/index.d.ts +24 -0
- package/dist/pointSet/index.js +139 -0
- package/dist/pointSet/index.js.map +1 -0
- package/dist/polygonisation/index.d.ts +44 -0
- package/dist/polygonisation/index.js +310 -0
- package/dist/polygonisation/index.js.map +1 -0
- package/dist/predicates/index.d.ts +35 -0
- package/dist/predicates/index.js +159 -0
- package/dist/predicates/index.js.map +1 -0
- package/dist/processing/index.d.ts +54 -0
- package/dist/processing/index.js +457 -0
- package/dist/processing/index.js.map +1 -0
- package/dist/segment-BKuIFMKD.d.ts +10 -0
- package/dist/segmentSet/index.d.ts +25 -0
- package/dist/segmentSet/index.js +109 -0
- package/dist/segmentSet/index.js.map +1 -0
- package/dist/shapeBoolean/index.d.ts +41 -0
- package/dist/shapeBoolean/index.js +211 -0
- package/dist/shapeBoolean/index.js.map +1 -0
- package/dist/svg/index.d.ts +38 -0
- package/dist/svg/index.js +317 -0
- package/dist/svg/index.js.map +1 -0
- package/dist/tiling/index.d.ts +32 -0
- package/dist/tiling/index.js +344 -0
- package/dist/tiling/index.js.map +1 -0
- package/dist/transformation/index.d.ts +37 -0
- package/dist/transformation/index.js +184 -0
- package/dist/transformation/index.js.map +1 -0
- package/dist/triangulation/index.d.ts +48 -0
- package/dist/triangulation/index.js +334 -0
- package/dist/triangulation/index.js.map +1 -0
- package/dist/vec2-CWyXN1Wj.d.ts +10 -0
- package/dist/voronoi/index.d.ts +31 -0
- package/dist/voronoi/index.js +211 -0
- package/dist/voronoi/index.js.map +1 -0
- package/package.json +165 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { V as Vec2 } from '../vec2-CWyXN1Wj.js';
|
|
2
|
+
import { S as Segment } from '../segment-BKuIFMKD.js';
|
|
3
|
+
import { P as Path } from '../path-0RjhYjJs.js';
|
|
4
|
+
import { G as Group } from '../group-BNjVVYSQ.js';
|
|
5
|
+
|
|
6
|
+
/** Edges shared by at least two faces (excludes perimeter and hole boundaries). */
|
|
7
|
+
declare function extractInnerEdges(faces: Path[]): Segment[];
|
|
8
|
+
/** Vertices not on the mesh perimeter. */
|
|
9
|
+
declare function extractInnerVertices(faces: Path[]): Vec2[];
|
|
10
|
+
/** First face that contains `point`, or null. */
|
|
11
|
+
declare function findContainingFace(faces: Path[], point: Vec2): Path | null;
|
|
12
|
+
/** Split every face edge longer than `maxLen` by inserting subdivision points. */
|
|
13
|
+
declare function splitEdges(faces: Path[], maxLen: number): Group;
|
|
14
|
+
/** Urquhart faces: remove longest edge of each triangle, then polygonize. */
|
|
15
|
+
declare function urquhartFaces(input: Vec2[] | Path[], preservePerimeter?: boolean): Group;
|
|
16
|
+
/** Gabriel graph faces from a point set or triangulation. */
|
|
17
|
+
declare function gabrielFaces(input: Vec2[] | Path[], preservePerimeter?: boolean): Group;
|
|
18
|
+
/** Relative-neighborhood graph faces. */
|
|
19
|
+
declare function relativeNeighborFaces(input: Vec2[] | Path[], preservePerimeter?: boolean): Group;
|
|
20
|
+
/**
|
|
21
|
+
* Greedy sparse spanner faces. Higher `k` allows longer detours, so more edges
|
|
22
|
+
* are collapsed → larger faces.
|
|
23
|
+
*/
|
|
24
|
+
declare function spannerFaces(input: Vec2[] | Path[], k?: number, preservePerimeter?: boolean): Group;
|
|
25
|
+
/**
|
|
26
|
+
* Dual faces of a triangulation: closed polygons connecting centroids of
|
|
27
|
+
* triangles around each interior primal vertex.
|
|
28
|
+
*/
|
|
29
|
+
declare function dualFaces(faces: Path[]): Group;
|
|
30
|
+
/**
|
|
31
|
+
* Centroid quadrangulation: one quad per triangulation edge using the
|
|
32
|
+
* centroids of the one or two incident triangles.
|
|
33
|
+
*/
|
|
34
|
+
declare function centroidQuadrangulation(input: Vec2[] | Path[], preservePerimeter?: boolean): Group;
|
|
35
|
+
/**
|
|
36
|
+
* Split (Catmull–Clark) quadrangulation: 3 quads per triangle via edge
|
|
37
|
+
* midpoints and the face centroid.
|
|
38
|
+
*/
|
|
39
|
+
declare function splitQuadrangulation(input: Vec2[] | Path[]): Group;
|
|
40
|
+
/**
|
|
41
|
+
* Edge-collapse quadrangulation: greedy pairing of adjacent triangles into quads
|
|
42
|
+
* (edge-coloring style collapse of shared edges).
|
|
43
|
+
*/
|
|
44
|
+
declare function edgeCollapseQuadrangulation(input: Vec2[] | Path[], preservePerimeter?: boolean): Group;
|
|
45
|
+
/**
|
|
46
|
+
* Matching quadrangulation: quality-weighted greedy matching of triangles
|
|
47
|
+
* (Blossom-Quad first step; leftover triangles retained).
|
|
48
|
+
*/
|
|
49
|
+
declare function matchingQuadrangulation(input: Vec2[] | Path[]): Group;
|
|
50
|
+
/**
|
|
51
|
+
* Spiral quadrangulation from a point set (characteristic spiral pattern).
|
|
52
|
+
*/
|
|
53
|
+
declare function spiralQuadrangulation(points: Vec2[]): Group;
|
|
54
|
+
/** Weighted Laplacian mesh smoothing. */
|
|
55
|
+
declare function smoothMesh(faces: Path[], iterationsOrCutoff: number, preservePerimeter?: boolean): Group;
|
|
56
|
+
/**
|
|
57
|
+
* Catmull–Clark-style subdivision: split each edge at `edgeSplitRatio` and
|
|
58
|
+
* connect to the face centroid (N subfaces per N-gon).
|
|
59
|
+
*/
|
|
60
|
+
declare function subdivideMesh(faces: Path[], edgeSplitRatio?: number): Group;
|
|
61
|
+
/**
|
|
62
|
+
* Simplify face boundaries while preserving mesh topology (shared edges
|
|
63
|
+
* simplified once, then faces rebuilt).
|
|
64
|
+
*/
|
|
65
|
+
declare function simplifyMesh(faces: Path[], tolerance: number, preservePerimeter?: boolean): Group;
|
|
66
|
+
/** Randomly dissolve adjacent faces that share a class id. */
|
|
67
|
+
declare function stochasticMerge(faces: Path[], nClasses: number, seed?: number): Group;
|
|
68
|
+
/**
|
|
69
|
+
* Merge faces below `minArea` into adjacent neighbors, or merge until at most
|
|
70
|
+
* `remainingFaces` remain when options use `{ remainingFaces }`.
|
|
71
|
+
*/
|
|
72
|
+
declare function areaMerge(faces: Path[], minAreaOrOptions: number | {
|
|
73
|
+
minArea?: number;
|
|
74
|
+
remainingFaces?: number;
|
|
75
|
+
}): Group;
|
|
76
|
+
/**
|
|
77
|
+
* Locate near-miss gaps between faces that should form a valid mesh
|
|
78
|
+
* (boundary segments without a matching twin within a tiny tolerance).
|
|
79
|
+
*/
|
|
80
|
+
declare function findBreaks(faces: Path[]): Group;
|
|
81
|
+
/**
|
|
82
|
+
* Clean inter-face gaps/overlaps/slivers toward a valid coverage by snapping
|
|
83
|
+
* vertices within `maxGapWidth` and dissolving overlaps.
|
|
84
|
+
*/
|
|
85
|
+
declare function fixBreaks(faces: Path[], maxGapWidth: number): Group;
|
|
86
|
+
/**
|
|
87
|
+
* Endpoint-only snap within `tolerance`, then optionally polygonize linework
|
|
88
|
+
* into faces.
|
|
89
|
+
*/
|
|
90
|
+
declare function fixBrokenFaces(coverage: Path[], tolerance: number, polygonise?: boolean): Group;
|
|
91
|
+
/** Disconnected face islands sorted by face count descending. */
|
|
92
|
+
declare function findIslands(faces: Path[]): Group[];
|
|
93
|
+
/** Sort faces by centroid angle around their collective centroid. */
|
|
94
|
+
declare function radialSortFaces(faces: Path[]): Path[];
|
|
95
|
+
/** Sort faces by centroid x then y. */
|
|
96
|
+
declare function centroidSortFaces(faces: Path[]): Path[];
|
|
97
|
+
declare const meshing: {
|
|
98
|
+
extractInnerEdges: typeof extractInnerEdges;
|
|
99
|
+
extractInnerVertices: typeof extractInnerVertices;
|
|
100
|
+
findContainingFace: typeof findContainingFace;
|
|
101
|
+
splitEdges: typeof splitEdges;
|
|
102
|
+
urquhartFaces: typeof urquhartFaces;
|
|
103
|
+
gabrielFaces: typeof gabrielFaces;
|
|
104
|
+
relativeNeighborFaces: typeof relativeNeighborFaces;
|
|
105
|
+
spannerFaces: typeof spannerFaces;
|
|
106
|
+
dualFaces: typeof dualFaces;
|
|
107
|
+
centroidQuadrangulation: typeof centroidQuadrangulation;
|
|
108
|
+
edgeCollapseQuadrangulation: typeof edgeCollapseQuadrangulation;
|
|
109
|
+
splitQuadrangulation: typeof splitQuadrangulation;
|
|
110
|
+
spiralQuadrangulation: typeof spiralQuadrangulation;
|
|
111
|
+
matchingQuadrangulation: typeof matchingQuadrangulation;
|
|
112
|
+
smoothMesh: typeof smoothMesh;
|
|
113
|
+
subdivideMesh: typeof subdivideMesh;
|
|
114
|
+
simplifyMesh: typeof simplifyMesh;
|
|
115
|
+
stochasticMerge: typeof stochasticMerge;
|
|
116
|
+
areaMerge: typeof areaMerge;
|
|
117
|
+
radialSortFaces: typeof radialSortFaces;
|
|
118
|
+
centroidSortFaces: typeof centroidSortFaces;
|
|
119
|
+
findBreaks: typeof findBreaks;
|
|
120
|
+
fixBreaks: typeof fixBreaks;
|
|
121
|
+
fixBrokenFaces: typeof fixBrokenFaces;
|
|
122
|
+
findIslands: typeof findIslands;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export { areaMerge, centroidQuadrangulation, centroidSortFaces, dualFaces, edgeCollapseQuadrangulation, extractInnerEdges, extractInnerVertices, findBreaks, findContainingFace, findIslands, fixBreaks, fixBrokenFaces, gabrielFaces, matchingQuadrangulation, meshing, radialSortFaces, relativeNeighborFaces, simplifyMesh, smoothMesh, spannerFaces, spiralQuadrangulation, splitEdges, splitQuadrangulation, stochasticMerge, subdivideMesh, urquhartFaces };
|