@layoutit/polycss 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/README.md +147 -148
- package/dist/{PolySelectElement-Tvsmhx2m.d.cts → PolyShapeElements-prI_DBZX.d.cts} +234 -104
- package/dist/{PolySelectElement-Tvsmhx2m.d.ts → PolyShapeElements-prI_DBZX.d.ts} +234 -104
- package/dist/elements.cjs +73 -17
- package/dist/elements.d.cts +1 -1
- package/dist/elements.d.ts +1 -1
- package/dist/elements.js +73 -17
- package/dist/index.cjs +73 -17
- package/dist/index.d.cts +126 -5
- package/dist/index.d.ts +126 -5
- package/dist/index.js +73 -17
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,87 @@
|
|
|
1
|
-
import { P as PolySceneHandle, a as PolyMeshHandle } from './
|
|
2
|
-
export { b as
|
|
3
|
-
import
|
|
1
|
+
import { P as PolySceneHandle, a as PolyMeshHandle } from './PolyShapeElements-prI_DBZX.cjs';
|
|
2
|
+
export { b as PolyBoxElement, c as PolyCameraElement, d as PolyCameraOptions, e as PolyConeElement, f as PolyCylinderElement, g as PolyDodecahedronElement, h as PolyFirstPersonControlsElement, i as PolyIcosahedronElement, j as PolyMapControlsElement, k as PolyMeshElement, l as PolyMeshTransform, m as PolyOctahedronElement, n as PolyOrbitControlsElement, o as PolyOrthographicCameraElement, p as PolyOrthographicCameraHandle, q as PolyOrthographicCameraOptions, r as PolyPerspectiveCameraElement, s as PolyPerspectiveCameraHandle, t as PolyPerspectiveCameraOptions, u as PolyPlaneElement, v as PolyPolygonElement, w as PolyRingElement, x as PolySceneElement, y as PolySceneOptions, z as PolySelectElement, A as PolySphereElement, B as PolyTetrahedronElement, C as PolyTorusElement, D as PolyTransformControlsElement, E as createPolyCamera, F as createPolyOrthographicCamera, G as createPolyPerspectiveCamera, H as createPolyScene } from './PolyShapeElements-prI_DBZX.cjs';
|
|
3
|
+
import * as _layoutit_polycss_core from '@layoutit/polycss-core';
|
|
4
|
+
import { PolyDirectionalLight, PolyAmbientLight, PolyTextureLightingMode, TextureAtlasPlan, TextureQuality, PackedAtlas, PackedPage, TextureAtlasPage, PolyRenderStrategy, SolidPaintDefaults, Polygon, SolidTriangleFrame, Vec3, BoxPolygonsOptions, ParseResult, ConePolygonsOptions, CylinderPolygonsOptions, DodecahedronPolygonsOptions, IcosahedronPolygonsOptions, OctahedronPolygonsOptions, PlanePolygonsOptions, RingPolygonsOptions, SpherePolygonsOptions, TetrahedronPolygonsOptions, TorusPolygonsOptions } from '@layoutit/polycss-core';
|
|
4
5
|
export * from '@layoutit/polycss-core';
|
|
6
|
+
export { ComputeTextureAtlasPlanOptions, PackedAtlas, PackedPage, PackedTextureAtlasEntry, PolyRenderStrategiesOption, PolyRenderStrategy, ParseResult as PolyShapeResult, SolidPaintDefaults, SolidTriangleFrame, TextureAtlasPage, TextureAtlasPlan, TextureQuality, buildTextureEdgeRepairSets, computeTextureAtlasPlanPublic, cssBorderShapeForPlan, formatBorderShapeEntryMatrix, formatCssLengthPx, formatMatrix3d, formatSolidQuadEntryMatrix, isFullRectSolid, isProjectiveQuadPlan, isSolidTrianglePlan } from '@layoutit/polycss-core';
|
|
7
|
+
|
|
8
|
+
interface RenderTextureAtlasOptions {
|
|
9
|
+
doc?: Document;
|
|
10
|
+
tileSize?: number;
|
|
11
|
+
layerElevation?: number;
|
|
12
|
+
directionalLight?: PolyDirectionalLight;
|
|
13
|
+
ambientLight?: PolyAmbientLight;
|
|
14
|
+
textureLighting?: PolyTextureLightingMode;
|
|
15
|
+
/**
|
|
16
|
+
* Atlas bitmap budget and CSS sprite size. Numeric values are clamped to
|
|
17
|
+
* 0.1..1 and keep the 64px sprite. Omitted / `"auto"` picks a raster scale
|
|
18
|
+
* from packed atlas area, caps oversized runtime bitmaps by side length and
|
|
19
|
+
* decoded-memory budget, and uses a 128px sprite on desktop-class documents
|
|
20
|
+
* or a 64px sprite on mobile-class documents.
|
|
21
|
+
*/
|
|
22
|
+
textureQuality?: _layoutit_polycss_core.TextureQuality;
|
|
23
|
+
solidPaintDefaults?: _layoutit_polycss_core.SolidPaintDefaults;
|
|
24
|
+
strategies?: _layoutit_polycss_core.PolyRenderStrategiesOption;
|
|
25
|
+
}
|
|
26
|
+
interface RenderedPoly {
|
|
27
|
+
polygonIndex: number;
|
|
28
|
+
element: HTMLElement;
|
|
29
|
+
kind?: "atlas" | "solid" | "border" | "corner" | "triangle";
|
|
30
|
+
plan?: _layoutit_polycss_core.TextureAtlasPlan;
|
|
31
|
+
dispose(): void;
|
|
32
|
+
}
|
|
33
|
+
interface RenderTextureAtlasResult {
|
|
34
|
+
rendered: RenderedPoly[];
|
|
35
|
+
dispose(): void;
|
|
36
|
+
}
|
|
37
|
+
interface RenderTextureAtlasAsyncResult extends RenderTextureAtlasResult {
|
|
38
|
+
solidPaintDefaults: _layoutit_polycss_core.SolidPaintDefaults;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare function packTextureAtlasPlansWithScale(plans: Array<TextureAtlasPlan | null>, textureQualityInput: TextureQuality | undefined, doc: Document | null | undefined): {
|
|
42
|
+
packed: PackedAtlas;
|
|
43
|
+
atlasScale: number;
|
|
44
|
+
atlasCanonicalSize: number;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
declare function buildAtlasPages(pages: PackedPage[], textureLighting: PolyTextureLightingMode, doc: Document, atlasScale: number, isCancelled: () => boolean): Promise<TextureAtlasPage[]>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Compute the dominant paint defaults from an already-computed array of plans.
|
|
51
|
+
*
|
|
52
|
+
* React and Vue compute plans first (to drive the atlas packing), then pass
|
|
53
|
+
* the plan array here so they don't need access to the raw polygon list.
|
|
54
|
+
* Requires access to a Document to check browser support for solid-triangle
|
|
55
|
+
* and border-shape strategies.
|
|
56
|
+
*/
|
|
57
|
+
declare function getSolidPaintDefaultsFromPlans(plans: Array<TextureAtlasPlan | null>, textureLighting: PolyTextureLightingMode, disabled?: ReadonlySet<PolyRenderStrategy>, doc?: Document | null): SolidPaintDefaults;
|
|
58
|
+
/**
|
|
59
|
+
* Returns true when the browser supports the `border-shape` CSS property and
|
|
60
|
+
* the pointer/hover media queries indicate a fine-pointer device (desktop-class).
|
|
61
|
+
* Falls back to a globalThis-based check when no Document is available.
|
|
62
|
+
*/
|
|
63
|
+
declare function isBorderShapeSupported(doc?: Document | null): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Returns true when the browser renders CSS border-trick triangles correctly.
|
|
66
|
+
* WebKit/Safari renders them incorrectly when transformed — this check gates
|
|
67
|
+
* the `<u>` strategy path.
|
|
68
|
+
*/
|
|
69
|
+
declare function isSolidTriangleSupported(doc?: Document | null): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Filter a plan array to the subset that needs atlas packing, given the active
|
|
72
|
+
* render strategies and texture-lighting mode. Plans excluded from the atlas
|
|
73
|
+
* will be rendered via `<b>`, `<i>`, or `<u>` by the framework components.
|
|
74
|
+
*/
|
|
75
|
+
declare function filterAtlasPlans(plans: Array<TextureAtlasPlan | null>, textureLighting: PolyTextureLightingMode, disabled: ReadonlySet<PolyRenderStrategy>, doc?: Document | null): Array<TextureAtlasPlan | null>;
|
|
76
|
+
|
|
77
|
+
declare function getSolidPaintDefaults(polygons: Polygon[], options?: RenderTextureAtlasOptions): SolidPaintDefaults;
|
|
78
|
+
declare function renderPolygonsWithTextureAtlas(polygons: Polygon[], options?: RenderTextureAtlasOptions): RenderTextureAtlasResult;
|
|
79
|
+
declare function renderPolygonsWithTextureAtlasAsync(polygons: Polygon[], options?: RenderTextureAtlasOptions, shouldCancel?: () => boolean): Promise<RenderTextureAtlasAsyncResult>;
|
|
80
|
+
declare function updateStableTriangleFrame(rendered: RenderedPoly[], polygons: Polygon[], frame: SolidTriangleFrame, options?: RenderTextureAtlasOptions): boolean;
|
|
81
|
+
declare function updatePolygonsWithStableTopology(rendered: RenderedPoly[], polygons: Polygon[], options?: RenderTextureAtlasOptions): boolean;
|
|
82
|
+
|
|
83
|
+
declare function renderPolygonsWithStableTriangles(polygons: Polygon[], options?: RenderTextureAtlasOptions): RenderTextureAtlasResult | null;
|
|
84
|
+
declare function updatePolygonsWithStableTriangles(rendered: RenderedPoly[], polygons: Polygon[], options?: RenderTextureAtlasOptions): RenderTextureAtlasResult | null;
|
|
5
85
|
|
|
6
86
|
/**
|
|
7
87
|
* Shared types, constants, and utilities for orbit/map controls factories.
|
|
@@ -191,7 +271,7 @@ interface PolyFirstPersonControlsHandle {
|
|
|
191
271
|
declare function createPolyFirstPersonControls(scene: PolySceneHandle, options?: PolyFirstPersonControlsOptions): PolyFirstPersonControlsHandle;
|
|
192
272
|
|
|
193
273
|
/**
|
|
194
|
-
* createSelect — additive selection layer for vanilla
|
|
274
|
+
* createSelect — additive selection layer for vanilla PolyCSS scenes.
|
|
195
275
|
* Mirrors the React `<Select>` API: tracks one or more selected
|
|
196
276
|
* meshes, fires `onChange` whenever the set changes, supports
|
|
197
277
|
* single-click toggle (re-clicking the selected mesh deselects it),
|
|
@@ -295,6 +375,47 @@ interface PolyTransformControlsHandle {
|
|
|
295
375
|
}
|
|
296
376
|
declare function createTransformControls(scene: PolySceneHandle, options?: PolyTransformControlsOptions): PolyTransformControlsHandle;
|
|
297
377
|
|
|
378
|
+
interface PolyRenderSurfaceLeafCounts {
|
|
379
|
+
quad: number;
|
|
380
|
+
clippedSolid: number;
|
|
381
|
+
atlas: number;
|
|
382
|
+
stableTriangle: number;
|
|
383
|
+
}
|
|
384
|
+
interface PolyRenderStats {
|
|
385
|
+
polygonCount: number;
|
|
386
|
+
mountedPolygonLeafCount: number;
|
|
387
|
+
shadowLeafCount: number;
|
|
388
|
+
surfaceLeafCounts: PolyRenderSurfaceLeafCounts;
|
|
389
|
+
bucketCount: number;
|
|
390
|
+
}
|
|
391
|
+
interface PolyRenderStatsOptions {
|
|
392
|
+
polygonCount?: number;
|
|
393
|
+
/**
|
|
394
|
+
* Optional subtree selector for diagnostics that only want model leaves and
|
|
395
|
+
* not helpers/floors/gizmos sharing the same scene root.
|
|
396
|
+
*/
|
|
397
|
+
scopeSelector?: string;
|
|
398
|
+
}
|
|
399
|
+
declare function collectPolyRenderStats(root: ParentNode | null | undefined, optionsOrPolygonCount?: number | PolyRenderStatsOptions): PolyRenderStats;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Primitive shape factories — thin wrappers over the polygon generators in
|
|
403
|
+
* @layoutit/polycss-core. Each returns a `ParseResult`-compatible object so
|
|
404
|
+
* it composes directly with `scene.add(createPolyBox({ size: 100 }))`.
|
|
405
|
+
*/
|
|
406
|
+
|
|
407
|
+
declare function createPolyBox(options?: BoxPolygonsOptions): ParseResult;
|
|
408
|
+
declare function createPolyPlane(options: PlanePolygonsOptions): ParseResult;
|
|
409
|
+
declare function createPolyRing(options: RingPolygonsOptions): ParseResult;
|
|
410
|
+
declare function createPolyOctahedron(options: OctahedronPolygonsOptions): ParseResult;
|
|
411
|
+
declare function createPolySphere(options?: SpherePolygonsOptions): ParseResult;
|
|
412
|
+
declare function createPolyTetrahedron(options?: TetrahedronPolygonsOptions): ParseResult;
|
|
413
|
+
declare function createPolyIcosahedron(options?: IcosahedronPolygonsOptions): ParseResult;
|
|
414
|
+
declare function createPolyDodecahedron(options?: DodecahedronPolygonsOptions): ParseResult;
|
|
415
|
+
declare function createPolyCylinder(options?: CylinderPolygonsOptions): ParseResult;
|
|
416
|
+
declare function createPolyCone(options?: ConePolygonsOptions): ParseResult;
|
|
417
|
+
declare function createPolyTorus(options?: TorusPolygonsOptions): ParseResult;
|
|
418
|
+
|
|
298
419
|
declare function injectPolyBaseStyles(doc?: Document): void;
|
|
299
420
|
|
|
300
|
-
export { type PolyControlsAnimateOptions, type PolyControlsBaseOptions, type PolyControlsCamera, type PolyControlsChangeEvent, type PolyControlsEvent, type PolyControlsHandle, type PolyControlsInteractionEvent, type PolyControlsListener, type PolyFirstPersonControlsHandle, type PolyFirstPersonControlsOptions, type PolyMapControlsHandle, type PolyMapControlsOptions, PolyMeshHandle, type PolyOrbitControlsHandle, type PolyOrbitControlsOptions, PolySceneHandle, type PolySelectOptions, type PolySelectionHandle, type PolyTransformControlsHandle, type PolyTransformControlsObjectChangeEvent, type PolyTransformControlsOptions, createPolyFirstPersonControls, createPolyMapControls, createPolyOrbitControls, createSelect, createTransformControls, injectPolyBaseStyles };
|
|
421
|
+
export { type PolyControlsAnimateOptions, type PolyControlsBaseOptions, type PolyControlsCamera, type PolyControlsChangeEvent, type PolyControlsEvent, type PolyControlsHandle, type PolyControlsInteractionEvent, type PolyControlsListener, type PolyFirstPersonControlsHandle, type PolyFirstPersonControlsOptions, type PolyMapControlsHandle, type PolyMapControlsOptions, PolyMeshHandle, type PolyOrbitControlsHandle, type PolyOrbitControlsOptions, type PolyRenderStats, type PolyRenderStatsOptions, type PolyRenderSurfaceLeafCounts, PolySceneHandle, type PolySelectOptions, type PolySelectionHandle, type PolyTransformControlsHandle, type PolyTransformControlsObjectChangeEvent, type PolyTransformControlsOptions, type RenderTextureAtlasAsyncResult, type RenderTextureAtlasOptions, type RenderTextureAtlasResult, type RenderedPoly, buildAtlasPages, collectPolyRenderStats, createPolyBox, createPolyCone, createPolyCylinder, createPolyDodecahedron, createPolyFirstPersonControls, createPolyIcosahedron, createPolyMapControls, createPolyOctahedron, createPolyOrbitControls, createPolyPlane, createPolyRing, createPolySphere, createPolyTetrahedron, createPolyTorus, createSelect, createTransformControls, filterAtlasPlans, getSolidPaintDefaults, getSolidPaintDefaultsFromPlans, injectPolyBaseStyles, isBorderShapeSupported, isSolidTriangleSupported, packTextureAtlasPlansWithScale, renderPolygonsWithStableTriangles, renderPolygonsWithTextureAtlas, renderPolygonsWithTextureAtlasAsync, updatePolygonsWithStableTopology, updatePolygonsWithStableTriangles, updateStableTriangleFrame };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,87 @@
|
|
|
1
|
-
import { P as PolySceneHandle, a as PolyMeshHandle } from './
|
|
2
|
-
export { b as
|
|
3
|
-
import
|
|
1
|
+
import { P as PolySceneHandle, a as PolyMeshHandle } from './PolyShapeElements-prI_DBZX.js';
|
|
2
|
+
export { b as PolyBoxElement, c as PolyCameraElement, d as PolyCameraOptions, e as PolyConeElement, f as PolyCylinderElement, g as PolyDodecahedronElement, h as PolyFirstPersonControlsElement, i as PolyIcosahedronElement, j as PolyMapControlsElement, k as PolyMeshElement, l as PolyMeshTransform, m as PolyOctahedronElement, n as PolyOrbitControlsElement, o as PolyOrthographicCameraElement, p as PolyOrthographicCameraHandle, q as PolyOrthographicCameraOptions, r as PolyPerspectiveCameraElement, s as PolyPerspectiveCameraHandle, t as PolyPerspectiveCameraOptions, u as PolyPlaneElement, v as PolyPolygonElement, w as PolyRingElement, x as PolySceneElement, y as PolySceneOptions, z as PolySelectElement, A as PolySphereElement, B as PolyTetrahedronElement, C as PolyTorusElement, D as PolyTransformControlsElement, E as createPolyCamera, F as createPolyOrthographicCamera, G as createPolyPerspectiveCamera, H as createPolyScene } from './PolyShapeElements-prI_DBZX.js';
|
|
3
|
+
import * as _layoutit_polycss_core from '@layoutit/polycss-core';
|
|
4
|
+
import { PolyDirectionalLight, PolyAmbientLight, PolyTextureLightingMode, TextureAtlasPlan, TextureQuality, PackedAtlas, PackedPage, TextureAtlasPage, PolyRenderStrategy, SolidPaintDefaults, Polygon, SolidTriangleFrame, Vec3, BoxPolygonsOptions, ParseResult, ConePolygonsOptions, CylinderPolygonsOptions, DodecahedronPolygonsOptions, IcosahedronPolygonsOptions, OctahedronPolygonsOptions, PlanePolygonsOptions, RingPolygonsOptions, SpherePolygonsOptions, TetrahedronPolygonsOptions, TorusPolygonsOptions } from '@layoutit/polycss-core';
|
|
4
5
|
export * from '@layoutit/polycss-core';
|
|
6
|
+
export { ComputeTextureAtlasPlanOptions, PackedAtlas, PackedPage, PackedTextureAtlasEntry, PolyRenderStrategiesOption, PolyRenderStrategy, ParseResult as PolyShapeResult, SolidPaintDefaults, SolidTriangleFrame, TextureAtlasPage, TextureAtlasPlan, TextureQuality, buildTextureEdgeRepairSets, computeTextureAtlasPlanPublic, cssBorderShapeForPlan, formatBorderShapeEntryMatrix, formatCssLengthPx, formatMatrix3d, formatSolidQuadEntryMatrix, isFullRectSolid, isProjectiveQuadPlan, isSolidTrianglePlan } from '@layoutit/polycss-core';
|
|
7
|
+
|
|
8
|
+
interface RenderTextureAtlasOptions {
|
|
9
|
+
doc?: Document;
|
|
10
|
+
tileSize?: number;
|
|
11
|
+
layerElevation?: number;
|
|
12
|
+
directionalLight?: PolyDirectionalLight;
|
|
13
|
+
ambientLight?: PolyAmbientLight;
|
|
14
|
+
textureLighting?: PolyTextureLightingMode;
|
|
15
|
+
/**
|
|
16
|
+
* Atlas bitmap budget and CSS sprite size. Numeric values are clamped to
|
|
17
|
+
* 0.1..1 and keep the 64px sprite. Omitted / `"auto"` picks a raster scale
|
|
18
|
+
* from packed atlas area, caps oversized runtime bitmaps by side length and
|
|
19
|
+
* decoded-memory budget, and uses a 128px sprite on desktop-class documents
|
|
20
|
+
* or a 64px sprite on mobile-class documents.
|
|
21
|
+
*/
|
|
22
|
+
textureQuality?: _layoutit_polycss_core.TextureQuality;
|
|
23
|
+
solidPaintDefaults?: _layoutit_polycss_core.SolidPaintDefaults;
|
|
24
|
+
strategies?: _layoutit_polycss_core.PolyRenderStrategiesOption;
|
|
25
|
+
}
|
|
26
|
+
interface RenderedPoly {
|
|
27
|
+
polygonIndex: number;
|
|
28
|
+
element: HTMLElement;
|
|
29
|
+
kind?: "atlas" | "solid" | "border" | "corner" | "triangle";
|
|
30
|
+
plan?: _layoutit_polycss_core.TextureAtlasPlan;
|
|
31
|
+
dispose(): void;
|
|
32
|
+
}
|
|
33
|
+
interface RenderTextureAtlasResult {
|
|
34
|
+
rendered: RenderedPoly[];
|
|
35
|
+
dispose(): void;
|
|
36
|
+
}
|
|
37
|
+
interface RenderTextureAtlasAsyncResult extends RenderTextureAtlasResult {
|
|
38
|
+
solidPaintDefaults: _layoutit_polycss_core.SolidPaintDefaults;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare function packTextureAtlasPlansWithScale(plans: Array<TextureAtlasPlan | null>, textureQualityInput: TextureQuality | undefined, doc: Document | null | undefined): {
|
|
42
|
+
packed: PackedAtlas;
|
|
43
|
+
atlasScale: number;
|
|
44
|
+
atlasCanonicalSize: number;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
declare function buildAtlasPages(pages: PackedPage[], textureLighting: PolyTextureLightingMode, doc: Document, atlasScale: number, isCancelled: () => boolean): Promise<TextureAtlasPage[]>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Compute the dominant paint defaults from an already-computed array of plans.
|
|
51
|
+
*
|
|
52
|
+
* React and Vue compute plans first (to drive the atlas packing), then pass
|
|
53
|
+
* the plan array here so they don't need access to the raw polygon list.
|
|
54
|
+
* Requires access to a Document to check browser support for solid-triangle
|
|
55
|
+
* and border-shape strategies.
|
|
56
|
+
*/
|
|
57
|
+
declare function getSolidPaintDefaultsFromPlans(plans: Array<TextureAtlasPlan | null>, textureLighting: PolyTextureLightingMode, disabled?: ReadonlySet<PolyRenderStrategy>, doc?: Document | null): SolidPaintDefaults;
|
|
58
|
+
/**
|
|
59
|
+
* Returns true when the browser supports the `border-shape` CSS property and
|
|
60
|
+
* the pointer/hover media queries indicate a fine-pointer device (desktop-class).
|
|
61
|
+
* Falls back to a globalThis-based check when no Document is available.
|
|
62
|
+
*/
|
|
63
|
+
declare function isBorderShapeSupported(doc?: Document | null): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Returns true when the browser renders CSS border-trick triangles correctly.
|
|
66
|
+
* WebKit/Safari renders them incorrectly when transformed — this check gates
|
|
67
|
+
* the `<u>` strategy path.
|
|
68
|
+
*/
|
|
69
|
+
declare function isSolidTriangleSupported(doc?: Document | null): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Filter a plan array to the subset that needs atlas packing, given the active
|
|
72
|
+
* render strategies and texture-lighting mode. Plans excluded from the atlas
|
|
73
|
+
* will be rendered via `<b>`, `<i>`, or `<u>` by the framework components.
|
|
74
|
+
*/
|
|
75
|
+
declare function filterAtlasPlans(plans: Array<TextureAtlasPlan | null>, textureLighting: PolyTextureLightingMode, disabled: ReadonlySet<PolyRenderStrategy>, doc?: Document | null): Array<TextureAtlasPlan | null>;
|
|
76
|
+
|
|
77
|
+
declare function getSolidPaintDefaults(polygons: Polygon[], options?: RenderTextureAtlasOptions): SolidPaintDefaults;
|
|
78
|
+
declare function renderPolygonsWithTextureAtlas(polygons: Polygon[], options?: RenderTextureAtlasOptions): RenderTextureAtlasResult;
|
|
79
|
+
declare function renderPolygonsWithTextureAtlasAsync(polygons: Polygon[], options?: RenderTextureAtlasOptions, shouldCancel?: () => boolean): Promise<RenderTextureAtlasAsyncResult>;
|
|
80
|
+
declare function updateStableTriangleFrame(rendered: RenderedPoly[], polygons: Polygon[], frame: SolidTriangleFrame, options?: RenderTextureAtlasOptions): boolean;
|
|
81
|
+
declare function updatePolygonsWithStableTopology(rendered: RenderedPoly[], polygons: Polygon[], options?: RenderTextureAtlasOptions): boolean;
|
|
82
|
+
|
|
83
|
+
declare function renderPolygonsWithStableTriangles(polygons: Polygon[], options?: RenderTextureAtlasOptions): RenderTextureAtlasResult | null;
|
|
84
|
+
declare function updatePolygonsWithStableTriangles(rendered: RenderedPoly[], polygons: Polygon[], options?: RenderTextureAtlasOptions): RenderTextureAtlasResult | null;
|
|
5
85
|
|
|
6
86
|
/**
|
|
7
87
|
* Shared types, constants, and utilities for orbit/map controls factories.
|
|
@@ -191,7 +271,7 @@ interface PolyFirstPersonControlsHandle {
|
|
|
191
271
|
declare function createPolyFirstPersonControls(scene: PolySceneHandle, options?: PolyFirstPersonControlsOptions): PolyFirstPersonControlsHandle;
|
|
192
272
|
|
|
193
273
|
/**
|
|
194
|
-
* createSelect — additive selection layer for vanilla
|
|
274
|
+
* createSelect — additive selection layer for vanilla PolyCSS scenes.
|
|
195
275
|
* Mirrors the React `<Select>` API: tracks one or more selected
|
|
196
276
|
* meshes, fires `onChange` whenever the set changes, supports
|
|
197
277
|
* single-click toggle (re-clicking the selected mesh deselects it),
|
|
@@ -295,6 +375,47 @@ interface PolyTransformControlsHandle {
|
|
|
295
375
|
}
|
|
296
376
|
declare function createTransformControls(scene: PolySceneHandle, options?: PolyTransformControlsOptions): PolyTransformControlsHandle;
|
|
297
377
|
|
|
378
|
+
interface PolyRenderSurfaceLeafCounts {
|
|
379
|
+
quad: number;
|
|
380
|
+
clippedSolid: number;
|
|
381
|
+
atlas: number;
|
|
382
|
+
stableTriangle: number;
|
|
383
|
+
}
|
|
384
|
+
interface PolyRenderStats {
|
|
385
|
+
polygonCount: number;
|
|
386
|
+
mountedPolygonLeafCount: number;
|
|
387
|
+
shadowLeafCount: number;
|
|
388
|
+
surfaceLeafCounts: PolyRenderSurfaceLeafCounts;
|
|
389
|
+
bucketCount: number;
|
|
390
|
+
}
|
|
391
|
+
interface PolyRenderStatsOptions {
|
|
392
|
+
polygonCount?: number;
|
|
393
|
+
/**
|
|
394
|
+
* Optional subtree selector for diagnostics that only want model leaves and
|
|
395
|
+
* not helpers/floors/gizmos sharing the same scene root.
|
|
396
|
+
*/
|
|
397
|
+
scopeSelector?: string;
|
|
398
|
+
}
|
|
399
|
+
declare function collectPolyRenderStats(root: ParentNode | null | undefined, optionsOrPolygonCount?: number | PolyRenderStatsOptions): PolyRenderStats;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Primitive shape factories — thin wrappers over the polygon generators in
|
|
403
|
+
* @layoutit/polycss-core. Each returns a `ParseResult`-compatible object so
|
|
404
|
+
* it composes directly with `scene.add(createPolyBox({ size: 100 }))`.
|
|
405
|
+
*/
|
|
406
|
+
|
|
407
|
+
declare function createPolyBox(options?: BoxPolygonsOptions): ParseResult;
|
|
408
|
+
declare function createPolyPlane(options: PlanePolygonsOptions): ParseResult;
|
|
409
|
+
declare function createPolyRing(options: RingPolygonsOptions): ParseResult;
|
|
410
|
+
declare function createPolyOctahedron(options: OctahedronPolygonsOptions): ParseResult;
|
|
411
|
+
declare function createPolySphere(options?: SpherePolygonsOptions): ParseResult;
|
|
412
|
+
declare function createPolyTetrahedron(options?: TetrahedronPolygonsOptions): ParseResult;
|
|
413
|
+
declare function createPolyIcosahedron(options?: IcosahedronPolygonsOptions): ParseResult;
|
|
414
|
+
declare function createPolyDodecahedron(options?: DodecahedronPolygonsOptions): ParseResult;
|
|
415
|
+
declare function createPolyCylinder(options?: CylinderPolygonsOptions): ParseResult;
|
|
416
|
+
declare function createPolyCone(options?: ConePolygonsOptions): ParseResult;
|
|
417
|
+
declare function createPolyTorus(options?: TorusPolygonsOptions): ParseResult;
|
|
418
|
+
|
|
298
419
|
declare function injectPolyBaseStyles(doc?: Document): void;
|
|
299
420
|
|
|
300
|
-
export { type PolyControlsAnimateOptions, type PolyControlsBaseOptions, type PolyControlsCamera, type PolyControlsChangeEvent, type PolyControlsEvent, type PolyControlsHandle, type PolyControlsInteractionEvent, type PolyControlsListener, type PolyFirstPersonControlsHandle, type PolyFirstPersonControlsOptions, type PolyMapControlsHandle, type PolyMapControlsOptions, PolyMeshHandle, type PolyOrbitControlsHandle, type PolyOrbitControlsOptions, PolySceneHandle, type PolySelectOptions, type PolySelectionHandle, type PolyTransformControlsHandle, type PolyTransformControlsObjectChangeEvent, type PolyTransformControlsOptions, createPolyFirstPersonControls, createPolyMapControls, createPolyOrbitControls, createSelect, createTransformControls, injectPolyBaseStyles };
|
|
421
|
+
export { type PolyControlsAnimateOptions, type PolyControlsBaseOptions, type PolyControlsCamera, type PolyControlsChangeEvent, type PolyControlsEvent, type PolyControlsHandle, type PolyControlsInteractionEvent, type PolyControlsListener, type PolyFirstPersonControlsHandle, type PolyFirstPersonControlsOptions, type PolyMapControlsHandle, type PolyMapControlsOptions, PolyMeshHandle, type PolyOrbitControlsHandle, type PolyOrbitControlsOptions, type PolyRenderStats, type PolyRenderStatsOptions, type PolyRenderSurfaceLeafCounts, PolySceneHandle, type PolySelectOptions, type PolySelectionHandle, type PolyTransformControlsHandle, type PolyTransformControlsObjectChangeEvent, type PolyTransformControlsOptions, type RenderTextureAtlasAsyncResult, type RenderTextureAtlasOptions, type RenderTextureAtlasResult, type RenderedPoly, buildAtlasPages, collectPolyRenderStats, createPolyBox, createPolyCone, createPolyCylinder, createPolyDodecahedron, createPolyFirstPersonControls, createPolyIcosahedron, createPolyMapControls, createPolyOctahedron, createPolyOrbitControls, createPolyPlane, createPolyRing, createPolySphere, createPolyTetrahedron, createPolyTorus, createSelect, createTransformControls, filterAtlasPlans, getSolidPaintDefaults, getSolidPaintDefaultsFromPlans, injectPolyBaseStyles, isBorderShapeSupported, isSolidTriangleSupported, packTextureAtlasPlansWithScale, renderPolygonsWithStableTriangles, renderPolygonsWithTextureAtlas, renderPolygonsWithTextureAtlasAsync, updatePolygonsWithStableTopology, updatePolygonsWithStableTriangles, updateStableTriangleFrame };
|