@layoutit/polycss 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/README.md CHANGED
@@ -84,7 +84,7 @@ export default function App() {
84
84
  - `autoCenter` shifts the mesh bbox center to local origin.
85
85
  - `meshResolution` chooses `"lossy"` (default) or `"lossless"` optimization. STL imports use the conservative lossless path in both modes.
86
86
  - `castShadow` emits CSS-projected shadows in dynamic lighting mode.
87
- - Tooling can reuse `buildPolyMeshTransform`, `worldPositionToPolyCss`, `worldDirectionToPolyCss`, `worldDistanceToPolyCss`, `polyCssDistanceToWorld`, and `polyCssPositionToWorld` for renderer-compatible transforms and world/CSS conversions.
87
+ - Tooling can reuse `buildPolyMeshTransform`, `buildPolySceneTransform`, `worldPositionToPolyCss`, `worldDirectionToPolyCss`, `worldDirectionalLightToPolyCss`, `worldDistanceToPolyCss`, `polyCssDistanceToWorld`, and `polyCssPositionToWorld` for renderer-compatible transforms and world/CSS conversions.
88
88
 
89
89
  ### Controls
90
90
 
@@ -1,4 +1,4 @@
1
- import { CameraHandle, Vec3, Polygon, MeshResolution, ParseResult, PolyDirectionalLight, PolyAmbientLight, PolyTextureLightingMode, TextureQuality, PolySeamBleed, PolyRenderStrategiesOption } from '@layoutit/polycss-core';
1
+ import { CameraHandle, Vec3, Polygon, MeshResolution, ParseResult, PolyDirectionalLight, PolyAmbientLight, PolyTextureLightingMode, TextureQuality, PolyTextureLeafSizing, PolyTextureImageRendering, PolyTextureBackend, PolyTextureProjection, PolySeamBleed, PolyRenderStrategiesOption } from '@layoutit/polycss-core';
2
2
 
3
3
  interface PolyCameraOptions {
4
4
  zoom?: number;
@@ -69,6 +69,14 @@ interface PolySceneOptions {
69
69
  * desktop/mobile sprite sizing. Numeric values 0.1..1 force an explicit
70
70
  * raster scale and the 64px sprite. */
71
71
  textureQuality?: TextureQuality;
72
+ /** Texture leaf primitive sizing. Defaults to "canonical". */
73
+ textureLeafSizing?: PolyTextureLeafSizing;
74
+ /** Default image filtering for atlas and direct image texture leaves. */
75
+ textureImageRendering?: PolyTextureImageRendering;
76
+ /** Default texture backend request. Defaults to "auto". */
77
+ textureBackend?: PolyTextureBackend;
78
+ /** Default texture projection request. Defaults to "affine". */
79
+ textureProjection?: PolyTextureProjection;
72
80
  /** Solid seam overscan. `"auto"` computes a fitted per-edge amount from the polygon plan. */
73
81
  seamBleed?: PolySeamBleed;
74
82
  /**
@@ -229,6 +237,8 @@ interface PolyMeshHandle {
229
237
  * pointer release (or any point where you want to commit the new shading).
230
238
  */
231
239
  rebakeAtlas(): void;
240
+ /** Resolves when this mesh's current texture generation has usable backgrounds. */
241
+ whenTexturesReady(): Promise<void>;
232
242
  /** Current `position` from the transform (matches framework API). */
233
243
  getPosition(): Vec3 | undefined;
234
244
  /** Current `rotation` from the transform (matches framework API). */
@@ -284,6 +294,8 @@ interface PolySceneHandle {
284
294
  /** Snapshot of mesh handles currently in the scene (insertion order).
285
295
  * Used by selection helpers to enumerate hit-test candidates. */
286
296
  meshes(): readonly PolyMeshHandle[];
297
+ /** Resolves when every mesh currently in the scene has usable texture backgrounds. */
298
+ whenTexturesReady(): Promise<void>;
287
299
  /** Resolve a `.polycss-mesh` element back to its handle, or `null` if
288
300
  * the element doesn't belong to this scene. */
289
301
  findMeshByElement(element: Element | null): PolyMeshHandle | null;
@@ -1,4 +1,4 @@
1
- import { CameraHandle, Vec3, Polygon, MeshResolution, ParseResult, PolyDirectionalLight, PolyAmbientLight, PolyTextureLightingMode, TextureQuality, PolySeamBleed, PolyRenderStrategiesOption } from '@layoutit/polycss-core';
1
+ import { CameraHandle, Vec3, Polygon, MeshResolution, ParseResult, PolyDirectionalLight, PolyAmbientLight, PolyTextureLightingMode, TextureQuality, PolyTextureLeafSizing, PolyTextureImageRendering, PolyTextureBackend, PolyTextureProjection, PolySeamBleed, PolyRenderStrategiesOption } from '@layoutit/polycss-core';
2
2
 
3
3
  interface PolyCameraOptions {
4
4
  zoom?: number;
@@ -69,6 +69,14 @@ interface PolySceneOptions {
69
69
  * desktop/mobile sprite sizing. Numeric values 0.1..1 force an explicit
70
70
  * raster scale and the 64px sprite. */
71
71
  textureQuality?: TextureQuality;
72
+ /** Texture leaf primitive sizing. Defaults to "canonical". */
73
+ textureLeafSizing?: PolyTextureLeafSizing;
74
+ /** Default image filtering for atlas and direct image texture leaves. */
75
+ textureImageRendering?: PolyTextureImageRendering;
76
+ /** Default texture backend request. Defaults to "auto". */
77
+ textureBackend?: PolyTextureBackend;
78
+ /** Default texture projection request. Defaults to "affine". */
79
+ textureProjection?: PolyTextureProjection;
72
80
  /** Solid seam overscan. `"auto"` computes a fitted per-edge amount from the polygon plan. */
73
81
  seamBleed?: PolySeamBleed;
74
82
  /**
@@ -229,6 +237,8 @@ interface PolyMeshHandle {
229
237
  * pointer release (or any point where you want to commit the new shading).
230
238
  */
231
239
  rebakeAtlas(): void;
240
+ /** Resolves when this mesh's current texture generation has usable backgrounds. */
241
+ whenTexturesReady(): Promise<void>;
232
242
  /** Current `position` from the transform (matches framework API). */
233
243
  getPosition(): Vec3 | undefined;
234
244
  /** Current `rotation` from the transform (matches framework API). */
@@ -284,6 +294,8 @@ interface PolySceneHandle {
284
294
  /** Snapshot of mesh handles currently in the scene (insertion order).
285
295
  * Used by selection helpers to enumerate hit-test candidates. */
286
296
  meshes(): readonly PolyMeshHandle[];
297
+ /** Resolves when every mesh currently in the scene has usable texture backgrounds. */
298
+ whenTexturesReady(): Promise<void>;
287
299
  /** Resolve a `.polycss-mesh` element back to its handle, or `null` if
288
300
  * the element doesn't belong to this scene. */
289
301
  findMeshByElement(element: Element | null): PolyMeshHandle | null;