@layoutit/polycss-core 0.2.4 → 0.2.6

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
@@ -11,6 +11,29 @@ declare const DEFAULT_PROJECTION: "cubic";
11
11
  * variables, no JS work, no atlas re-rasterization.
12
12
  */
13
13
  type PolyTextureLightingMode = "baked" | "dynamic";
14
+ type PolyTextureLeafSizing = "canonical" | "local" | "raster";
15
+ type PolyTextureBackend = "auto" | "atlas" | "image";
16
+ type PolyTextureImageRendering = "auto" | "pixelated";
17
+ type PolyTextureImageLighting = "scene" | "source";
18
+ type PolyTextureProjection = "affine" | "projective";
19
+ interface PolyTextureImageSource {
20
+ url: string;
21
+ width: number;
22
+ height: number;
23
+ sourceRect?: {
24
+ x: number;
25
+ y: number;
26
+ width: number;
27
+ height: number;
28
+ };
29
+ imageRendering?: PolyTextureImageRendering;
30
+ }
31
+ interface PolyTexturePresentation {
32
+ imageRendering?: PolyTextureImageRendering;
33
+ backend?: PolyTextureBackend;
34
+ lighting?: PolyTextureImageLighting;
35
+ projection?: PolyTextureProjection;
36
+ }
14
37
  /**
15
38
  * Mesh post-processing intent.
16
39
  * - "lossless": preserve the authored surface while applying exact
@@ -92,6 +115,8 @@ interface PolyMaterial {
92
115
  * pass a stable string; if omitted, the material's identity is its object
93
116
  * reference. */
94
117
  key?: string;
118
+ imageSource?: PolyTextureImageSource;
119
+ presentation?: PolyTexturePresentation;
95
120
  }
96
121
  /**
97
122
  * The single polygon type for polycss. N coplanar vertices in 3D space,
@@ -134,6 +159,8 @@ interface Polygon {
134
159
  * polygon canvas rasterization). Falls back to the atlas path otherwise.
135
160
  */
136
161
  material?: PolyMaterial;
162
+ textureImageSource?: PolyTextureImageSource;
163
+ texturePresentation?: PolyTexturePresentation;
137
164
  /**
138
165
  * Per-vertex UV coords (0..1, OBJ convention with v=0 at bottom).
139
166
  * Length MUST equal vertices.length when set; mismatched UVs are
@@ -432,8 +459,32 @@ interface CameraHandle {
432
459
  height: string;
433
460
  };
434
461
  }
462
+ interface PolyCameraSceneTransformOptions {
463
+ autoCenterOffset?: Vec3;
464
+ layoutScale?: number;
465
+ tileSize?: number;
466
+ }
467
+ type PolyCameraProjection = "orthographic" | "perspective";
468
+ interface PolyCameraSnapshot {
469
+ projection: PolyCameraProjection;
470
+ perspectiveStyle: string;
471
+ appliedPerspectiveStyle: string;
472
+ state: CameraState;
473
+ }
474
+ interface PolyCameraSnapshotOptions {
475
+ projection?: PolyCameraProjection;
476
+ perspectiveStyle?: string;
477
+ }
478
+ type PolyCameraSnapshotSource = CameraHandle & {
479
+ readonly type?: PolyCameraProjection;
480
+ readonly perspectiveStyle?: string;
481
+ };
435
482
  declare function normalizeInvertMultiplier(value: number | boolean | undefined): number | undefined;
436
483
  declare const DEFAULT_CAMERA_STATE: CameraState;
484
+ declare function polyCameraTargetToCss(target?: Vec3, autoCenterOffset?: Vec3, tileSize?: number): Vec3;
485
+ declare function buildPolyCameraSceneTransform(state?: Partial<CameraState>, options?: PolyCameraSceneTransformOptions): string;
486
+ declare function resolvePolyCameraAppliedPerspectiveStyle(perspectiveStyle?: string): string;
487
+ declare function capturePolyCameraSnapshot(camera: PolyCameraSnapshotSource, options?: PolyCameraSnapshotOptions): PolyCameraSnapshot;
437
488
  declare function createIsometricCamera(initial?: Partial<CameraState>): CameraHandle;
438
489
 
439
490
  /**
@@ -1492,11 +1543,17 @@ declare function worldDirectionToCss(d: Vec3): Vec3;
1492
1543
  /** Apply {@link worldDirectionToCss} to a directional-light object,
1493
1544
  * preserving the other fields. Used by atlas plan + buildBasisHints +
1494
1545
  * receiver-shadow callers so the light vector is in the same CSS-axis
1495
- * frame as the polygon normals. Mirror of vanilla's
1496
- * `worldDirectionalLightToCss` in `packages/polycss/src/api/scene/transforms.ts`. */
1546
+ * frame as the polygon normals. Public package wrappers delegate here so
1547
+ * directional-light conversion stays single-source. */
1497
1548
  declare function worldDirectionalLightToCss<T extends {
1498
1549
  direction?: Vec3;
1499
1550
  } | undefined>(light: T): T;
1551
+ declare const worldDistanceToPolyCss: typeof worldDistanceToCss;
1552
+ declare const polyCssDistanceToWorld: typeof cssDistanceToWorld;
1553
+ declare const worldPositionToPolyCss: typeof worldPositionToCss;
1554
+ declare const polyCssPositionToWorld: typeof cssPositionToWorld;
1555
+ declare const worldDirectionToPolyCss: typeof worldDirectionToCss;
1556
+ declare const worldDirectionalLightToPolyCss: typeof worldDirectionalLightToCss;
1500
1557
  /** Normalize a mesh `scale` value into a Vec3 (undefined → [1,1,1], number →
1501
1558
  * uniform, Vec3 → as-is with `?? 1` per axis). */
1502
1559
  declare function meshScaleVec3(scale: number | Vec3 | undefined | null): Vec3;
