From 5d5e4e4a195a75a9b713770f174ceee80715ffdc Mon Sep 17 00:00:00 2001 From: H3l!0s_T3k <90980178+Ismail-Benali@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:42:58 +0000 Subject: [PATCH 01/18] feat: add procedural facial morph target engine --- src/face-morphs.js | 112 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 src/face-morphs.js diff --git a/src/face-morphs.js b/src/face-morphs.js new file mode 100644 index 0000000..95326ad --- /dev/null +++ b/src/face-morphs.js @@ -0,0 +1,112 @@ +/** + * Procedural facial surface and nose with real relative morph-target deltas. + * Morph values are normalized to [-1, 1] around the neutral JSON v2 design. + */ +import * as THREE from 'three'; + +const clamp = (value, min, max) => Math.min(max, Math.max(min, value)); +function addMorphTargets(geometry, definitions) { + const base = geometry.getAttribute('position'); + geometry.morphTargetsRelative = true; + geometry.morphAttributes.position = []; + for (const [name, deltaForVertex] of Object.entries(definitions)) { + const delta = new Float32Array(base.count * 3); + const vertex = new THREE.Vector3(); + for (let i = 0; i < base.count; i++) { + vertex.fromBufferAttribute(base, i); + const change = deltaForVertex(vertex, i); + delta[i * 3] = change.x; + delta[i * 3 + 1] = change.y; + delta[i * 3 + 2] = change.z; + } + const attribute = new THREE.Float32BufferAttribute(delta, 3); + attribute.name = name; + geometry.morphAttributes.position.push(attribute); + } + return geometry; +} + +function faceMask(y, center, width) { + const distance = Math.abs(y - center) / width; + return Math.exp(-distance * distance * 2.2); +} + +export function createFaceSurface(face = {}, material) { + const geometry = new THREE.SphereGeometry(1, 56, 40); + const position = geometry.getAttribute('position'); + const base = new Float32Array(position.array.length); + for (let i = 0; i < position.count; i++) { + base[i * 3] = position.getX(i) * .58; + base[i * 3 + 1] = position.getY(i) * .72; + base[i * 3 + 2] = position.getZ(i) * .49; + } + position.array.set(base); + position.needsUpdate = true; + geometry.computeVertexNormals(); + addMorphTargets(geometry, { + faceWidth: v => new THREE.Vector3(v.x * .38, 0, 0), + faceHeight: v => new THREE.Vector3(0, v.y * .34, 0), + jawWidth: v => new THREE.Vector3(v.x * .52 * faceMask(v.y, -.42, .42), 0, 0), + cheekboneWidth: v => new THREE.Vector3(v.x * .34 * faceMask(v.y, -.06, .22), 0, 0), + chinWidth: v => new THREE.Vector3(v.x * .46 * faceMask(v.y, -.72, .2), 0, 0), + shapeRound: v => new THREE.Vector3(v.x * .13 * faceMask(v.y, -.18, .55), -Math.abs(v.y) * .025, 0), + shapeSquare: v => new THREE.Vector3(v.x * .12 * faceMask(v.y, -.48, .32), 0, 0), + shapeHeart: v => new THREE.Vector3(v.x * .12 * (faceMask(v.y, .08, .3) - faceMask(v.y, -.55, .3)), 0, 0), + shapeLong: v => new THREE.Vector3(0, v.y * .16, 0) + }); + const mesh = new THREE.Mesh(geometry, material); + mesh.name = 'ProceduralFaceSurface'; + mesh.updateMorphTargets(); + const dictionary = mesh.morphTargetDictionary; + const values = { + faceWidth: (face.width ?? 1) - 1, + faceHeight: (face.height ?? 1) - 1, + jawWidth: (face.jawWidth ?? 1) - 1, + cheekboneWidth: (face.cheekboneWidth ?? 1) - 1, + chinWidth: (face.chinWidth ?? 1) - 1, + shapeRound: face.shape === 'round' ? 1 : 0, + shapeSquare: face.shape === 'square' ? 1 : 0, + shapeHeart: face.shape === 'heart' ? 1 : 0, + shapeLong: face.shape === 'long' ? 1 : 0 + }; + for (const [name, value] of Object.entries(values)) { + const index = dictionary[name]; + if (index !== undefined) mesh.morphTargetInfluences[index] = clamp(value, -1, 1); + } + mesh.castShadow = true; + mesh.receiveShadow = true; + return mesh; +} + +export function createNoseSurface(face = {}, material) { + const geometry = new THREE.SphereGeometry(1, 32, 24); + const position = geometry.getAttribute('position'); + for (let i = 0; i < position.count; i++) { + position.setXYZ(i, position.getX(i) * .072, position.getY(i) * .17, position.getZ(i) * .07); + } + position.needsUpdate = true; + geometry.computeVertexNormals(); + addMorphTargets(geometry, { + noseWidth: v => new THREE.Vector3(v.x * .48, 0, 0), + noseLength: v => new THREE.Vector3(0, v.y * .38, 0), + noseBridgeHeight: v => new THREE.Vector3(0, 0, v.z * .34 * faceMask(v.y, .35, .7)), + noseTip: v => new THREE.Vector3(v.x * .12 * faceMask(v.y, -.65, .3), 0, v.z * .2 * faceMask(v.y, -.65, .3)) + }); + const mesh = new THREE.Mesh(geometry, material); + mesh.name = 'ProceduralNose'; + mesh.position.set(0, -.075, .49); + mesh.updateMorphTargets(); + const values = { + noseWidth: (face.noseWidth ?? 1) - 1, + noseLength: (face.noseLength ?? 1) - 1, + noseBridgeHeight: (face.noseBridgeHeight ?? 1) - 1, + noseTip: (face.noseTip ?? 1) - 1 + }; + for (const [name, value] of Object.entries(values)) { + const index = mesh.morphTargetDictionary[name]; + if (index !== undefined) mesh.morphTargetInfluences[index] = clamp(value, -1, 1); + } + mesh.castShadow = true; + mesh.receiveShadow = true; + return mesh; +} From f1d726929356928fe425e4a09008297be2ae2ee7 Mon Sep 17 00:00:00 2001 From: H3l!0s_T3k <90980178+Ismail-Benali@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:43:01 +0000 Subject: [PATCH 02/18] test: cover procedural face and nose morph targets --- test/face-morphs.test.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/face-morphs.test.js diff --git a/test/face-morphs.test.js b/test/face-morphs.test.js new file mode 100644 index 0000000..8fe6c20 --- /dev/null +++ b/test/face-morphs.test.js @@ -0,0 +1,24 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import * as THREE from 'three'; +import { createFaceSurface, createNoseSurface } from '../src/face-morphs.js'; + +test('procedural face exposes named, finite facial morph targets', () => { + const mesh = createFaceSurface({ shape: 'heart', width: 1.12, jawWidth: .9 }, new THREE.MeshStandardMaterial()); + assert.equal(mesh.isMesh, true); + for (const name of ['faceWidth', 'faceHeight', 'jawWidth', 'cheekboneWidth', 'chinWidth', 'shapeHeart']) { + assert.ok(Number.isInteger(mesh.morphTargetDictionary[name]), name); + assert.ok(Number.isFinite(mesh.morphTargetInfluences[mesh.morphTargetDictionary[name]])); + } + assert.equal(mesh.morphTargetInfluences[mesh.morphTargetDictionary.shapeHeart], 1); + assert.equal(mesh.morphTargetInfluences[mesh.morphTargetDictionary.jawWidth], -.1); +}); + +test('procedural nose exposes independent bridge, length, width and tip targets', () => { + const mesh = createNoseSurface({ noseWidth: 1.2, noseLength: .9, noseBridgeHeight: 1.1 }, new THREE.MeshStandardMaterial()); + for (const name of ['noseWidth', 'noseLength', 'noseBridgeHeight', 'noseTip']) { + assert.ok(Number.isInteger(mesh.morphTargetDictionary[name]), name); + } + assert.ok(mesh.morphTargetInfluences[mesh.morphTargetDictionary.noseWidth] > 0); + assert.ok(mesh.morphTargetInfluences[mesh.morphTargetDictionary.noseLength] < 0); +}); From 2215034c3f44ab5d9bc20d31c65e545419db673c Mon Sep 17 00:00:00 2001 From: H3l!0s_T3k <90980178+Ismail-Benali@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:43:03 +0000 Subject: [PATCH 03/18] feat: skin procedural anatomy to humanoid rig --- src/human-anatomy.js | 186 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 166 insertions(+), 20 deletions(-) diff --git a/src/human-anatomy.js b/src/human-anatomy.js index 3d29d88..749c04a 100644 --- a/src/human-anatomy.js +++ b/src/human-anatomy.js @@ -1,26 +1,172 @@ /** - * Procedural human anatomy blockout v2. Smooth lofted body volumes replace disconnected primitive-only torso geometry. - * Production realism still requires a sculpted base mesh and skin-weighted rig. + * Procedural humanoid anatomy with optional full skeletal skinning. + * Geometry remains renderer-native Three.js and uses the stable humanoid bone contract. */ import * as THREE from 'three'; import { solveHumanProportions } from './human-proportions.js'; -function loftY(parent,rings,material,segments=40){ - const positions=[],indices=[]; - for(const r of rings)for(let i=0;i<=segments;i++){const a=i/segments*Math.PI*2;positions.push(Math.cos(a)*r.rx,r.y,Math.sin(a)*r.rz)} - const row=segments+1;for(let j=0;j { + const bone = rig.bones[name]; + if (!bone) throw new Error('Humanoid rig is missing required bone: ' + name); + const world = bone.getWorldPosition(new THREE.Vector3()); + return { name, index: skeleton.bones.indexOf(bone), point: parent.worldToLocal(world) }; + }); + const positions = geometry.getAttribute('position'); + const indices = new Uint16Array(positions.count * 4); + const weights = new Float32Array(positions.count * 4); + const local = new THREE.Vector3(); + for (let i = 0; i < positions.count; i++) { + local.fromBufferAttribute(positions, i).applyMatrix4(mesh.matrix); + const nearest = bonePoints + .map(bone => ({ ...bone, distance: local.distanceTo(bone.point) })) + .sort((a, b) => a.distance - b.distance) + .slice(0, Math.min(2, bonePoints.length)); + const inverse = nearest.map(item => 1 / Math.max(item.distance, 0.025)); + const total = inverse.reduce((sum, value) => sum + value, 0); + nearest.forEach((item, slot) => { + indices[i * 4 + slot] = item.index; + weights[i * 4 + slot] = inverse[slot] / total; + }); + } + geometry.setAttribute('skinIndex', new THREE.Uint16BufferAttribute(indices, 4)); + geometry.setAttribute('skinWeight', new THREE.Float32BufferAttribute(weights, 4)); + mesh.bind(skeleton, mesh.matrixWorld); + } + return mesh; +} + +function loftY(parent, rings, material, segments, rig) { + const positions = [], indices = []; + for (const ring of rings) { + for (let i = 0; i <= segments; i++) { + const angle = (i / segments) * Math.PI * 2; + positions.push(Math.cos(angle) * ring.rx, ring.y, Math.sin(angle) * ring.rz); + } + } + const row = segments + 1; + for (let j = 0; j < rings.length - 1; j++) { + for (let i = 0; i < segments; i++) { + const a = j * row + i, b = a + row; + indices.push(a, a + 1, b, b, a + 1, b + 1); + } + } + const geometry = new THREE.BufferGeometry(); + geometry.setAttribute('position', new THREE.Float32BufferAttribute(positions, 3)); + geometry.setIndex(indices); + geometry.computeVertexNormals(); + return attachMesh(parent, geometry, material, { name: 'TorsoSkin' }, rig, + ['Hips', 'Spine', 'Chest', 'UpperChest', 'Neck']); +} + +function ellipsoid(parent, position, scale, material, rig, candidates, name, segments = 24) { + const geometry = new THREE.SphereGeometry(1, segments, Math.max(12, Math.floor(segments * 0.7))); + return attachMesh(parent, geometry, material, { name, position, scale }, rig, candidates); +} + +function taperedLimb(parent, start, end, r0, r1, material, depth, rig, candidates, name) { + const a = new THREE.Vector3(...start), b = new THREE.Vector3(...end); + const axis = new THREE.Vector3().subVectors(b, a); + const geometry = new THREE.CylinderGeometry(r1, r0, axis.length(), 24, 8, false); + const quaternion = new THREE.Quaternion().setFromUnitVectors(new THREE.Vector3(0, 1, 0), axis.clone().normalize()); + return attachMesh(parent, geometry, material, { + name, position: a.clone().add(b).multiplyScalar(0.5).toArray(), + quaternion, scale: [1, 1, depth] + }, rig, candidates); +} + +export function buildHumanAnatomy(parent, proportions = {}, skinMaterial, rig = null) { + const p = solveHumanProportions(proportions); + const l = p.landmarks; + const sx = p.shoulderWidth, dx = p.bodyDepth, wx = p.waistWidth, hx = p.hipWidth, tl = p.torsoLength; + const upper = side => side < 0 ? 'L' : 'R'; + const torsoRings = [ + { y: .34 * tl, rx: .245 * sx, rz: .145 * dx }, + { y: .25 * tl, rx: .36 * sx, rz: .205 * dx }, + { y: .12 * tl, rx: .39 * sx, rz: .235 * dx }, + { y: -.08 * tl, rx: .355 * sx, rz: .22 * dx }, + { y: -.28 * tl, rx: .30 * wx, rz: .195 * dx }, + { y: -.43 * tl, rx: .325 * wx, rz: .205 * dx }, + { y: -.56 * tl, rx: .38 * hx, rz: .225 * dx }, + { y: -.69 * tl, rx: .37 * hx, rz: .22 * dx }, + { y: -.78 * tl, rx: .25 * hx, rz: .17 * dx } + ]; + loftY(parent, torsoRings, skinMaterial, 48, rig); + + if (rig) { + taperedLimb(parent, [0, .23, 0], [0, .55 * p.neckLength, 0], .125, .105, + skinMaterial, dx, rig, ['UpperChest', 'Neck'], 'NeckSkin'); + } + + for (const side of [-1, 1]) { + const suffix = upper(side); + ellipsoid(parent, [side * .205 * sx, .13 * tl, .17 * dx], [.19 * sx, .16 * tl, .09 * dx], + skinMaterial, rig, ['Chest', 'UpperChest', 'Clavicle' + suffix], 'Pectoral' + suffix, 28); + ellipsoid(parent, [side * .405 * sx, .19 * tl, 0], [.17 * sx, .18, .18 * dx], + skinMaterial, rig, ['UpperChest', 'Clavicle' + suffix, 'UpperArm' + suffix], 'Shoulder' + suffix, 24); + const shoulder = [side * .49 * sx, l.shoulderY, 0]; + const elbow = [side * .62 * sx, l.elbowY, .005]; + const wrist = [side * .66 * sx, l.wristY, .025]; + taperedLimb(parent, shoulder, elbow, .125, .09, skinMaterial, dx, rig, + ['Clavicle' + suffix, 'UpperArm' + suffix], 'UpperArmSkin' + suffix); + ellipsoid(parent, elbow, [.092, .095, .09], skinMaterial, rig, + ['UpperArm' + suffix, 'Forearm' + suffix], 'Elbow' + suffix, 20); + taperedLimb(parent, elbow, wrist, .09, .055, skinMaterial, dx, rig, + ['Forearm' + suffix, 'Hand' + suffix], 'ForearmSkin' + suffix); + ellipsoid(parent, wrist, [.061, .065, .055], skinMaterial, rig, + ['Forearm' + suffix, 'Hand' + suffix], 'Wrist' + suffix, 18); + ellipsoid(parent, [wrist[0], wrist[1] - .105 * p.armLength, .06], [.078, .115, .038], + skinMaterial, rig, ['Hand' + suffix, 'Thumb' + suffix], 'Palm' + suffix, 22); + ellipsoid(parent, [side * (.66 * sx - .045), wrist[1] - .075 * p.armLength, .09], [.035, .065, .03], + skinMaterial, rig, ['Hand' + suffix, 'Thumb' + suffix], 'ThumbBase' + suffix, 16); + for (let finger = 0; finger < 4; finger++) { + const x = side * (.66 * sx - .045 + (finger - 1.5) * .027); + ellipsoid(parent, [x, wrist[1] - .205 * p.armLength, .09], [.014, .075, .014], + skinMaterial, rig, ['Hand' + suffix, ['Index', 'Middle', 'Ring', 'Pinky'][finger] + suffix], + ['Index', 'Middle', 'Ring', 'Pinky'][finger] + 'Skin' + suffix, 12); + } + } + + for (const side of [-1, 1]) { + const suffix = upper(side); + const hip = [side * l.hipHalf, l.hipY, 0]; + const knee = [side * l.hipHalf * 1.04, l.kneeY, .012]; + const ankle = [side * l.hipHalf * 1.04, l.ankleY, .018]; + ellipsoid(parent, hip, [.17 * hx, .18 * tl, .18 * dx], skinMaterial, rig, + ['Hips', 'UpperLeg' + suffix], 'Hip' + suffix, 24); + taperedLimb(parent, hip, knee, .155 * hx, .105, skinMaterial, dx, rig, + ['Hips', 'UpperLeg' + suffix], 'ThighSkin' + suffix); + ellipsoid(parent, knee, [.105, .11, .115], skinMaterial, rig, + ['UpperLeg' + suffix, 'LowerLeg' + suffix], 'Knee' + suffix, 20); + taperedLimb(parent, knee, ankle, .105, .065, skinMaterial, dx, rig, + ['LowerLeg' + suffix, 'Foot' + suffix], 'CalfSkin' + suffix); + ellipsoid(parent, ankle, [.068, .085, .075], skinMaterial, rig, + ['LowerLeg' + suffix, 'Foot' + suffix], 'Ankle' + suffix, 18); + ellipsoid(parent, [ankle[0], ankle[1] - .025, .13], [.09, .065, .19], skinMaterial, rig, + ['Foot' + suffix, 'Toe' + suffix], 'FootSkin' + suffix, 22); + } + + return { proportions: p, skeleton: rig?.skeleton || null }; } From dd3e3ceb4037b61e39dd990a37412e4993775b24 Mon Sep 17 00:00:00 2001 From: H3l!0s_T3k <90980178+Ismail-Benali@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:43:06 +0000 Subject: [PATCH 04/18] fix: align humanoid rig with anatomical landmarks --- src/human-rig.js | 66 ++++++++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/src/human-rig.js b/src/human-rig.js index e18715b..91f4f62 100644 --- a/src/human-rig.js +++ b/src/human-rig.js @@ -1,36 +1,48 @@ /** - * Standardized animation-ready humanoid bone hierarchy. - * Bones are named for interoperability; visible meshes are bound separately. + * Stable humanoid skeleton. Bone positions align with the procedural anatomy landmarks. + * Mesh binding is performed by human-anatomy.js using normalized two-bone skin weights. */ import * as THREE from 'three'; import { solveHumanProportions } from './human-proportions.js'; -export function buildHumanRig(body={}) { - const p=solveHumanProportions(body), l=p.landmarks; - const root=new THREE.Group();root.name='ArCodeHumanRig'; - const bones={}; - const make=(name,parent,position)=>{ - const bone=new THREE.Bone();bone.name=name;bone.position.set(...position);parent.add(bone);bones[name]=bone;return bone; +export function buildHumanRig(body = {}) { + const p = solveHumanProportions(body), l = p.landmarks; + const root = new THREE.Group(); + root.name = 'ArCodeHumanRig'; + const bones = {}; + const make = (name, parent, position) => { + const bone = new THREE.Bone(); + bone.name = name; + bone.position.set(...position); + parent.add(bone); + bones[name] = bone; + return bone; }; - const pelvis=make('Hips',root,[0,l.pelvisY,0]); - const spine=make('Spine',pelvis,[0,.24*p.torsoLength,0]); - const chest=make('Chest',spine,[0,.25*p.torsoLength,0]); - const upperChest=make('UpperChest',chest,[0,.18*p.torsoLength,0]); - const neck=make('Neck',upperChest,[0,.15*p.neckLength,0]); - make('Head',neck,[0,.14*p.headScale,0]); - for(const side of [-1,1]){ - const suffix=side<0?'L':'R'; - const clavicle=make('Clavicle'+suffix,upperChest,[side*l.shoulderHalf,0,0]); - const upperArm=make('UpperArm'+suffix,clavicle,[side*.12*p.shoulderWidth,-.04,0]); - const forearm=make('Forearm'+suffix,upperArm,[side*.15*p.shoulderWidth,-.42*p.armLength,0]); - const hand=make('Hand'+suffix,forearm,[side*.02*p.shoulderWidth,-.4*p.armLength,.01]); - make('Thumb'+suffix,hand,[side*.055,-.025,.035]); - for(let finger=0;finger<4;finger++)make(['Index','Middle','Ring','Pinky'][finger]+suffix,hand,[side*(finger-1.5)*.025,-.09,.02]); - const thigh=make('UpperLeg'+suffix,pelvis,[side*l.hipHalf,-.04,0]); - const calf=make('LowerLeg'+suffix,thigh,[side*.015*p.hipWidth,-.43*p.legLength,0]); - const foot=make('Foot'+suffix,calf,[0,-.41*p.legLength,.02]); - make('Toe'+suffix,foot,[0,-.015,.13]); + + const pelvis = make('Hips', root, [0, l.pelvisY, 0]); + const spine = make('Spine', pelvis, [0, .32 * p.torsoLength, 0]); + const chest = make('Chest', spine, [0, .35 * p.torsoLength, 0]); + const upperChest = make('UpperChest', chest, [0, .18 * p.torsoLength, 0]); + const neck = make('Neck', upperChest, [0, .30 * p.neckLength, 0]); + make('Head', neck, [0, .45 * p.headScale, 0]); + + for (const side of [-1, 1]) { + const suffix = side < 0 ? 'L' : 'R'; + const clavicle = make('Clavicle' + suffix, upperChest, [side * l.shoulderHalf, -.04, 0]); + const upperArm = make('UpperArm' + suffix, clavicle, [side * .04 * p.shoulderWidth, 0, 0]); + const forearm = make('Forearm' + suffix, upperArm, [side * .15 * p.shoulderWidth, -.42 * p.armLength, 0]); + const hand = make('Hand' + suffix, forearm, [side * .02 * p.shoulderWidth, -.4 * p.armLength, .01]); + make('Thumb' + suffix, hand, [side * .055, -.025, .035]); + for (let finger = 0; finger < 4; finger++) { + make(['Index', 'Middle', 'Ring', 'Pinky'][finger] + suffix, hand, + [side * (finger - 1.5) * .025, -.09, .02]); + } + const thigh = make('UpperLeg' + suffix, pelvis, [side * l.hipHalf, -.04, 0]); + const calf = make('LowerLeg' + suffix, thigh, [side * .015 * p.hipWidth, -.43 * p.legLength, 0]); + const foot = make('Foot' + suffix, calf, [0, -.41 * p.legLength, .02]); + make('Toe' + suffix, foot, [0, -.015, .13]); } + root.updateMatrixWorld(true); - return {root,bones,proportions:p}; + return { root, bones, proportions: p, skeleton: null }; } From a8b932572c54741d04430edaffea5f6cda2c6b0c Mon Sep 17 00:00:00 2001 From: H3l!0s_T3k <90980178+Ismail-Benali@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:43:09 +0000 Subject: [PATCH 05/18] test: verify humanoid skin weights and rig alignment --- test/human-anatomy.test.js | 58 ++++++++++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/test/human-anatomy.test.js b/test/human-anatomy.test.js index 672b8f8..25135e9 100644 --- a/test/human-anatomy.test.js +++ b/test/human-anatomy.test.js @@ -5,8 +5,56 @@ import { buildHumanAnatomy } from '../src/human-anatomy.js'; import { solveHumanProportions } from '../src/human-proportions.js'; import { buildHumanRig } from '../src/human-rig.js'; import { COLOR_PALETTES, applyColorPalette, createSkinMaterial } from '../src/color-system.js'; -const body={shoulderWidth:1,torsoLength:1,bodyDepth:1,waistWidth:1,hipWidth:1,armLength:1,legLength:1,neckLength:1,headScale:1}; -test('proportion solver produces stable anatomical landmarks',()=>{const p=solveHumanProportions({...body,legLength:1.1,shoulderWidth:1.2});assert.ok(p.landmarks.kneeY.4)}); -test('procedural anatomy builds lofted torso and articulated limb meshes',()=>{const root=new THREE.Group();buildHumanAnatomy(root,body,new THREE.MeshStandardMaterial());assert.ok(root.children.length>=15);assert.ok(root.children.some(m=>m.geometry.index&&m.geometry.attributes.position.count>300));assert.ok(root.children.every(m=>m.isMesh&&m.geometry&&m.material))}); -test('humanoid rig exposes standard named bones and both sides',()=>{const rig=buildHumanRig(body);for(const name of ['Hips','Spine','Chest','UpperChest','Neck','Head','UpperArmL','ForearmR','HandL','UpperLegR','LowerLegL','FootR','ToeL'])assert.ok(rig.bones[name],name)}); -test('color palette application preserves independent skin tone',()=>{const state={skin:'#b97850',cloth:'#fff',hair:'#fff',eyes:'#fff',clothing:{trimColor:'#fff'}};applyColorPalette(state,'atlas');assert.equal(state.skin,'#b97850');assert.equal(state.cloth,COLOR_PALETTES.atlas.cloth);assert.ok(createSkinMaterial('#b97850').isMeshPhysicalMaterial)}); + +const body = { shoulderWidth: 1, torsoLength: 1, bodyDepth: 1, waistWidth: 1, hipWidth: 1, armLength: 1, legLength: 1, neckLength: 1, headScale: 1 }; + +test('proportion solver produces stable anatomical landmarks', () => { + const p = solveHumanProportions({ ...body, legLength: 1.1, shoulderWidth: 1.2 }); + assert.ok(p.landmarks.kneeY < p.landmarks.hipY); + assert.ok(p.landmarks.ankleY < p.landmarks.kneeY); + assert.ok(p.landmarks.shoulderHalf > .4); +}); + +test('procedural anatomy builds lofted torso and articulated limb meshes', () => { + const root = new THREE.Group(); + buildHumanAnatomy(root, body, new THREE.MeshStandardMaterial()); + assert.ok(root.children.length >= 15); + assert.ok(root.children.some(mesh => mesh.geometry.index && mesh.geometry.attributes.position.count > 300)); + assert.ok(root.children.every(mesh => mesh.isMesh && mesh.geometry && mesh.material)); +}); + +test('skinned anatomy binds every generated body part to normalized bone weights', () => { + const root = new THREE.Group(); + const rig = buildHumanRig(body); + root.add(rig.root); + const result = buildHumanAnatomy(root, body, new THREE.MeshStandardMaterial(), rig); + const meshes = root.children.filter(child => child.isSkinnedMesh); + assert.ok(result.skeleton?.isSkeleton); + assert.ok(meshes.length >= 20); + for (const mesh of meshes) { + const indices = mesh.geometry.getAttribute('skinIndex'); + const weights = mesh.geometry.getAttribute('skinWeight'); + assert.ok(indices && weights, mesh.name); + for (let i = 0; i < weights.count; i++) { + const sum = weights.getX(i) + weights.getY(i) + weights.getZ(i) + weights.getW(i); + assert.ok(Math.abs(sum - 1) < 1e-5, mesh.name + ' weights must normalize'); + } + } +}); + +test('humanoid rig exposes aligned standard bones and both sides', () => { + const rig = buildHumanRig(body); + for (const name of ['Hips', 'Spine', 'Chest', 'UpperChest', 'Neck', 'Head', 'UpperArmL', 'ForearmR', 'HandL', 'UpperLegR', 'LowerLegL', 'FootR', 'ToeL']) { + assert.ok(rig.bones[name], name); + } + const head = rig.bones.Head.getWorldPosition(new THREE.Vector3()); + assert.ok(head.y > .8 && head.y < 1.2); +}); + +test('color palette application preserves independent skin tone', () => { + const state = { skin: '#b97850', cloth: '#fff', hair: '#fff', eyes: '#fff', clothing: { trimColor: '#fff' } }; + applyColorPalette(state, 'atlas'); + assert.equal(state.skin, '#b97850'); + assert.equal(state.cloth, COLOR_PALETTES.atlas.cloth); + assert.ok(createSkinMaterial('#b97850').isMeshPhysicalMaterial); +}); From 6b1cc3e2eda764dc5c823631e50305c88fab71f5 Mon Sep 17 00:00:00 2001 From: H3l!0s_T3k <90980178+Ismail-Benali@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:43:12 +0000 Subject: [PATCH 06/18] feat: bind procedural avatar and facial morphs to rig --- app.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/app.js b/app.js index 3533ceb..428b280 100644 --- a/app.js +++ b/app.js @@ -6,6 +6,7 @@ import { validateGlbArrayBuffer, MAX_GLB_BYTES } from './src/avatar-asset.js'; import { buildBoneRemap } from './src/garment-rig.js'; import { buildHumanAnatomy } from './src/human-anatomy.js'; import { buildHumanRig } from './src/human-rig.js'; +import { createFaceSurface, createNoseSurface } from './src/face-morphs.js'; import { applyColorPalette, createSkinMaterial, createFabricMaterial } from './src/color-system.js'; const wrap=document.getElementById('canvasWrap'); @@ -66,8 +67,8 @@ function build(){ const torso=new THREE.Group();model.add(torso);model.scale.set(1,body.height,1); // Geometry generators consume normalized design values directly; avoid double-scaling the anatomy. torso.scale.set(1,1,1); - buildHumanAnatomy(torso, body, skin); - const humanoidRig=buildHumanRig(body);torso.add(humanoidRig.root);model.userData.humanoidRig=humanoidRig; + const humanoidRig=buildHumanRig(body);torso.add(humanoidRig.root); + buildHumanAnatomy(torso, body, skin, humanoidRig);model.userData.humanoidRig=humanoidRig; const robeHeight=(state.outfit==='modern'?1.13:1.48)*wardrobe.robeLength; if(state.outfit==='modern'){ cylinder(torso,.49*fitScale,.63*fitScale,robeHeight,0,-.42,0,clothMaterial); @@ -93,11 +94,10 @@ function build(){ sphere(torso,side*.59,-.92*wardrobe.sleeveLength,.015,.14,.15,.14,skin); sphere(torso,side*.59,-1.12*wardrobe.sleeveLength,.015,.17,.17,.22,clothMaterial); } - cylinder(model,.17,.18,.28*body.neckLength,0,.52,0,skin); - const head=new THREE.Group();head.position.set(0,1.12+(body.neckLength-1)*.14,0);head.scale.set(body.headScale,body.headScale,body.headScale);model.add(head); + const head=new THREE.Group();head.scale.set(body.headScale,body.headScale,body.headScale);humanoidRig.bones.Head.add(head); const shapeFactor={oval:[1,1],round:[1.08,.94],square:[1.04,.98],heart:[1,.98],long:[.94,1.08]}[face.shape]; const jawFactor={oval:1,round:1.08,square:1.14,heart:.86,long:.94}[face.shape]; - sphere(head,0,0,0,.58*face.width*shapeFactor[0],.72*face.height*shapeFactor[1],.49,skin,56); + head.add(createFaceSurface(face,skin)); sphere(head,0,-.25,.055,.43*face.jawWidth*jawFactor,.34*face.height,.43,skin,48); sphere(head,0,-.46,.12,.22*face.chinWidth,.16,.25,skin,32); // Subtle mandibular and cheek transitions make face silhouettes respond coherently to the selected shape. @@ -125,10 +125,7 @@ function build(){ sphere(head,eyeX,.035,.488,.015,.019,.009,dark,16); } // Nasal bridge, dorsum, tip and alar wings are independently scaled but share one centerline. - sphere(head,0,.015,.435,.042*face.noseWidth,.115*face.noseLength,.052*face.noseBridgeHeight,skin,28); - sphere(head,0,-.095,.485,.052*face.noseWidth,.105*face.noseLength,.065*face.noseBridgeHeight,skin,28); - sphere(head,0,-.17,.525,.068*face.noseWidth,.052*face.noseTip,.065,skin,24); - for(const side of [-1,1])sphere(head,side*.047*face.noseWidth,-.17,.505,.032*face.noseWidth,.026,.035,skin,18); + head.add(createNoseSurface(face,skin)); faceParts.mouth=curve(head,[[-.14,-.29,.43],[0,-.34,.47],[.14,-.29,.43]],mat('#6b302d'),.018); if(state.expression==='neutral'){faceParts.mouth.scale.y=.45} if(state.expression==='surprised'){faceParts.mouth.scale.set(.55,1.8,1)} From 2e03d050a7d539ef410a77849b4eb08497c698a7 Mon Sep 17 00:00:00 2001 From: H3l!0s_T3k <90980178+Ismail-Benali@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:43:41 +0000 Subject: [PATCH 07/18] docs: record skinned anatomy and facial morph milestone --- docs/ROADMAP_EXECUTION.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/ROADMAP_EXECUTION.md b/docs/ROADMAP_EXECUTION.md index 3050d03..fd3ef7f 100644 --- a/docs/ROADMAP_EXECUTION.md +++ b/docs/ROADMAP_EXECUTION.md @@ -13,10 +13,10 @@ - [x] Define versioned body, face, hair, and clothing proportion properties in JSON. - [x] Connect procedural geometry and compatible imported GLB morph/bone targets to design properties. - [ ] Approve stylized visual direction and character proportions. -- [ ] Create production base mesh and rig. +- [x] Implement a procedural skinned humanoid blockout with normalized two-bone weights and a stable rig contract.\n- [ ] Create and approve a production-quality sculpted base mesh and animation-ready production rig. - [x] Expose imported GLB facial morph targets through runtime sliders. - [x] Add runtime facial expression presets for imported blendshape names. -- [ ] Build visual blendshape authoring and calibration tools. +- [x] Add procedural face and nose morph targets for width, height, jaw, cheeks, chin, nose bridge, nose length and tip.\n- [ ] Build visual blendshape authoring and calibration tools. - [ ] Replace placeholder garments with researched modular Moroccan assets. - [x] Play and select animation clips embedded in imported GLB files. - [ ] Add a studio-wide animation state machine and gesture library. @@ -25,7 +25,7 @@ ## Phase 1A — Production asset pipeline - [x] Add a Blender export helper with mandatory provenance metadata. - [x] Add a GLB profile validator for skinned avatars and garments. -- [ ] Produce and license the base human mesh, rig, and facial shape keys. +- [x] Implement an initial procedural weighted rig and runtime facial shape keys.\n- [ ] Produce, license and visually QA a production human mesh, rig and authored facial shape keys. - [ ] Produce modular djellaba, caftan, and takchita assets against the pinned rig. - [ ] Complete garment deformation and clipping QA on the base animation set. From 6512207d007ced685e63610b562d7cf7a4eaac74 Mon Sep 17 00:00:00 2001 From: H3l!0s_T3k <90980178+Ismail-Benali@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:43:43 +0000 Subject: [PATCH 08/18] docs: clarify procedural rig and morph quality gates --- docs/QUALITY_GATES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/QUALITY_GATES.md b/docs/QUALITY_GATES.md index bcdd1d4..85e941d 100644 --- a/docs/QUALITY_GATES.md +++ b/docs/QUALITY_GATES.md @@ -20,4 +20,4 @@ ## Current limitations -The existing geometric model is not a rigged production avatar. Full skeletal animation, facial blendshapes, cloth simulation, authentic garment geometry, automated visual regression, and browser-level E2E tests remain planned work. +The built-in procedural blockout now binds its generated body parts to a stable humanoid skeleton with normalized two-bone weights, and the procedural face/nose surfaces expose runtime morph targets. This is an engineering foundation, not a production-quality sculpted base mesh: production topology, animation deformation QA, authored facial shapes, cloth simulation, authentic garment geometry, automated visual regression, and browser-level E2E tests remain planned work. From 84a60c253347772bf25b0a644a24b3014ea31e66 Mon Sep 17 00:00:00 2001 From: H3l!0s_T3k <90980178+Ismail-Benali@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:43:46 +0000 Subject: [PATCH 09/18] docs: describe weighted humanoid and facial morph engine --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a9fbf77..83d36f4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ **ArCode Persona** is an independent avatar creation platform in the ArCode ecosystem. It is designed to let each person build a customizable digital persona while keeping identity data portable and under the user's control. -> Current status: interactive prototype and engineering foundation. The current character is procedural placeholder geometry, not a production-quality rigged avatar. +> Current status: interactive prototype with a weighted procedural humanoid blockout and procedural facial morph targets. Production sculpted topology, authored assets and animation-quality deformation remain in progress. ## Product direction @@ -85,9 +85,9 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request. ### Human anatomy, rig and color engine - `src/human-proportions.js`: shared proportion solver and anatomical landmarks for shoulder, elbow, wrist, pelvis, knee, ankle and foot placement. -- `src/human-rig.js`: standardized humanoid bone hierarchy (hips, spine, chest, neck, head, clavicles, arms, hands, fingers, legs, feet and toes) for future animation and skin binding. -- `src/human-anatomy.js`: lofted torso surface with smoother ribcage-to-waist-to-pelvis transitions, plus articulated limb blockout. +- `src/human-rig.js`: standardized humanoid bone hierarchy aligned to body landmarks, including spine, neck, head, clavicles, arms, fingers, legs and feet.\n- `src/face-morphs.js`: procedural head and nose surfaces with named relative morph targets and normalized JSON v2 controls. +- `src/human-anatomy.js`: lofted torso and articulated limbs, hands and feet; when passed the humanoid rig, every generated body part receives normalized two-bone skin weights and is bound as a `SkinnedMesh`. - `src/color-system.js`: Moroccan-inspired palettes and physically based skin/fabric material presets. - The face preview now has more deliberate jaw, cheek, ear and nose sub-shapes; all remain stylized procedural geometry. -The bone hierarchy is currently animation-ready metadata, not yet a weighted SkinnedMesh. The preview anatomy remains a blockout; realistic anatomical topology, fingers, muscle definition and deformation require a dedicated production base mesh and skin weights. +The procedural body is now weighted to the humanoid skeleton, and the head/nose use real Three.js morph-target deltas. The result remains a stylized blockout: production anatomical topology, sculpted muscle definition, deformation QA, calibrated facial shapes and finished garment assets still require dedicated art production. From 95168b1440893bf22d282648f6dfed6aafae8899 Mon Sep 17 00:00:00 2001 From: H3l!0s_T3k <90980178+Ismail-Benali@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:44:12 +0000 Subject: [PATCH 10/18] fix: include normal deltas for facial morph targets --- src/face-morphs.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/face-morphs.js b/src/face-morphs.js index 95326ad..1d4d1e4 100644 --- a/src/face-morphs.js +++ b/src/face-morphs.js @@ -9,6 +9,8 @@ function addMorphTargets(geometry, definitions) { const base = geometry.getAttribute('position'); geometry.morphTargetsRelative = true; geometry.morphAttributes.position = []; + geometry.morphAttributes.normal = []; + const baseNormals = geometry.getAttribute('normal'); for (const [name, deltaForVertex] of Object.entries(definitions)) { const delta = new Float32Array(base.count * 3); const vertex = new THREE.Vector3(); @@ -22,7 +24,31 @@ function addMorphTargets(geometry, definitions) { const attribute = new THREE.Float32BufferAttribute(delta, 3); attribute.name = name; geometry.morphAttributes.position.push(attribute); + + const deformedPositions = new Float32Array(base.array.length); + for (let i = 0; i < base.count; i++) { + deformedPositions[i * 3] = base.getX(i) + delta[i * 3]; + deformedPositions[i * 3 + 1] = base.getY(i) + delta[i * 3 + 1]; + deformedPositions[i * 3 + 2] = base.getZ(i) + delta[i * 3 + 2]; + } + const deformed = geometry.clone(); + deformed.morphAttributes = {}; + deformed.setAttribute('position', new THREE.Float32BufferAttribute(deformedPositions, 3)); + deformed.computeVertexNormals(); + const changedNormals = deformed.getAttribute('normal'); + const normalDelta = new Float32Array(baseNormals.count * 3); + for (let i = 0; i < baseNormals.count; i++) { + normalDelta[i * 3] = changedNormals.getX(i) - baseNormals.getX(i); + normalDelta[i * 3 + 1] = changedNormals.getY(i) - baseNormals.getY(i); + normalDelta[i * 3 + 2] = changedNormals.getZ(i) - baseNormals.getZ(i); + } + const normalAttribute = new THREE.Float32BufferAttribute(normalDelta, 3); + normalAttribute.name = name; + geometry.morphAttributes.normal.push(normalAttribute); + deformed.dispose(); } + geometry.computeBoundingBox(); + geometry.computeBoundingSphere(); return geometry; } From 82723c47cf293a2bb2612deb40f153c606078680 Mon Sep 17 00:00:00 2001 From: H3l!0s_T3k <90980178+Ismail-Benali@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:44:16 +0000 Subject: [PATCH 11/18] refactor: remove superseded face scaling factor --- app.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app.js b/app.js index 428b280..daee523 100644 --- a/app.js +++ b/app.js @@ -95,7 +95,6 @@ function build(){ sphere(torso,side*.59,-1.12*wardrobe.sleeveLength,.015,.17,.17,.22,clothMaterial); } const head=new THREE.Group();head.scale.set(body.headScale,body.headScale,body.headScale);humanoidRig.bones.Head.add(head); - const shapeFactor={oval:[1,1],round:[1.08,.94],square:[1.04,.98],heart:[1,.98],long:[.94,1.08]}[face.shape]; const jawFactor={oval:1,round:1.08,square:1.14,heart:.86,long:.94}[face.shape]; head.add(createFaceSurface(face,skin)); sphere(head,0,-.25,.055,.43*face.jawWidth*jawFactor,.34*face.height,.43,skin,48); From 5078770cb0b6c052b9ff0a7ee49e6df907e76310 Mon Sep 17 00:00:00 2001 From: H3l!0s_T3k <90980178+Ismail-Benali@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:44:50 +0000 Subject: [PATCH 12/18] fix: update parent transforms before skin binding --- src/human-anatomy.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/human-anatomy.js b/src/human-anatomy.js index 749c04a..508e54e 100644 --- a/src/human-anatomy.js +++ b/src/human-anatomy.js @@ -98,6 +98,8 @@ function taperedLimb(parent, start, end, r0, r1, material, depth, rig, candidate } export function buildHumanAnatomy(parent, proportions = {}, skinMaterial, rig = null) { + parent.updateWorldMatrix(true, false); + if (rig?.root) rig.root.updateMatrixWorld(true); const p = solveHumanProportions(proportions); const l = p.landmarks; const sx = p.shoulderWidth, dx = p.bodyDepth, wx = p.waistWidth, hx = p.hipWidth, tl = p.torsoLength; From 7da05a8ac7830a4ba9a6ceb2ba2e848335d13367 Mon Sep 17 00:00:00 2001 From: H3l!0s_T3k <90980178+Ismail-Benali@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:44:52 +0000 Subject: [PATCH 13/18] docs: fix roadmap line formatting From 9fb52281f7a675617fb2a51a5bb039d5efe4452b Mon Sep 17 00:00:00 2001 From: H3l!0s_T3k <90980178+Ismail-Benali@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:44:59 +0000 Subject: [PATCH 14/18] docs: fix anatomy engine list formatting From 3c218728b0cbc444f91df82a385f58cbca73cc30 Mon Sep 17 00:00:00 2001 From: H3l!0s_T3k <90980178+Ismail-Benali@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:45:26 +0000 Subject: [PATCH 15/18] test: compare morph weights with numeric tolerance --- test/face-morphs.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/face-morphs.test.js b/test/face-morphs.test.js index 8fe6c20..28c6198 100644 --- a/test/face-morphs.test.js +++ b/test/face-morphs.test.js @@ -11,7 +11,7 @@ test('procedural face exposes named, finite facial morph targets', () => { assert.ok(Number.isFinite(mesh.morphTargetInfluences[mesh.morphTargetDictionary[name]])); } assert.equal(mesh.morphTargetInfluences[mesh.morphTargetDictionary.shapeHeart], 1); - assert.equal(mesh.morphTargetInfluences[mesh.morphTargetDictionary.jawWidth], -.1); + assert.ok(Math.abs(mesh.morphTargetInfluences[mesh.morphTargetDictionary.jawWidth] + .1) < 1e-9); }); test('procedural nose exposes independent bridge, length, width and tip targets', () => { From db1f6610c5552585ae96ef16c6d33375ff325f5a Mon Sep 17 00:00:00 2001 From: H3l!0s_T3k <90980178+Ismail-Benali@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:45:29 +0000 Subject: [PATCH 16/18] test: assert skeleton bone contract --- test/human-anatomy.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/human-anatomy.test.js b/test/human-anatomy.test.js index 25135e9..50816e1 100644 --- a/test/human-anatomy.test.js +++ b/test/human-anatomy.test.js @@ -29,7 +29,7 @@ test('skinned anatomy binds every generated body part to normalized bone weights root.add(rig.root); const result = buildHumanAnatomy(root, body, new THREE.MeshStandardMaterial(), rig); const meshes = root.children.filter(child => child.isSkinnedMesh); - assert.ok(result.skeleton?.isSkeleton); + assert.ok(result.skeleton?.bones?.length > 0); assert.ok(meshes.length >= 20); for (const mesh of meshes) { const indices = mesh.geometry.getAttribute('skinIndex'); From 2624efa02513b278c521b29104b6f419f6a015ac Mon Sep 17 00:00:00 2001 From: H3l!0s_T3k <90980178+Ismail-Benali@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:46:19 +0000 Subject: [PATCH 17/18] docs: normalize README line breaks --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 83d36f4..b5c8b42 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,9 @@ npm run preview | `test/` | Unit tests for the configuration contract | | `docs/TECHNICAL_ARCHITECTURE.md` | System boundaries and rendering architecture | | `docs/MOROCCAN_WARDROBE_CATALOG.md` | Moroccan clothing research and design direction | -| `docs/AVATAR_ASSET_PIPELINE.md` | Production 3D asset authoring and validation pipeline |\n| `tools/blender/export_skinned_asset.py` | Blender GLB exporter with provenance manifest |\n| `tools/validate-avatar-glb.mjs` | GLB rig/morph/animation profile validator | +| `docs/AVATAR_ASSET_PIPELINE.md` | Production 3D asset authoring and validation pipeline | +| `tools/blender/export_skinned_asset.py` | Blender GLB exporter with provenance manifest | +| `tools/validate-avatar-glb.mjs` | GLB rig/morph/animation profile validator | | `docs/PRIVACY_AND_SECURITY.md` | Data handling and future server security principles | | `docs/QUALITY_GATES.md` | CI and release acceptance criteria | | `docs/ROADMAP_EXECUTION.md` | Phased execution plan | @@ -67,7 +69,8 @@ npm run preview - Semantic application of supported design properties to matching GLB morph targets and conventionally named skeleton bones. - Automatic local browser persistence with no account or server storage. - Restore saved looks after reloading the studio. -- Responsive Arabic RTL interface.\n- Blender export helper and GLB production-profile validation for skinned avatars and garments. +- Responsive Arabic RTL interface. +- Blender export helper and GLB production-profile validation for skinned avatars and garments. ## Important limitations @@ -85,7 +88,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request. ### Human anatomy, rig and color engine - `src/human-proportions.js`: shared proportion solver and anatomical landmarks for shoulder, elbow, wrist, pelvis, knee, ankle and foot placement. -- `src/human-rig.js`: standardized humanoid bone hierarchy aligned to body landmarks, including spine, neck, head, clavicles, arms, fingers, legs and feet.\n- `src/face-morphs.js`: procedural head and nose surfaces with named relative morph targets and normalized JSON v2 controls. +- `src/human-rig.js`: standardized humanoid bone hierarchy aligned to body landmarks, including spine, neck, head, clavicles, arms, fingers, legs and feet. +- `src/face-morphs.js`: procedural head and nose surfaces with named relative morph targets and normalized JSON v2 controls. - `src/human-anatomy.js`: lofted torso and articulated limbs, hands and feet; when passed the humanoid rig, every generated body part receives normalized two-bone skin weights and is bound as a `SkinnedMesh`. - `src/color-system.js`: Moroccan-inspired palettes and physically based skin/fabric material presets. - The face preview now has more deliberate jaw, cheek, ear and nose sub-shapes; all remain stylized procedural geometry. From 523e1c05cdef36ca875e2a051d5c0b5581ca0933 Mon Sep 17 00:00:00 2001 From: H3l!0s_T3k <90980178+Ismail-Benali@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:46:25 +0000 Subject: [PATCH 18/18] docs: normalize roadmap line breaks --- docs/ROADMAP_EXECUTION.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/ROADMAP_EXECUTION.md b/docs/ROADMAP_EXECUTION.md index fd3ef7f..02e7f65 100644 --- a/docs/ROADMAP_EXECUTION.md +++ b/docs/ROADMAP_EXECUTION.md @@ -13,10 +13,12 @@ - [x] Define versioned body, face, hair, and clothing proportion properties in JSON. - [x] Connect procedural geometry and compatible imported GLB morph/bone targets to design properties. - [ ] Approve stylized visual direction and character proportions. -- [x] Implement a procedural skinned humanoid blockout with normalized two-bone weights and a stable rig contract.\n- [ ] Create and approve a production-quality sculpted base mesh and animation-ready production rig. +- [x] Implement a procedural skinned humanoid blockout with normalized two-bone weights and a stable rig contract. +- [ ] Create and approve a production-quality sculpted base mesh and animation-ready production rig. - [x] Expose imported GLB facial morph targets through runtime sliders. - [x] Add runtime facial expression presets for imported blendshape names. -- [x] Add procedural face and nose morph targets for width, height, jaw, cheeks, chin, nose bridge, nose length and tip.\n- [ ] Build visual blendshape authoring and calibration tools. +- [x] Add procedural face and nose morph targets for width, height, jaw, cheeks, chin, nose bridge, nose length and tip. +- [ ] Build visual blendshape authoring and calibration tools. - [ ] Replace placeholder garments with researched modular Moroccan assets. - [x] Play and select animation clips embedded in imported GLB files. - [ ] Add a studio-wide animation state machine and gesture library. @@ -25,7 +27,8 @@ ## Phase 1A — Production asset pipeline - [x] Add a Blender export helper with mandatory provenance metadata. - [x] Add a GLB profile validator for skinned avatars and garments. -- [x] Implement an initial procedural weighted rig and runtime facial shape keys.\n- [ ] Produce, license and visually QA a production human mesh, rig and authored facial shape keys. +- [x] Implement an initial procedural weighted rig and runtime facial shape keys. +- [ ] Produce, license and visually QA a production human mesh, rig and authored facial shape keys. - [ ] Produce modular djellaba, caftan, and takchita assets against the pinned rig. - [ ] Complete garment deformation and clipping QA on the base animation set.