makepad/libs/model/CONSTRUCTION_API.md
Admin d2130e6550 libs: model, mesh_edit, csg, scene, sim, render, xr
Squash of 25 work commits (Sep 1–12):
  237da90  render: the sprite lane hands the screen draw back the way it found it
  895b9a7  particles: an emitter can ride a body's own frame
  914471f  ai-hub: a feed session whose last socket left ends on its idle timeout; skin: parent, skinned centroid and a nodes-only rig for retargets
  3fcccf3  sim: the whole world is implicitly editable, and one seam says where the ground is
  5692fab  sim: the landform world proves itself — walker through the tunnel included
  f4af6df  sim: terrain knows who changed it — a plan layer over player history
  adbb078  render: a water volume can be physics without a picture
  c17480f  render: a non-rigid body may carry its own orientation
  acad401  sim: an agent with no route holds and retries instead of walking into the wall
  22b2bf9  sim + chat: the composed world surface takes a map floor; the chat gets plan tools
  faf8112  web path: the tessellator's lap timer, the trace span and the fusion cycle timer have no clock on the web
  d3472eb  tsdf: the clock-taking XR helpers are native-only — the browser has no depth camera and no Instant
  4946c9e  sim + render: a repaint is not a world edit — colour and glow restyles never rebake the lightmap
  4317f58  sim + render + chat: walk decks as a surface, the filmed body is no obstruction, the brief never asks
  9791279  render: support rigged models and custom materials across viewers
  3ce2792  sim: use deck geometry for collision and sensing
  c8b79ff  Add portable PBR, rig and soft-body authoring support
  108d423  Add transactional polygon modeling and editable asset documents
  38f4d3b  Refine editable modeling and firm yarn character behavior
  08a2637  sim: add entity-owned lights and vehicle headlights
  00d96a7  render: add clustered lights, local shadows and incremental GI
  cf916af  render: import glTF asset extensions and wire clustered GI
  c6d2cca  model: cut transaction memory and raise capacity limits
  41af47a  raytrace: add a CPU probe-ray BVH budget example
  c963d0a  libs: the game sim splits into makepad-scene and makepad-soft-body; render, model, fab and the asset importer retarget

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-15 13:40:31 +02:00

64 lines
4.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Mesh construction operations
Construction commands create a new object and keep input objects intact:
| op | Additional fields |
|---|---|
| sphere | `radius`, `segments: 3–128`, `rings: 2–128`, `smooth?: boolean` (default true); radial normals across UV seams, including poles |
| cylinder | `radius`, `height`, `segments: 3–128`, `smooth?: boolean` (default true); centered on Y, radial side normals, flat caps with a hard rim |
| sweep | `profile: XY[]` (3–128), `path: XYZ[]` (2–128), `caps`, `material`; transported local frames |
| lathe | `profile: [radius,height][]` (2–128), `axis`, `segments: 3–128`, `caps`, `material`; zero-radius endpoint poles supported |
| loft | `profiles: XYZ[][]` (2–128 equal-size rings), `closed`, `caps`, `material` |
| quad_strip | `a: XYZ[]`, `b: XYZ[]` (equal length 2–4096), `closed`, `material` |
| boolean | `a`, `b`, `mode: union/difference/intersection`; closed manifold inputs, bounded candidate pairs, unambiguous source-triangle UV/material/normal transfer |
| voxel_remesh | `source`, `resolution: 8/16/32`; bounded FaithC reconstruction with nearest-surface UV/material/weight reprojection |
Boolean and voxel inputs are transformed by their complete scene-node world
matrices (including parents); the new output object has an identity frame.
Input geometry and nodes stay unchanged. Make linked sources unique and apply
enabled modifiers before these direct construction commands.
Boolean and voxel operations refuse seam/crease/pin constraints they cannot map.
Booleans also refuse weighted intersection geometry; new intersections do not
have a unique rigging interpretation. Existing CSG/FaithC phases run sequentially
on the worker; cancellation is checked before/after those bounded phases, and
CSG inherits an installed cancellation token. Topology-changing output receives
new identities in the new object's scope. Local manifold validation does not
certify that arbitrary inputs or deformed shells have no global intersections.
Sphere/cylinder `smooth:false` selects faceted polygon shading. Smooth shading
does not increase geometry density or round a coarse silhouette. Existing
saved sources keep their stored normals. Sweep/lathe/loft and custom polygon
meshes can use a subsequent `normals` operation to derive smooth shading with
an explicit crease angle; see [Mesh editing operations](MESH_API.md).
For a glossy surface, author a low `surface_material.roughness` along with the
desired color and metallic factor; see [Surface authoring](SURFACE_API.md).
This uses the existing PBR path and does not require image generation.
## Surface fibers
For a short fur coat or fine fuzz, prefer `surface_material.fur` from
[Surface authoring](SURFACE_API.md). It keeps the base mesh and uses bounded
shader shells. Use the geometry operation below when individual modeled
strands are intentional; its output contributes to GLB size, topology checks,
skinning and triangle cost.
`fiber_shell {object,source,count,length,width,seed,material}` creates a new
mesh of tapered closed fibers sampled by source triangle area. Counts1–32768,
length0.0001–1m, width0.00001–0.1m and at most half the length, u32 seed;
source input uses the document triangle/work budgets. Geometry, normals, root UV/color sampling
and inherited skin weights are deterministic. Fibers use source mesh coordinates;
copy its object transform to the new object when required. `length:0.012`,
`width:0.0006`, `count:1400` is a starting yarn-ball surface. This creates
ordinary geometry, not a volumetric fur shader or a strand physics simulation.
For soft bodies pass the separate mesh in `deform_objects`; only the main body
supplies contact samples. Source is preserved. Context work/byte/topology budgets
apply before allocation; seed changes intentionally create a different surface.
Each bent fiber is admitted against conservative capsules covering both of its
segments, including its embedded root cap. A spatial grid limits nearby
comparisons. Generation tries at most64 candidates per requested fiber and
refuses with an explicit packing-budget error if the requested count cannot
fit; it never silently returns fewer fibers. This keeps distinct fibers apart
in the authored rest mesh. The root still overlaps the source surface by
design, and subsequent deformation does not simulate strand self-collision.