{
 "id": "isotropic-remeshing",
 "title": "Isotropic Remeshing",
 "aliases": [],
 "domain": "geometry",
 "subdomain": "remeshing",
 "stage": "geometry",
 "realtime": "interactive",
 "platforms": [
  "cpu",
  "blender"
 ],
 "year_introduced": 2004,
 "inputs": [
  "mesh"
 ],
 "outputs": [
  "mesh"
 ],
 "style": "both",
 "dynamic": "static",
 "summary": "Iteratively splits long edges, collapses short ones, flips edges toward valence six and relaxes vertices tangentially, driving a triangle mesh to near-equilateral triangles of a target edge length.",
 "how_it_works": "Pick a target edge length L. Then loop: (1) split every edge longer than 4/3 L at its midpoint; (2) collapse every edge shorter than 4/5 L, unless that makes a longer edge; (3) flip edges when doing so reduces total deviation of vertex valence from six (four on the boundary); (4) move each vertex a step toward the centroid of its neighbours, projected onto the tangent plane; (5) reproject vertices back onto the original surface so the shape does not drift. A few iterations suffice. Feature edges and boundaries are pinned or only moved along their curve. Adaptive variants make L depend on curvature.",
 "when_to_use": "Choose it before simulation, smoothing, sculpting or parametrization when you need triangles of even size and shape, for example to fix marching-cubes slivers. Prefer `qem-mesh-simplification` when only fewer triangles matter, `instant-meshes` or `quadriflow` when you want a quad mesh with aligned edge flow.",
 "cost": {
  "class": "offline",
  "notes": "Several passes over the mesh with a spatial structure for reprojection; seconds for hundreds of thousands of triangles on CPU."
 },
 "failure_modes": [
  "Sharp features blur or get eaten unless feature edges are detected and constrained",
  "Tangential relaxation can drift thin structures without proper reprojection",
  "Does not respect existing UVs; seams must be pinned",
  "A uniform target length wastes triangles on flat areas and under-resolves fine details"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1145/1057432.1057457",
   "type": "paper",
   "title": "A remeshing approach to multiresolution modeling",
   "authors": [
    "Mario Botsch",
    "Leif Kobbelt"
   ],
   "year": 2004,
   "venue": "Proceedings of the 2004 Eurographics/ACM SIGGRAPH symposium on Geometry processing",
   "url": "https://doi.org/10.1145/1057432.1057457",
   "ids": {
    "doi": "10.1145/1057432.1057457"
   },
   "license": null,
   "extra": {
    "csl_type": "proceedings-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1057432.1057457",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1057432.1057457",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1057432.1057457",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1057432.1057457",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1057432.1057457",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "botsch2004remeshing"
  },
  {
   "role": "implementation",
   "key": "gh:pmp-library/pmp-library",
   "type": "code",
   "title": "pmp-library/pmp-library",
   "description": "The Polygon Mesh Processing Library",
   "authors": [
    "pmp-library"
   ],
   "year": 2017,
   "venue": "GitHub",
   "url": "https://github.com/pmp-library/pmp-library",
   "ids": {
    "repo": "pmp-library/pmp-library"
   },
   "license": "MIT",
   "extra": {
    "stars": 1515,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2026-11-21T11:04:24Z",
    "language": "C++",
    "homepage": "https://www.pmp-library.org",
    "license_name": "MIT License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/pmp-library/pmp-library",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/pmp-library/pmp-library",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/pmp-library/pmp-library",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/pmp-library/pmp-library",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/pmp-library/pmp-library",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/pmp-library/pmp-library",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "pmplibrary2017library"
  }
 ],
 "presets": [
  {
   "id": "isotropic-remeshing-live",
   "title": "Isotropic Remeshing — skinny stretched triangles (left) vs uniform equilateral valence-6 mesh (right)",
   "runtime": "glsl-fragment",
   "params": {
    "P_TARGET_EDGE": 11,
    "P_WIRE_VIS": 1,
    "P_ROT_SPEED": 0.7,
    "P_SPLIT": 0.48
   },
   "basis": "original",
   "license_note": "MIT — written for this index.",
   "code": "const float P_TARGET_EDGE = 11.0; // P Target Edge Inv [6.0, 20.0, 1.0]\nconst float P_WIRE_VIS = 1.0; // P Wire Contrast [0.2, 1.5, 0.05]\nconst float P_ROT_SPEED = 0.70; // P Spin Speed [0.0, 2.2, 0.05]\nconst float P_SPLIT = 0.48; // P Skinny / Isotropic [0.0, 1.0, 0.02]\n\nmat2 rot2(float a) { float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }\n\nfloat sdTorus(vec3 p, vec2 t) {\n  vec2 q = vec2(length(p.xz) - t.x, p.y);\n  return length(q) - t.y;\n}\n\n// Sculpted saddle torus-peanut manifold where naive UV triangulation creates extreme aspect-ratio slivers\nfloat mapManifold(vec3 p, float spin) {\n  vec3 q = p;\n  q.xz = rot2(spin * 0.55) * q.xz;\n  q.xy = rot2(0.52) * q.xy;\n  float dTor = sdTorus(q, vec2(0.54, 0.25 + 0.04 * sin(atan(q.z, q.x) * 3.0)));\n  return dTor * 0.85;\n}\n\nvec3 calcNormal(vec3 p, float spin) {\n  vec2 e = vec2(0.0020, 0.0);\n  return normalize(vec3(\n    mapManifold(p + e.xyy, spin) - mapManifold(p - e.xyy, spin),\n    mapManifold(p + e.yxy, spin) - mapManifold(p - e.yxy, spin),\n    mapManifold(p + e.yyx, spin) - mapManifold(p - e.yyx, spin)\n  ));\n}\n\n// Equilateral triangular lattice wireframe in 2D tangent space (valence-6 uniform triangles!)\nfloat equilateralWire(vec2 p) {\n  // Skew into 60-degree simplex lattice\n  vec2 q = vec2(p.x - p.y * 0.57735027, p.y * 1.15470054);\n  vec2 f = fract(q);\n  float d1 = min(f.x, 1.0 - f.x);\n  float d2 = min(f.y, 1.0 - f.y);\n  float d3 = abs(f.x + f.y - 1.0) * 0.7071;\n  return smoothstep(0.055, 0.012, min(min(d1, d2), d3));\n}\n\nvec3 aces(vec3 x) {\n  x = max(x, 0.0);\n  return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);\n}\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;\n  float screenX = fragCoord.x / max(iResolution.x, 1.0);\n  float split = clamp(P_SPLIT, 0.0, 1.0);\n  bool isIso = screenX >= split;\n  float freq = clamp(floor(P_TARGET_EDGE + 0.5), 6.0, 22.0);\n  float wireVis = clamp(P_WIRE_VIS, 0.1, 1.5);\n  float spin = iTime * max(P_ROT_SPEED, 0.0);\n\n  vec3 ro = vec3(0.0, 0.04, 2.38);\n  vec3 rd = normalize(vec3(uv, -1.55));\n\n  vec3 col = mix(vec3(0.025, 0.035, 0.058), vec3(0.072, 0.092, 0.140), smoothstep(-0.55, 0.55, uv.y));\n\n  float t = 0.0;\n  bool hit = false;\n  for (int i = 0; i < 64; i++) {\n    float d = mapManifold(ro + rd * t, spin);\n    if (d < 0.002) { hit = true; break; }\n    t += d;\n    if (t > 7.5) break;\n  }\n\n  if (hit) {\n    vec3 p = ro + rd * t;\n    vec3 n = calcNormal(p, spin);\n\n    vec3 objP = p;\n    objP.xz = rot2(spin * 0.55) * objP.xz;\n    objP.xy = rot2(0.52) * objP.xy;\n\n    // Toroidal angles (u around major circle, v around minor tube)\n    float uAng = atan(objP.z, objP.x);\n    float rMaj = length(objP.xz) - 0.54;\n    float vAng = atan(objP.y, rMaj);\n\n    vec3 l1 = normalize(vec3(0.58, 0.82, 0.54));\n    vec3 l2 = normalize(vec3(-0.72, -0.22, 0.50));\n    float diff = max(dot(n, l1), 0.0) * 0.85 + max(dot(n, l2), 0.0) * 0.25;\n    float spec = pow(max(dot(n, normalize(l1 - rd)), 0.0), 48.0);\n\n    if (!isIso) {\n      // Left: Raw non-uniform mesh with skinny stretched sliver triangles (aspect ratio > 4:1)\n      vec2 stretched = vec2(uAng * 0.85 * freq / 3.1415926 + sin(vAng * 2.0) * 0.45, vAng * 3.8 * freq / 6.2831853);\n      // Irregular vertex jitter creating pinched high-valence hubs & thin slivers\n      stretched.x += 0.35 * sin(vAng * 5.0 + uAng * 2.0);\n      float wireBad = equilateralWire(stretched);\n      float badQuality = clamp(0.45 + 0.55 * abs(sin(uAng * 2.0 + vAng * 3.0)), 0.0, 1.0);\n      vec3 qualityCol = mix(vec3(0.92, 0.58, 0.18), vec3(0.94, 0.24, 0.20), badQuality);\n      col = qualityCol * (0.28 + 0.82 * diff) + vec3(0.95) * spec * 0.40;\n      col = mix(col, vec3(0.14, 0.04, 0.04), wireBad * 0.78 * min(wireVis, 1.2));\n    } else {\n      // Right: Isotropic remeshing (arc-length scaled equal-edge equilateral triangles, valence-6!)\n      // Arc-length around major circle ~ 2*pi*0.54, around tube ~ 2*pi*0.25 => exact 2.16:1 ratio!\n      vec2 isoCoord = vec2(uAng * (freq * 2.16) / 6.2831853, vAng * freq / 6.2831853);\n      float wireIso = equilateralWire(isoCoord);\n      vec3 goodCol = vec3(0.16, 0.78, 0.68);\n      col = goodCol * (0.28 + 0.82 * diff) + vec3(0.95) * spec * 0.50;\n      col = mix(col, vec3(0.03, 0.12, 0.14), wireIso * 0.72 * min(wireVis, 1.2));\n    }\n  }\n\n  float sep = smoothstep(0.0035, 0.0008, abs(screenX - split));\n  col = mix(col, vec3(0.95, 0.97, 1.0), sep);\n\n  fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);\n}",
   "execution_fidelity": "conceptual-diagram",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-30",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "isotropic-remeshing",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-30T19:53:28.000Z",
     "renderer": "Headless EGL Tesla T4/PCIe/SSE2, OpenGL 3.30 Core, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.431,
      "std": 0.1929,
      "min": 0.1858,
      "max": 0.9035
     },
     "image": "/specimens/isotropic-remeshing-live.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "qem-mesh-simplification",
  "instant-meshes",
  "quadriflow"
 ],
 "extends": [],
 "supersedes": [],
 "combines_with": [
  {
   "id": "three-mesh-bvh",
   "why": "A BVH accelerates the closest-point reprojection back onto the source surface."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/geometry/isotropic-remeshing.json"
 },
 "solves": [
  "marching cubes output has thin sliver triangles",
  "mesh triangles vary wildly in size",
  "simulation blows up on badly shaped triangles",
  "need even triangle size before sculpting or smoothing",
  "want near-equilateral triangles at a target edge length"
 ],
 "authority": "Botsch & Kobbelt, 2004",
 "url": "https://texelatlas.vercel.app/t/isotropic-remeshing/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 19.39,
  "tier": "moderate",
  "p50_ms": 0.601,
  "p95_ms": 0.6377,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 36,
  "preset_id": "isotropic-remeshing-live",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 15.89,
   "tier": "moderate",
   "p50_ms": 0.2527,
   "p95_ms": 0.2641,
   "speedup_x": 2.38,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 11.47,
   "tier": "moderate",
   "p50_ms": 0.3304,
   "p95_ms": 0.334,
   "speedup_x": 1.82,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}