@layoutit/polycss-core 0.2.0 → 0.2.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/dist/index.d.cts CHANGED
@@ -25,7 +25,7 @@ type MeshResolution = "lossless" | "lossy";
25
25
  * and the difference adds up. Destructure with `const [x, y, z] = v` when
26
26
  * you need named axes.
27
27
  *
28
- * Polycss world space convention: +X right, +Y forward, +Z up.
28
+ * PolyCSS world space convention: +X right, +Y forward, +Z up.
29
29
  */
30
30
  type Vec3 = [number, number, number];
31
31
  /**
@@ -39,6 +39,12 @@ interface TextureTriangle {
39
39
  vertices: [Vec3, Vec3, Vec3];
40
40
  uvs: [Vec2, Vec2, Vec2];
41
41
  }
42
+ type PolyTextureWrapMode = "repeat" | "clamp-to-edge" | "mirrored-repeat";
43
+ interface PolyTextureWrap {
44
+ s: PolyTextureWrapMode;
45
+ t: PolyTextureWrapMode;
46
+ }
47
+ type PolyTextureAlphaMode = "opaque" | "mask" | "blend";
42
48
  /**
43
49
  * Directional light — simulates a single distant source (sun, key light).
44
50
  * Contributes Lambert shading scaled by `intensity`. `direction` is in
@@ -70,7 +76,7 @@ interface PolyAmbientLight {
70
76
  *
71
77
  * In CSS terms, a material bundles the `background-image` source plus paint
72
78
  * config. When a polygon references a material AND its UVs form an
73
- * axis-aligned rectangle, polycss renders the polygon as an <i> with
79
+ * axis-aligned rectangle, PolyCSS renders the polygon as an <i> with
74
80
  * `background-image: url(material.texture)` directly — no per-polygon canvas
75
81
  * rasterization, browser-cached texture, mounting / unmounting one polygon
76
82
  * does not affect any other.
@@ -82,7 +88,7 @@ interface PolyAmbientLight {
82
88
  interface PolyMaterial {
83
89
  /** Image source. Anything `background-image: url(...)` can use. */
84
90
  texture: string;
85
- /** Optional unique key (used by polycss to dedupe / cache). Caller can
91
+ /** Optional unique key (used by PolyCSS to dedupe / cache). Caller can
86
92
  * pass a stable string; if omitted, the material's identity is its object
87
93
  * reference. */
88
94
  key?: string;
