3D engine that AI agents drive
Put installation on home and expand engine documentation
Nguyen Xuan An38792f292fbf
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d5b72c4e..feaf63e4 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,6 +1,10 @@# Changelog-## Unreleased+## 0.4.1++- Put installation on the homepage with npm, pnpm, Yarn and Bun controls.+- Replace the Downloads navigation tab with a legacy redirect to homepage installation.+- Expand the documentation with modeling, deformation, physics and surface workflows.- Add retained rigid surface attachments that follow relative morphs, four-influence skinning and world transforms.- Separate source package checks from published npm consumer checks with verified archive integrity.diff --git a/README.md b/README.mdindex f53fe70b..db9b3a9a 100644--- a/README.md+++ b/README.md@@ -182,7 +182,7 @@ Compatible results can become relative GPU morph targets, so animation reuses thThe current source adds [surface attachments](docs/surface-attachment.md) for rigid accessories following a selected triangle through morphing and skinning.The retained frame uses world-space clearance and samples three bound vertices without rebuilding a BVH every frame.-This addon is newer than npm `0.4.0`. It does not certify clearance over an accessory's entire footprint.+This addon is available from version `0.4.1`. It does not certify clearance over an accessory's entire footprint.The trailer's rigid actor joints now use authored clips, with attached headwear and hands moving together.The [optional asset addon](docs/gltf.md) loads glTF/GLB meshes, base-color textures, opaque vertex colors and rigid node animation.diff --git a/docs.html b/docs.htmlindex d2235bbe..21abd7d7 100644--- a/docs.html+++ b/docs.html@@ -6,7 +6,7 @@<header class="navigation"><a class="brand" href="/">67<span>.js</span></a><span class="version" data-release-version>Loading release</span>- <nav aria-label="Library"><a href="/downloads.html">Downloads</a><a href="/docs.html" aria-current="page">Docs</a></nav>+ <nav aria-label="Library"><a href="/docs.html" aria-current="page">Docs</a></nav></header><main id="content" class="docs docs-page"><aside class="docs-sidebar" aria-label="Documentation navigation">diff --git a/docs/guide.md b/docs/guide.mdindex 8add3ac8..dc7e967f 100644--- a/docs/guide.md+++ b/docs/guide.md@@ -94,6 +94,91 @@ renderer.render({ eye: [3,2,4], target: [0,0,0] });Supply a real HTML canvas with nonzero CSS width and height. The example assumes `canvas` refers to that element. `box(fillet, samples)`, `cylinder(segments)`, `sphere(segments, rings)` and `torus(tubeRadius, segments, sides)` are core primitives. Inspect the supplied demos for dimension and transform conventions.+## Procedural modeling++Version `0.4.0` provides `lathe`, `extrude` and `tube` through `67js/addons/modeling`.+They generate static geometry from radius/height profiles, polygon contours and XYZ paths.+Extrusion supports holes and bevels. Open tube ends remain uncapped.++1. Choose a profile, contour or path in local coordinates.+2. Generate the geometry once with the matching addon function.+3. Assign the result to a part before creating `Renderer67`.+4. Share the geometry among repeated parts.++The [modeling contract](/modeling.md) defines input bounds, winding, bevel limits and resource estimates.+The [scene graph](/scene-graph.md) supports hierarchy and pivots without changing mesh topology.+The [modeling demo](/modeling.html) combines these tools in a lantern scene.+These generators do not perform solid Boolean operations or provide a mesh editor.++## Sculpt brushes++Version `0.4.0` provides `sculptGeometry` through `67js/addons/sculpt`.+It applies `inflate`, directional `displace` and `smooth` strokes to a copy of static indexed geometry.+Stroke centers, radii and strengths use geometry-local units.+The result preserves topology, UVs and colors, and rebuilds normals.++1. Define bounded strokes on the undeformed mesh.+2. Call `sculptGeometry` before creating the renderer.+3. Inspect the resulting surface for folds or intersections.+4. Rebuild surface patches and query indices after changing geometry.++The [sculpt contract](/sculpt.md) defines brush strength, seam handling and work limits.+Smoothing can shrink volume. Sculpting rejects skin and morph channels and does not remesh or prevent intersections.+Compatible deformations can become [relative morph targets](/morph-targets.md) for animation.++## Contact detection++Version `0.4.0` provides static BVH queries through `67js/addons/mesh-query`.+`createMeshQueryIndex` copies positions and indices. `createMeshPairQuery` tests two indices under explicit affine matrices.+The `surfaces` mode finds triangle contact. The `closed-solids` mode also tests containment between two validated solid indices.++1. Build one index per static geometry with explicit count and memory budgets.+2. For containment, create both indices with `solid: true`.+3. Create a pair query with the required mode.+4. Evaluate the query with both current world matrices.+5. Dispose the indices when their geometry is no longer needed.++An index also supports `raycast(matrix, ray)` for a triangle number, hit point and barycentric coordinates.+The [mesh query contract](/mesh-query.md) describes results, solid validation, numerical limits and budget errors.+Rebuild indices after geometry edits. Queries reject skin and morph channels.+Contact results do not measure penetration depth, resolve collisions or diagnose z-fighting.++## Shrinkwrap and surface patches++Version `0.4.0` provides `shrinkwrapGeometry` through `67js/addons/shrinkwrap`.+It returns new static geometry in target-local coordinates while preserving source topology, UVs and colors.+Nearest mode chooses a surface point. Project mode casts along a target-local direction.++1. Define `sourceToTarget` to map source-local positions into target-local coordinates.+2. Choose `nearest` or `project` mode and a bounded `maxDistance`.+3. Set `clearance` and an explicit `onMiss` policy.+4. Use the returned geometry with the target part's retained matrix.+5. Inspect `stats` and the resulting mesh before rendering.++The [shrinkwrap contract](/shrinkwrap.md) defines local distances, work budgets and miss handling.+Collapsed output triangles cause errors. Projection does not guarantee clearance across the complete accessory surface.++`createSurfacePatch` from `67js/addons/surface` clips target triangles into an overlay with its own UVs and material.+The [surface patch contract](/surface.md) defines projector orientation, depth and local clearance.+Patches and shrinkwrap are static operations. They do not follow skin or morph deformation.++## Retained surface attachments++`createSurfaceAttachment` is introduced in `0.4.1`. Published npm `0.4.0` does not include this addon.+It binds a rigid accessory to one triangle through world transforms, relative morphs and four-influence skinning.+The accessory uses the attachment's retained world matrix. Its positive Z axis follows the posed triangle's geometric winding.++1. Choose an original triangle number and barycentric coordinates for the contact point.+2. Bind the target with `createSurfaceAttachment` from `67js/addons/surface-attachment` using `0.4.1` or a current source build.+3. Assign `attachment.matrix` to the accessory part before creating the renderer.+4. Update the target matrix, morph weights and skin palette for the frame.+5. Call `attachment.update()` before `renderer.updateParts()`.++The [attachment contract](/surface-attachment.md) defines retained identities, world-unit clearance and unsupported shader deformation.+Updates sample the selected triangle without rebuilding a BVH.+Static raycast hits can supply binding coordinates, but query indices cannot raycast a visibly skinned or morphed surface.+An attachment positions one rigid frame. It does not conform the accessory footprint or prevent every intersection.+## Materials and color`color` and `emissiveColor` are linear RGB. `metallic` and `roughness` describe the PBR surface. `emission` sets emission intensity. `material.map` is a decoded texture descriptor with an image, UV channel 0, color space and supported sampler settings.@@ -153,6 +238,24 @@ Bloom cannot recover missing geometry or lighting detail.Outdoor `environment` accepts `skyTop`, `skyBottom` (display RGB), `fogColor` (linear RGB), `fogDensity`, `lightDirection` and `daylight`. Set `world: true` and `ground: false`. Frames can override environment and supply `time`, `wind`, `waterRipple` and `rippleTime`.+## Local lights and volume fog++Version `0.4.0` supports local lighting through the renderer's `environment` option and per-frame environment overrides.+`pointLights` accepts at most eight world-space lights with linear RGB colors.+`keyIntensity`, `fillIntensity` and `ambientIntensity` control the existing studio lighting.++1. Set the environment's lighting controls when creating the renderer.+2. Supply the complete `frame.environment.pointLights` list to animate local lights.+3. Inspect exposure and material response at a fixed sample time.++The [lighting contract](/lighting.md) defines intensity, radius, range and validation limits.+Point lights have no local shadows and can illuminate through walls.+Radius regularizes attenuation and does not create an area emitter.++The [volume fog contract](/volumetric.md) covers depth-clipped directional scattering in version `0.4.0`.+Active fog requires `hdr: true`, `depth: true` and supported floating-point targets.+Its depth texture contributes to the render memory estimate.+## Deterministic animation```js@@ -167,10 +270,67 @@ renderer.updateParts(parts);renderer.render({ eye: [3,2,4], target: [0,0,0], time: 1 });```-Tracks target unique part names. Supported transform tracks are translation, rotation (quaternion XYZW) and scale. Material tracks include metallic, roughness and emission. Interpolation is LINEAR, STEP or SMOOTH.+Tracks target unique part names. Supported transform tracks are translation, rotation (quaternion XYZW) and scale. Material tracks include metallic, roughness and emission. Interpolation supports `LINEAR`, `STEP`, `SMOOTH` and `CUBICSPLINE`.`sampleAnimationClip(clip, time)` returns samples without binding parts. Preserve the original graph and apply absolute time so seeking backwards reproduces the scene. Use `requestAnimationFrame` for playback, pause when hidden, and use a fixed sample time for export.+## Animation curves and mixing++Version `0.4.0` supports `CUBICSPLINE` tracks with explicit `inTangent` and `outTangent` values on every keyframe.+Tangents represent component changes per second. Quaternion tangents are component derivatives.+The [curve contract](/animation-curves.md) defines interpolation, overshoot constraints and retained player buffers.++`createAnimationMixer(parts)` combines clips through reusable actions and absolute-time control timelines.+Actions support weights, playback speed, fades and crossfades.+The [mixer contract](/animation-mixer.md) defines blending, ownership and control ordering.++1. Create clips and bind their actions through `mixer.clipAction(clip)`.+2. Author `play`, `fadeTo` or `crossFade` controls in nondecreasing time order.+3. Call `mixer.apply(time)` for the desired absolute time.+4. Upload the changed parts with `renderer.updateParts(parts)`.++Playback can seek backward independently of control authoring order.+The mixer owns its registered properties and captures their base values during binding.++## Skeletal and morph animation++Version `0.4.0` supports four-influence GPU skinning and relative position/normal morph targets.+`createSkinPose` supplies a retained joint palette. `updateSkinPose` calculates mesh-local joint matrices from world joints and inverse binds.+`createMorphPose` supplies retained weights for the geometry's relative targets.+The renderer applies morph deltas before skinning.++1. Define static skin influences or relative morph channels before renderer construction.+2. Assign the matching retained `skin` and `morph` poses to each part.+3. Update joint palette values and morph weights for the desired frame.+4. Call `renderer.updateParts(parts)` to validate and upload the poses.++The [skinning contract](/skinning.md) defines supported transforms, four influences and identity requirements.+The [morph contract](/morph-targets.md) defines channel shapes, weight bounds and resource estimates.+Changing topology, influences or pose identities requires a new renderer.++The glTF addon imports supported skins and relative targets, including joint and weight animation.+`asset.applyAnimation(time, clipIndex)` updates retained parts and poses for upload.+The [glTF morph contract](/gltf-morph.md) and [asset contract](/gltf.md) define the supported asset subset.++## Recorded physics++Version `0.4.0` provides recorded rigid-body simulation through `67js/addons/physics`.+The addon requires the separate optional peer dependency `@dimforge/[email protected]`.+It bakes body contacts, joints, limits and bounded motors into a timeline.+Playback samples that recording without rerunning the solver.++1. Define named bodies, colliders, joints and tick events.+2. Call `planPhysicsScene` to validate the definition and allocation estimate.+3. Await `createPhysicsScene` to bake the bounded recording.+4. Bind visual parts through `physics.bindParts`.+5. Apply bindings at absolute time before uploading changed parts.+6. Call `physics.dispose()` when the recording is no longer needed.++The [physics contract](/physics.md) defines supported colliders, joint controls, timing and disposal.+Recorded poses can seek forward or backward. Interpolation between recorded frames can show small penetrations.+The bake can block the main thread after WASM initialization.+Cloth, soft bodies, mesh colliders and direct skeletal bindings are unsupported.+## Assemblies and interactionExplodable parts include `assembly: { layer: 'exterior' | 'interior', section, offset: [x,y,z], detailOffset: [x,y,z] }`. Base matrices stay assembled. A frame's `assemblyAmount` goes from 0 to 1. Section offsets separate first, small detail offsets separate later.@@ -190,7 +350,9 @@ renderer.render({ eye: [3,2,4], target: [0,0,0] });// Close in this order: renderer.dispose(); asset.dispose();```-Supported: standard opaque meshes, UV base-color PNG/JPEG textures, vertex colors, emissive color and rigid node animation. Unsupported: skinning, morph targets, transparent or double-sided materials, compressed geometry and additional PBR maps. The optional decoder uses Three.js GLTFLoader, not its renderer. Read the [asset contract](/gltf.md) before choosing a model.+Version `0.4.0` imports supported opaque meshes, vertex colors, five PBR texture channels, skins, relative morph targets and animation.+Transparent or double-sided materials and compressed geometry remain unsupported.+The optional decoder uses Three.js GLTFLoader without its renderer. Read the [asset contract](/gltf.md) before choosing a model.Core `exportGlb(parts)` returns GLB geometry. This geometry exporter is not a full texture/animation round-trip. For exploded output, apply `assemblyOffset` to copied matrices. Use the browser demo's PNG controls for a still.@@ -276,18 +438,13 @@ Core exports are available from `67js`:67.js targets WebGL2. Version `0.4.0` includes the APIs below. Check the installed package version and release metadata before using them.-## Current source additions--The current checkout adds authoring and animation APIs through separate modules:--- [Scene hierarchy](scene-graph.md), [procedural modeling](modeling.md), [animation curves](animation-curves.md) and [clip mixing](animation-mixer.md).-- [Skeletal animation](skinning.md), [relative morph targets](morph-targets.md) and [glTF morph animation](gltf-morph.md).-- [Recorded Rapier physics](physics.md), including contacts, joints, limits and bounded motors.-- [Static sculpt brushes](sculpt.md), [curved surface patches](surface.md) and [BVH mesh queries](mesh-query.md).-- [Static shrinkwrap](shrinkwrap.md) through nearest-surface or directional projection, with bounded work and explicit miss handling.-- [GLB snapshot export](export-glb.md), including vertex colors, UVs, HDR emission and current morph weights.+## Release and source availability-These APIs do not provide a Blender-style editor, WebGPU backend or general asset compatibility. Mesh queries operate on static geometry. They do not automatically resolve collisions or diagnose z-fighting. The physics addon requires its separate Rapier dependency. See each module's contract for limits and disposal requirements.+Published npm `0.4.0` includes modeling, sculpting, static mesh queries, shrinkwrap, surface patches, animation mixing, skinning, morphs, physics and lighting.+Retained [surface attachments](/surface-attachment.md) are introduced in `0.4.1` and are absent from published npm `0.4.0`.+Source checkouts can contain unreleased changes beyond their package version.-The current source also adds [surface attachments](surface-attachment.md), newer than npm `0.4.0`.-These retained rigid frames follow selected triangles through morphing and skinning without rebuilding a mesh query index each frame.+The [release metadata](/release.json) identifies the published package and browser module.+The checkout's `CHANGELOG.md` separates released features from unreleased work.+The [GLB snapshot contract](/export-glb.md) describes geometry, colors, UVs, HDR emission and current morph weights.+Module contracts define their own resource limits and disposal requirements.diff --git a/docs/surface-attachment.md b/docs/surface-attachment.mdindex ce793ec5..6ce325b1 100644--- a/docs/surface-attachment.md+++ b/docs/surface-attachment.md@@ -1,6 +1,6 @@# Retained triangle attachments-This addon exists in the current source build, newer than npm `0.4.0`.+This addon is available from version `0.4.1`.`createSurfaceAttachment` follows one triangle through rigid transforms, relative morphs, and skinning.It returns a retained rigid world matrix for an accessory placed at a barycentric point.diff --git a/downloads.html b/downloads.htmlindex e6aa771d..2872e3b0 100644--- a/downloads.html+++ b/downloads.html@@ -3,42 +3,9 @@<head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" />- <meta name="theme-color" content="#191d22" />- <meta name="description" content="Install 67.js using npm, pnpm, Yarn or Bun. Find the current published release, source and documentation." />- <title>Downloads — 67.js</title>- <link rel="icon" href="/favicon.svg" />+ <meta http-equiv="refresh" content="0;url=/#downloads" />+ <link rel="canonical" href="https://67js.codepawl.com/#downloads" />+ <title>Install 67.js</title></head>- <body>- <a class="skip-link" href="#content">Skip to content</a>- <header class="navigation">- <a class="brand" href="/" aria-label="67.js home">67<span>.js</span></a>- <span class="version" data-release-version>Loading release</span>- <nav aria-label="Library">- <a href="/downloads.html" aria-current="page">Downloads</a>- <a href="/docs.html">Docs</a>- </nav>- </header>- <main id="content" class="downloads-page">- <section id="downloads" class="downloads" aria-labelledby="downloads-title">- <div class="section-heading"><h1 id="downloads-title">Downloads</h1><span data-release-version>Loading release</span></div>- <p>Choose your package manager and install the current release</p>- <div class="package-install">- <div class="package-managers" role="group" aria-label="Package manager">- <button data-package-manager="npm" aria-pressed="true"><span class="package-logo package-logo-npm" aria-hidden="true"></span><span>npm</span></button>- <button data-package-manager="pnpm" aria-pressed="false"><span class="package-logo package-logo-pnpm" aria-hidden="true"></span><span>pnpm</span></button>- <button data-package-manager="yarn" aria-pressed="false"><span class="package-logo package-logo-yarn" aria-hidden="true"></span><span>Yarn</span></button>- <button data-package-manager="bun" aria-pressed="false"><span class="package-logo package-logo-bun" aria-hidden="true"></span><span>Bun</span></button>- </div>- <div class="command-row"><code data-install-command>Loading the release command…</code><button data-copy-install disabled>Copy command</button></div>- <div class="release-feedback" hidden><p data-release-status role="status">Loading release information</p><button data-release-retry hidden>Retry</button></div>- <div class="package-links"><a href="https://www.npmjs.com/package/@codepawlhq/67js" data-icon="package">View on npm</a><a href="https://github.com/anxuanng/67.js" data-icon="github">Source on GitHub</a><a href="/docs.html" data-icon="book">Docs</a></div>- </div>- </section>- </main>- <footer class="site-footer" aria-label="Site footer">- <div class="footer-introduction"><a class="brand" href="/" aria-label="67.js home">67<span>.js</span></a><p>Browser 3D, from scene to film.<br>Made by <a href="https://codepawl.com">CodePawl</a>.</p></div>- <div class="footer-links"><a href="https://github.com/anxuanng/67.js" data-icon="github">GitHub</a><a href="https://www.npmjs.com/package/@codepawlhq/67js"><span class="package-logo package-logo-npm" aria-hidden="true"></span>npm</a><a href="/changelog.md">Changelog</a><a href="/license.txt">MIT license</a><a href="/logo.svg" download>Logo SVG</a></div>- </footer>-<script type="module" src="/src/home.js"></script>- </body>+ <body><p><a href="/#downloads">Install 67.js on the homepage</a></p></body></html>diff --git a/index.html b/index.htmlindex ec66cfc6..b0d89dbb 100644--- a/index.html+++ b/index.html@@ -14,13 +14,24 @@<a class="brand" href="/" aria-label="67.js home">67<span>.js</span></a><span class="version" data-release-version>Loading release</span><nav aria-label="Library">- <a href="/downloads.html">Downloads</a><a href="/docs.html">Docs</a></nav></header><main id="content"><section class="hero" aria-label="67.js introduction and live preview">- <header class="introduction"><div><h1>Your 3D scene,<br />from browser to film</h1><p>67.js brings browser 3D, animation and image/video export into one workflow. Create interactive experiences and export the same scene as images or video</p><div class="hero-actions"><a href="/downloads.html" data-icon="download">Download 67.js</a></div></div></header>+ <header class="introduction"><div><h1>Your 3D scene,<br />from browser to film</h1><p>Build interactive 3D, animate it and export the same scene as images or video.</p><section id="downloads" class="home-install" aria-label="Install 67.js">+ <div class="package-install">+ <div class="package-managers" role="group" aria-label="Package manager">+ <button data-package-manager="npm" aria-pressed="true"><span class="package-logo package-logo-npm" aria-hidden="true"></span><span>npm</span></button>+ <button data-package-manager="pnpm" aria-pressed="false"><span class="package-logo package-logo-pnpm" aria-hidden="true"></span><span>pnpm</span></button>+ <button data-package-manager="yarn" aria-pressed="false"><span class="package-logo package-logo-yarn" aria-hidden="true"></span><span>Yarn</span></button>+ <button data-package-manager="bun" aria-pressed="false"><span class="package-logo package-logo-bun" aria-hidden="true"></span><span>Bun</span></button>+ </div>+ <div class="command-row"><code data-install-command>Loading the release command…</code><button data-copy-install disabled>Copy command</button></div>+ <div class="release-feedback" hidden><p data-release-status role="status">Loading release information</p><button data-release-retry hidden>Retry</button></div>+ <div class="package-links"><a href="https://www.npmjs.com/package/@codepawlhq/67js" data-icon="package">View on npm</a><a href="https://github.com/anxuanng/67.js" data-icon="github">Source on GitHub</a><a href="/docs.html" data-icon="book">Docs</a></div>+ </div>+ </section></div></header><section class="feature-showcase live-showcase" aria-label="Interactive 3D preview"><canvas id="home-preview" tabindex="0" aria-label="WALL·E 3D model. Drag or use arrow keys to rotate. Use plus and minus to zoom. Press Space to pause or resume animation."></canvas>diff --git a/package-lock.json b/package-lock.jsonindex a74b9cf6..1ddae78c 100644--- a/package-lock.json+++ b/package-lock.json@@ -1,12 +1,12 @@{"name": "@codepawlhq/67js",- "version": "0.4.0",+ "version": "0.4.1","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "@codepawlhq/67js",- "version": "0.4.0",+ "version": "0.4.1","license": "MIT","devDependencies": {"@codepawlhq/orglet-ui": "0.2.1",diff --git a/package.json b/package.jsonindex 4bb1424b..fd63a969 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "@codepawlhq/67js",- "version": "0.4.0",+ "version": "0.4.1","private": false,"type": "module","description": "A browser graphics engine for interactive worlds, animation and cinematic media, with memory-aware CPU/GPU export",diff --git a/public/llms.txt b/public/llms.txtindex c1a553e5..c10256c7 100644--- a/public/llms.txt+++ b/public/llms.txt@@ -102,7 +102,7 @@ Vertex clearance does not certify whole-triangle clearance. Compatible static ouGLB support excludes transparent and double-sided materials and compressed geometry. Unsupported features require visible errors.-The current source adds `addons/surface-attachment`, newer than npm `0.4.0`. Read `docs/surface-attachment.md` before binding.+Version `0.4.1` adds `addons/surface-attachment`. Read `docs/surface-attachment.md` before binding.Bind a triangle and barycentric coordinates once. Assign the retained attachment.matrix to the accessory.Update the target morph/skin/world pose, call attachment.update(), then upload target and accessory through renderer.updateParts().Clearance uses world units and the geometric face normal. This rigid point attachment does not guarantee clearance over the entire accessory footprint.diff --git a/scripts/smoke-navigation.mjs b/scripts/smoke-navigation.mjsindex 6d7d9ec7..726917ef 100644--- a/scripts/smoke-navigation.mjs+++ b/scripts/smoke-navigation.mjs@@ -14,11 +14,14 @@ try {await page.emulateMedia({ colorScheme });for (const route of ['/', '/downloads.html', '/docs.html', '/getting-started.html']) {await page.goto(origin + route);+ if (route === '/downloads.html') await page.waitForURL(origin + '/#downloads');+ if (route === '/getting-started.html') await page.waitForURL(origin + '/docs.html#install');+ await page.locator('.navigation nav a .nav-label').waitFor();for (const width of [320, 390, 580, 1440]) {await page.setViewportSize({ width, height: 1000 });const linkPositions = await page.locator('.navigation nav a').evaluateAll(links => links.map(link => link.getBoundingClientRect().top));assert.ok(linkPositions.every(top => Math.abs(top - linkPositions[0]) < 1), 'Library navigation wraps to another row');- const contrast = await page.locator(route === '/' ? '.navigation nav a:first-child' : '.navigation nav a[aria-current]').evaluate(link => {+ const contrast = await page.locator('.navigation nav a').evaluate(link => {const channels = color => color.match(/[\d.]+/g).map(Number);const backgrounds = [];for (let element = link; element; element = element.parentElement) {diff --git a/scripts/smoke-package.mjs b/scripts/smoke-package.mjsindex 59ed51e8..f03d74f4 100644--- a/scripts/smoke-package.mjs+++ b/scripts/smoke-package.mjs@@ -110,7 +110,7 @@ assert.equal(wrappedPatch.stats.missedVertices, 0);assert.deepEqual(wrappedPatch.geometry.indices, packedPatch.indices);assert.deepEqual(wrappedPatch.geometry.uvs, packedPatch.uvs);assert.ok(wrappedPatch.geometry.positions.every((value, index) => index % 3 !== 2 || Math.abs(value - 0.502) < 1e-6));-if (${!published}) {+if (${!published || metadata.version !== '0.4.0'}) {const { createSurfaceAttachment } = await import('67js/addons/surface-attachment');const attachmentMatrix = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);const attachmentMorph = createMorphPose(1);diff --git a/scripts/smoke-site.mjs b/scripts/smoke-site.mjsindex 73614d1d..2addd8e9 100644--- a/scripts/smoke-site.mjs+++ b/scripts/smoke-site.mjs@@ -19,6 +19,11 @@ try {page.on('pageerror', error => errors.push(error.message));for (const route of ['/', '/downloads.html', '/docs.html', '/getting-started.html', '/object.html', '/motion.html', '/nature.html', '/assets.html', '/view2d.html', '/film.html']) {await page.goto(origin + route);+ if (route === '/downloads.html') await page.waitForURL(origin + '/#downloads');+ if (route === '/getting-started.html') await page.waitForURL(origin + '/docs.html#install');+ if (['/', '/downloads.html', '/docs.html', '/getting-started.html'].includes(route)) {+ await page.locator('.navigation nav a .nav-label').waitFor();+ }if (route.includes('object')) await page.waitForFunction(() => window.__studio?.renderer);if (route.includes('motion')) await page.waitForFunction(() => window.__motion?.renderer);if (route.includes('nature')) await page.waitForFunction(() => window.__nature?.renderer);@@ -30,6 +35,10 @@ try {if (route === '/') {await page.locator('img').evaluateAll(images => images.forEach(image => { image.loading = 'eager'; }));await page.waitForFunction(() => [...document.images].every(image => image.complete));+ if (width < 760) {+ const commandHeight = await page.locator('.home-install .command-row').evaluate(element => element.getBoundingClientRect().height);+ assert.ok(commandHeight < 180, `Homepage command consumes excessive mobile height: ${commandHeight}`);+ }}const overflow = await page.evaluate(() => document.documentElement.scrollWidth > innerWidth + 1);assert.equal(overflow,false,`${route} overflow at ${width}`);@@ -49,14 +58,14 @@ try {await page.setViewportSize({ width:1440,height:1000 });if (['/', '/downloads.html', '/docs.html', '/getting-started.html'].includes(route)) {assert.equal(await page.locator('aside.navigation').count(), 0);- assert.deepEqual(await page.locator('.navigation nav .nav-label').allTextContents(), ['Downloads', 'Docs']);- assert.equal(await page.locator('.navigation nav a[aria-current="page"]').count(), route === '/' ? 0 : 1);+ assert.deepEqual(await page.locator('.navigation nav .nav-label').allTextContents(), ['Docs']);+ assert.equal(await page.locator('.navigation nav a[aria-current="page"]').count(), ['/', '/downloads.html'].includes(route) ? 0 : 1);assert.equal(await page.locator('a[href$="llms.txt"]').count(), 0, 'Machine guide appears in public UI');assert.equal(await page.locator('.navigation a[href*="getting-started.html"]').count(), 0, 'Getting started still has separate navigation');}if (route === '/') {assert.equal(await page.locator('video').count(), 0, 'Homepage still embeds video');- assert.equal(await page.locator('#downloads').count(), 0, 'Downloads still merged into Showcase');+ assert.equal(await page.locator('#downloads').count(), 1, 'Homepage install controls are missing');const scenePaths = await page.locator('.gallery .example').evaluateAll(links => links.map(link => new URL(link.href).pathname));assert.equal(new Set(scenePaths).size, scenePaths.length, 'Showcase repeats the same scene');await page.locator('#home-preview').scrollIntoViewIfNeeded();@@ -114,7 +123,8 @@ try {await page.screenshot({ path:'artifacts/home-live-preview.png' });report.interactions.push('Live WALL·E, keyboard orbit, transparent render and paused assembly with gradual drive restart');}- if (route === '/downloads.html') {+ if (['/', '/downloads.html'].includes(route)) {+ if (route === '/downloads.html') assert.match(page.url(), /\/#downloads$/);await page.waitForFunction(() => window.__home.state.status === 'ready');assert.equal(await page.locator('.package-managers .package-logo').count(), 4);assert.equal(await page.locator('[data-package-manager]').count(), 4);@@ -127,7 +137,7 @@ try {await page.locator('[data-copy-install]').click();assert.equal(await page.evaluate(() => window.__copiedText), expectedCommand);}- report.interactions.push('Separate Downloads page with four branded package managers and command copying');+ report.interactions.push('Homepage installation with four branded package managers, copying and legacy URL redirect');}if (route === '/getting-started.html') {assert.match(page.url(), /\/docs(?:\.html)?#install$/);diff --git a/src/documentation.js b/src/documentation.jsindex cb7a6b64..ad99ce5d 100644--- a/src/documentation.js+++ b/src/documentation.js@@ -22,10 +22,11 @@ topicMenu.open = desktopTopics.matches;desktopTopics.addEventListener('change', () => { topicMenu.open = desktopTopics.matches; });const groups = [{ title: 'Start here', icon: 'start', ids: ['overview', 'install', 'getting-started'] },- { title: 'Build a scene', icon: 'cube', ids: ['parts-and-geometry', 'materials-and-color', 'renderer-reference', 'cameras-and-framing', 'effects-and-lighting'] },- { title: 'Animate and interact', icon: 'motion', ids: ['deterministic-animation', 'assemblies-and-interaction'] },+ { title: 'Build a scene', icon: 'cube', ids: ['parts-and-geometry', 'materials-and-color', 'renderer-reference', 'cameras-and-framing', 'effects-and-lighting', 'local-lights-and-volume-fog'] },+ { title: 'Model and fit surfaces', icon: 'cube', ids: ['procedural-modeling', 'sculpt-brushes', 'contact-detection', 'shrinkwrap-and-surface-patches', 'retained-surface-attachments'] },+ { title: 'Animate and interact', icon: 'motion', ids: ['deterministic-animation', 'animation-curves-and-mixing', 'skeletal-and-morph-animation', 'recorded-physics', 'assemblies-and-interaction'] },{ title: 'Assets and media', icon: 'image', ids: ['import-and-export-models', 'images-and-films'] },- { title: 'Reference and workflows', icon: 'book', ids: ['performance-and-memory', 'lifecycle-and-troubleshooting', 'models-and-ai-agents', 'addons-and-limits'] },+ { title: 'Reference and workflows', icon: 'book', ids: ['performance-and-memory', 'lifecycle-and-troubleshooting', 'models-and-ai-agents', 'addons-and-limits', 'release-and-source-availability'] },];const iconPaths = {start: '<path d="m9 5 10 7-10 7V5Z"/>',@@ -195,7 +196,7 @@ function openTopic(focus = false) {article.replaceChildren(section);if (currentTopic.id === 'install') {const managerLink = document.createElement('p');- managerLink.innerHTML = `<a class="doc-install-link" href="/downloads.html">Download 67.js ${icon('arrow')}</a>`;+ managerLink.innerHTML = `<a class="doc-install-link" href="/#downloads">Install 67.js ${icon('arrow')}</a>`;section.append(managerLink);}const index = topics.indexOf(currentTopic);diff --git a/src/home.css b/src/home.cssindex fbbf9c9e..9f2a137b 100644--- a/src/home.css+++ b/src/home.css@@ -120,6 +120,17 @@ button:hover { background:var(--border); }.example img { aspect-ratio:16/9; border-radius:var(--panel-radius); border:1px solid var(--border); }.hero { display:grid; grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); align-items:center; gap:40px; margin:16px 0 48px; }.hero .introduction { margin:0; padding:20px 0; min-width:0; }+.hero .introduction > div { width:100%; min-width:0; }+.home-install { scroll-margin-top:24px; margin-top:28px; }+.home-install .package-install { padding:20px; }+.home-install .command-row { flex-wrap:wrap; gap:12px; padding:16px; }+.home-install .command-row code { flex:1 1 240px; min-width:0; }+.home-install .package-links { gap:4px 16px; margin-top:14px; }+.home-install .package-links a { font-size:13px; }+@media (max-width:760px) {+ .home-install .command-row code { flex:0 1 auto; width:100%; }+ .home-install .package-install { padding:16px; }+}.hero .feature-showcase { margin:0; min-width:0; }.hero .live-showcase canvas { height:clamp(320px,30vw,430px); }@media (max-width:960px) {diff --git a/src/home.js b/src/home.jsindex 07a0a77f..4fee946c 100644--- a/src/home.js+++ b/src/home.js@@ -122,15 +122,6 @@ document.querySelectorAll('[data-package-manager]').forEach(button => {packageControls.push({ name, control });});-function redirectLegacyDownloads() {- if (['/', '/index.html'].includes(location.pathname) && location.hash === '#downloads') {- location.replace('/downloads.html');- }-}--redirectLegacyDownloads();-window.addEventListener('hashchange', redirectLegacyDownloads);-document.querySelectorAll('.example img').forEach(image => {image.addEventListener('error', () => {image.alt = `${image.alt}. Preview unavailable. Open the example to explore it`;