@@ -1559,6 +1616,31 @@ interface PolyMeshTransformInput {
1559
1616
  */
1560
1617
  declare function buildPolyMeshTransform(t: PolyMeshTransformInput): string | undefined;
1561
1618
 
1619
+ interface PolySceneTransformInput {
1620
+ /** World point that should appear at the viewport center. */
1621
+ target?: Vec3;
1622
+ /** Scene orbit tilt in degrees. */
1623
+ rotX?: number;
1624
+ /** Scene orbit rotation around world up in degrees. */
1625
+ rotY?: number;
1626
+ /** User-facing zoom in CSS pixels per world unit. */
1627
+ zoom?: number;
1628
+ /** Camera pull-back from target in CSS pixels. */
1629
+ distance?: number;
1630
+ /** Auto-center offset added to target before world→CSS conversion. */
1631
+ autoCenterOffset?: Vec3;
1632
+ /** Extra scale folded into zoom and distance for CSS zoom compensation. */
1633
+ layoutScale?: number;
1634
+ /** CSS pixels per PolyCSS world unit. Defaults to the renderer base tile. */
1635
+ worldUnitPx?: number;
1636
+ }
1637
+ /**
1638
+ * Build the scene-root transform used by PolyCSS renderers:
1639
+ *
1640
+ * `translateZ(-distance) scale(zoom / worldUnitPx) rotateX(rotX) rotate(rotY) translate3d(-targetCss)`
1641
+ */
1642
+ declare function buildPolySceneTransform(input?: PolySceneTransformInput): string;
1643
+
1562
1644
  /**
1563
1645
  * Caster-mesh silhouette extraction for the receiver-shadow path.
1564
1646
  *
@@ -2247,6 +2329,9 @@ interface TextureAtlasPlan {
2247
2329
  canonicalMatrix: string;
2248
2330
  atlasMatrix: string;
2249
2331
  atlasCanonicalSize?: number;
2332
+ atlasLeafSizing?: PolyTextureLeafSizing;
2333
+ atlasLeafWidth?: number;
2334
+ atlasLeafHeight?: number;
2250
2335
  projectiveMatrix: string | null;
2251
2336
  canvasW: number;
2252
2337
  canvasH: number;
@@ -2271,6 +2356,33 @@ interface TextureAtlasPlan {
2271
2356
  textureTint: RGBFactors;
2272
2357
  shadedColor: string;
2273
2358
  }
2359
+ interface PolyTextureLeafSourceRect {
2360
+ x: number;
2361
+ y: number;
2362
+ width: number;
2363
+ height: number;
2364
+ }
2365
+ interface PolyTextureLeafGeometry {
2366
+ source: PolyTextureImageSource;
2367
+ url: string;
2368
+ sourceRect: PolyTextureLeafSourceRect;
2369
+ leafWidth: number;
2370
+ leafHeight: number;
2371
+ matrix: string;
2372
+ backgroundPosition: [number, number];
2373
+ backgroundSize: [number, number];
2374
+ imageRendering: PolyTextureImageRendering;
2375
+ lighting: PolyTextureImageLighting;
2376
+ projection: PolyTextureProjection;
2377
+ }
2378
+ interface PolyTextureLeafResolverOptions {
2379
+ imageRendering?: PolyTextureImageRendering;
2380
+ backend?: PolyTextureBackend;
2381
+ lighting?: PolyTextureImageLighting;
2382
+ projection?: PolyTextureProjection;
2383
+ allowProjective?: boolean;
2384
+ projectiveQuadGuards?: ProjectiveQuadGuardSettings;
2385
+ }
2274
2386
  interface BorderShapeBounds {
2275
2387
  minX: number;
2276
2388
  minY: number;
@@ -2513,7 +2625,7 @@ declare function formatAffineMatrix3dTransformScalars(x0: number, x1: number, x2
2513
2625
  declare function formatScaledMatrixFromPlan(entry: TextureAtlasPlan, scaleX: number, scaleY: number, offsetX?: number, offsetY?: number): string;
2514
2626
  declare function formatBorderShapeMatrix(entry: TextureAtlasPlan, bounds: BorderShapeBounds): string;
2515
2627
  declare function formatSolidQuadMatrix(entry: TextureAtlasPlan): string;
2516
- declare function formatAtlasMatrix(entry: TextureAtlasPlan, atlasCanonicalSize: number): string;
2628
+ declare function formatAtlasMatrix(entry: TextureAtlasPlan, atlasLeafWidth: number, atlasLeafHeight?: number): string;
2517
2629
  declare function formatPercent(value: number, decimals?: number): string;
2518
2630
  /** Format a raw comma-separated matrix3d value string with rounded decimals. */
2519
2631
  declare function formatMatrix3d(matrix: string, decimals?: number): string;
@@ -2589,6 +2701,10 @@ interface FilterAtlasPlansEnv {
2589
2701
  solidTriangleSupported: boolean;
2590
2702
  projectiveQuadSupported: boolean;
2591
2703
  borderShapeSupported: boolean;
2704
+ textureBackend?: PolyTextureBackend;
2705
+ textureImageRendering?: PolyTextureImageRendering;
2706
+ textureImageLighting?: PolyTextureImageLighting;
2707
+ textureProjection?: PolyTextureProjection;
2592
2708
  /** When true, non-triangle non-rect non-projective polys whose plan has
2593
2709
  * cornerShapeGeometryForPlan != null are excluded from the atlas (they
2594
2710
  * render as <u> via corner-*-shape: bevel CSS — matches vanilla's
@@ -2698,6 +2814,13 @@ declare function computeTextureAtlasPlanPublic(polygon: Polygon, index: number,
2698
2814
  * this from {@link buildBasisHints}; React/Vue mirror that path. */
2699
2815
  basisHintOverride?: BasisHint): TextureAtlasPlan | null;
2700
2816
 
2817
+ declare function resolvePolyTextureLeafGeometry(plan: TextureAtlasPlan, options?: PolyTextureLeafResolverOptions): PolyTextureLeafGeometry | null;
2818
+
2819
+ declare function resolvePolyTextureImageSource(polygon: Polygon): PolyTextureImageSource | undefined;
2820
+ declare function resolvePolyTextureUrl(polygon: Polygon): string | undefined;
2821
+ declare function resolvePolyTexturePresentation(polygon: Polygon, defaults?: PolyTexturePresentation): PolyTexturePresentation;
2822
+ declare function resolvePolyTextureImageRendering(polygon: Polygon, defaultImageRendering: PolyTextureImageRendering | undefined): PolyTextureImageRendering;
2823
+
2701
2824
  declare function normalizeAtlasScale(scale: number | string | undefined): number;
2702
2825
  declare function atlasArea(pages: PackedPage[]): number;
2703
2826
  declare function autoAtlasScaleCap(pages: PackedPage[], maxDecodedBytes: number): number;
@@ -2710,6 +2833,12 @@ declare function autoAtlasMaxDecodedBytes(isMobile: boolean): number;
2710
2833
  /** Returns the atlas canonical size for the given texture quality and device class. */
2711
2834
  declare function atlasCanonicalSizeForTextureQuality(textureQualityInput: TextureQuality | undefined, isMobile: boolean): number;
2712
2835
  declare function applyPackedAtlasCanonicalSize(packed: PackedAtlas, atlasCanonicalSize: number): PackedAtlas;
2836
+ declare function resolveAtlasLeafBox(entry: TextureAtlasPlan, atlasScale: number, textureLeafSizing: PolyTextureLeafSizing | undefined, atlasCanonicalSize?: number): {
2837
+ width: number;
2838
+ height: number;
2839
+ sizing: PolyTextureLeafSizing;
2840
+ };
2841
+ declare function applyPackedAtlasLeafSizing(packed: PackedAtlas, atlasCanonicalSize: number, atlasScale: number, textureLeafSizing?: PolyTextureLeafSizing | undefined): PackedAtlas;
2713
2842
  declare function atlasCanonicalSizeForEntry(entry: TextureAtlasPlan): number;
2714
2843
  declare function atlasPadding(atlasScale: number): number;
2715
2844
  declare function packTextureAtlasPlans(plans: Array<TextureAtlasPlan | null>, atlasScale?: number): PackedAtlas;
@@ -2717,10 +2846,10 @@ declare function packTextureAtlasPlans(plans: Array<TextureAtlasPlan | null>, at
2717
2846
  * Pack atlas plans and resolve atlas scale, accepting a pre-resolved isMobile
2718
2847
  * boolean instead of a Document reference.
2719
2848
  */
2720
- declare function packTextureAtlasPlansWithScaleCore(plans: Array<TextureAtlasPlan | null>, textureQualityInput: TextureQuality | undefined, isMobile: boolean): {
2849
+ declare function packTextureAtlasPlansWithScaleCore(plans: Array<TextureAtlasPlan | null>, textureQualityInput: TextureQuality | undefined, isMobile: boolean, textureLeafSizing?: PolyTextureLeafSizing | undefined): {
2721
2850
  packed: PackedAtlas;
2722
2851
  atlasScale: number;
2723
2852
  atlasCanonicalSize: number;
2724
2853
  };
2725
2854
 
2726
- 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 CasterPolyItem, type ComputeReceiverShadowFacesInput, 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 EdgeOwners, 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 OptimizeMeshParseResultOptions, 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 ParseStlColor, type ParseStlSolid, type ParseStlTopology, type ParsedColor, type PlanePolygonsOptions, type PolyAmbientLight, type PolyAnimationAction, type ParseAnimationClip as PolyAnimationClip, type PolyAnimationMixer, type PolyAnimationTarget, type PolyDirectionalLight, type PolyMaterial, type PolyMeshTransformInput, 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, RECEIVER_NORMAL_TOL, RECEIVER_OFFSET_TOL, RECEIVER_OUTLINE_EXPAND, RECT_EPS, type RGB, type RGBFactors, type ReceiverCasterInput, type ReceiverFacePlane, type ReceiverPlaneGroup, type ReceiverShadowFaceSpec, type ReceiverShadowPath, type RectBrush, type RingPolygonsOptions, type RingQuadPolygonsOptions, SEAM_LIGHT_EPS, SOLID_QUAD_CANONICAL_SIZE, SOLID_TRIANGLE_BLEED, SOLID_TRIANGLE_CANONICAL_SIZE, SOLID_TRIANGLE_LARGE_BORDER_CANONICAL_SIZE, SURFACE_DISTANCE_EPS, SURFACE_NORMAL_EPS, type SceneBbox, type SceneContext, type SceneContextBuildArgs, type SceneContextBuildResult, type ScreenToWorldOptions, type SeamBleedInsets, type SeamFacetSplitCandidate, type SeamFacetSplitCandidateReason, type SeamFacetSplitOptions, type SeamFacetSplitReport, type SeamOverlapCandidate, type SeamOverlapCandidateKind, type SeamOverlapDiagnostics, type SeamOverlapOptions, type SimplifyTriangleMeshPolygonsOptions, type SolidPaintDefaults, type SolidTextureSampleOptions, type SolidTriangleBasis, type SolidTriangleColorPlan, type SolidTriangleComputeOptions, type SolidTriangleFrame, type SolidTrianglePlan, type SolidTrianglePlanOptions, type SolidTrianglePrimitive, type SpherePolygonsOptions, type StablePlanBasis, type StableTriangleColorState, type StlParseOptions, 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, buildEdgeOwners, buildPolyMeshTransform, buildSceneContext, buildSeamBleedPolygonEdges, buildSeamBleedPolygonSet, buildSharedEdgeMap, buildTextureEdgeRepairSets, cachedParsePureColor, cameraCullNormalGroups, cameraCullNormalGroupsFromPolygons, cameraCullNormalKey, cameraCullVisibleSignature, cameraFacingDepth, chooseIslandXAxis, chooseLocalBasis, clampChannel, classifyFacing, clipPolygonToConvex2D, colorErrorScore, compatibleBleedSurface, compatibleSurface, computeLightVisibility, computePlanSeamBleedEdgeAmounts, computeProjectiveQuadCoefficients, computeProjectiveQuadMatrix, computeReceiverShadowFaces, computeSceneBbox, computeSeamBleedInsets, computeShapeLighting, computeSolidTriangleColorPlan, computeSolidTriangleColorPlanFromNormal, computeSolidTrianglePlan, computeSolidTrianglePlanFromCssPoints, computeSurfaceNormal, computeTextureAtlasPlan, computeTextureAtlasPlanPublic, computeTexturePaintMetrics, computeUvAffine, computeUvSampleRect, conePolygons, convexHull2D, cornerShapeDiagonal, cornerShapeGeometryForPlan, cornerShapePointSides, coverPlanarPolygons, createIsometricCamera, createPolyAnimationMixer, crossVec, cssBorderShapeForGeometry, cssBorderShapeForPlan, cssDistanceToWorld, cssPoints, cssPositionToWorld, cullInteriorPolygons, cylinderPolygons, dedupeOverlappingPolygons, dodecahedronPolygons, dominantCountKey, dotVec, ensureCcw2D, eulerXYZFromQuat, evaluateIslandAxis, expandClipPoints, expandConvexHullOutward, extractSilhouetteLoops, filterAtlasPlans, findOverlappingPolygonDuplicates, formatAffineMatrix3dColumns, formatAffineMatrix3dScalars, formatAffineMatrix3dTransformScalars, formatAtlasMatrix, formatBorderShapeElementStyle, formatBorderShapeEntryMatrix, formatBorderShapeMatrix, formatColor, formatCornerShapeElementStyle, formatCssLength, formatCssLengthPx, formatMatrix3d, formatMatrix3dValues, formatPercent, formatScaledMatrixFromPlan, formatSolidQuadEntryMatrix, formatSolidQuadMatrix, fullRectBounds, getPolygonBasisInfo, getSolidPaintDefaultsForPlansCore, groupReceiverFaceGroups, icosahedronPolygons, incrementCount, intersect2DLines, intersect2DLinesRaw, inverseRotateVec3, isAxisAlignedSurfaceNormal, isBakedShadowCaster, isBasisOptimizable, isConvexPolygonPoints, isFullRectBasis, isFullRectSolid, isProjectiveQuadPlan, isSolidTrianglePlan, isVoxelCameraCullableNormalGroups, loadMesh, makeLocalBasis, mergePolygons, meshScaleVec3, normalFacesCamera, normalizeAtlasScale, normalizeInvertMultiplier, normalizePolygons, normalizedSeamBleed, octahedronPolygons, offsetConvexPolygonPoints, offsetConvexPolygonPointsByEdgeAmounts, offsetStableTrianglePoints, offsetTrianglePoints, optimizeAnimatedMeshPolygons, optimizeMeshParseResult, optimizeMeshPolygons, packTextureAtlasPlans, packTextureAtlasPlansWithScaleCore, parseAlpha, parseColor, parseGltf, parseHex, parseHexColor, parseMtl, parseObj, parsePureColor, parseRgbColor, parseStl, parseVox, planePolygons, cssDistanceToWorld as polyCssDistanceToWorld, cssPositionToWorld as polyCssPositionToWorld, polygonContainsPoint, polygonCssSurfaceNormal, polygonFaces, polygonFacesCamera, polygonSignedArea2D, prepareCasterEdgeOwners, prepareCasterPolyItems, prepareReceiverFacePlanes, projectCssVertexToGround, projectTextureTriangle, quantizeCssColor, quatFromAxisAngle, quatFromEulerXYZ, quatMultiply, repairMeshSeams, resolveBleedRatio, resolveProjectiveQuadGuards, resolveSeamBleed, rgbEqual, rgbKey, rgbToCss, rgbToHex, ringPolygons, ringQuadPolygons, rotateVec3, rotateVec3InWrapperCssFrame, roundDecimal, safariCssProjectiveUnsupported, safePlanSeamBleedAmount, screenToWorldOnSphere, screenToWorldRay, seamBleedAmountArray, seamFacetSplitPolygons, seamFacetSplitReport, seamLightBrightness, seamOverlapDiagnostics, seamOverlapPolygons, seamOverlapReport, shadeColor, shadePolygon, sharedCornerShapeSide, signedArea2D, simplifyCornerShapePoints, simplifyTriangleMeshPolygons, spherePolygons, stableBasisFromPlan, stableTriangleMatrixDecimals, stepRgbToward, tetrahedronPolygons, textureTintFactors, tintToCss, torusPolygons, worldCssForMesh, worldDirectionToCss, worldDirectionToCss as worldDirectionToPolyCss, worldDirectionalLightToCss, worldDistanceToCss, worldDistanceToCss as worldDistanceToPolyCss, worldPositionToCss, worldPositionToCss as worldPositionToPolyCss };
2855
+ 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 CasterPolyItem, type ComputeReceiverShadowFacesInput, 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 EdgeOwners, 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 OptimizeMeshParseResultOptions, 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 ParseStlColor, type ParseStlSolid, type ParseStlTopology, type ParsedColor, type PlanePolygonsOptions, type PolyAmbientLight, type PolyAnimationAction, type ParseAnimationClip as PolyAnimationClip, type PolyAnimationMixer, type PolyAnimationTarget, type PolyCameraProjection, type PolyCameraSceneTransformOptions, type PolyCameraSnapshot, type PolyCameraSnapshotOptions, type PolyCameraSnapshotSource, type PolyDirectionalLight, type PolyMaterial, type PolyMeshTransformInput, type PolyRenderStrategiesOption, type PolyRenderStrategy, type PolySceneTransformInput, type PolySeamBleed, type PolySeamBleedEdgeValue, type PolySeamBleedEdges, type PolyTextureAlphaMode, type PolyTextureBackend, type PolyTextureImageLighting, type PolyTextureImageRendering, type PolyTextureImageSource, type PolyTextureLeafGeometry, type PolyTextureLeafResolverOptions, type PolyTextureLeafSizing, type PolyTextureLeafSourceRect, type PolyTextureLightingMode, type PolyTexturePresentation, type PolyTextureProjection, 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, RECEIVER_NORMAL_TOL, RECEIVER_OFFSET_TOL, RECEIVER_OUTLINE_EXPAND, RECT_EPS, type RGB, type RGBFactors, type ReceiverCasterInput, type ReceiverFacePlane, type ReceiverPlaneGroup, type ReceiverShadowFaceSpec, type ReceiverShadowPath, type RectBrush, type RingPolygonsOptions, type RingQuadPolygonsOptions, SEAM_LIGHT_EPS, SOLID_QUAD_CANONICAL_SIZE, SOLID_TRIANGLE_BLEED, SOLID_TRIANGLE_CANONICAL_SIZE, SOLID_TRIANGLE_LARGE_BORDER_CANONICAL_SIZE, SURFACE_DISTANCE_EPS, SURFACE_NORMAL_EPS, type SceneBbox, type SceneContext, type SceneContextBuildArgs, type SceneContextBuildResult, type ScreenToWorldOptions, type SeamBleedInsets, type SeamFacetSplitCandidate, type SeamFacetSplitCandidateReason, type SeamFacetSplitOptions, type SeamFacetSplitReport, type SeamOverlapCandidate, type SeamOverlapCandidateKind, type SeamOverlapDiagnostics, type SeamOverlapOptions, type SimplifyTriangleMeshPolygonsOptions, type SolidPaintDefaults, type SolidTextureSampleOptions, type SolidTriangleBasis, type SolidTriangleColorPlan, type SolidTriangleComputeOptions, type SolidTriangleFrame, type SolidTrianglePlan, type SolidTrianglePlanOptions, type SolidTrianglePrimitive, type SpherePolygonsOptions, type StablePlanBasis, type StableTriangleColorState, type StlParseOptions, 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, applyPackedAtlasLeafSizing, arrowPolygons, atlasArea, atlasBitmapMaxSide, atlasCanonicalSizeForEntry, atlasCanonicalSizeForTextureQuality, atlasDecodedBytes, atlasPadding, autoAtlasBudgetFactor, autoAtlasMaxDecodedBytes, autoAtlasScale, autoAtlasScaleCap, axesHelperPolygons, bakeSolidTextureSampledPolygons, bakeSolidTextureSamples, basisAxisKey, borderShapeBoundsFromPoints, borderShapeGeometryForPlan, boxPolygons, buildBakedShadowProjectionMatrix, buildBasisHints, buildEdgeOwners, buildPolyCameraSceneTransform, buildPolyMeshTransform, buildPolySceneTransform, buildSceneContext, buildSeamBleedPolygonEdges, buildSeamBleedPolygonSet, buildSharedEdgeMap, buildTextureEdgeRepairSets, cachedParsePureColor, cameraCullNormalGroups, cameraCullNormalGroupsFromPolygons, cameraCullNormalKey, cameraCullVisibleSignature, cameraFacingDepth, capturePolyCameraSnapshot, chooseIslandXAxis, chooseLocalBasis, clampChannel, classifyFacing, clipPolygonToConvex2D, colorErrorScore, compatibleBleedSurface, compatibleSurface, computeLightVisibility, computePlanSeamBleedEdgeAmounts, computeProjectiveQuadCoefficients, computeProjectiveQuadMatrix, computeReceiverShadowFaces, computeSceneBbox, computeSeamBleedInsets, computeShapeLighting, computeSolidTriangleColorPlan, computeSolidTriangleColorPlanFromNormal, computeSolidTrianglePlan, computeSolidTrianglePlanFromCssPoints, computeSurfaceNormal, computeTextureAtlasPlan, computeTextureAtlasPlanPublic, computeTexturePaintMetrics, computeUvAffine, computeUvSampleRect, conePolygons, convexHull2D, cornerShapeDiagonal, cornerShapeGeometryForPlan, cornerShapePointSides, coverPlanarPolygons, createIsometricCamera, createPolyAnimationMixer, crossVec, cssBorderShapeForGeometry, cssBorderShapeForPlan, cssDistanceToWorld, cssPoints, cssPositionToWorld, cullInteriorPolygons, cylinderPolygons, dedupeOverlappingPolygons, dodecahedronPolygons, dominantCountKey, dotVec, ensureCcw2D, eulerXYZFromQuat, evaluateIslandAxis, expandClipPoints, expandConvexHullOutward, extractSilhouetteLoops, filterAtlasPlans, findOverlappingPolygonDuplicates, formatAffineMatrix3dColumns, formatAffineMatrix3dScalars, formatAffineMatrix3dTransformScalars, formatAtlasMatrix, formatBorderShapeElementStyle, formatBorderShapeEntryMatrix, formatBorderShapeMatrix, formatColor, formatCornerShapeElementStyle, formatCssLength, formatCssLengthPx, formatMatrix3d, formatMatrix3dValues, formatPercent, formatScaledMatrixFromPlan, formatSolidQuadEntryMatrix, formatSolidQuadMatrix, fullRectBounds, getPolygonBasisInfo, getSolidPaintDefaultsForPlansCore, groupReceiverFaceGroups, icosahedronPolygons, incrementCount, intersect2DLines, intersect2DLinesRaw, inverseRotateVec3, isAxisAlignedSurfaceNormal, isBakedShadowCaster, isBasisOptimizable, isConvexPolygonPoints, isFullRectBasis, isFullRectSolid, isProjectiveQuadPlan, isSolidTrianglePlan, isVoxelCameraCullableNormalGroups, loadMesh, makeLocalBasis, mergePolygons, meshScaleVec3, normalFacesCamera, normalizeAtlasScale, normalizeInvertMultiplier, normalizePolygons, normalizedSeamBleed, octahedronPolygons, offsetConvexPolygonPoints, offsetConvexPolygonPointsByEdgeAmounts, offsetStableTrianglePoints, offsetTrianglePoints, optimizeAnimatedMeshPolygons, optimizeMeshParseResult, optimizeMeshPolygons, packTextureAtlasPlans, packTextureAtlasPlansWithScaleCore, parseAlpha, parseColor, parseGltf, parseHex, parseHexColor, parseMtl, parseObj, parsePureColor, parseRgbColor, parseStl, parseVox, planePolygons, polyCameraTargetToCss, polyCssDistanceToWorld, polyCssPositionToWorld, polygonContainsPoint, polygonCssSurfaceNormal, polygonFaces, polygonFacesCamera, polygonSignedArea2D, prepareCasterEdgeOwners, prepareCasterPolyItems, prepareReceiverFacePlanes, projectCssVertexToGround, projectTextureTriangle, quantizeCssColor, quatFromAxisAngle, quatFromEulerXYZ, quatMultiply, repairMeshSeams, resolveAtlasLeafBox, resolveBleedRatio, resolvePolyCameraAppliedPerspectiveStyle, resolvePolyTextureImageRendering, resolvePolyTextureImageSource, resolvePolyTextureLeafGeometry, resolvePolyTexturePresentation, resolvePolyTextureUrl, resolveProjectiveQuadGuards, resolveSeamBleed, rgbEqual, rgbKey, rgbToCss, rgbToHex, ringPolygons, ringQuadPolygons, rotateVec3, rotateVec3InWrapperCssFrame, roundDecimal, safariCssProjectiveUnsupported, safePlanSeamBleedAmount, screenToWorldOnSphere, screenToWorldRay, seamBleedAmountArray, seamFacetSplitPolygons, seamFacetSplitReport, seamLightBrightness, seamOverlapDiagnostics, seamOverlapPolygons, seamOverlapReport, shadeColor, shadePolygon, sharedCornerShapeSide, signedArea2D, simplifyCornerShapePoints, simplifyTriangleMeshPolygons, spherePolygons, stableBasisFromPlan, stableTriangleMatrixDecimals, stepRgbToward, tetrahedronPolygons, textureTintFactors, tintToCss, torusPolygons, worldCssForMesh, worldDirectionToCss, worldDirectionToPolyCss, worldDirectionalLightToCss, worldDirectionalLightToPolyCss, worldDistanceToCss, worldDistanceToPolyCss, worldPositionToCss, worldPositionToPolyCss };
package/dist/index.d.ts CHANGED
@@ -11,6 +11,29 @@ declare const DEFAULT_PROJECTION: "cubic";
11
11
  * variables, no JS work, no atlas re-rasterization.
12
12
  */
13
13
  type PolyTextureLightingMode = "baked" | "dynamic";
14
+ type PolyTextureLeafSizing = "canonical" | "local" | "raster";
15
+ type PolyTextureBackend = "auto" | "atlas" | "image";
16
+ type PolyTextureImageRendering = "auto" | "pixelated";
17
+ type PolyTextureImageLighting = "scene" | "source";
18
+ type PolyTextureProjection = "affine" | "projective";
19
+ interface PolyTextureImageSource {
20
+ url: string;
21
+ width: number;
22
+ height: number;
23
+ sourceRect?: {
24
+ x: number;
25
+ y: number;
26
+ width: number;
27
+ height: number;
28
+ };
29
+ imageRendering?: PolyTextureImageRendering;
30
+ }
31
+ interface PolyTexturePresentation {
32
+ imageRendering?: PolyTextureImageRendering;
33
+ backend?: PolyTextureBackend;
34
+ lighting?: PolyTextureImageLighting;
35
+ projection?: PolyTextureProjection;
36
+ }
14
37
  /**
15
38
  * Mesh post-processing intent.
16
39
  * - "lossless": preserve the authored surface while applying exact
@@ -92,6 +115,8 @@ interface PolyMaterial {
92
115
  * pass a stable string; if omitted, the material's identity is its object
93
116
  * reference. */
94
117
  key?: string;
118
+ imageSource?: PolyTextureImageSource;
119
+ presentation?: PolyTexturePresentation;
95
120
  }
