chore: checkpoint web Blender migration source, tools and docs
Accumulated uncommitted work: GHOST Web backend, WebGL/GPU web layer, web workflow engine and protocol, tooling, docs and task records. Large generated evidence, user-testing archives, build snapshots and imported test assets remain untracked. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
9
web/protocol/uv-pack-target.ts
Normal file
9
web/protocol/uv-pack-target.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export interface NativeUVPackTarget { tile:number; tiled:boolean; cursor:[number,number]; grid:[number,number] }
|
||||
export function parseNativeUVPackTarget(value:unknown):NativeUVPackTarget {
|
||||
if(!value||typeof value!=='object'||Array.isArray(value))throw new Error('UV 活动目标无效');
|
||||
const target=value as Record<string,unknown>;
|
||||
if(!Number.isSafeInteger(target.tile)||Number(target.tile)<1001||Number(target.tile)>2147483647||typeof target.tiled!=='boolean')throw new Error('UV 目标瓦片无效');
|
||||
if(!Array.isArray(target.cursor)||target.cursor.length!==2||target.cursor.some(n=>typeof n!=='number'||!Number.isFinite(n)))throw new Error('UV 游标无效');
|
||||
if(!Array.isArray(target.grid)||target.grid.length!==2||target.grid.some((n,i)=>!Number.isInteger(n)||n<1||n>(i===0?10:100)))throw new Error('UV 网格无效');
|
||||
return {tile:Number(target.tile),tiled:target.tiled,cursor:[...target.cursor] as [number,number],grid:[...target.grid] as [number,number]};
|
||||
}
|
||||
Reference in New Issue
Block a user