@@ -107,10 +113,24 @@ interface Polygon {
107
113
  * `color` (or default gray).
108
114
  */
109
115
  texture?: string;
116
+ /**
117
+ * Texture sampler wrap mode for UVs outside [0, 1]. glTF imports preserve
118
+ * sampler.wrapS / wrapT here so the atlas rasterizer can tile repeated UVs.
119
+ * When unset, renderers keep the historical single-image behavior.
120
+ * @internal
121
+ */
122
+ textureWrap?: PolyTextureWrap;
123
+ /**
124
+ * Texture alpha interpretation imported from glTF `material.alphaMode`.
125
+ * Opaque textures can use transparent PNG padding without cutting holes in
126
+ * the rendered polygon.
127
+ * @internal
128
+ */
129
+ textureAlphaMode?: PolyTextureAlphaMode;
110
130
  /**
111
131
  * Shared material. When set, `material.texture` takes precedence over the
112
132
  * inline `texture` field. If the polygon's UVs form an axis-aligned
113
- * rectangle, polycss uses the direct CSS background-image path (no per-
133
+ * rectangle, PolyCSS uses the direct CSS background-image path (no per-
114
134
  * polygon canvas rasterization). Falls back to the atlas path otherwise.
115
135
  */
116
136
  material?: PolyMaterial;
@@ -127,6 +147,12 @@ interface Polygon {
127
147
  * @internal
128
148
  */
129
149
  textureTriangles?: TextureTriangle[];
150
+ /**
151
+ * Source material requested two-sided rendering. Importers use this so
152
+ * optimization passes do not collapse intentional reverse-wound faces.
153
+ * @internal
154
+ */
155
+ doubleSided?: boolean;
130
156
  /**
131
157
  * User-controlled metadata. Reflected to DOM as `data-*` attributes via
132
158
  * stringification by the framework wrappers. Only string|number|boolean
@@ -262,7 +288,7 @@ declare function computeTexturePaintMetrics(polygons: Polygon[], options?: Textu
262
288
 
263
289
  /**
264
290
  * Apply CSS-style chained `rotateX(rx) rotateY(ry) rotateZ(rz)` rotation
265
- * to a 3D vector. Matches the matrix composition used by polycss mesh
291
+ * to a 3D vector. Matches the matrix composition used by PolyCSS mesh
266
292
  * wrapper transforms (see `buildTransform` in each PolyMesh implementation).
267
293
  *
268
294
  * CSS composes `transform: rotateX(rx) rotateY(ry) rotateZ(rz)` as the
@@ -334,7 +360,7 @@ declare function quatFromEulerXYZ(eulerDeg: Vec3): Quat;
334
360
  declare function eulerXYZFromQuat(q: Quat): Vec3;
335
361
 
336
362
  /**
337
- * Base tile size in CSS pixels. One polycss world unit = BASE_TILE CSS
363
+ * Base tile size in CSS pixels. One PolyCSS world unit = BASE_TILE CSS
338
364
  * pixels (pre-scale). Used to convert world-coordinate target values to
339
365
  * CSS translations in the transform string.
340
366
  */
@@ -349,7 +375,7 @@ type AutoRotateOption = boolean | number | AutoRotateConfig;
349
375
  * World-coordinate camera state (Three.js-style).
350
376
  *
351
377
  * `target` is the world point that should appear at the viewport centre.
352
- * Polycss world axes: [0]=X (rows/south), [1]=Y (cols/east), [2]=Z (up).
378
+ * PolyCSS world axes: [0]=X (rows/south), [1]=Y (cols/east), [2]=Z (up).
353
379
  *
354
380
  * `pan`, `tilt`, and `depthOffset` are gone. Translations now live inside
355
381
  * `target` so they happen BEFORE rotations — enabling correct world-space
@@ -509,6 +535,10 @@ interface DedupeOverlappingPolygonsOptions {
509
535
  * containment ratios) for a pair to count as a duplicate.
510
536
  * Default 0.7. Lower (~0.4) is liberal; higher (~0.9) is strict. */
511
537
  overlapFraction?: number;
538
+ /** Preserve reverse-wound faces from authored double-sided materials.
539
+ * Geometry dedupe keeps these by default; shadow dedupe can disable it
540
+ * because coincident front/back casters produce stacked shadows. */
541
+ preserveDoubleSidedBackfaces?: boolean;
512
542
  }
513
543
  /** Identify polygons that are duplicates within tolerance. Returns the
514
544
  * set of indices into the input array that should be dropped (the
@@ -542,12 +572,6 @@ interface CoverPlanarPolygonsOptions {
542
572
  */
543
573
  declare function coverPlanarPolygons(input: Polygon[], options?: CoverPlanarPolygonsOptions): Polygon[];
544
574
 
545
- interface ApproximateMergeOptions {
546
- maxAngleDeg?: number;
547
- maxPlaneDisplacement?: number;
548
- maxBoundaryDisplacement?: number;
549
- isolatedPairs?: boolean;
550
- }
551
575
  interface OptimizeMeshPolygonsOptions {
552
576
  /** Public quality/resolution intent. Defaults to "lossy". */
553
577
  meshResolution?: MeshResolution;
@@ -556,16 +580,98 @@ interface OptimizeMeshPolygonsOptions {
556
580
  * regions. Defaults to true.
557
581
  */
558
582
  rectCover?: boolean | CoverPlanarPolygonsOptions;
559
- /**
560
- * Lossy approximate merge settings. Ignored for lossless resolution.
561
- * When omitted, lossy evaluates isolated-pair and small plane-group
562
- * strategies, then chooses the lowest render-cost result with a near-cost
563
- * preference for candidates that reduce detected internal gaps.
564
- */
565
- approximateMerge?: boolean | ApproximateMergeOptions;
566
583
  }
567
584
  declare function optimizeMeshPolygons(polygons: Polygon[], options?: OptimizeMeshPolygonsOptions): Polygon[];
568
585
 
586
+ type SeamOverlapCandidateKind = "true-gap" | "connected-facet" | "material-boundary";
587
+ interface SeamOverlapCandidate {
588
+ kind: SeamOverlapCandidateKind;
589
+ aPolygon: number;
590
+ aEdge: number;
591
+ bPolygon: number;
592
+ bEdge: number;
593
+ aColor?: string;
594
+ bColor?: string;
595
+ aMaterialKey: string;
596
+ bMaterialKey: string;
597
+ gapPx: number;
598
+ spanPx: number;
599
+ aStartPx: number;
600
+ aEndPx: number;
601
+ bStartPx: number;
602
+ bEndPx: number;
603
+ targetClosurePx: number;
604
+ appliedClosurePx: number;
605
+ residualGapPx: number;
606
+ residualTargetPx: number;
607
+ }
608
+ interface SeamOverlapDiagnostics {
609
+ exactPairs: number;
610
+ nearPairs: number;
611
+ patchedPolygons: number;
612
+ patchedEdges: number;
613
+ maxMeasuredGapPx: number;
614
+ maxAppliedAmountPx: number;
615
+ unclosedPairs: number;
616
+ maxResidualGapPx: number;
617
+ }
618
+ interface SeamOverlapOptions {
619
+ overlapPx?: number;
620
+ maxGapPx?: number;
621
+ capacityScale?: number;
622
+ }
623
+ interface SeamFacetSplitOptions {
624
+ rotX?: number;
625
+ rotY?: number;
626
+ viewAware?: boolean;
627
+ passes?: number;
628
+ budget?: number;
629
+ }
630
+ type SeamFacetSplitCandidateReason = "component-anchor" | "global-outlier" | "local-follow-up" | "shared-polygon" | "below-threshold";
631
+ interface SeamFacetSplitCandidate {
632
+ key: string;
633
+ aPolygon: number;
634
+ aEdge: number;
635
+ bPolygon: number;
636
+ bEdge: number;
637
+ color?: string;
638
+ materialKey: string;
639
+ lengthPx: number;
640
+ projectedLengthPx: number;
641
+ score: number;
642
+ normalRisk: number;
643
+ shapeRisk: number;
644
+ viewRisk: number;
645
+ component: number;
646
+ marginalCost: number;
647
+ selected: boolean;
648
+ reason: SeamFacetSplitCandidateReason;
649
+ }
650
+ interface SeamFacetSplitReport {
651
+ candidates: SeamFacetSplitCandidate[];
652
+ selectedPolygons: number;
653
+ selectedEdges: number;
654
+ addedPolygons: number;
655
+ }
656
+
657
+ declare const DEFAULT_SEAM_OVERLAP_OPTIONS: {
658
+ readonly overlapPx: 1.25;
659
+ readonly maxGapPx: 14;
660
+ readonly capacityScale: 1;
661
+ };
662
+ declare const DEFAULT_SEAM_FACET_SPLIT_OPTIONS: {
663
+ readonly budget: 40;
664
+ };
665
+ declare function seamFacetSplitPolygons(polygons: Polygon[], seamOptions?: number | SeamOverlapOptions, splitOptions?: SeamFacetSplitOptions): Polygon[];
666
+ declare function seamFacetSplitReport(polygons: Polygon[], seamOptions?: number | SeamOverlapOptions, splitOptions?: SeamFacetSplitOptions): SeamFacetSplitReport;
667
+ declare function seamOverlapPolygons(polygons: Polygon[], options?: number | SeamOverlapOptions): Polygon[];
668
+ declare function repairMeshSeams(polygons: Polygon[], seamOptions?: number | SeamOverlapOptions, splitOptions?: SeamFacetSplitOptions): Polygon[];
669
+ declare function seamOverlapDiagnostics(polygons: Polygon[], options?: number | SeamOverlapOptions): SeamOverlapDiagnostics;
670
+ declare function seamOverlapReport(polygons: Polygon[], options?: number | SeamOverlapOptions): {
671
+ diagnostics: SeamOverlapDiagnostics;
672
+ candidates: SeamOverlapCandidate[];
673
+ };
674
+
569
675
  /**
570
676
  * cullInteriorPolygons — remove polygons that are fully enclosed by other
571
677
  * polygons of the same mesh and therefore never visible from any external
@@ -588,7 +694,7 @@ declare function optimizeMeshPolygons(polygons: Polygon[], options?: OptimizeMes
588
694
  */
589
695
 
590
696
  interface CullInteriorOptions {
591
- /** Hemisphere ray samples per polygon. Higher = fewer false positives, slower. Default 12. */
697
+ /** Hemisphere ray samples per polygon. Higher = fewer false positives, slower. Default 8. */
592
698
  samples?: number;
593
699
  }
594
700
  declare function cullInteriorPolygons(polygons: Polygon[], options?: CullInteriorOptions): Polygon[];
@@ -621,7 +727,7 @@ declare function cameraCullVisibleSignature(groups: readonly CameraCullNormalGro
621
727
  * cuboids stretching along world-X, world-Y and world-Z. Mirrors the
622
728
  * convention `red=X, green=Y, blue=Z`.
623
729
  *
624
- * Returned polygons are in the standard polycss world-space convention
730
+ * Returned polygons are in the standard PolyCSS world-space convention
625
731
  * (`+X right, +Y forward, +Z up`). Wrap with the framework's PolyMesh /
626
732
  * PolyScene equivalent to render.
627
733
  */
@@ -650,7 +756,7 @@ declare function axesHelperPolygons(options?: AxesHelperOptions): Polygon[];
650
756
  /**
651
757
  * Axis-aligned box/cuboid geometry as six quad polygons.
652
758
  *
653
- * Returned polygons are in standard polycss world space:
759
+ * Returned polygons are in standard PolyCSS world space:
654
760
  * +X = right, +Y = front/forward, +Z = top/up.
655
761
  */
656
762
 
@@ -678,7 +784,7 @@ declare function boxPolygons(options?: BoxPolygonsOptions): Polygon[];
678
784
  * drag handle for `<TransformControls>` — same primitive recipe as
679
785
  * `axesHelperPolygons`, plus an arrowhead.
680
786
  *
681
- * Returned polygons are in standard polycss world space and intended
787
+ * Returned polygons are in standard PolyCSS world space and intended
682
788
  * to be wrapped in the framework's PolyMesh equivalent for rendering.
683
789
  */
684
790
 
@@ -717,7 +823,7 @@ declare function arrowPolygons(options: ArrowPolygonsOptions): Polygon[];
717
823
  * "rotation circle" and keeps the polygon count proportional to the
718
824
  * `segments` knob.
719
825
  *
720
- * Returned polygons are in standard polycss world space and intended
826
+ * Returned polygons are in standard PolyCSS world space and intended
721
827
  * to be wrapped in the framework's PolyMesh equivalent for rendering.
722
828
  */
723
829
 
@@ -775,7 +881,7 @@ declare function ringQuadPolygons(options: RingQuadPolygonsOptions): Polygon[];
775
881
  * attached mesh along two axes simultaneously (XY, XZ, or YZ), instead of
776
882
  * the single-axis motion the arrow shafts provide.
777
883
  *
778
- * The polygon lives in standard polycss world space; wrap it in the
884
+ * The polygon lives in standard PolyCSS world space; wrap it in the
779
885
  * framework's PolyMesh equivalent for rendering.
780
886
  */
781
887
 
@@ -816,6 +922,249 @@ interface OctahedronPolygonsOptions {
816
922
  }
817
923
  declare function octahedronPolygons(options: OctahedronPolygonsOptions): Polygon[];
818
924
 
925
+ /**
926
+ * Icosphere (subdivided icosahedron) geometry — approximates a sphere with
927
+ * triangular faces. Each subdivision step quadruples the face count:
928
+ * subdivisions 0 → 20, 1 → 80, 2 → 320, 3 → 1280 (capped).
929
+ *
930
+ * Vertex coordinates use PolyCSS world space: +X right, +Y forward, +Z up.
931
+ * The sphere is centered at the origin; all vertices sit at distance `radius`.
932
+ * Faces wind CCW from the outside (outward normal = away from origin).
933
+ */
934
+
935
+ interface SpherePolygonsOptions {
936
+ /** Radius of the sphere. Default 50. */
937
+ radius?: number;
938
+ /** Subdivision level (0 = bare icosahedron, 20 triangles; each +1 quadruples count). Default 1 → 80 triangles. Cap at 3 (1280 triangles). */
939
+ subdivisions?: number;
940
+ /** Fill color applied to all faces. */
941
+ color?: string;
942
+ }
943
+ declare function spherePolygons(options?: SpherePolygonsOptions): Polygon[];
944
+
945
+ /**
946
+ * Regular tetrahedron geometry — four equilateral triangular faces.
947
+ *
948
+ * Vertices are placed so the tetrahedron is centered at the origin.
949
+ * Faces wind CCW from the outside.
950
+ *
951
+ * PolyCSS world space: +X right, +Y forward, +Z up.
952
+ */
953
+
954
+ interface TetrahedronPolygonsOptions {
955
+ /** Circumradius: distance from center to each vertex. Default 100. */
956
+ size?: number;
957
+ /** Fill color applied to all four faces. */
958
+ color?: string;
959
+ }
960
+ declare function tetrahedronPolygons(options?: TetrahedronPolygonsOptions): Polygon[];
961
+
962
+ /**
963
+ * Regular icosahedron geometry — 20 equilateral triangular faces.
964
+ *
965
+ * Vertices are placed on a sphere of radius `size` centered at the origin.
966
+ * Faces wind CCW from the outside.
967
+ *
968
+ * PolyCSS world space: +X right, +Y forward, +Z up.
969
+ */
970
+
971
+ interface IcosahedronPolygonsOptions {
972
+ /** Circumradius: distance from center to each vertex. Default 100. */
973
+ size?: number;
974
+ /** Fill color applied to all 20 faces. */
975
+ color?: string;
976
+ }
977
+ declare function icosahedronPolygons(options?: IcosahedronPolygonsOptions): Polygon[];
978
+
979
+ /**
980
+ * Regular dodecahedron geometry — 12 regular pentagonal faces.
981
+ *
982
+ * Vertices are placed on a sphere of radius `size` centered at the origin.
983
+ * Each face is a pentagon (5 vertices) wound CCW from the outside.
984
+ *
985
+ * All 12 pentagonal faces of a regular dodecahedron are truly planar — each
986
+ * lies on a single tangent plane. No triangulation is needed. The renderer
987
+ * uses <i> (border-shape) on Chromium and <s> elsewhere for non-quad polygons.
988
+ *
989
+ * PolyCSS world space: +X right, +Y forward, +Z up.
990
+ */
991
+
992
+ interface DodecahedronPolygonsOptions {
993
+ /** Circumradius: distance from center to each vertex. Default 100. */
994
+ size?: number;
995
+ /** Fill color applied to all 12 faces. */
996
+ color?: string;
997
+ }
998
+ declare function dodecahedronPolygons(options?: DodecahedronPolygonsOptions): Polygon[];
999
+
1000
+ /**
1001
+ * Z-axis cylinder geometry with optional radius taper.
1002
+ *
1003
+ * Geometry:
1004
+ * - `radialSegments` side faces (quads for cylinders/frustums, triangles
1005
+ * when one radius collapses to a cone tip).
1006
+ * - `radialSegments` bottom-cap triangles (fan from center).
1007
+ * - `radialSegments` top-cap triangles (fan from center), omitted when
1008
+ * radiusTop ≈ 0 (i.e. cone tip).
1009
+ *
1010
+ * The cylinder sits centered at the origin, spanning Z = −height/2 to
1011
+ * Z = +height/2. Side quads are axis-aligned in the cylinder's own local
1012
+ * frame, which maximises the chance of hitting the <b> quad fast-path.
1013
+ *
1014
+ * PolyCSS world space: +X right, +Y forward, +Z up. The cylinder axis is
1015
+ * the Z axis so a typical upright pillar stands without any extra rotation.
1016
+ */
1017
+
1018
+ interface CylinderPolygonsOptions {
1019
+ /** Bottom-cap radius. Default 50. */
1020
+ radius?: number;
1021
+ /** Top-cap radius. Defaults to `radius` (straight cylinder).
1022
+ * Set to 0 (or near 0) for a cone. */
1023
+ radiusTop?: number;
1024
+ /** Height along the Z axis. Default 100. */
1025
+ height?: number;
1026
+ /** Number of radial segments. Default 12. */
1027
+ radialSegments?: number;
1028
+ /** Fill color applied to all polygons. */
1029
+ color?: string;
1030
+ }
1031
+ declare function cylinderPolygons(options?: CylinderPolygonsOptions): Polygon[];
1032
+
1033
+ /**
1034
+ * Z-axis cone geometry — a cylinder with `radiusTop: 0`.
1035
+ *
1036
+ * This is a thin wrapper around `cylinderPolygons` with `radiusTop` forced
1037
+ * to zero. The top cap is omitted (no area at the tip), and side faces are
1038
+ * emitted as triangles.
1039
+ *
1040
+ * PolyCSS world space: +X right, +Y forward, +Z up. Cone axis is Z; the apex
1041
+ * is at Z = +height/2 and the base at Z = -height/2.
1042
+ */
1043
+
1044
+ interface ConePolygonsOptions {
1045
+ /** Base radius. Default 50. */
1046
+ radius?: number;
1047
+ /** Height along the Z axis. Default 100. */
1048
+ height?: number;
1049
+ /** Number of radial segments. Default 12. */
1050
+ radialSegments?: number;
1051
+ /** Fill color applied to all polygons. */
1052
+ color?: string;
1053
+ }
1054
+ declare function conePolygons(options?: ConePolygonsOptions): Polygon[];
1055
+
1056
+ /**
1057
+ * Torus geometry — Z-axis ring plane.
1058
+ *
1059
+ * The torus is centered at the origin. The ring lies in the XY plane (the
1060
+ * ground plane in PolyCSS world space, where Z is up). The donut hole points
1061
+ * along the Z axis.
1062
+ *
1063
+ * Geometry: `radialSegments × tubularSegments` quads on the surface.
1064
+ *
1065
+ * DOM cost note: at default settings (12 × 16 = 192 quads) this is the
1066
+ * heaviest of the built-in primitives. Reduce radialSegments / tubularSegments
1067
+ * if render budget is tight.
1068
+ *
1069
+ * PolyCSS world space: +X right, +Y forward, +Z up.
1070
+ */
1071
+
1072
+ interface TorusPolygonsOptions {
1073
+ /** Distance from center of tube to center of torus. Default 50. */
1074
+ radius?: number;
1075
+ /** Radius of the tube. Default 15. */
1076
+ tube?: number;
1077
+ /** Number of segments around the main ring. Default 12. */
1078
+ radialSegments?: number;
1079
+ /** Number of segments around the tube cross-section. Default 16. */
1080
+ tubularSegments?: number;
1081
+ /** Fill color applied to all polygons. */
1082
+ color?: string;
1083
+ }
1084
+ declare function torusPolygons(options?: TorusPolygonsOptions): Polygon[];
1085
+
1086
+ /** Tiny non-zero scale collapsed into the projection's Z column to keep
1087
+ * the matrix invertible. Chromium skips elements whose composed
1088
+ * transform is singular (m22 = 0 would make this a true projection
1089
+ * matrix, but Chromium would refuse to paint it), so we crush Z to 1%
1090
+ * of its input instead of exactly zero. The result still looks flat
1091
+ * to the eye — sub-pixel drift on any realistic scene size. */
1092
+ declare const BAKED_SHADOW_Z_SQUASH = 0.01;
1093
+ /** Minimum absolute value of the up-axis light component before the
1094
+ * projection blows up (we divide by it). Matches the --clz clamp in
1095
+ * the dynamic-mode applyDynamicLightVars helper so baked + dynamic
1096
+ * behave identically when the light is near-horizontal. */
1097
+ declare const BAKED_SHADOW_MIN_UP = 0.01;
1098
+ /**
1099
+ * Build the CSS-space shadow projection matrix for a fixed light + ground
1100
+ * plane. The 16-element output mirrors the matrix3d expression in the
1101
+ * dynamic-mode `--shadow-proj` CSS custom property, but with literal
1102
+ * numbers — ready to be formatted into a single `matrix3d(...)` per
1103
+ * shadow leaf.
1104
+ *
1105
+ * `lightDir` is the direction the light TRAVELS (e.g. `[0, 0, -1]` is
1106
+ * straight down). PolyCSS world Z is up, and the world→CSS axis swap
1107
+ * leaves Z alone — see styles.ts for the full convention.
1108
+ *
1109
+ * `groundCssZ` is the receiver plane in CSS-Z (= world-Z) coordinates,
1110
+ * already in unit-less form (matrix3d entries must be dimensionless).
1111
+ */
1112
+ declare function buildBakedShadowProjectionMatrix(lightDir: Vec3, groundCssZ: number): number[];
1113
+ /**
1114
+ * Decides whether a polygon should cast a shadow given its outward
1115
+ * normal and the light's travel direction.
1116
+ *
1117
+ * True for polygons whose normals point in the same direction as the
1118
+ * light travels — i.e., on the far/dark side of the mesh from the
1119
+ * light's POV. Those define the silhouette of the cast shadow.
1120
+ *
1121
+ * False for front-facing polygons whose projection would land inside
1122
+ * the silhouette and only add overdraw. Dynamic mode hides these with
1123
+ * a Lambert opacity gate; baked mode skips the DOM emission entirely.
1124
+ */
1125
+ declare function isBakedShadowCaster(normal: Vec3, lightDir: Vec3): boolean;
1126
+ /**
1127
+ * 2D convex hull (Andrew's monotone chain, O(n log n)). Returns the
1128
+ * hull vertices in CCW order. Used to compute a receiver mesh's XY
1129
+ * footprint when subtracting it from the global ground shadow.
1130
+ */
1131
+ declare function convexHull2D(points: ReadonlyArray<readonly [number, number]>): Array<[number, number]>;
1132
+ /**
1133
+ * Signed area of a 2D polygon (positive for CCW vertex order, negative
1134
+ * for CW). Used by `ensureCcw2D` to normalize winding before concatenating
1135
+ * polygons into a compound SVG path under `fill-rule="nonzero"`: mixed
1136
+ * CCW/CW subpaths would cancel each other's winding in the overlap
1137
+ * region and paint an unintended hole.
1138
+ */
1139
+ declare function polygonSignedArea2D(vertices: ReadonlyArray<readonly [number, number]>): number;
1140
+ /**
1141
+ * Returns the polygon's vertices in CCW order, reversing if necessary.
1142
+ * Operates on a copy — input is left unmodified.
1143
+ */
1144
+ declare function ensureCcw2D(vertices: ReadonlyArray<readonly [number, number]>): Array<[number, number]>;
1145
+ /**
1146
+ * Projects a single CSS-3D vertex onto the shadow ground plane, returning
1147
+ * the resulting 2D point in CSS coordinates. Mirrors the per-element
1148
+ * matrix3d that the dynamic-mode `--shadow-proj` builds, but evaluated on
1149
+ * the CPU for a fixed light + ground — handy when many projected vertices
1150
+ * are needed at once (e.g. rendering shadow outlines into a single SVG
1151
+ * per mesh instead of one DOM leaf per casting polygon).
1152
+ *
1153
+ * `cssVertex` is a 3D point that has already been through the world→CSS
1154
+ * axis swap and unit scale (so its components are dimensionless CSS-space
1155
+ * coordinates). `lightDir` follows the same `--clx/--cly/--clz` convention
1156
+ * as `buildBakedShadowProjectionMatrix`.
1157
+ */
1158
+ declare function projectCssVertexToGround(cssVertex: Vec3, lightDir: Vec3, groundCssZ: number): [number, number];
1159
+
1160
+ type Pt = readonly [number, number];
1161
+ /**
1162
+ * Clips `subject` against the convex polygon `clip`. Both polygons are
1163
+ * 2D, given in CCW vertex order. Returns the clipped polygon as a new
1164
+ * array of points; an empty array means `subject` lies entirely outside.
1165
+ */
1166
+ declare function clipPolygonToConvex2D(subject: ReadonlyArray<Pt>, clip: ReadonlyArray<Pt>): Array<[number, number]>;
1167
+
819
1168
  /**
820
1169
  * Unified parser return type. All polygon-emitting parsers (parseObj,
821
1170
  * parseGltf, the loadMesh dispatcher) return this exact shape.
@@ -1008,6 +1357,12 @@ interface PolyAnimationMixer {
1008
1357
  }
1009
1358
  declare function createPolyAnimationMixer(root: PolyAnimationTarget, controller: ParseAnimationController): PolyAnimationMixer;
1010
1359
 
1360
+ interface OptimizeAnimatedMeshPolygonsOptions {
1361
+ /** Public quality/resolution intent. Defaults to "lossy". */
1362
+ meshResolution?: MeshResolution;
1363
+ }
1364
+ declare function optimizeAnimatedMeshPolygons(result: ParseResult, options?: OptimizeAnimatedMeshPolygonsOptions): ParseResult;
1365
+
1011
1366
  interface ObjParseOptions {
1012
1367
  /**
1013
1368
  * Largest mesh extent (in scene-space units). The mesh is uniformly
@@ -1095,10 +1450,16 @@ interface GltfParseOptions {
1095
1450
  * material's `pbrMetallicRoughness.baseColorFactor` if not in this map.
1096
1451
  */
1097
1452
  materialColors?: Record<string, string>;
1453
+ /**
1454
+ * Override map: glTF material name → texture image URL. Takes priority over
1455
+ * `pbrMetallicRoughness.baseColorTexture`; useful for GLB/GLTF exports that
1456
+ * preserved UVs but dropped external image references.
1457
+ */
1458
+ materialTextures?: Record<string, string>;
1098
1459
  /**
1099
1460
  * Which axis is "up" in the source mesh.
1100
1461
  * - "y" (default, glTF spec): cyclic permutation (x,y,z) → (z,x,y) so
1101
- * +Y ends up on polycss's +Z (elevation).
1462
+ * +Y ends up on PolyCSS's +Z (elevation).
1102
1463
  * - "z" (Blender-style, FBX2glTF often emits this): identity, no swap.
1103
1464
  * Pick "z" if the model lands on its side / lies down instead of
1104
1465
  * standing.
@@ -1147,54 +1508,22 @@ interface VoxParseOptions {
1147
1508
  * non-negative integers so zero makes sensible default.
1148
1509
  */
1149
1510
  gridShift?: number;
1511
+ /**
1512
+ * Optional lossy palette simplification. When > 0, opaque, hue-compatible
1513
+ * palette colors within this RGB distance are folded into the most-used
1514
+ * nearby color before greedy voxel meshing. Default: disabled.
1515
+ */
1516
+ paletteMergeDistance?: number;
1517
+ /**
1518
+ * Optional lossy local cleanup. When > 0, small face-plane color islands
1519
+ * and thin streaks are recolored to a neighboring dominant hue-compatible
1520
+ * color within this RGB distance before greedy voxel meshing. Default:
1521
+ * disabled.
1522
+ */
1523
+ colorRegionMergeDistance?: number;
1150
1524
  }
1151
1525
  declare function parseVox(buffer: ArrayBuffer, options?: VoxParseOptions): ParseResult;
1152
1526
 
1153
- type PlaneAxis = "x" | "y" | "z";
1154
- type PolyVoxelFace = "t" | "b" | "bl" | "br" | "fr" | "fl";
1155
- interface PolyVoxelWallsMask {
1156
- t: boolean;
1157
- b: boolean;
1158
- bl: boolean;
1159
- br: boolean;
1160
- fl: boolean;
1161
- fr: boolean;
1162
- }
1163
- interface FaceKey {
1164
- axis: PlaneAxis;
1165
- plane: number;
1166
- face: PolyVoxelFace;
1167
- }
1168
- interface FaceBuffer {
1169
- width: number;
1170
- height: number;
1171
- minRow: number;
1172
- minCol: number;
1173
- ids: Uint32Array;
1174
- mask: Uint8Array;
1175
- filledCount: number;
1176
- palette: string[];
1177
- }
1178
- interface FaceData {
1179
- key: FaceKey;
1180
- buffer: FaceBuffer;
1181
- }
1182
- type Brush = {
1183
- r0: number;
1184
- c0: number;
1185
- r1: number;
1186
- c1: number;
1187
- baseColor: string;
1188
- };
1189
- type SlicePlan = {
1190
- key: FaceKey;
1191
- buffer: FaceBuffer;
1192
- brushes: Brush[];
1193
- };
1194
- declare const NEXT_LAYER_STEP: Record<PolyVoxelFace, number>;
1195
- declare const buildSlicePlan: (faceData: FaceData, nextLayer: FaceBuffer | null) => SlicePlan;
1196
- declare const buildFaceDataFromVoxelSource: (source: PolyVoxelSource) => FaceData[];
1197
-
1198
1527
  /**
1199
1528
  * loadMesh — high-level fetch+parse dispatcher. Picks the parser by file
1200
1529
  * extension, fetches the URL, runs the parser, returns the unified
@@ -1247,4 +1576,513 @@ interface LoadMeshOptions {
1247
1576
  }
1248
1577
  declare function loadMesh(url: string, options?: LoadMeshOptions): Promise<ParseResult>;
1249
1578
 
1250
- export { type ApproximateMergeOptions, type ArrowPolygonsOptions, type AutoRotateConfig, type AutoRotateOption, type AxesHelperOptions, BASE_TILE, type BoxFace, type BoxFaceOptions, type BoxPolygonsOptions, CAMERA_BACKFACE_CULL_EPS, type CameraCullNormalGroup, type CameraCullRotation, type CameraHandle, type CameraState, type CameraStyleInput, type CoverPlanarPolygonsOptions, type CullInteriorOptions, DEFAULT_CAMERA_STATE, DEFAULT_PROJECTION, type DedupeOverlappingPolygonsOptions, type GltfParseOptions, type LoadMeshOptions, type LoopMode, LoopOnce, LoopPingPong, LoopRepeat, type MeshResolution, type MtlParseResult, type NormalizeResult, type ObjParseOptions, type OctahedronPolygonsOptions, type OptimizeMeshPolygonsOptions, NEXT_LAYER_STEP as POLY_VOXEL_NEXT_LAYER_STEP, type ParseAnimationClip, type ParseAnimationController, type ParseResult, type ParsedColor, type PlanePolygonsOptions, type PolyAmbientLight, type PolyAnimationAction, type ParseAnimationClip as PolyAnimationClip, type PolyAnimationMixer, type PolyAnimationTarget, type PolyDirectionalLight, type PolyMaterial, type PolyTextureLightingMode, type Brush as PolyVoxelBrush, type PolyVoxelCell, type PolyVoxelFace, type FaceBuffer as PolyVoxelFaceBuffer, type FaceData as PolyVoxelFaceData, type FaceKey as PolyVoxelFaceKey, type PlaneAxis as PolyVoxelPlaneAxis, type SlicePlan as PolyVoxelSlicePlan, type PolyVoxelSource, type PolyVoxelWallsMask, type Polygon, type PolygonFace, QUAT_IDENTITY, type Quat, type RingPolygonsOptions, type RingQuadPolygonsOptions, type SceneBbox, type SceneContext, type SceneContextBuildArgs, type SceneContextBuildResult, type SolidTextureSampleOptions, type TexturePaintMetrics, type TexturePaintMetricsOptions, type TextureTriangle, VOXEL_CAMERA_CULL_AXIS_EPS, VOXEL_CAMERA_CULL_NORMAL_LIMIT, type Vec2, type Vec3, type VoxParseOptions, arrowPolygons, axesHelperPolygons, bakeSolidTextureSampledPolygons, bakeSolidTextureSamples, boxPolygons, buildFaceDataFromVoxelSource as buildPolyVoxelFaceData, buildSlicePlan as buildPolyVoxelSlicePlan, buildSceneContext, cameraCullNormalGroups, cameraCullNormalGroupsFromPolygons, cameraCullNormalKey, cameraCullVisibleSignature, cameraFacingDepth, clampChannel, computeSceneBbox, computeShapeLighting, computeTexturePaintMetrics, coverPlanarPolygons, createIsometricCamera, createPolyAnimationMixer, cullInteriorPolygons, dedupeOverlappingPolygons, eulerXYZFromQuat, findOverlappingPolygonDuplicates, formatColor, inverseRotateVec3, isAxisAlignedSurfaceNormal, isVoxelCameraCullableNormalGroups, loadMesh, mergePolygons, normalFacesCamera, normalizeInvertMultiplier, normalizePolygons, octahedronPolygons, optimizeMeshPolygons, parseColor, parseGltf, parseHexColor, parseMtl, parseObj, parsePureColor, parseRgbColor, parseVox, planePolygons, polygonCssSurfaceNormal, polygonFaces, polygonFacesCamera, quatFromAxisAngle, quatFromEulerXYZ, quatMultiply, ringPolygons, ringQuadPolygons, rotateVec3, shadeColor };
1579
+ declare const DEFAULT_TILE = 50;
1580
+ declare const DEFAULT_LIGHT_DIR: Vec3;
1581
+ declare const DEFAULT_LIGHT_COLOR = "#ffffff";
1582
+ declare const DEFAULT_LIGHT_INTENSITY = 1;
1583
+ declare const DEFAULT_AMBIENT_COLOR = "#ffffff";
1584
+ declare const DEFAULT_AMBIENT_INTENSITY = 0.4;
1585
+ declare const ATLAS_MAX_SIZE = 4096;
1586
+ declare const ATLAS_PADDING = 1;
1587
+ declare const MIN_ATLAS_SCALE = 0.1;
1588
+ declare const MAX_ATLAS_SCALE = 1;
1589
+ declare const AUTO_ATLAS_LOW_AREA: number;
1590
+ declare const AUTO_ATLAS_MEDIUM_AREA: number;
1591
+ declare const AUTO_ATLAS_MAX_BITMAP_SIDE = 2048;
1592
+ declare const AUTO_ATLAS_MAX_DECODED_BYTES_MOBILE: number;
1593
+ declare const AUTO_ATLAS_MAX_DECODED_BYTES_DESKTOP: number;
1594
+ declare const AUTO_ATLAS_SCALE_GUARD = 0.995;
1595
+ declare const COLOR_PARSE_CACHE_MAX = 512;
1596
+ declare const ASYNC_RENDER_BUDGET_MS = 12;
1597
+ declare const RECT_EPS = 0.001;
1598
+ declare const BASIS_EPS = 1e-9;
1599
+ declare const SURFACE_NORMAL_EPS = 0.0001;
1600
+ declare const SURFACE_DISTANCE_EPS = 0.1;
1601
+ declare const SEAM_LIGHT_EPS = 0.01;
1602
+ declare const TEXTURE_TRIANGLE_BLEED = 0.75;
1603
+ declare const TEXTURE_EDGE_REPAIR_ALPHA_MIN = 1;
1604
+ declare const TEXTURE_EDGE_REPAIR_SOURCE_ALPHA_MIN = 250;
1605
+ declare const TEXTURE_EDGE_REPAIR_RADIUS = 1.5;
1606
+ declare const SOLID_TRIANGLE_BLEED = 0.75;
1607
+ declare const DEFAULT_MATRIX_DECIMALS = 3;
1608
+ declare const DEFAULT_BORDER_SHAPE_DECIMALS = 2;
1609
+ declare const DEFAULT_ATLAS_CSS_DECIMALS = 4;
1610
+ declare const DECIMAL_SCALES: number[];
1611
+ declare const SOLID_QUAD_CANONICAL_SIZE = 64;
1612
+ declare const SOLID_TRIANGLE_CANONICAL_SIZE = 32;
1613
+ declare const SOLID_TRIANGLE_LARGE_BORDER_CANONICAL_SIZE = 96;
1614
+ declare const SOLID_TRIANGLE_CORNER_CLASS = "polycss-corner-triangle";
1615
+ declare const SOLID_TRIANGLE_LARGE_BORDER_CLASS = "polycss-large-border-triangle";
1616
+ declare const ATLAS_CANONICAL_SIZE_EXPLICIT = 64;
1617
+ declare const ATLAS_CANONICAL_SIZE_AUTO_DESKTOP = 128;
1618
+ declare const BORDER_SHAPE_CENTER_PERCENT = 50;
1619
+ declare const BORDER_SHAPE_POINT_EPS = 1e-7;
1620
+ declare const BORDER_SHAPE_CANONICAL_SIZE = 16;
1621
+ declare const BORDER_SHAPE_BLEED = 0.9;
1622
+ declare const CORNER_SHAPE_POINT_EPS = 0.75;
1623
+ declare const CORNER_SHAPE_DUPLICATE_EPS = 0.2;
1624
+ declare const PROJECTIVE_QUAD_DENOM_EPS = 0.05;
1625
+ declare const PROJECTIVE_QUAD_MAX_WEIGHT_RATIO = 256;
1626
+ declare const PROJECTIVE_QUAD_BLEED = 0.6;
1627
+ declare const DEFAULT_SEAM_BLEED = 1.5;
1628
+
1629
+ interface RGB {
1630
+ r: number;
1631
+ g: number;
1632
+ b: number;
1633
+ }
1634
+ interface RGBFactors {
1635
+ r: number;
1636
+ g: number;
1637
+ b: number;
1638
+ }
1639
+ interface UvAffine {
1640
+ a: number;
1641
+ b: number;
1642
+ c: number;
1643
+ d: number;
1644
+ e: number;
1645
+ f: number;
1646
+ }
1647
+ interface UvSampleRect {
1648
+ minU: number;
1649
+ minV: number;
1650
+ maxU: number;
1651
+ maxV: number;
1652
+ }
1653
+ interface TextureTrianglePlan {
1654
+ screenPts: number[];
1655
+ uvAffine: UvAffine | null;
1656
+ uvSampleRect: UvSampleRect | null;
1657
+ }
1658
+ interface TextureAtlasPlan {
1659
+ index: number;
1660
+ polygon: Polygon;
1661
+ texture?: string;
1662
+ tileSize: number;
1663
+ layerElevation: number;
1664
+ matrix: string;
1665
+ canonicalMatrix: string;
1666
+ atlasMatrix: string;
1667
+ atlasCanonicalSize?: number;
1668
+ projectiveMatrix: string | null;
1669
+ canvasW: number;
1670
+ canvasH: number;
1671
+ screenPts: number[];
1672
+ uvAffine: UvAffine | null;
1673
+ uvSampleRect: UvSampleRect | null;
1674
+ textureTriangles: TextureTrianglePlan[] | null;
1675
+ textureEdgeRepairEdges: Set<number> | null;
1676
+ textureEdgeRepair: boolean;
1677
+ seamBleed?: number;
1678
+ seamBleedEdges?: Set<number>;
1679
+ seamBleedEdgeAmounts?: Map<number, number>;
1680
+ seamBleedInsets?: SeamBleedInsets;
1681
+ /** World-space surface normal — stable across light changes, used by dynamic mode. */
1682
+ normal: Vec3;
1683
+ textureTint: RGBFactors;
1684
+ shadedColor: string;
1685
+ }
1686
+ interface BorderShapeBounds {
1687
+ minX: number;
1688
+ minY: number;
1689
+ width: number;
1690
+ height: number;
1691
+ }
1692
+ interface BorderShapeGeometry {
1693
+ bounds: BorderShapeBounds;
1694
+ points: Array<[number, number]>;
1695
+ }
1696
+ type CornerShapeCorner = "topLeft" | "topRight" | "bottomRight" | "bottomLeft";
1697
+ type CornerShapeSide = "left" | "right" | "top" | "bottom";
1698
+ interface CornerShapeRadius {
1699
+ x: number;
1700
+ y: number;
1701
+ }
1702
+ interface CornerShapeGeometry {
1703
+ bounds: BorderShapeBounds;
1704
+ radii: Partial<Record<CornerShapeCorner, CornerShapeRadius>>;
1705
+ }
1706
+ type TextureQuality = number | "auto";
1707
+ type PolySeamBleed = number | "auto";
1708
+ type PolySeamBleedEdgeValue = ReadonlySet<number> | ReadonlyMap<number, number>;
1709
+ type PolySeamBleedEdges = ReadonlyMap<number, PolySeamBleedEdgeValue> | readonly (PolySeamBleedEdgeValue | undefined)[];
1710
+ type PolyRenderStrategy = "b" | "i" | "u";
1711
+ type SolidTrianglePrimitive = "border" | "border-large" | "corner-bevel";
1712
+ interface PolyRenderStrategiesOption {
1713
+ /** Strategies to skip; polygons that would normally use them fall through
1714
+ * the chain (b → i → s, u → i → s, i → s). `<s>` is the universal
1715
+ * fallback and cannot be disabled — textured polys have no other path. */
1716
+ disable?: readonly PolyRenderStrategy[];
1717
+ }
1718
+ interface SeamBleedInsets {
1719
+ left: number;
1720
+ right: number;
1721
+ top: number;
1722
+ bottom: number;
1723
+ }
1724
+ interface PackedTextureAtlasEntry extends TextureAtlasPlan {
1725
+ pageIndex: number;
1726
+ x: number;
1727
+ y: number;
1728
+ }
1729
+ interface PackedPage {
1730
+ width: number;
1731
+ height: number;
1732
+ entries: PackedTextureAtlasEntry[];
1733
+ }
1734
+ interface PackingShelf {
1735
+ x: number;
1736
+ y: number;
1737
+ height: number;
1738
+ }
1739
+ interface PackingPage extends PackedPage {
1740
+ shelves: PackingShelf[];
1741
+ sealed?: boolean;
1742
+ }
1743
+ interface PackedAtlas {
1744
+ entries: Array<PackedTextureAtlasEntry | null>;
1745
+ pages: PackedPage[];
1746
+ }
1747
+ interface SolidTriangleBasis {
1748
+ a: number;
1749
+ b: number;
1750
+ c: number;
1751
+ }
1752
+ interface SolidTriangleColorPlan {
1753
+ index: number;
1754
+ polygon: Polygon;
1755
+ colorComputed: boolean;
1756
+ bakedColor?: string;
1757
+ bakedRgb?: RGB;
1758
+ bakedAlpha?: number;
1759
+ dynamicVars?: string;
1760
+ }
1761
+ interface SolidTrianglePlan extends SolidTriangleColorPlan {
1762
+ styleText: string;
1763
+ transformText: string;
1764
+ basis: SolidTriangleBasis;
1765
+ primitive: SolidTrianglePrimitive;
1766
+ }
1767
+ interface SolidTriangleComputeOptions {
1768
+ basis?: SolidTriangleBasis;
1769
+ includeColor?: boolean;
1770
+ matrixDecimals?: number;
1771
+ color?: string;
1772
+ primitive?: SolidTrianglePrimitive;
1773
+ /** Pre-resolved primitive used when `primitive` is not set — replaces the
1774
+ * browser-global resolution that formerly happened inside the function. */
1775
+ resolvedPrimitive?: SolidTrianglePrimitive | null;
1776
+ }
1777
+ interface StableTriangleColorState {
1778
+ updatesDisabled: boolean;
1779
+ freezeFrames: number;
1780
+ colorFrame: number;
1781
+ maxStep: number;
1782
+ }
1783
+ interface SolidTriangleFrame {
1784
+ polygonCount: number;
1785
+ vertices: ArrayLike<number>;
1786
+ colors?: readonly (string | undefined)[];
1787
+ }
1788
+ interface SolidPaintDefaults {
1789
+ paintColor?: string;
1790
+ dynamicColor?: {
1791
+ r: number;
1792
+ g: number;
1793
+ b: number;
1794
+ };
1795
+ dynamicColorKey?: string;
1796
+ }
1797
+ interface TextureAtlasPage {
1798
+ width: number;
1799
+ height: number;
1800
+ url: string | null;
1801
+ }
1802
+ interface RectBrush {
1803
+ left: number;
1804
+ top: number;
1805
+ width: number;
1806
+ height: number;
1807
+ }
1808
+ interface LocalBasis {
1809
+ xAxis: Vec3;
1810
+ yAxis: Vec3;
1811
+ local2D: Vec2[];
1812
+ shiftX: number;
1813
+ shiftY: number;
1814
+ canvasW: number;
1815
+ canvasH: number;
1816
+ pixelArea: number;
1817
+ rawArea: number;
1818
+ }
1819
+ interface BasisOptions {
1820
+ optimize: boolean;
1821
+ fixedXAxis?: Vec3;
1822
+ boundsOrigin?: Vec3;
1823
+ snapBounds?: boolean;
1824
+ seamEdges?: Set<number>;
1825
+ }
1826
+ interface BasisHint {
1827
+ xAxis?: Vec3;
1828
+ boundsOrigin?: Vec3;
1829
+ seamEdges: Set<number>;
1830
+ textureEdgeRepairEdges?: Set<number>;
1831
+ }
1832
+ interface PolygonBasisInfo {
1833
+ pts: Vec3[];
1834
+ normal: Vec3;
1835
+ planeD: number;
1836
+ optimizable: boolean;
1837
+ }
1838
+ interface ProjectiveQuadGuardSettings {
1839
+ denomEps: number;
1840
+ maxWeightRatio: number;
1841
+ bleed: number;
1842
+ disableGuards: boolean;
1843
+ }
1844
+ interface ProjectiveQuadGuardOverrides {
1845
+ denomEps?: number;
1846
+ maxWeightRatio?: number;
1847
+ bleed?: number;
1848
+ disableGuards?: boolean;
1849
+ }
1850
+ interface ProjectiveQuadGuardGlobal {
1851
+ __polycssProjectiveQuadGuards?: ProjectiveQuadGuardOverrides;
1852
+ }
1853
+ interface ProjectiveQuadCoefficients {
1854
+ g: number;
1855
+ h: number;
1856
+ w1: number;
1857
+ w3: number;
1858
+ }
1859
+ interface StablePlanBasis {
1860
+ normal: Vec3;
1861
+ xAxis: Vec3;
1862
+ yAxis: Vec3;
1863
+ tx: number;
1864
+ ty: number;
1865
+ tz: number;
1866
+ }
1867
+ /** Options for solidTrianglePlan computation — the pure-math subset of
1868
+ * RenderTextureAtlasOptions with no DOM reference. */
1869
+ interface SolidTrianglePlanOptions {
1870
+ tileSize?: number;
1871
+ layerElevation?: number;
1872
+ directionalLight?: PolyDirectionalLight;
1873
+ ambientLight?: PolyAmbientLight;
1874
+ textureLighting?: PolyTextureLightingMode;
1875
+ solidPaintDefaults?: SolidPaintDefaults;
1876
+ strategies?: PolyRenderStrategiesOption;
1877
+ seamBleed?: PolySeamBleed;
1878
+ seamEdges?: Set<number>;
1879
+ }
1880
+ /** Internal solid-triangle plan options (extends SolidTrianglePlanOptions). */
1881
+ interface InternalSolidTrianglePlanOptions extends SolidTrianglePlanOptions {
1882
+ optimizeStableTriangleStyle?: boolean;
1883
+ stableTriangleColorSteps?: number;
1884
+ stableTriangleMatrixDecimals?: number;
1885
+ }
1886
+ /** Options accepted by the public {@link computeTextureAtlasPlanPublic} wrapper. */
1887
+ interface ComputeTextureAtlasPlanOptions {
1888
+ tileSize?: number;
1889
+ layerElevation?: number;
1890
+ directionalLight?: PolyDirectionalLight;
1891
+ ambientLight?: PolyAmbientLight;
1892
+ /** Shared-edge set returned by {@link buildTextureEdgeRepairSets}. */
1893
+ textureEdgeRepairEdges?: Set<number>;
1894
+ seamBleed?: PolySeamBleed;
1895
+ seamEdges?: Set<number>;
1896
+ }
1897
+
1898
+ declare function roundDecimal(value: number, decimals: number): string;
1899
+ declare function formatCssLength(value: number, decimals?: number): string;
1900
+ declare function formatMatrix3dValues(values: readonly number[], decimals?: number): string;
1901
+ declare function formatAffineMatrix3dColumns(xCol: Vec3, yCol: Vec3, zCol: Vec3, txCol: Vec3, decimals?: number): string;
1902
+ declare function formatAffineMatrix3dScalars(x0: number, x1: number, x2: number, y0: number, y1: number, y2: number, z0: number, z1: number, z2: number, tx0: number, tx1: number, tx2: number, decimals?: number): string;
1903
+ declare function formatAffineMatrix3dTransformScalars(x0: number, x1: number, x2: number, y0: number, y1: number, y2: number, z0: number, z1: number, z2: number, tx0: number, tx1: number, tx2: number, decimals?: number): string;
1904
+ declare function formatScaledMatrixFromPlan(entry: TextureAtlasPlan, scaleX: number, scaleY: number, offsetX?: number, offsetY?: number): string;
1905
+ declare function formatBorderShapeMatrix(entry: TextureAtlasPlan, bounds: BorderShapeBounds): string;
1906
+ declare function formatSolidQuadMatrix(entry: TextureAtlasPlan): string;
1907
+ declare function formatAtlasMatrix(entry: TextureAtlasPlan, atlasCanonicalSize: number): string;
1908
+ declare function formatPercent(value: number, decimals?: number): string;
1909
+ /** Format a raw comma-separated matrix3d value string with rounded decimals. */
1910
+ declare function formatMatrix3d(matrix: string, decimals?: number): string;
1911
+ /** Format a pixel CSS length value. */
1912
+ declare function formatCssLengthPx(value: number, decimals?: number): string;
1913
+ /**
1914
+ * Produce the CSS matrix3d transform for a solid-quad (`<b>`) leaf, including
1915
+ * the canonical 64px primitive scale.
1916
+ */
1917
+ declare function formatSolidQuadEntryMatrix(entry: TextureAtlasPlan): string;
1918
+
1919
+ declare function buildTextureEdgeRepairSets(polygons: Polygon[]): Array<Set<number> | undefined>;
1920
+ declare function resolveSeamBleed(value: unknown, fallback: number): number;
1921
+ declare function normalizedSeamBleed(value: unknown): number | undefined;
1922
+ declare function safePlanSeamBleedAmount(screenPts: number[], edgeIndex: number, requested: number): number;
1923
+ declare function computePlanSeamBleedEdgeAmounts(screenPts: number[], seamEdges: ReadonlySet<number> | undefined, seamBleed: number | undefined): Map<number, number> | undefined;
1924
+ declare function seamBleedAmountArray(vertexCount: number, edgeAmounts: ReadonlyMap<number, number> | undefined): number[] | null;
1925
+ declare function computeSeamBleedInsets(screenPts: number[], edgeAmounts: ReadonlyMap<number, number> | undefined): SeamBleedInsets | undefined;
1926
+ interface SeamBleedDetectionOptions {
1927
+ tileSize?: number;
1928
+ layerElevation?: number;
1929
+ directionalLight?: unknown;
1930
+ ambientLight?: unknown;
1931
+ }
1932
+ declare function buildSeamBleedPolygonSet(polygons: Polygon[], options?: SeamBleedDetectionOptions): Set<number>;
1933
+ declare function buildSeamBleedPolygonEdges(polygons: Polygon[], options?: SeamBleedDetectionOptions): Map<number, Set<number>>;
1934
+
1935
+ type PureColorParseResult = ReturnType<typeof parsePureColor>;
1936
+ declare function cachedParsePureColor(input: string): PureColorParseResult;
1937
+ declare function parseHex(hex: string): RGB;
1938
+ declare function rgbKey({ r, g, b }: RGB): string;
1939
+ /** Returns the parsed alpha for a color string (1.0 default). */
1940
+ declare function parseAlpha(input: string): number;
1941
+ declare function rgbToHex({ r, g, b }: RGB): string;
1942
+ declare function textureTintFactors(directScale: number, lightColor: string, ambientColor: string, ambientIntensity: number): RGBFactors;
1943
+ declare function tintToCss({ r, g, b }: RGBFactors): string;
1944
+ declare function shadePolygon(baseColor: string, directScale: number, lightColor: string, ambientColor: string, ambientIntensity: number): string;
1945
+ declare function quantizeCssColor(input: string, steps: number): string;
1946
+ declare function rgbEqual(a: RGB | undefined, b: RGB | undefined): boolean;
1947
+ declare function stepRgbToward(current: RGB, target: RGB, maxStep: number): RGB;
1948
+ declare function rgbToCss(rgb: RGB, alpha?: number): string;
1949
+ declare function colorErrorScore(current: string | undefined, next: string): number;
1950
+
1951
+ declare function fullRectBounds(entry: TextureAtlasPlan): {
1952
+ left: number;
1953
+ top: number;
1954
+ width: number;
1955
+ height: number;
1956
+ } | null;
1957
+ declare function isFullRectSolid(entry: TextureAtlasPlan): boolean;
1958
+ declare function isSolidTrianglePlan(entry: TextureAtlasPlan): boolean;
1959
+ declare function isProjectiveQuadPlan(entry: TextureAtlasPlan): entry is TextureAtlasPlan & {
1960
+ projectiveMatrix: string;
1961
+ };
1962
+ declare function safariCssProjectiveUnsupported(userAgent: string): boolean;
1963
+ declare function incrementCount(map: Map<string, number>, key: string): void;
1964
+ declare function dominantCountKey(map: Map<string, number>): string | undefined;
1965
+ interface FilterAtlasPlansEnv {
1966
+ solidTriangleSupported: boolean;
1967
+ borderShapeSupported: boolean;
1968
+ }
1969
+ /**
1970
+ * Filter a plan array to the subset that needs atlas packing, given the active
1971
+ * render strategies and texture-lighting mode. Plans excluded from the atlas
1972
+ * will be rendered via `<b>`, `<i>`, or `<u>` by the framework components.
1973
+ */
1974
+ declare function filterAtlasPlans(plans: Array<TextureAtlasPlan | null>, textureLighting: PolyTextureLightingMode, disabled: ReadonlySet<PolyRenderStrategy>, env: FilterAtlasPlansEnv): Array<TextureAtlasPlan | null>;
1975
+ interface GetSolidPaintDefaultsEnv {
1976
+ solidTriangleSupported: boolean;
1977
+ projectiveQuadSupported: boolean;
1978
+ cornerShapeSupported: boolean;
1979
+ borderShapeSupported: boolean;
1980
+ }
1981
+ declare function getSolidPaintDefaultsForPlansCore(plans: Array<TextureAtlasPlan | null>, textureLighting: PolyTextureLightingMode, disabled: ReadonlySet<PolyRenderStrategy>, env: GetSolidPaintDefaultsEnv, parseHexFn: (color: string) => RGB, rgbKeyFn: (rgb: RGB) => string, cornerShapeGeometryForPlanFn?: (plan: TextureAtlasPlan) => unknown): {
1982
+ paintColor?: string;
1983
+ dynamicColorKey?: string;
1984
+ dynamicColor?: RGB;
1985
+ };
1986
+
1987
+ declare function cssPoints(vertices: Vec3[], tile: number, elev: number): Vec3[];
1988
+ declare function computeSurfaceNormal(pts: Vec3[]): Vec3 | null;
1989
+ declare function isConvexPolygonPoints(points: Array<[number, number]>): boolean;
1990
+ declare function signedArea2D(points: Array<[number, number]>): number;
1991
+ declare function intersect2DLines(a0: [number, number], a1: [number, number], b0: [number, number], b1: [number, number]): [number, number] | null;
1992
+ declare function intersect2DLinesRaw(a0x: number, a0y: number, a1x: number, a1y: number, b0x: number, b0y: number, b1x: number, b1y: number): Vec2 | null;
1993
+ declare function expandClipPoints(points: number[], amount: number): number[];
1994
+ declare function offsetConvexPolygonPoints(points: number[], amount: number): number[];
1995
+ declare function offsetConvexPolygonPointsByEdgeAmounts(points: number[], amounts: readonly number[]): number[];
1996
+ declare function offsetTrianglePoints(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, amount: number): number[];
1997
+ declare function offsetStableTrianglePoints(left: number, right: number, height: number, amount: number): number[];
1998
+ declare function stableBasisFromPlan(source: TextureAtlasPlan, polygon: Polygon): StablePlanBasis | null;
1999
+ declare function stableTriangleMatrixDecimals(matrixDecimals: number | undefined): number;
2000
+
2001
+ declare function polygonContainsPoint(points: Array<[number, number]>, px?: number, py?: number): boolean;
2002
+ declare function borderShapeBoundsFromPoints(points: number[], fallbackWidth: number, fallbackHeight: number): BorderShapeBounds;
2003
+ declare function borderShapeGeometryForPlan(entry: TextureAtlasPlan): BorderShapeGeometry;
2004
+ declare function simplifyCornerShapePoints(points: Array<[number, number]>): Array<[number, number]>;
2005
+ declare function cornerShapePointSides([x, y]: [number, number]): Set<CornerShapeSide> | null;
2006
+ declare function sharedCornerShapeSide(a: Set<CornerShapeSide>, b: Set<CornerShapeSide>): boolean;
2007
+ declare function cornerShapeDiagonal(aPoint: [number, number], aSides: Set<CornerShapeSide>, bPoint: [number, number], bSides: Set<CornerShapeSide>): [CornerShapeCorner, CornerShapeRadius] | null;
2008
+ declare function cornerShapeGeometryForPlan(entry: TextureAtlasPlan): CornerShapeGeometry | null;
2009
+ declare function cssBorderShapeForGeometry(points: Array<[number, number]>): string;
2010
+ declare function cssBorderShapeForPlan(entry: TextureAtlasPlan): string;
2011
+ declare function formatBorderShapeEntryMatrix(entry: TextureAtlasPlan): string;
2012
+ declare function formatBorderShapeElementStyle(entry: TextureAtlasPlan): string;
2013
+ declare function formatCornerShapeElementStyle(entry: TextureAtlasPlan, geometry: CornerShapeGeometry): string;
2014
+
2015
+ declare function computeSolidTriangleColorPlanFromNormal(polygon: Polygon, index: number, nx: number, ny: number, nz: number, options: SolidTrianglePlanOptions, includeColor: boolean, colorOverride?: string): SolidTriangleColorPlan;
2016
+ declare function computeSolidTriangleColorPlan(polygon: Polygon, index: number, options: SolidTrianglePlanOptions): SolidTriangleColorPlan | null;
2017
+ declare function computeSolidTrianglePlan(polygon: Polygon, index: number, options: SolidTrianglePlanOptions, computeOptions?: SolidTriangleComputeOptions): SolidTrianglePlan | null;
2018
+ declare function computeSolidTrianglePlanFromCssPoints(polygon: Polygon, index: number, options: SolidTrianglePlanOptions, computeOptions: SolidTriangleComputeOptions, p0x: number, p0y: number, p0z: number, p1x: number, p1y: number, p1z: number, p2x: number, p2y: number, p2z: number): SolidTrianglePlan | null;
2019
+
2020
+ declare function resolveProjectiveQuadGuards(overrides: ProjectiveQuadGuardOverrides | undefined): ProjectiveQuadGuardSettings;
2021
+ declare function computeProjectiveQuadCoefficients(q: Array<[number, number]>, guards: ProjectiveQuadGuardSettings): ProjectiveQuadCoefficients | null;
2022
+ declare function computeProjectiveQuadMatrix(screenPts: number[], xAxis: Vec3, yAxis: Vec3, normal: Vec3, tx: number, ty: number, tz: number, guards: ProjectiveQuadGuardSettings, seamBleedEdgeAmounts?: ReadonlyMap<number, number>): string | null;
2023
+ declare function dotVec(a: Vec3, b: Vec3): number;
2024
+ declare function crossVec(a: Vec3, b: Vec3): Vec3;
2025
+ declare function isBasisOptimizable(polygon: Polygon): boolean;
2026
+ declare function getPolygonBasisInfo(polygon: Polygon, tile: number, elev: number): PolygonBasisInfo | null;
2027
+ declare function compatibleSurface(a: PolygonBasisInfo | null, b: PolygonBasisInfo | null): boolean;
2028
+ declare function compatibleBleedSurface(a: PolygonBasisInfo | null, b: PolygonBasisInfo | null): boolean;
2029
+ declare function seamLightBrightness(info: PolygonBasisInfo | null, options: SolidTrianglePlanOptions): number | null;
2030
+ declare function basisAxisKey(axis: Vec3): string;
2031
+ declare function makeLocalBasis(pts: Vec3[], origin: Vec3, normal: Vec3, rawXAxis: Vec3, options?: {
2032
+ boundsOrigin?: Vec3;
2033
+ snapBounds?: boolean;
2034
+ }): LocalBasis | null;
2035
+ declare function evaluateIslandAxis(component: number[], infos: Array<PolygonBasisInfo | null>, axis: Vec3, boundsOrigin: Vec3): {
2036
+ pixelArea: number;
2037
+ rawArea: number;
2038
+ } | null;
2039
+ declare function chooseIslandXAxis(component: number[], infos: Array<PolygonBasisInfo | null>): BasisHint | null;
2040
+ declare function buildBasisHints(polygons: Polygon[], options: SolidTrianglePlanOptions): Array<BasisHint | undefined>;
2041
+ declare function chooseLocalBasis(pts: Vec3[], origin: Vec3, normal: Vec3, options: BasisOptions): LocalBasis | null;
2042
+ declare function isFullRectBasis(basis: LocalBasis): boolean;
2043
+ declare function computeUvAffine(points: Vec2[], uvs: Vec2[]): UvAffine | null;
2044
+ declare function computeUvSampleRect(uvs: Vec2[]): UvSampleRect | null;
2045
+ declare function projectTextureTriangle(triangle: TextureTriangle, tile: number, elev: number, origin: Vec3, xAxis: Vec3, yAxis: Vec3, shiftX: number, shiftY: number): TextureTrianglePlan | null;
2046
+ declare function computeTextureAtlasPlan(polygon: Polygon, index: number, options: SolidTrianglePlanOptions, projectiveQuadGuards: ProjectiveQuadGuardSettings, basisHint?: BasisHint): TextureAtlasPlan | null;
2047
+ /**
2048
+ * Compute the per-polygon layout plan for one polygon in isolation.
2049
+ *
2050
+ * This is the public single-polygon variant used by React and Vue components.
2051
+ * It does not run the cross-polygon basis-optimisation or seam-detection that
2052
+ * the full `renderPolygonsWithTextureAtlas` pipeline performs, but the
2053
+ * strategy selection (projective-quad, rect, etc.) is identical to the
2054
+ * canonical renderer.
2055
+ *
2056
+ * The `projectiveQuadOverrides` parameter is the pre-resolved override bag
2057
+ * formerly obtained from `doc.defaultView.__polycssProjectiveQuadGuards`.
2058
+ * Callers that have a Document should extract it before calling; callers in
2059
+ * browser-free environments can pass `undefined` for the default guards.
2060
+ */
2061
+ declare function computeTextureAtlasPlanPublic(polygon: Polygon, index: number, options?: ComputeTextureAtlasPlanOptions, projectiveQuadOverrides?: ProjectiveQuadGuardOverrides): TextureAtlasPlan | null;
2062
+
2063
+ declare function normalizeAtlasScale(scale: number | string | undefined): number;
2064
+ declare function atlasArea(pages: PackedPage[]): number;
2065
+ declare function autoAtlasScaleCap(pages: PackedPage[], maxDecodedBytes: number): number;
2066
+ declare function autoAtlasScale(pages: PackedPage[], maxDecodedBytes: number): number;
2067
+ declare function atlasBitmapMaxSide(pages: PackedPage[], atlasScale: number): number;
2068
+ declare function atlasDecodedBytes(pages: PackedPage[], atlasScale: number): number;
2069
+ declare function autoAtlasBudgetFactor(pages: PackedPage[], atlasScale: number, maxDecodedBytes: number): number;
2070
+ /** Returns the max decoded-bytes budget for the given device class. */
2071
+ declare function autoAtlasMaxDecodedBytes(isMobile: boolean): number;
2072
+ /** Returns the atlas canonical size for the given texture quality and device class. */
2073
+ declare function atlasCanonicalSizeForTextureQuality(textureQualityInput: TextureQuality | undefined, isMobile: boolean): number;
2074
+ declare function applyPackedAtlasCanonicalSize(packed: PackedAtlas, atlasCanonicalSize: number): PackedAtlas;
2075
+ declare function atlasCanonicalSizeForEntry(entry: TextureAtlasPlan): number;
2076
+ declare function atlasPadding(atlasScale: number): number;
2077
+ declare function packTextureAtlasPlans(plans: Array<TextureAtlasPlan | null>, atlasScale?: number): PackedAtlas;
2078
+ /**
2079
+ * Pack atlas plans and resolve atlas scale, accepting a pre-resolved isMobile
2080
+ * boolean instead of a Document reference.
2081
+ */
2082
+ declare function packTextureAtlasPlansWithScaleCore(plans: Array<TextureAtlasPlan | null>, textureQualityInput: TextureQuality | undefined, isMobile: boolean): {
2083
+ packed: PackedAtlas;
2084
+ atlasScale: number;
2085
+ atlasCanonicalSize: number;
2086
+ };
2087
+
2088
+ export { ASYNC_RENDER_BUDGET_MS, ATLAS_CANONICAL_SIZE_AUTO_DESKTOP, ATLAS_CANONICAL_SIZE_EXPLICIT, ATLAS_MAX_SIZE, ATLAS_PADDING, AUTO_ATLAS_LOW_AREA, AUTO_ATLAS_MAX_BITMAP_SIDE, AUTO_ATLAS_MAX_DECODED_BYTES_DESKTOP, AUTO_ATLAS_MAX_DECODED_BYTES_MOBILE, AUTO_ATLAS_MEDIUM_AREA, AUTO_ATLAS_SCALE_GUARD, type ArrowPolygonsOptions, type AutoRotateConfig, type AutoRotateOption, type AxesHelperOptions, BAKED_SHADOW_MIN_UP, BAKED_SHADOW_Z_SQUASH, BASE_TILE, BASIS_EPS, BORDER_SHAPE_BLEED, BORDER_SHAPE_CANONICAL_SIZE, BORDER_SHAPE_CENTER_PERCENT, BORDER_SHAPE_POINT_EPS, type BasisHint, type BasisOptions, type BorderShapeBounds, type BorderShapeGeometry, type BoxFace, type BoxFaceOptions, type BoxPolygonsOptions, CAMERA_BACKFACE_CULL_EPS, COLOR_PARSE_CACHE_MAX, CORNER_SHAPE_DUPLICATE_EPS, CORNER_SHAPE_POINT_EPS, type CameraCullNormalGroup, type CameraCullRotation, type CameraHandle, type CameraState, type CameraStyleInput, type ComputeTextureAtlasPlanOptions, type ConePolygonsOptions, type CornerShapeCorner, type CornerShapeGeometry, type CornerShapeRadius, type CornerShapeSide, type CoverPlanarPolygonsOptions, type CullInteriorOptions, type CylinderPolygonsOptions, DECIMAL_SCALES, DEFAULT_AMBIENT_COLOR, DEFAULT_AMBIENT_INTENSITY, DEFAULT_ATLAS_CSS_DECIMALS, DEFAULT_BORDER_SHAPE_DECIMALS, DEFAULT_CAMERA_STATE, DEFAULT_LIGHT_COLOR, DEFAULT_LIGHT_DIR, DEFAULT_LIGHT_INTENSITY, DEFAULT_MATRIX_DECIMALS, DEFAULT_PROJECTION, DEFAULT_SEAM_BLEED, DEFAULT_SEAM_FACET_SPLIT_OPTIONS, DEFAULT_SEAM_OVERLAP_OPTIONS, DEFAULT_TILE, type DedupeOverlappingPolygonsOptions, type DodecahedronPolygonsOptions, type FilterAtlasPlansEnv, type GetSolidPaintDefaultsEnv, type GltfParseOptions, type IcosahedronPolygonsOptions, type InternalSolidTrianglePlanOptions, type LoadMeshOptions, type LocalBasis, type LoopMode, LoopOnce, LoopPingPong, LoopRepeat, MAX_ATLAS_SCALE, MIN_ATLAS_SCALE, type MeshResolution, type MtlParseResult, type NormalizeResult, type ObjParseOptions, type OctahedronPolygonsOptions, type OptimizeAnimatedMeshPolygonsOptions, type OptimizeMeshPolygonsOptions, PROJECTIVE_QUAD_BLEED, PROJECTIVE_QUAD_DENOM_EPS, PROJECTIVE_QUAD_MAX_WEIGHT_RATIO, type PackedAtlas, type PackedPage, type PackedTextureAtlasEntry, type PackingPage, type PackingShelf, type ParseAnimationClip, type ParseAnimationController, type ParseResult, type ParsedColor, type PlanePolygonsOptions, type PolyAmbientLight, type PolyAnimationAction, type ParseAnimationClip as PolyAnimationClip, type PolyAnimationMixer, type PolyAnimationTarget, type PolyDirectionalLight, type PolyMaterial, type PolyRenderStrategiesOption, type PolyRenderStrategy, type PolySeamBleed, type PolySeamBleedEdgeValue, type PolySeamBleedEdges, type PolyTextureAlphaMode, type PolyTextureLightingMode, type PolyTextureWrap, type PolyTextureWrapMode, type PolyVoxelCell, type PolyVoxelSource, type Polygon, type PolygonBasisInfo, type PolygonFace, type ProjectiveQuadCoefficients, type ProjectiveQuadGuardGlobal, type ProjectiveQuadGuardOverrides, type ProjectiveQuadGuardSettings, QUAT_IDENTITY, type Quat, RECT_EPS, type RGB, type RGBFactors, type RectBrush, type RingPolygonsOptions, type RingQuadPolygonsOptions, SEAM_LIGHT_EPS, SOLID_QUAD_CANONICAL_SIZE, SOLID_TRIANGLE_BLEED, SOLID_TRIANGLE_CANONICAL_SIZE, SOLID_TRIANGLE_CORNER_CLASS, SOLID_TRIANGLE_LARGE_BORDER_CANONICAL_SIZE, SOLID_TRIANGLE_LARGE_BORDER_CLASS, SURFACE_DISTANCE_EPS, SURFACE_NORMAL_EPS, type SceneBbox, type SceneContext, type SceneContextBuildArgs, type SceneContextBuildResult, type SeamBleedInsets, type SeamFacetSplitCandidate, type SeamFacetSplitCandidateReason, type SeamFacetSplitOptions, type SeamFacetSplitReport, type SeamOverlapCandidate, type SeamOverlapCandidateKind, type SeamOverlapDiagnostics, type SeamOverlapOptions, type SolidPaintDefaults, type SolidTextureSampleOptions, type SolidTriangleBasis, type SolidTriangleColorPlan, type SolidTriangleComputeOptions, type SolidTriangleFrame, type SolidTrianglePlan, type SolidTrianglePlanOptions, type SolidTrianglePrimitive, type SpherePolygonsOptions, type StablePlanBasis, type StableTriangleColorState, TEXTURE_EDGE_REPAIR_ALPHA_MIN, TEXTURE_EDGE_REPAIR_RADIUS, TEXTURE_EDGE_REPAIR_SOURCE_ALPHA_MIN, TEXTURE_TRIANGLE_BLEED, type TetrahedronPolygonsOptions, type TextureAtlasPage, type TextureAtlasPlan, type TexturePaintMetrics, type TexturePaintMetricsOptions, type TextureQuality, type TextureTriangle, type TextureTrianglePlan, type TorusPolygonsOptions, type UvAffine, type UvSampleRect, VOXEL_CAMERA_CULL_AXIS_EPS, VOXEL_CAMERA_CULL_NORMAL_LIMIT, type Vec2, type Vec3, type VoxParseOptions, applyPackedAtlasCanonicalSize, arrowPolygons, atlasArea, atlasBitmapMaxSide, atlasCanonicalSizeForEntry, atlasCanonicalSizeForTextureQuality, atlasDecodedBytes, atlasPadding, autoAtlasBudgetFactor, autoAtlasMaxDecodedBytes, autoAtlasScale, autoAtlasScaleCap, axesHelperPolygons, bakeSolidTextureSampledPolygons, bakeSolidTextureSamples, basisAxisKey, borderShapeBoundsFromPoints, borderShapeGeometryForPlan, boxPolygons, buildBakedShadowProjectionMatrix, buildBasisHints, buildSceneContext, buildSeamBleedPolygonEdges, buildSeamBleedPolygonSet, buildTextureEdgeRepairSets, cachedParsePureColor, cameraCullNormalGroups, cameraCullNormalGroupsFromPolygons, cameraCullNormalKey, cameraCullVisibleSignature, cameraFacingDepth, chooseIslandXAxis, chooseLocalBasis, clampChannel, clipPolygonToConvex2D, colorErrorScore, compatibleBleedSurface, compatibleSurface, computePlanSeamBleedEdgeAmounts, computeProjectiveQuadCoefficients, computeProjectiveQuadMatrix, computeSceneBbox, computeSeamBleedInsets, computeShapeLighting, computeSolidTriangleColorPlan, computeSolidTriangleColorPlanFromNormal, computeSolidTrianglePlan, computeSolidTrianglePlanFromCssPoints, computeSurfaceNormal, computeTextureAtlasPlan, computeTextureAtlasPlanPublic, computeTexturePaintMetrics, computeUvAffine, computeUvSampleRect, conePolygons, convexHull2D, cornerShapeDiagonal, cornerShapeGeometryForPlan, cornerShapePointSides, coverPlanarPolygons, createIsometricCamera, createPolyAnimationMixer, crossVec, cssBorderShapeForGeometry, cssBorderShapeForPlan, cssPoints, cullInteriorPolygons, cylinderPolygons, dedupeOverlappingPolygons, dodecahedronPolygons, dominantCountKey, dotVec, ensureCcw2D, eulerXYZFromQuat, evaluateIslandAxis, expandClipPoints, filterAtlasPlans, findOverlappingPolygonDuplicates, formatAffineMatrix3dColumns, formatAffineMatrix3dScalars, formatAffineMatrix3dTransformScalars, formatAtlasMatrix, formatBorderShapeElementStyle, formatBorderShapeEntryMatrix, formatBorderShapeMatrix, formatColor, formatCornerShapeElementStyle, formatCssLength, formatCssLengthPx, formatMatrix3d, formatMatrix3dValues, formatPercent, formatScaledMatrixFromPlan, formatSolidQuadEntryMatrix, formatSolidQuadMatrix, fullRectBounds, getPolygonBasisInfo, getSolidPaintDefaultsForPlansCore, icosahedronPolygons, incrementCount, intersect2DLines, intersect2DLinesRaw, inverseRotateVec3, isAxisAlignedSurfaceNormal, isBakedShadowCaster, isBasisOptimizable, isConvexPolygonPoints, isFullRectBasis, isFullRectSolid, isProjectiveQuadPlan, isSolidTrianglePlan, isVoxelCameraCullableNormalGroups, loadMesh, makeLocalBasis, mergePolygons, normalFacesCamera, normalizeAtlasScale, normalizeInvertMultiplier, normalizePolygons, normalizedSeamBleed, octahedronPolygons, offsetConvexPolygonPoints, offsetConvexPolygonPointsByEdgeAmounts, offsetStableTrianglePoints, offsetTrianglePoints, optimizeAnimatedMeshPolygons, optimizeMeshPolygons, packTextureAtlasPlans, packTextureAtlasPlansWithScaleCore, parseAlpha, parseColor, parseGltf, parseHex, parseHexColor, parseMtl, parseObj, parsePureColor, parseRgbColor, parseVox, planePolygons, polygonContainsPoint, polygonCssSurfaceNormal, polygonFaces, polygonFacesCamera, polygonSignedArea2D, projectCssVertexToGround, projectTextureTriangle, quantizeCssColor, quatFromAxisAngle, quatFromEulerXYZ, quatMultiply, repairMeshSeams, resolveProjectiveQuadGuards, resolveSeamBleed, rgbEqual, rgbKey, rgbToCss, rgbToHex, ringPolygons, ringQuadPolygons, rotateVec3, roundDecimal, safariCssProjectiveUnsupported, safePlanSeamBleedAmount, seamBleedAmountArray, seamFacetSplitPolygons, seamFacetSplitReport, seamLightBrightness, seamOverlapDiagnostics, seamOverlapPolygons, seamOverlapReport, shadeColor, shadePolygon, sharedCornerShapeSide, signedArea2D, simplifyCornerShapePoints, spherePolygons, stableBasisFromPlan, stableTriangleMatrixDecimals, stepRgbToward, tetrahedronPolygons, textureTintFactors, tintToCss, torusPolygons };