threejs-procedural-geometry

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Procedural Geometry

程序化几何

Generate geometry from a semantic contract and explicit coordinate frame. Treat polygon operations as the design model and triangle emission as the final compilation step. Do not declare an object complete until its topology, assembly relationships, semantic measurements, and fixed views all pass.
基于语义约定和明确坐标系生成几何。将多边形操作视为设计模型,将三角形输出视为最终编译步骤。只有当拓扑结构、装配关系、语义测量和固定视角全部验证通过后,才能判定对象构建完成。

Craft loop

制作流程

  1. Define units, local/world frames, dimensions, bounds, primary profiles, topology intent, shell thickness, apertures, material slots, and triangle band.
  2. Declare every required contact, support, clearance, penetration, reveal, moving envelope, and interaction datum.
  3. Choose a modeling operation for each visible form: profile extrusion, inset, loft, revolve, sweep, direct-topology aperture, solidify, subdivision, bevel, or fillet.
  4. Keep quads and n-gons through design. Preserve one named mesh per semantic part; do not weld unrelated parts or merge material slots yet.
  5. Apply modifiers in a deliberate order, then clean inside each part, repair winding, assign a part-specific smooth angle, and emit triangles.
  6. Run the polygon topology gate, then audit the named world assembly for coplanar overlap, defects, and substantial solid clashes.
  7. Run builder-owned semantic checks, including support, openings, shell thickness samples, ergonomic clearances, and moving extrema.
  8. Merge by material slot, audit again, and inspect fixed silhouettes, hidden sides, joints, interaction views, wireframe, normals, and grazing light.
  1. 定义单位、局部/世界坐标系、尺寸、边界、主轮廓、拓扑意图、壳体厚度、开孔、材质插槽和三角带。
  2. 声明所有必需的接触、支撑、间隙、穿透、外露范围、运动包络和交互基准。
  3. 为每个可见形态选择建模操作:轮廓挤出、内凹、放样、旋转、扫掠、直接拓扑开孔、实体化、细分、倒角或圆角。
  4. 在设计过程中保留四边形和N边形。为每个语义部件保留一个命名网格;暂不焊接无关部件或合并材质插槽。
  5. 按指定顺序应用修改器,然后清理每个部件内部、修复缠绕顺序、分配部件专属平滑角度并输出三角形。
  6. 运行多边形拓扑检查,然后审核命名世界装配体的共面重叠、缺陷和严重实体冲突。
  7. 运行构建器专属的语义检查,包括支撑、开口、壳体厚度采样、人机工程学间隙和运动极值。
  8. 按材质插槽合并,再次审核,并检查固定轮廓、隐藏面、接缝、交互视图、线框、法线和掠射光效果。

Modeling bar

建模规范

  • Use primitives only for genuinely primitive or hidden structural parts.
  • Give every visible manufactured edge a scale-appropriate bevel or fillet.
  • Build openings into one closed shell; do not stack a dark plane over a solid.
  • Construct thick shells with paired profiles or
    solidify
    ; never rely on a single surface where an exposed rim reveals thickness.
  • Drive mating parts from the same datum. A late visual nudge is a failed dimension contract.
  • Choose a continuous mesh for a continuous manufactured form. An arrangement of intersecting primitives is not a substitute for modeling.
  • Keep narrow, named allowances only for intersections that are structurally intentional.
Read references/geometry-craft-workflow.md for the polygon-first modeling grammar, modifier order, join floors, detail budgets, fixed visual-review contract, and geometry-craft failure diagnosis.
Read references/geometry-quality-gates.md for exact topology, coplanar, solid-clash, semantic, support, clearance, motion-envelope, and visual gates with metre-scale tolerances.
  • 仅将基础几何体用于真正基础或隐藏的结构部件。
  • 为每个可见的加工边缘添加符合比例的倒角或圆角。
  • 在单个闭合壳体中构建开口;不要在实体上叠加深色平面模拟开孔。
  • 使用配对轮廓或
    solidify
    构建厚壳体;当外露边缘会显示厚度时,绝不要依赖单一表面。
  • 从同一基准驱动配合部件。后期视觉微调意味着尺寸约定失效。
  • 为连续加工形态构建连续网格。相交基础几何体的组合不能替代建模。
  • 仅为结构上有意的相交保留窄幅命名余量。