96
121
  /**
97
122
  * The single polygon type for polycss. N coplanar vertices in 3D space,
@@ -134,6 +159,8 @@ interface Polygon {
134
159
  * polygon canvas rasterization). Falls back to the atlas path otherwise.
135
160
  */
136
161
  material?: PolyMaterial;
162
+ textureImageSource?: PolyTextureImageSource;
163
+ texturePresentation?: PolyTexturePresentation;
137
164
  /**
138
165
  * Per-vertex UV coords (0..1, OBJ convention with v=0 at bottom).
139
166
  * Length MUST equal vertices.length when set; mismatched UVs are
@@ -432,8 +459,32 @@ interface CameraHandle {
432
459
  height: string;
433
460
  };
434
461
  }
462
+ interface PolyCameraSceneTransformOptions {
463
+ autoCenterOffset?: Vec3;
464
+ layoutScale?: number;
465
+ tileSize?: number;
466
+ }
467
+ type PolyCameraProjection = "orthographic" | "perspective";
468
+ interface PolyCameraSnapshot {
469
+ projection: PolyCameraProjection;
470
+ perspectiveStyle: string;
471
+ appliedPerspectiveStyle: string;
472
+ state: CameraState;
473
+ }
474
+ interface PolyCameraSnapshotOptions {
475
+ projection?: PolyCameraProjection;
476
+ perspectiveStyle?: string;
477
+ }
478
+ type PolyCameraSnapshotSource = CameraHandle & {
479
+ readonly type?: PolyCameraProjection;
480
+ readonly perspectiveStyle?: string;
481
+ };
435
482
  declare function normalizeInvertMultiplier(value: number | boolean | undefined): number | undefined;
436
483
  declare const DEFAULT_CAMERA_STATE: CameraState;
484
+ declare function polyCameraTargetToCss(target?: Vec3, autoCenterOffset?: Vec3, tileSize?: number): Vec3;
485
+ declare function buildPolyCameraSceneTransform(state?: Partial<CameraState>, options?: PolyCameraSceneTransformOptions): string;
486
+ declare function resolvePolyCameraAppliedPerspectiveStyle(perspectiveStyle?: string): string;
487
+ declare function capturePolyCameraSnapshot(camera: PolyCameraSnapshotSource, options?: PolyCameraSnapshotOptions): PolyCameraSnapshot;
437
488
  declare function createIsometricCamera(initial?: Partial<CameraState>): CameraHandle;
438
489
 
439
490
  /**
@@ -1492,11 +1543,17 @@ declare function worldDirectionToCss(d: Vec3): Vec3;
1492
1543
  /** Apply {@link worldDirectionToCss} to a directional-light object,
1493
1544
  * preserving the other fields. Used by atlas plan + buildBasisHints +
1494
1545
  * receiver-shadow callers so the light vector is in the same CSS-axis
1495
- * frame as the polygon normals. Mirror of vanilla's
1496
- * `worldDirectionalLightToCss` in `packages/polycss/src/api/scene/transforms.ts`. */
1546
+ * frame as the polygon normals. Public package wrappers delegate here so
1547
+ * directional-light conversion stays single-source. */
1497
1548
  declare function worldDirectionalLightToCss<T extends {
1498
1549
  direction?: Vec3;
1499
1550
  } | undefined>(light: T): T;