阅读references/geometry-craft-workflow.md 了解多边形优先建模语法、修改器顺序、合并规则、细节预算、固定视觉评审约定和几何制作故障诊断方法。
阅读references/geometry-quality-gates.md 了解精确拓扑、共面、实体冲突、语义、支撑、间隙、运动包络和视觉检查的米级公差标准。

Portable JavaScript kit

可移植JavaScript工具包

Place the complete
assets/geometry-quality-kit/
directory into a Three.js project when the project lacks an equivalent modeling and quality layer. Adjust import paths and scene plumbing as needed; preserve the geometry and audit contracts.
  • procedural-mesh.js provides
    MeshData
    , polygon cleanup, winding reconstruction, profiles, offsets, extrusion, loft, revolve, sweeps, solidify, subdivision, bevels, apertures, smooth-angle normals, material-slot builds, and Three.js emission.
  • mesh-topology-audit.js checks loose/duplicate vertices, degenerates, open/non-manifold edges, detached components, signed volume, and emitted positions/normals.
  • geometry-audit.js audits a built
    Object3D
    hierarchy for true clipped coplanar overlap, invalid mesh data, missing materials, and substantial triangle-crossing clashes.
  • geometry-contract.js runs object-specific measurements without imposing project-specific shape semantics.
  • assembly.js preserves named parts for auditing, then builds one draw mesh per material slot after gates pass.
  • selftest.js plants known defects and verifies the modeling, topology, contract, assembly, z-fight, and clash paths; run it after placing or adapting the kit.
当Three.js项目缺少等效的建模和质量层时,将完整的
assets/geometry-quality-kit/
目录放入项目中。根据需要调整导入路径和场景管线;保留几何和审计约定。
  • procedural-mesh.js 提供
    MeshData
    、多边形清理、缠绕重建、轮廓、偏移、挤出、放样、旋转、扫掠、实体化、细分、倒角、开孔、平滑角度法线、材质插槽构建和Three.js输出功能。
  • mesh-topology-audit.js 检查松散/重复顶点、退化面、开放/非流形边、分离组件、有符号体积以及输出的位置/法线。
  • geometry-audit.js 审核已构建的
    Object3D
    层级结构,检查真实裁剪共面重叠、无效网格数据、缺失材质和严重三角交叉冲突。
  • geometry-contract.js 运行对象专属测量,无需强加项目专属形状语义。
  • assembly.js 保留命名部件用于审核,在检查通过后按材质插槽构建单个绘制网格。
  • selftest.js 植入已知缺陷并验证建模、拓扑、约定、装配、Z轴冲突和冲突检测流程;放置或适配工具包后运行此脚本。

Mechanism references and implementations

机制参考与实现

Read references/profile-sweeps-and-mesh-writers.md for the exact sculpted-frame profile, rail emission, tree rings, semantic mesh writer, and their observed scaling limits.
Read the sculpted gallery frame geometry for profile sweeps, miter-like rail mapping, deliberate cap ownership, PBR surface bundles, grazing highlights, selective bloom, and geometry diagnostics.
Read references/complete-submarine-assembly.md for the exact dimensioned object contract, shared loft/sweep kernel, UV-owned apertures, semantic subassemblies, generated fittings, and model diagnostics.
Read the porcelain-and-brass submarine model for a complete assembly with a tilted-collar hull loft, parallel-transport trim, furnished glass cabin, shrouded propeller, lens-section fins, and per-part triangle evidence.
Read references/vehicle-loft-and-projector-contract.md for parameter-curve section tracks, recess-opening sections, superellipse volumes, spanwise airfoil lofts, warped plates, projector ownership, load-deflected tyres, and measured limits.
Read the Formula One race car model for one continuous body loft, section-owned cockpit recess, real inlet aperture, spanwise wing lofts, livery projection, and contact-deflected tyres.
Read the sport motorcycle model for slot-tagged emission, revolve and upright-frame sweeps, offset panel shells, spoked wheels, a hanging chain path, and a volume-audited assembly.
Read references/procedural-optimus-humanoid-assembly.md for the exact coordinate, polygon/modifier, curve, loft, spine, pillow, CSG, bevel, semantic assembly, filtered material, emission, limitation, and diagnostic contracts of a complete human-scale robot.
Read the procedural Optimus humanoid entry and its complete geometry and material system for a 176-object torso/head/arm/hand/hip/leg/foot assembly with five-finger hands, 891,809 emitted triangles, fourteen PBR identities, exact polygon cuts, angle-limited bevels, split corner normals, and derivative-filtered object-space roughness and bump.
Read the procedural financial tower compiler for semantic placement compilation and material-slot instancing at building scale.
阅读references/profile-sweeps-and-mesh-writers.md 了解精确雕刻框架轮廓、轨道输出、年轮效果、语义网格生成器及其观测到的缩放限制。
查看 雕刻画廊框架几何 了解轮廓扫掠、类似斜接的轨道映射、明确的顶盖归属、PBR表面束、掠射高光、选择性 bloom 和几何诊断。
查看 references/complete-submarine-assembly.md 了解精确尺寸化对象约定、共享放样/扫掠内核、UV归属开孔、语义子装配体、生成配件和模型诊断。
查看 瓷铜潜艇模型 了解完整装配体,包括倾斜环船体放样、平行传输装饰、带内饰玻璃舱、包覆式螺旋桨、透镜截面鳍片和逐部件三角证据。
查看 references/vehicle-loft-and-projector-contract.md 了解参数曲线截面轨迹、凹槽开口截面、超椭圆体积、翼展方向翼型放样、翘曲板、投影归属、载荷偏转轮胎和测量限制。
查看 一级方程式赛车模型 了解连续车身放样、截面归属驾驶舱凹槽、真实进气开孔、翼展方向机翼放样、涂装投影和接触偏转轮胎。
查看 运动摩托车模型 了解插槽标记输出、旋转和直立框架扫掠、偏移面板壳体、辐条轮、悬挂链条路径和体积审核装配体。
查看 references/procedural-optimus-humanoid-assembly.md 了解完整人形机器人的精确坐标、多边形/修改器、曲线、放样、脊柱、枕形、CSG、倒角、语义装配体、过滤材质、输出、限制和诊断约定。
查看 程序化Optimus人形机器人示例 及其完整的 几何与材质系统 了解包含176个对象的躯干/头部/手臂/手/髋部/腿/脚装配体,带有五指手、891,809个输出三角形、14种PBR属性、精确多边形切割、角度限制倒角、拆分角落法线和导数过滤的对象空间粗糙度与凹凸效果。
查看 程序化金融塔楼编译器 了解建筑尺度下的语义放置编译和材质插槽实例化。

Failure conditions

失败场景

  • same-facing coplanar triangles survive at a visible scale;
  • a loose vertex, degenerate face, open solid, non-manifold edge, detached component, invalid normal, or inward closed volume reaches emission;
  • substantial unrelated solids intersect, or a placed part lacks a declared support/contact relationship;
  • an exposed shell is paper-thin or an aperture is a visual overlay;
  • a visible primitive keeps razor edges or joins another primitive without a designed transition;
  • profile frames flip, caps share smooth side normals, or UV density changes with segment count;
  • material merging happens before named-part auditing;
  • triangle count is the only complexity evidence;
  • a script passes but fixed-view inspection still finds implausible modeling.
  • a complete humanoid is reduced to intersecting capsules and boxes;
  • mirrored hands or limbs keep inward winding;
  • high-frequency object-space material noise is emitted without footprint filtering.
  • 同向共面三角形在可见尺度下未被清除;
  • 松散顶点、退化面、开放实体、非流形边、分离组件、无效法线或向内闭合体积被输出;
  • 无关实体严重相交,或放置的部件缺少声明的支撑/接触关系;
  • 外露壳体薄如纸张,或开孔仅为视觉叠加层;
  • 可见基础几何体保留锐利边缘,或未通过设计过渡连接其他基础几何体;
  • 轮廓框架翻转、顶盖共享平滑面法线,或UV密度随段数变化;
  • 材质合并在命名部件审核前进行;
  • 仅以三角形数量作为复杂度依据;
  • 脚本通过但固定视角检查仍发现不合理建模;
  • 完整人形机器人被简化为相交胶囊体和立方体;
  • 镜像手或肢体保留向内缠绕顺序;
  • 输出高频对象空间材质噪声但未进行足迹过滤。

Routing boundary

职责边界

This skill owns reusable mesh construction and geometry quality. Use
$threejs-procedural-materials
when surface identity is primary,
$threejs-procedural-architecture
for a building grammar, and
$threejs-procedural-vegetation
for a growth hierarchy; those subject skills may then apply these geometry mechanisms.
本技能负责可复用网格构建和几何质量保障。当表面属性为核心需求时使用
$threejs-procedural-materials
,建筑语法使用
$threejs-procedural-architecture
,生长层级使用
$threejs-procedural-vegetation
;这些专项技能可应用本几何机制。