1551
+ declare const worldDistanceToPolyCss: typeof worldDistanceToCss;
1552
+ declare const polyCssDistanceToWorld: typeof cssDistanceToWorld;
1553
+ declare const worldPositionToPolyCss: typeof worldPositionToCss;
1554
+ declare const polyCssPositionToWorld: typeof cssPositionToWorld;
1555
+ declare const worldDirectionToPolyCss: typeof worldDirectionToCss;
1556
+ declare const worldDirectionalLightToPolyCss: typeof worldDirectionalLightToCss;
1500
1557
  /** Normalize a mesh `scale` value into a Vec3 (undefined → [1,1,1], number →
1501
1558
  * uniform, Vec3 → as-is with `?? 1` per axis). */
1502
1559
  declare function meshScaleVec3(scale: number | Vec3 | undefined | null): Vec3;
@@ -1559,6 +1616,31 @@ interface PolyMeshTransformInput {
1559
1616
  */
1560
1617
  declare function buildPolyMeshTransform(t: PolyMeshTransformInput): string | undefined;
1561
1618
 
1619
+ interface PolySceneTransformInput {
1620
+ /** World point that should appear at the viewport center. */
1621
+ target?: Vec3;
1622
+ /** Scene orbit tilt in degrees. */
1623
+ rotX?: number;
1624
+ /** Scene orbit rotation around world up in degrees. */
1625
+ rotY?: number;
1626
+ /** User-facing zoom in CSS pixels per world unit. */
1627
+ zoom?: number;
1628
+ /** Camera pull-back from target in CSS pixels. */
1629
+ distance?: number;
1630
+ /** Auto-center offset added to target before world→CSS conversion. */
1631
+ autoCenterOffset?: Vec3;
1632
+ /** Extra scale folded into zoom and distance for CSS zoom compensation. */
1633
+ layoutScale?: number;
1634
+ /** CSS pixels per PolyCSS world unit. Defaults to the renderer base tile. */
1635
+ worldUnitPx?: number;
1636
+ }
1637
+ /**
1638
+ * Build the scene-root transform used by PolyCSS renderers:
1639
+ *
1640
+ * `translateZ(-distance) scale(zoom / worldUnitPx) rotateX(rotX) rotate(rotY) translate3d(-targetCss)`
1641
+ */
1642
+ declare function buildPolySceneTransform(input?: PolySceneTransformInput): string;
1643
+
1562
1644
  /**
1563
1645
  * Caster-mesh silhouette extraction for the receiver-shadow path.
1564
1646
  *
@@ -2247,6 +2329,9 @@ interface TextureAtlasPlan {
2247
2329
  canonicalMatrix: string;
2248
2330
  atlasMatrix: string;
2249
2331
  atlasCanonicalSize?: number;
2332
+ atlasLeafSizing?: PolyTextureLeafSizing;
2333
+ atlasLeafWidth?: number;
2334
+ atlasLeafHeight?: number;
2250
2335
  projectiveMatrix: string | null;
2251
2336
  canvasW: number;
2252
2337
  canvasH: number;
@@ -2271,6 +2356,33 @@ interface TextureAtlasPlan {
2271
2356
  textureTint: RGBFactors;
2272
2357
  shadedColor: string;
2273
2358
  }
2359
+ interface PolyTextureLeafSourceRect {
2360
+ x: number;
2361
+ y: number;
2362
+ width: number;
2363
+ height: number;
2364
+ }
2365
+ interface PolyTextureLeafGeometry {
2366
+ source: PolyTextureImageSource;
2367
+ url: string;
2368
+ sourceRect: PolyTextureLeafSourceRect;
2369
+ leafWidth: number;
2370
+ leafHeight: number;
2371
+ matrix: string;
2372
+ backgroundPosition: [number, number];
2373
+ backgroundSize: [number, number];
2374
+ imageRendering: PolyTextureImageRendering;
2375
+ lighting: PolyTextureImageLighting;
2376
+ projection: PolyTextureProjection;
2377
+ }
2378
+ interface PolyTextureLeafResolverOptions {
2379
+ imageRendering?: PolyTextureImageRendering;
2380
+ backend?: PolyTextureBackend;
2381
+ lighting?: PolyTextureImageLighting;
2382
+ projection?: PolyTextureProjection;
2383
+ allowProjective?: boolean;
2384
+ projectiveQuadGuards?: ProjectiveQuadGuardSettings;
2385
+ }
2274
2386
  interface BorderShapeBounds {
2275
2387
  minX: number;
2276
2388
  minY: number;
@@ -2513,7 +2625,7 @@ declare function formatAffineMatrix3dTransformScalars(x0: number, x1: number, x2
2513
2625
  declare function formatScaledMatrixFromPlan(entry: TextureAtlasPlan, scaleX: number, scaleY: number, offsetX?: number, offsetY?: number): string;
2514
2626
  declare function formatBorderShapeMatrix(entry: TextureAtlasPlan, bounds: BorderShapeBounds): string;
2515
2627
  declare function formatSolidQuadMatrix(entry: TextureAtlasPlan): string;
2516
- declare function formatAtlasMatrix(entry: TextureAtlasPlan, atlasCanonicalSize: number): string;
2628
+ declare function formatAtlasMatrix(entry: TextureAtlasPlan, atlasLeafWidth: number, atlasLeafHeight?: number): string;
2517
2629
  declare function formatPercent(value: number, decimals?: number): string;
2518
2630
  /** Format a raw comma-separated matrix3d value string with rounded decimals. */
2519
2631
  declare function formatMatrix3d(matrix: string, decimals?: number): string;
@@ -2589,6 +2701,10 @@ interface FilterAtlasPlansEnv {
2589
2701
  solidTriangleSupported: boolean;
2590
2702
  projectiveQuadSupported: boolean;
2591
2703
  borderShapeSupported: boolean;
2704
+ textureBackend?: PolyTextureBackend;
2705
+ textureImageRendering?: PolyTextureImageRendering;
2706
+ textureImageLighting?: PolyTextureImageLighting;
2707
+ textureProjection?: PolyTextureProjection;
2592
2708
  /** When true, non-triangle non-rect non-projective polys whose plan has
2593
2709
  * cornerShapeGeometryForPlan != null are excluded from the atlas (they
2594
2710
  * render as <u> via corner-*-shape: bevel CSS — matches vanilla's
@@ -2698,6 +2814,13 @@ declare function computeTextureAtlasPlanPublic(polygon: Polygon, index: number,
2698
2814
  * this from {@link buildBasisHints}; React/Vue mirror that path. */
2699
2815
  basisHintOverride?: BasisHint): TextureAtlasPlan | null;
2700
2816
 
2817
+ declare function resolvePolyTextureLeafGeometry(plan: TextureAtlasPlan, options?: PolyTextureLeafResolverOptions): PolyTextureLeafGeometry | null;
2818
+
2819
+ declare function resolvePolyTextureImageSource(polygon: Polygon): PolyTextureImageSource | undefined;
2820
+ declare function resolvePolyTextureUrl(polygon: Polygon): string | undefined;
2821
+ declare function resolvePolyTexturePresentation(polygon: Polygon, defaults?: PolyTexturePresentation): PolyTexturePresentation;
2822
+ declare function resolvePolyTextureImageRendering(polygon: Polygon, defaultImageRendering: PolyTextureImageRendering | undefined): PolyTextureImageRendering;
2823
+
2701
2824
  declare function normalizeAtlasScale(scale: number | string | undefined): number;
2702
2825
  declare function atlasArea(pages: PackedPage[]): number;
2703
2826
  declare function autoAtlasScaleCap(pages: PackedPage[], maxDecodedBytes: number): number;
@@ -2710,6 +2833,12 @@ declare function autoAtlasMaxDecodedBytes(isMobile: boolean): number;
2710
2833
  /** Returns the atlas canonical size for the given texture quality and device class. */
2711
2834
  declare function atlasCanonicalSizeForTextureQuality(textureQualityInput: TextureQuality | undefined, isMobile: boolean): number;
2712
2835
  declare function applyPackedAtlasCanonicalSize(packed: PackedAtlas, atlasCanonicalSize: number): PackedAtlas;
2836
+ declare function resolveAtlasLeafBox(entry: TextureAtlasPlan, atlasScale: number, textureLeafSizing: PolyTextureLeafSizing | undefined, atlasCanonicalSize?: number): {
2837
+ width: number;
2838
+ height: number;
2839
+ sizing: PolyTextureLeafSizing;
2840
+ };
2841
+ declare function applyPackedAtlasLeafSizing(packed: PackedAtlas, atlasCanonicalSize: number, atlasScale: number, textureLeafSizing?: PolyTextureLeafSizing | undefined): PackedAtlas;
2713
2842
  declare function atlasCanonicalSizeForEntry(entry: TextureAtlasPlan): number;
2714
2843
  declare function atlasPadding(atlasScale: number): number;
2715
2844
  declare function packTextureAtlasPlans(plans: Array<TextureAtlasPlan | null>, atlasScale?: number): PackedAtlas;
@@ -2717,10 +2846,10 @@ declare function packTextureAtlasPlans(plans: Array<TextureAtlasPlan | null>, at
2717
2846
  * Pack atlas plans and resolve atlas scale, accepting a pre-resolved isMobile
2718
2847
  * boolean instead of a Document reference.
2719
2848
  */
2720
- declare function packTextureAtlasPlansWithScaleCore(plans: Array<TextureAtlasPlan | null>, textureQualityInput: TextureQuality | undefined, isMobile: boolean): {
2849
+ declare function packTextureAtlasPlansWithScaleCore(plans: Array<TextureAtlasPlan | null>, textureQualityInput: TextureQuality | undefined, isMobile: boolean, textureLeafSizing?: PolyTextureLeafSizing | undefined): {
2721
2850
  packed: PackedAtlas;
2722
2851
  atlasScale: number;
2723
2852
  atlasCanonicalSize: number;
2724
2853
  };
2725
2854
 
2726
- 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 CasterPolyItem, type ComputeReceiverShadowFacesInput, 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 EdgeOwners, 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 OptimizeMeshParseResultOptions, 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 ParseStlColor, type ParseStlSolid, type ParseStlTopology, type ParsedColor, type PlanePolygonsOptions, type PolyAmbientLight, type PolyAnimationAction, type ParseAnimationClip as PolyAnimationClip, type PolyAnimationMixer, type PolyAnimationTarget, type PolyDirectionalLight, type PolyMaterial, type PolyMeshTransformInput, 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, RECEIVER_NORMAL_TOL, RECEIVER_OFFSET_TOL, RECEIVER_OUTLINE_EXPAND, RECT_EPS, type RGB, type RGBFactors, type ReceiverCasterInput, type ReceiverFacePlane, type ReceiverPlaneGroup, type ReceiverShadowFaceSpec, type ReceiverShadowPath, type RectBrush, type RingPolygonsOptions, type RingQuadPolygonsOptions, SEAM_LIGHT_EPS, SOLID_QUAD_CANONICAL_SIZE, SOLID_TRIANGLE_BLEED, SOLID_TRIANGLE_CANONICAL_SIZE, SOLID_TRIANGLE_LARGE_BORDER_CANONICAL_SIZE, SURFACE_DISTANCE_EPS, SURFACE_NORMAL_EPS, type SceneBbox, type SceneContext, type SceneContextBuildArgs, type SceneContextBuildResult, type ScreenToWorldOptions, type SeamBleedInsets, type SeamFacetSplitCandidate, type SeamFacetSplitCandidateReason, type SeamFacetSplitOptions, type SeamFacetSplitReport, type SeamOverlapCandidate, type SeamOverlapCandidateKind, type SeamOverlapDiagnostics, type SeamOverlapOptions, type SimplifyTriangleMeshPolygonsOptions, type SolidPaintDefaults, type SolidTextureSampleOptions, type SolidTriangleBasis, type SolidTriangleColorPlan, type SolidTriangleComputeOptions, type SolidTriangleFrame, type SolidTrianglePlan, type SolidTrianglePlanOptions, type SolidTrianglePrimitive, type SpherePolygonsOptions, type StablePlanBasis, type StableTriangleColorState, type StlParseOptions, 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, buildEdgeOwners, buildPolyMeshTransform, buildSceneContext, buildSeamBleedPolygonEdges, buildSeamBleedPolygonSet, buildSharedEdgeMap, buildTextureEdgeRepairSets, cachedParsePureColor, cameraCullNormalGroups, cameraCullNormalGroupsFromPolygons, cameraCullNormalKey, cameraCullVisibleSignature, cameraFacingDepth, chooseIslandXAxis, chooseLocalBasis, clampChannel, classifyFacing, clipPolygonToConvex2D, colorErrorScore, compatibleBleedSurface, compatibleSurface, computeLightVisibility, computePlanSeamBleedEdgeAmounts, computeProjectiveQuadCoefficients, computeProjectiveQuadMatrix, computeReceiverShadowFaces, computeSceneBbox, computeSeamBleedInsets, computeShapeLighting, computeSolidTriangleColorPlan, computeSolidTriangleColorPlanFromNormal, computeSolidTrianglePlan, computeSolidTrianglePlanFromCssPoints, computeSurfaceNormal, computeTextureAtlasPlan, computeTextureAtlasPlanPublic, computeTexturePaintMetrics, computeUvAffine, computeUvSampleRect, conePolygons, convexHull2D, cornerShapeDiagonal, cornerShapeGeometryForPlan, cornerShapePointSides, coverPlanarPolygons, createIsometricCamera, createPolyAnimationMixer, crossVec, cssBorderShapeForGeometry, cssBorderShapeForPlan, cssDistanceToWorld, cssPoints, cssPositionToWorld, cullInteriorPolygons, cylinderPolygons, dedupeOverlappingPolygons, dodecahedronPolygons, dominantCountKey, dotVec, ensureCcw2D, eulerXYZFromQuat, evaluateIslandAxis, expandClipPoints, expandConvexHullOutward, extractSilhouetteLoops, filterAtlasPlans, findOverlappingPolygonDuplicates, formatAffineMatrix3dColumns, formatAffineMatrix3dScalars, formatAffineMatrix3dTransformScalars, formatAtlasMatrix, formatBorderShapeElementStyle, formatBorderShapeEntryMatrix, formatBorderShapeMatrix, formatColor, formatCornerShapeElementStyle, formatCssLength, formatCssLengthPx, formatMatrix3d, formatMatrix3dValues, formatPercent, formatScaledMatrixFromPlan, formatSolidQuadEntryMatrix, formatSolidQuadMatrix, fullRectBounds, getPolygonBasisInfo, getSolidPaintDefaultsForPlansCore, groupReceiverFaceGroups, icosahedronPolygons, incrementCount, intersect2DLines, intersect2DLinesRaw, inverseRotateVec3, isAxisAlignedSurfaceNormal, isBakedShadowCaster, isBasisOptimizable, isConvexPolygonPoints, isFullRectBasis, isFullRectSolid, isProjectiveQuadPlan, isSolidTrianglePlan, isVoxelCameraCullableNormalGroups, loadMesh, makeLocalBasis, mergePolygons, meshScaleVec3, normalFacesCamera, normalizeAtlasScale, normalizeInvertMultiplier, normalizePolygons, normalizedSeamBleed, octahedronPolygons, offsetConvexPolygonPoints, offsetConvexPolygonPointsByEdgeAmounts, offsetStableTrianglePoints, offsetTrianglePoints, optimizeAnimatedMeshPolygons, optimizeMeshParseResult, optimizeMeshPolygons, packTextureAtlasPlans, packTextureAtlasPlansWithScaleCore, parseAlpha, parseColor, parseGltf, parseHex, parseHexColor, parseMtl, parseObj, parsePureColor, parseRgbColor, parseStl, parseVox, planePolygons, cssDistanceToWorld as polyCssDistanceToWorld, cssPositionToWorld as polyCssPositionToWorld, polygonContainsPoint, polygonCssSurfaceNormal, polygonFaces, polygonFacesCamera, polygonSignedArea2D, prepareCasterEdgeOwners, prepareCasterPolyItems, prepareReceiverFacePlanes, projectCssVertexToGround, projectTextureTriangle, quantizeCssColor, quatFromAxisAngle, quatFromEulerXYZ, quatMultiply, repairMeshSeams, resolveBleedRatio, resolveProjectiveQuadGuards, resolveSeamBleed, rgbEqual, rgbKey, rgbToCss, rgbToHex, ringPolygons, ringQuadPolygons, rotateVec3, rotateVec3InWrapperCssFrame, roundDecimal, safariCssProjectiveUnsupported, safePlanSeamBleedAmount, screenToWorldOnSphere, screenToWorldRay, seamBleedAmountArray, seamFacetSplitPolygons, seamFacetSplitReport, seamLightBrightness, seamOverlapDiagnostics, seamOverlapPolygons, seamOverlapReport, shadeColor, shadePolygon, sharedCornerShapeSide, signedArea2D, simplifyCornerShapePoints, simplifyTriangleMeshPolygons, spherePolygons, stableBasisFromPlan, stableTriangleMatrixDecimals, stepRgbToward, tetrahedronPolygons, textureTintFactors, tintToCss, torusPolygons, worldCssForMesh, worldDirectionToCss, worldDirectionToCss as worldDirectionToPolyCss, worldDirectionalLightToCss, worldDistanceToCss, worldDistanceToCss as worldDistanceToPolyCss, worldPositionToCss, worldPositionToCss as worldPositionToPolyCss };
2855
+ 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 CasterPolyItem, type ComputeReceiverShadowFacesInput, 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 EdgeOwners, 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 OptimizeMeshParseResultOptions, 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 ParseStlColor, type ParseStlSolid, type ParseStlTopology, type ParsedColor, type PlanePolygonsOptions, type PolyAmbientLight, type PolyAnimationAction, type ParseAnimationClip as PolyAnimationClip, type PolyAnimationMixer, type PolyAnimationTarget, type PolyCameraProjection, type PolyCameraSceneTransformOptions, type PolyCameraSnapshot, type PolyCameraSnapshotOptions, type PolyCameraSnapshotSource, type PolyDirectionalLight, type PolyMaterial, type PolyMeshTransformInput, type PolyRenderStrategiesOption, type PolyRenderStrategy, type PolySceneTransformInput, type PolySeamBleed, type PolySeamBleedEdgeValue, type PolySeamBleedEdges, type PolyTextureAlphaMode, type PolyTextureBackend, type PolyTextureImageLighting, type PolyTextureImageRendering, type PolyTextureImageSource, type PolyTextureLeafGeometry, type PolyTextureLeafResolverOptions, type PolyTextureLeafSizing, type PolyTextureLeafSourceRect, type PolyTextureLightingMode, type PolyTexturePresentation, type PolyTextureProjection, 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, RECEIVER_NORMAL_TOL, RECEIVER_OFFSET_TOL, RECEIVER_OUTLINE_EXPAND, RECT_EPS, type RGB, type RGBFactors, type ReceiverCasterInput, type ReceiverFacePlane, type ReceiverPlaneGroup, type ReceiverShadowFaceSpec, type ReceiverShadowPath, type RectBrush, type RingPolygonsOptions, type RingQuadPolygonsOptions, SEAM_LIGHT_EPS, SOLID_QUAD_CANONICAL_SIZE, SOLID_TRIANGLE_BLEED, SOLID_TRIANGLE_CANONICAL_SIZE, SOLID_TRIANGLE_LARGE_BORDER_CANONICAL_SIZE, SURFACE_DISTANCE_EPS, SURFACE_NORMAL_EPS, type SceneBbox, type SceneContext, type SceneContextBuildArgs, type SceneContextBuildResult, type ScreenToWorldOptions, type SeamBleedInsets, type SeamFacetSplitCandidate, type SeamFacetSplitCandidateReason, type SeamFacetSplitOptions, type SeamFacetSplitReport, type SeamOverlapCandidate, type SeamOverlapCandidateKind, type SeamOverlapDiagnostics, type SeamOverlapOptions, type SimplifyTriangleMeshPolygonsOptions, type SolidPaintDefaults, type SolidTextureSampleOptions, type SolidTriangleBasis, type SolidTriangleColorPlan, type SolidTriangleComputeOptions, type SolidTriangleFrame, type SolidTrianglePlan, type SolidTrianglePlanOptions, type SolidTrianglePrimitive, type SpherePolygonsOptions, type StablePlanBasis, type StableTriangleColorState, type StlParseOptions, 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, applyPackedAtlasLeafSizing, arrowPolygons, atlasArea, atlasBitmapMaxSide, atlasCanonicalSizeForEntry, atlasCanonicalSizeForTextureQuality, atlasDecodedBytes, atlasPadding, autoAtlasBudgetFactor, autoAtlasMaxDecodedBytes, autoAtlasScale, autoAtlasScaleCap, axesHelperPolygons, bakeSolidTextureSampledPolygons, bakeSolidTextureSamples, basisAxisKey, borderShapeBoundsFromPoints, borderShapeGeometryForPlan, boxPolygons, buildBakedShadowProjectionMatrix, buildBasisHints, buildEdgeOwners, buildPolyCameraSceneTransform, buildPolyMeshTransform, buildPolySceneTransform, buildSceneContext, buildSeamBleedPolygonEdges, buildSeamBleedPolygonSet, buildSharedEdgeMap, buildTextureEdgeRepairSets, cachedParsePureColor, cameraCullNormalGroups, cameraCullNormalGroupsFromPolygons, cameraCullNormalKey, cameraCullVisibleSignature, cameraFacingDepth, capturePolyCameraSnapshot, chooseIslandXAxis, chooseLocalBasis, clampChannel, classifyFacing, clipPolygonToConvex2D, colorErrorScore, compatibleBleedSurface, compatibleSurface, computeLightVisibility, computePlanSeamBleedEdgeAmounts, computeProjectiveQuadCoefficients, computeProjectiveQuadMatrix, computeReceiverShadowFaces, computeSceneBbox, computeSeamBleedInsets, computeShapeLighting, computeSolidTriangleColorPlan, computeSolidTriangleColorPlanFromNormal, computeSolidTrianglePlan, computeSolidTrianglePlanFromCssPoints, computeSurfaceNormal, computeTextureAtlasPlan, computeTextureAtlasPlanPublic, computeTexturePaintMetrics, computeUvAffine, computeUvSampleRect, conePolygons, convexHull2D, cornerShapeDiagonal, cornerShapeGeometryForPlan, cornerShapePointSides, coverPlanarPolygons, createIsometricCamera, createPolyAnimationMixer, crossVec, cssBorderShapeForGeometry, cssBorderShapeForPlan, cssDistanceToWorld, cssPoints, cssPositionToWorld, cullInteriorPolygons, cylinderPolygons, dedupeOverlappingPolygons, dodecahedronPolygons, dominantCountKey, dotVec, ensureCcw2D, eulerXYZFromQuat, evaluateIslandAxis, expandClipPoints, expandConvexHullOutward, extractSilhouetteLoops, filterAtlasPlans, findOverlappingPolygonDuplicates, formatAffineMatrix3dColumns, formatAffineMatrix3dScalars, formatAffineMatrix3dTransformScalars, formatAtlasMatrix, formatBorderShapeElementStyle, formatBorderShapeEntryMatrix, formatBorderShapeMatrix, formatColor, formatCornerShapeElementStyle, formatCssLength, formatCssLengthPx, formatMatrix3d, formatMatrix3dValues, formatPercent, formatScaledMatrixFromPlan, formatSolidQuadEntryMatrix, formatSolidQuadMatrix, fullRectBounds, getPolygonBasisInfo, getSolidPaintDefaultsForPlansCore, groupReceiverFaceGroups, icosahedronPolygons, incrementCount, intersect2DLines, intersect2DLinesRaw, inverseRotateVec3, isAxisAlignedSurfaceNormal, isBakedShadowCaster, isBasisOptimizable, isConvexPolygonPoints, isFullRectBasis, isFullRectSolid, isProjectiveQuadPlan, isSolidTrianglePlan, isVoxelCameraCullableNormalGroups, loadMesh, makeLocalBasis, mergePolygons, meshScaleVec3, normalFacesCamera, normalizeAtlasScale, normalizeInvertMultiplier, normalizePolygons, normalizedSeamBleed, octahedronPolygons, offsetConvexPolygonPoints, offsetConvexPolygonPointsByEdgeAmounts, offsetStableTrianglePoints, offsetTrianglePoints, optimizeAnimatedMeshPolygons, optimizeMeshParseResult, optimizeMeshPolygons, packTextureAtlasPlans, packTextureAtlasPlansWithScaleCore, parseAlpha, parseColor, parseGltf, parseHex, parseHexColor, parseMtl, parseObj, parsePureColor, parseRgbColor, parseStl, parseVox, planePolygons, polyCameraTargetToCss, polyCssDistanceToWorld, polyCssPositionToWorld, polygonContainsPoint, polygonCssSurfaceNormal, polygonFaces, polygonFacesCamera, polygonSignedArea2D, prepareCasterEdgeOwners, prepareCasterPolyItems, prepareReceiverFacePlanes, projectCssVertexToGround, projectTextureTriangle, quantizeCssColor, quatFromAxisAngle, quatFromEulerXYZ, quatMultiply, repairMeshSeams, resolveAtlasLeafBox, resolveBleedRatio, resolvePolyCameraAppliedPerspectiveStyle, resolvePolyTextureImageRendering, resolvePolyTextureImageSource, resolvePolyTextureLeafGeometry, resolvePolyTexturePresentation, resolvePolyTextureUrl, resolveProjectiveQuadGuards, resolveSeamBleed, rgbEqual, rgbKey, rgbToCss, rgbToHex, ringPolygons, ringQuadPolygons, rotateVec3, rotateVec3InWrapperCssFrame, roundDecimal, safariCssProjectiveUnsupported, safePlanSeamBleedAmount, screenToWorldOnSphere, screenToWorldRay, seamBleedAmountArray, seamFacetSplitPolygons, seamFacetSplitReport, seamLightBrightness, seamOverlapDiagnostics, seamOverlapPolygons, seamOverlapReport, shadeColor, shadePolygon, sharedCornerShapeSide, signedArea2D, simplifyCornerShapePoints, simplifyTriangleMeshPolygons, spherePolygons, stableBasisFromPlan, stableTriangleMatrixDecimals, stepRgbToward, tetrahedronPolygons, textureTintFactors, tintToCss, torusPolygons, worldCssForMesh, worldDirectionToCss, worldDirectionToPolyCss, worldDirectionalLightToCss, worldDirectionalLightToPolyCss, worldDistanceToCss, worldDistanceToPolyCss, worldPositionToCss, worldPositionToPolyCss };