{"id":7277,"date":"2026-09-10T15:23:49","date_gmt":"2026-09-10T07:23:49","guid":{"rendered":"https:\/\/yunbroidery.com\/?page_id=7277"},"modified":"2026-10-01T16:11:42","modified_gmt":"2026-10-01T08:11:42","slug":"case-study-canvas-018","status":"publish","type":"page","link":"https:\/\/yunbroidery.com\/en\/case-study-canvas-018\/","title":{"rendered":"Case Study: Canvas-018"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Case Study: Canvas-018<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">Yunbroidery Stitch Algorithm Syntax Card<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Module 1: Metadata Table<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Parameter<\/strong><\/td><td><strong>Specification<\/strong><\/td><\/tr><tr><td><strong>Archive ID<\/strong><\/td><td>Canvas-018<\/td><\/tr><tr><td><strong>Perceptual Image<\/strong><\/td><td>Good Friends<\/td><\/tr><tr><td><strong>Basic Structure<\/strong><\/td><td>2-3-3-2 unit grid forming a 3&#215;4 rectangular mirror-symmetric matrix<\/td><\/tr><tr><td><strong>Syntax Type<\/strong><\/td><td>Mirror Symmetry<\/td><\/tr><tr><td><strong>Thread Spec<\/strong><\/td><td>DMC No. 5 \/ No. 25 3-ply folded<\/td><\/tr><tr><td><strong>Color Scheme<\/strong><\/td><td>Emerald Green, Bright Yellow<\/td><\/tr><tr><td><strong>Stitch Direction<\/strong><\/td><td>Green: Top-Left to Bottom-Right (-45\u00b0) \/ Yellow: Bottom-Right to Top-Left (135\u00b0)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Module 2: Starting &amp; Vector Operations<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">1. Starting Logic &amp; Phase Sequence<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Phase \u2460: Dual-Color Diagonal Cross Array<\/strong> Constructed on a 2-3-3-2 grid sequence, red\/blue (green\/yellow) vector stitches are placed alternately. Green stitches (-45\u00b0) descend from top-left to bottom-right, while yellow stitches (135\u00b0) traverse diagonally, forming a balanced tension grid.<\/li>\n\n\n\n<li><strong>Phase \u2461: Regional Duplication &amp; Matrix Extension<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Region 1 (Base Shape, Stitches 1\u201316):<\/strong> Defines the core mirror-symmetric block.<\/li>\n\n\n\n<li><strong>Region 2 (Stitches 17\u201332):<\/strong> Shifted along the X-axis by \u0394x = +4 grid units (+80px).<\/li>\n\n\n\n<li><strong>Region 3 (Stitches 33\u201348):<\/strong> Shifted further along X-axis by \u0394x = +4 grid units (+80px).<\/li>\n\n\n\n<li><strong>Regions 4\u20136 (Stitches 49\u201396):<\/strong> Translated down the Y-axis by \u0394y = +3 grid units (+60px) to achieve a full 3&#215;2 grid layout.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">2. Vector Coordinates &amp; Translation Calculations<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Grid Unit Scale:<\/strong> 1 grid unit = 20 px. Single stitch vector defined as V = (\u0394x, \u0394y).<\/li>\n\n\n\n<li><strong>Base Vectors &amp; Inclinational Angles:<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Forward Stitch (e.g., Stitch 1):<\/strong> P1(30, 30) -> P2(50, 50), Vector V = (20, 20), Length L = 28.28 px, Angle \u03b8 = -45\u00b0.<\/li>\n\n\n\n<li><strong>Long Diagonal Stitch (e.g., Stitch 3):<\/strong> P1(90, 30) -> P2(50, 70), Vector V = (-40, 40), Length L = 56.57 px, Angle \u03b8 = 135\u00b0.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Regional Shift Matrix:<\/strong> R(i, j) = Base_Shape + (i * 80px, j * 60px), where i \u2208 {0, 1, 2} and j \u2208 {0, 1}.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Module 3: Structural Mechanics &amp; Topology<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">1. Structural Backbone &amp; Intersections<\/h4>\n\n\n\n<h6 class=\"wp-block-heading\">Canvas-018 operates as a Bi-directional Diagonal Lattice.<\/h6>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Topological Nodes:<\/strong> Intersection nodes at grid points (e.g., (50, 50), (50, 70)) sustain multiple thread penetrations, creating a robust multi-connected topological network.<\/li>\n\n\n\n<li><strong>Variable Length Superposition:<\/strong> The 2-3-3-2 stepping pattern mixes long stitches (56.57 px) that act as primary tension beams with short stitches (28.28 px) that lock boundaries and distribute localized stress.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">2. Tension Equilibrium &amp; Stress Distribution<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Vectorial Counter-Balance:<\/strong> Opposing -45\u00b0 and +135\u00b0 stitch directions ensure that net force \u03a3F \u2248 0 across the canvas plane, effectively suppressing fabric distortion and warping.<\/li>\n\n\n\n<li><strong>Stress Decomposition:<\/strong> Tension forces resolve into orthogonal components F_x = 0.707 F and F_y = 0.707 F. Equal and opposite component vectors across mirrored regions eliminate shear stress concentration.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Module 4: Vector API &amp; Interactive Dynamic Renderer<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">1. Rendered Dynamic Embroidery Card<\/h4>\n\n\n\n<meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <title>96 \u6b65\u91dd\u6b65\u523a\u7e61 SVG \u52d5\u756b\u6a21\u64ec\u5668<\/title>\n  <style>\n    \/* CSS \u8b8a\u6578\u6a21\u7d44\u5316\u53c3\u6578 *\/\n    :root {\n      --stitch-duration: 0.6s;\n      --stitch-step: 0.4s;\n      --playback-rate: 1;\n\n      --bg-color: #f8fafc;\n      --card-bg: #ffffff;\n      --text-main: #0f172a;\n      --text-muted: #64748b;\n      --grid-stroke: #cbd5e1;\n      --border-color: #e2e8f0;\n      \n      --red-stitch: #ef4444;\n      --blue-stitch: #3b82f6;\n      --red-glow: rgba(239, 68, 68, 0.4);\n      --blue-glow: rgba(59, 130, 246, 0.4);\n    }\n\n    .high-contrast {\n      --bg-color: #0f172a;\n      --card-bg: #1e293b;\n      --text-main: #f8fafc;\n      --text-muted: #94a3b8;\n      --grid-stroke: #334155;\n      --border-color: #475569;\n      \n      --red-stitch: #ff0055;\n      --blue-stitch: #00e5ff;\n      --red-glow: rgba(255, 0, 85, 0.6);\n      --blue-glow: rgba(0, 229, 255, 0.6);\n    }\n\n    * { box-sizing: border-box; margin: 0; padding: 0; }\n\n    body {\n      font-family: system-ui, -apple-system, sans-serif;\n      background-color: var(--bg-color);\n      color: var(--text-main);\n      padding: 16px;\n      display: flex;\n      justify-content: center;\n      transition: background-color 0.3s, color 0.3s;\n    }\n\n    .c018_wrapper {\n      width: 100%;\n      max-width: 900px;\n      background: var(--card-bg);\n      border-radius: 12px;\n      padding: 20px;\n      box-shadow: 0 4px 20px rgba(0,0,0,0.08);\n      border: 1px solid var(--border-color);\n      display: flex;\n      flex-direction: column;\n      gap: 16px;\n    }\n\n    .header-bar {\n      display: flex;\n      justify-content: space-between;\n      align-items: center;\n      flex-wrap: wrap;\n      gap: 12px;\n    }\n\n    .title-group h2 { font-size: 1.25rem; font-weight: 700; }\n    .title-group p { font-size: 0.85rem; color: var(--text-muted); }\n\n    \/* \u63a7\u5236\u9762\u677f *\/\n    .controls-panel {\n      display: flex;\n      flex-direction: column;\n      gap: 12px;\n      background: rgba(0,0,0,0.02);\n      padding: 12px;\n      border-radius: 8px;\n      border: 1px solid var(--border-color);\n    }\n\n    .btn-group {\n      display: flex;\n      flex-wrap: wrap;\n      gap: 8px;\n      align-items: center;\n    }\n\n    .btn {\n      padding: 8px 16px;\n      font-size: 13px;\n      font-weight: 600;\n      border-radius: 6px;\n      border: 1px solid var(--border-color);\n      background: #ffffff;\n      color: #1e293b;\n      cursor: pointer;\n      user-select: none;\n      transition: all 0.2s ease;\n      display: inline-flex;\n      align-items: center;\n      gap: 6px;\n    }\n\n    .btn:hover { background: #f1f5f9; border-color: #0284c7; }\n    .btn-primary { background: #0284c7; color: #ffffff; border-color: #0284c7; }\n    .btn-primary:hover { background: #0369a1; }\n    \n    .speed-selector {\n      display: flex;\n      align-items: center;\n      gap: 4px;\n      margin-left: auto;\n      font-size: 12px;\n      color: var(--text-muted);\n    }\n\n    .speed-btn {\n      padding: 4px 8px;\n      font-size: 12px;\n      border-radius: 4px;\n      border: 1px solid var(--border-color);\n      background: var(--card-bg);\n      color: var(--text-main);\n      cursor: pointer;\n    }\n\n    .speed-btn.active {\n      background: #0284c7;\n      color: #fff;\n      border-color: #0284c7;\n    }\n\n    \/* \u9032\u5ea6\u689d *\/\n    .progress-box {\n      display: flex;\n      flex-direction: column;\n      gap: 6px;\n    }\n\n    .progress-info {\n      display: flex;\n      justify-content: space-between;\n      font-size: 12px;\n      font-weight: 600;\n    }\n\n    .progress-bar-bg {\n      width: 100%;\n      height: 10px;\n      background: var(--border-color);\n      border-radius: 5px;\n      overflow: hidden;\n    }\n\n    .progress-bar-fill {\n      height: 100%;\n      width: 0%;\n      background: linear-gradient(90deg, #ef4444, #3b82f6);\n      transition: width 0.1s linear;\n    }\n\n    \/* SVG \u8996\u5716\u8207\u7dda\u689d *\/\n    .c018_svg {\n      width: 100%;\n      height: auto;\n      background: var(--card-bg);\n      border: 1px solid var(--border-color);\n      border-radius: 8px;\n    }\n\n    .c018_grid_line { stroke: var(--grid-stroke); stroke-width: 0.8; stroke-dasharray: 2,2; }\n    .c018_region_box { fill: none; stroke: #f59e0b; stroke-width: 1.2; stroke-dasharray: 4,4; }\n\n    .c018_stitch {\n      fill: none;\n      stroke-width: 3.5;\n      stroke-linecap: round;\n      stroke-linejoin: round;\n      stroke-dasharray: 80;\n      stroke-dashoffset: 80;\n      animation: c018_draw calc(var(--stitch-duration) \/ var(--playback-rate)) ease forwards;\n    }\n\n    .c018_red { stroke: var(--red-stitch); filter: drop-shadow(0 0 2px var(--red-glow)); }\n    .c018_blue { stroke: var(--blue-stitch); filter: drop-shadow(0 0 2px var(--blue-glow)); }\n\n    \/* \u91dd\u5b54\u8207\u7aef\u9ede\u8cea\u611f *\/\n    .c018_pinhole { fill: #0f172a; stroke: var(--border-color); stroke-width: 0.5; opacity: 0; animation: c018_fadeIn 0.3s forwards; }\n    .c018_node { fill: var(--text-main); opacity: 0; animation: c018_fadeIn 0.3s forwards; }\n    .c018_label { font-size: 6px; fill: var(--text-muted); font-weight: bold; opacity: 0; animation: c018_fadeIn 0.3s forwards; text-anchor: middle; }\n\n    @keyframes c018_draw { to { stroke-dashoffset: 0; } }\n    @keyframes c018_fadeIn { to { opacity: 1; } }\n\n    \/* \u66ab\u505c\u8207\u8df3\u904e CSS \u72c0\u614b *\/\n    .paused .c018_stitch,\n    .paused .c018_node,\n    .paused .c018_pinhole,\n    .paused .c018_label {\n      animation-play-state: paused !important;\n    }\n\n    .completed .c018_stitch { animation: none !important; stroke-dashoffset: 0 !important; }\n    .completed .c018_node,\n    .completed .c018_pinhole,\n    .completed .c018_label { animation: none !important; opacity: 1 !important; }\n  <\/style>\n\n\n\n<div class=\"c018_wrapper\" id=\"mainWrapper\">\n  <!-- \u9802\u90e8\u6a19\u984c\u5340 -->\n  <div class=\"header-bar\">\n    <div class=\"title-group\">\n      <h2>\ud83e\uddf5 96-Step Stitch Embroidery SVG Animation Simulator<\/h2>\n      <p>Real-time display of embroidery path and step sequence (1-96 stitches illustrated)<\/p>\n    <\/div>\n    <button class=\"btn\" onclick=\"toggleContrast()\">\ud83c\udf13 Switch to high contrast mode<\/button>\n  <\/div>\n\n  <!-- \u63a7\u5236\u9762\u677f -->\n  <div class=\"controls-panel\">\n    <div class=\"btn-group\">\n      <button class=\"btn btn-primary\" id=\"btnPlayPause\" onclick=\"togglePlayPause()\">\u23f8\ufe0f pause<\/button>\n      <button class=\"btn\" onclick=\"replayAnimation()\">\ud83d\udd04 Replay<\/button>\n      <button class=\"btn\" onclick=\"skipToEnd()\">\u23ed\ufe0f Skip \/ Show Results<\/button>\n\n      <div class=\"speed-selector\">\n        <span>speed\uff1a<\/span>\n        <button class=\"speed-btn active\" onclick=\"setSpeed(1, this)\">1x<\/button>\n        <button class=\"speed-btn\" onclick=\"setSpeed(1.5, this)\">1.5x<\/button>\n        <button class=\"speed-btn\" onclick=\"setSpeed(2, this)\">2x<\/button>\n      <\/div>\n    <\/div>\n\n    <!-- \u9032\u5ea6\u689d -->\n    <div class=\"progress-box\">\n      <div class=\"progress-info\">\n        <span id=\"stepText\">Current step\uff1a1 \/ 96 \u91dd<\/span>\n        <span id=\"percentText\">0%<\/span>\n      <\/div>\n      <div class=\"progress-bar-bg\">\n        <div class=\"progress-bar-fill\" id=\"progressBar\"><\/div>\n      <\/div>\n    <\/div>\n  <\/div>\n\n  <!-- SVG \u4e3b\u9ad4 -->\n  <svg class=\"c018_svg\" id=\"embroiderySvg\" viewBox=\"-10 -10 320 180\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n    <g class=\"c018_grid\">\n      <path d=\"M-10,20 H300 M-10,40 H300 M-10,60 H300 M-10,80 H300 M-10,100 H300 M-10,120 H300 M-10,140 H300 M-10,160 H300\" class=\"c018_grid_line\"><\/path>\n      <path d=\"M0,-10 V170 M20,-10 V170 M40,-10 V170 M60,-10 V170 M80,-10 V170 M100,-10 V170 M120,-10 V170 M140,-10 V170 M160,-10 V170 M180,-10 V170 M200,-10 V170 M220,-10 V170 M240,-10 V170 M260,-10 V170 M280,-10 V170 M300,-10 V170\" class=\"c018_grid_line\"><\/path>\n      \n      <rect x=\"0\" y=\"20\" width=\"80\" height=\"80\" class=\"c018_region_box\"><\/rect>\n      <text x=\"40\" y=\"12\" class=\"c018_label\" style=\"opacity:1;\">\u7b2c 1 \u5340 (1-16)<\/text>\n\n      <rect x=\"80\" y=\"20\" width=\"80\" height=\"80\" class=\"c018_region_box\" stroke=\"#10b981\"><\/rect>\n      <text x=\"120\" y=\"12\" class=\"c018_label\" style=\"opacity:1; fill:#10b981;\">\u7b2c 2 \u5340 (17-32)<\/text>\n\n      <rect x=\"160\" y=\"20\" width=\"80\" height=\"80\" class=\"c018_region_box\" stroke=\"#8b5cf6\"><\/rect>\n      <text x=\"200\" y=\"12\" class=\"c018_label\" style=\"opacity:1; fill:#8b5cf6;\">\u7b2c 3 \u5340 (33-48)<\/text>\n\n      <rect x=\"40\" y=\"80\" width=\"80\" height=\"80\" class=\"c018_region_box\" stroke=\"#ec4899\"><\/rect>\n      <text x=\"80\" y=\"172\" class=\"c018_label\" style=\"opacity:1; fill:#ec4899;\">\u7b2c 4 \u5340 (49-64)<\/text>\n\n      <rect x=\"120\" y=\"80\" width=\"80\" height=\"80\" class=\"c018_region_box\" stroke=\"#f97316\"><\/rect>\n      <text x=\"160\" y=\"172\" class=\"c018_label\" style=\"opacity:1; fill:#f97316;\">\u7b2c 5 \u5340 (65-80)<\/text>\n\n      <rect x=\"200\" y=\"80\" width=\"80\" height=\"80\" class=\"c018_region_box\" stroke=\"#06b6d4\"><\/rect>\n      <text x=\"240\" y=\"172\" class=\"c018_label\" style=\"opacity:1; fill:#06b6d4;\">\u7b2c 6 \u5340 (81-96)<\/text>\n    <\/g>\n\n    <!-- \u523a\u7e61\u8def\u5f91\u52d5\u614b\u751f\u6210\u5bb9\u5668 -->\n    <g id=\"stitchesContainer\"><\/g>\n  <\/svg>\n<\/div>\n\n<script>\n  \/\/ 96 \u6b65\u5b8c\u6574\u91dd\u6b65\u8cc7\u6599\u96c6\n  const rawStitches = [\n    \/\/ 1-16\n    {s:1, c:'red', x1:30, y1:30, x2:50, y2:50, n:[{x:30,y:30,t:'1'},{x:50,y:50,t:'2\/4'}]},\n    {s:2, c:'blue', x1:70, y1:30, x2:50, y2:50, n:[{x:70,y:30,t:'3'}]},\n    {s:3, c:'blue', x1:90, y1:30, x2:50, y2:70, n:[{x:90,y:30,t:'5\/23'},{x:50,y:70,t:'6\/8'}]},\n    {s:4, c:'red', x1:10, y1:30, x2:50, y2:70, n:[{x:10,y:30,t:'7'}]},\n    {s:5, c:'red', x1:10, y1:50, x2:50, y2:90, n:[{x:10,y:50,t:'9'},{x:50,y:90,t:'10\/12'}]},\n    {s:6, c:'blue', x1:90, y1:50, x2:50, y2:90, n:[{x:90,y:50,t:'11\/25'}]},\n    {s:7, c:'blue', x1:90, y1:70, x2:70, y2:90, n:[{x:90,y:70,t:'13\/31'},{x:70,y:90,t:'14'}]},\n    {s:8, c:'red', x1:10, y1:70, x2:30, y2:90, n:[{x:10,y:70,t:'15'},{x:30,y:90,t:'16'}]},\n    \/\/ 17-32\n    {s:9, c:'red', x1:110, y1:30, x2:130, y2:50, n:[{x:110,y:30,t:'17'},{x:130,y:50,t:'18\/20'}]},\n    {s:10, c:'blue', x1:150, y1:30, x2:130, y2:50, n:[{x:150,y:30,t:'19'}]},\n    {s:11, c:'blue', x1:170, y1:30, x2:130, y2:70, n:[{x:170,y:30,t:'21\/39'},{x:130,y:70,t:'22\/24'}]},\n    {s:12, c:'red', x1:90, y1:30, x2:130, y2:70, n:[]},\n    {s:13, c:'red', x1:90, y1:50, x2:130, y2:90, n:[{x:130,y:90,t:'26\/28'}]},\n    {s:14, c:'blue', x1:170, y1:50, x2:130, y2:90, n:[{x:170,y:50,t:'27\/41'}]},\n    {s:15, c:'blue', x1:170, y1:70, x2:150, y2:90, n:[{x:170,y:70,t:'29\/47'},{x:150,y:90,t:'30'}]},\n    {s:16, c:'red', x1:90, y1:70, x2:110, y2:90, n:[{x:110,y:90,t:'32'}]},\n    \/\/ 33-48\n    {s:17, c:'red', x1:190, y1:30, x2:210, y2:50, n:[{x:190,y:30,t:'33'},{x:210,y:50,t:'34\/36'}]},\n    {s:18, c:'blue', x1:230, y1:30, x2:210, y2:50, n:[{x:230,y:30,t:'35'}]},\n    {s:19, c:'blue', x1:250, y1:30, x2:210, y2:70, n:[{x:250,y:30,t:'37'},{x:210,y:70,t:'38\/40'}]},\n    {s:20, c:'red', x1:170, y1:30, x2:210, y2:70, n:[]},\n    {s:21, c:'red', x1:170, y1:50, x2:210, y2:90, n:[{x:210,y:90,t:'42\/44'}]},\n    {s:22, c:'blue', x1:250, y1:50, x2:210, y2:90, n:[{x:250,y:50,t:'43'}]},\n    {s:23, c:'blue', x1:250, y1:70, x2:230, y2:90, n:[{x:250,y:70,t:'45'},{x:230,y:90,t:'46'}]},\n    {s:24, c:'red', x1:170, y1:70, x2:190, y2:90, n:[{x:190,y:90,t:'48'}]},\n    \/\/ 49-64\n    {s:25, c:'red', x1:70, y1:90, x2:90, y2:110, n:[{x:70,y:90,t:'49'},{x:90,y:110,t:'50\/52'}]},\n    {s:26, c:'blue', x1:110, y1:90, x2:90, y2:110, n:[{x:110,y:90,t:'51'}]},\n    {s:27, c:'blue', x1:130, y1:90, x2:90, y2:130, n:[{x:130,y:90,t:'53\/71'},{x:90,y:130,t:'54\/56'}]},\n    {s:28, c:'red', x1:50, y1:90, x2:90, y2:130, n:[{x:50,y:90,t:'55'}]},\n    {s:29, c:'red', x1:50, y1:110, x2:90, y2:150, n:[{x:50,y:110,t:'57'},{x:90,y:150,t:'58\/60'}]},\n    {s:30, c:'blue', x1:130, y1:110, x2:90, y2:150, n:[{x:130,y:110,t:'59\/73'}]},\n    {s:31, c:'blue', x1:130, y1:130, x2:110, y2:150, n:[{x:130,y:130,t:'61\/79'},{x:110,y:150,t:'62'}]},\n    {s:32, c:'red', x1:50, y1:130, x2:70, y2:150, n:[{x:50,y:130,t:'63'},{x:70,y:150,t:'64'}]},\n    \/\/ 65-80\n    {s:33, c:'red', x1:150, y1:90, x2:170, y2:110, n:[{x:150,y:90,t:'65'},{x:170,y:110,t:'66\/68'}]},\n    {s:34, c:'blue', x1:190, y1:90, x2:170, y2:110, n:[{x:190,y:90,t:'67'}]},\n    {s:35, c:'blue', x1:210, y1:90, x2:170, y2:130, n:[{x:210,y:90,t:'69\/87'},{x:170,y:130,t:'70\/72'}]},\n    {s:36, c:'red', x1:130, y1:90, x2:170, y2:130, n:[]},\n    {s:37, c:'red', x1:130, y1:110, x2:170, y2:150, n:[{x:170,y:150,t:'74\/76'}]},\n    {s:38, c:'blue', x1:210, y1:110, x2:170, y2:150, n:[{x:210,y:110,t:'75\/89'}]},\n    {s:39, c:'blue', x1:210, y1:130, x2:190, y2:150, n:[{x:210,y:130,t:'77\/95'},{x:190,y:150,t:'78'}]},\n    {s:40, c:'red', x1:130, y1:130, x2:150, y2:150, n:[{x:150,y:150,t:'80'}]},\n    \/\/ 81-96\n    {s:41, c:'red', x1:230, y1:90, x2:250, y2:110, n:[{x:230,y:90,t:'81'},{x:250,y:110,t:'82\/84'}]},\n    {s:42, c:'blue', x1:270, y1:90, x2:250, y2:110, n:[{x:270,y:90,t:'83'}]},\n    {s:43, c:'blue', x1:290, y1:90, x2:250, y2:130, n:[{x:290,y:90,t:'85'},{x:250,y:130,t:'86\/88'}]},\n    {s:44, c:'red', x1:210, y1:90, x2:250, y2:130, n:[]},\n    {s:45, c:'red', x1:210, y1:110, x2:250, y2:150, n:[{x:250,y:150,t:'90\/92'}]},\n    {s:46, c:'blue', x1:290, y1:110, x2:250, y2:150, n:[{x:290,y:110,t:'91'}]},\n    {s:47, c:'blue', x1:290, y1:130, x2:270, y2:150, n:[{x:290,y:130,t:'93'},{x:270,y:150,t:'94'}]},\n    {s:48, c:'red', x1:210, y1:130, x2:230, y2:150, n:[{x:230,y:150,t:'96'}]}\n  ];\n\n  \/\/ \u5168\u57df\u8b8a\u6578\u72c0\u614b\n  let isPaused = false;\n  let isCompleted = false;\n  let playbackRate = 1;\n  let progressInterval = null;\n  let startTime = null;\n  let pausedElapsed = 0;\n  \n  const totalDuration = 0.6 + (48 - 1) * 0.4; \/\/ 19.4 \u79d2\n\n  \/\/ \u521d\u59cb\u5316 DOM \u5143\u7d20\n  const wrapper = document.getElementById('mainWrapper');\n  const svgContainer = document.getElementById('stitchesContainer');\n  const btnPlayPause = document.getElementById('btnPlayPause');\n  const progressBar = document.getElementById('progressBar');\n  const stepText = document.getElementById('stepText');\n  const percentText = document.getElementById('percentText');\n\n  \/\/ \u751f\u6210 SVG \u7bc0\u9ede\u8207\u52d5\u756b\u5ef6\u9072\n  function buildStitches() {\n    svgContainer.innerHTML = '';\n    rawStitches.forEach((item) => {\n      const delay = (item.s - 1) * 0.4;\n\n      \/\/ \u756b\u7dda\n      const line = document.createElementNS('http:\/\/www.w3.org\/2000\/svg', 'line');\n      line.setAttribute('x1', item.x1);\n      line.setAttribute('y1', item.y1);\n      line.setAttribute('x2', item.x2);\n      line.setAttribute('y2', item.y2);\n      line.setAttribute('class', `c018_stitch c018_${item.c}`);\n      line.style.animationDelay = `${delay}s`;\n      svgContainer.appendChild(line);\n\n      \/\/ \u7aef\u9ede\u8207\u91dd\u5b54\n      item.n.forEach(node => {\n        const pinhole = document.createElementNS('http:\/\/www.w3.org\/2000\/svg', 'circle');\n        pinhole.setAttribute('cx', node.x);\n        pinhole.setAttribute('cy', node.y);\n        pinhole.setAttribute('r', '3');\n        pinhole.setAttribute('class', 'c018_pinhole');\n        pinhole.style.animationDelay = `${delay}s`;\n        svgContainer.appendChild(pinhole);\n\n        const circle = document.createElementNS('http:\/\/www.w3.org\/2000\/svg', 'circle');\n        circle.setAttribute('cx', node.x);\n        circle.setAttribute('cy', node.y);\n        circle.setAttribute('r', '1.8');\n        circle.setAttribute('class', 'c018_node');\n        circle.style.animationDelay = `${delay}s`;\n        svgContainer.appendChild(circle);\n\n        const text = document.createElementNS('http:\/\/www.w3.org\/2000\/svg', 'text');\n        text.setAttribute('x', node.x);\n        text.setAttribute('y', node.y - 5);\n        text.setAttribute('class', 'c018_label');\n        text.style.animationDelay = `${delay}s`;\n        text.textContent = node.t;\n        svgContainer.appendChild(text);\n      });\n    });\n  }\n\n  \/\/ \u555f\u52d5\u9032\u5ea6\u8a08\u7b97\u8a08\u6642\u5668\n  function startProgressTimer() {\n    clearInterval(progressInterval);\n    startTime = Date.now() - (pausedElapsed \/ playbackRate) * 1000;\n\n    progressInterval = setInterval(() => {\n      if (isPaused || isCompleted) return;\n\n      const elapsed = ((Date.now() - startTime) \/ 1000) * playbackRate;\n      pausedElapsed = elapsed;\n\n      let pct = Math.min(100, (elapsed \/ totalDuration) * 100);\n      let currentStep = Math.min(96, Math.floor((elapsed \/ totalDuration) * 96) + 1);\n\n      if (pct >= 100) {\n        pct = 100;\n        currentStep = 96;\n        isCompleted = true;\n        clearInterval(progressInterval);\n      }\n\n      progressBar.style.width = `${pct.toFixed(1)}%`;\n      percentText.textContent = `${Math.round(pct)}%`;\n      stepText.textContent = `\u7576\u524d\u6b65\u9a5f\uff1a${currentStep} \/ 96 \u91dd`;\n    }, 50);\n  }\n\n  \/\/ \u5207\u63db \u64ad\u653e \/ \u66ab\u505c\n  function togglePlayPause() {\n    if (isCompleted) {\n      replayAnimation();\n      return;\n    }\n\n    isPaused = !isPaused;\n    if (isPaused) {\n      wrapper.classList.add('paused');\n      btnPlayPause.textContent = '\u25b6\ufe0f \u64ad\u653e';\n      btnPlayPause.classList.remove('btn-primary');\n    } else {\n      wrapper.classList.remove('paused');\n      btnPlayPause.textContent = '\u23f8\ufe0f \u66ab\u505c';\n      btnPlayPause.classList.add('btn-primary');\n      startProgressTimer();\n    }\n  }\n\n  \/\/ \u91cd\u64ad\u52d5\u756b\n  function replayAnimation() {\n    isPaused = false;\n    isCompleted = false;\n    pausedElapsed = 0;\n    wrapper.classList.remove('paused', 'completed');\n    btnPlayPause.textContent = '\u23f8\ufe0f \u66ab\u505c';\n    btnPlayPause.classList.add('btn-primary');\n\n    buildStitches();\n    startProgressTimer();\n  }\n\n  \/\/ \u8df3\u904e\u81f3\u6700\u5f8c\u7d50\u679c\n  function skipToEnd() {\n    isCompleted = true;\n    isPaused = false;\n    wrapper.classList.remove('paused');\n    wrapper.classList.add('completed');\n    btnPlayPause.textContent = '\u25b6\ufe0f \u91cd\u65b0\u64ad\u653e';\n    \n    clearInterval(progressInterval);\n    progressBar.style.width = '100%';\n    percentText.textContent = '100%';\n    stepText.textContent = '\u7576\u524d\u6b65\u9a5f\uff1a96 \/ 96 \u91dd (\u5df2\u5b8c\u6210)';\n  }\n\n  \/\/ \u8a2d\u7f6e\u500d\u901f\n  function setSpeed(rate, btn) {\n    playbackRate = rate;\n    document.documentElement.style.setProperty('--playback-rate', rate);\n\n    document.querySelectorAll('.speed-btn').forEach(b => b.classList.remove('active'));\n    if (btn) btn.classList.add('active');\n\n    if (!isPaused && !isCompleted) {\n      startProgressTimer();\n    }\n  }\n\n  \/\/ \u9ad8\u5c0d\u6bd4\u6a21\u5f0f\u5207\u63db\n  function toggleContrast() {\n    wrapper.classList.toggle('high-contrast');\n    document.body.classList.toggle('high-contrast');\n  }\n\n  \/\/ \u9801\u9762\u521d\u6b21\u8f09\u5165\u57f7\u884c\n  document.addEventListener('DOMContentLoaded', () => {\n    buildStitches();\n    startProgressTimer();\n  });\n<\/script>\n\n\n\n<h4 class=\"wp-block-heading\">2. Vector Parameters Table<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>ViewBox:<\/strong> <code>-10 -10 320 180<\/code><\/li>\n\n\n\n<li><strong>Grid Resolution:<\/strong> Base unit 20 px \u00d7 20 px, structured across 6 spatial translation blocks.<\/li>\n\n\n\n<li><strong>Color Schemes:<\/strong> Primary Red\/Green (<code>#ef4444<\/code>), Secondary Blue\/Yellow (<code>#3b82f6<\/code>).<\/li>\n\n\n\n<li><strong>Animation Delay Matrix:<\/strong> Duration = 0.6s per stitch, step interval = 0.4s. Total sequence runtime = 19.4s (96 steps).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Module 5: Visual Gallery<\/h3>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"795\" data-id=\"7540\" src=\"https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CP_018-1.jpg?resize=1024%2C795&#038;ssl=1\" alt=\"\" class=\"wp-image-7540\" srcset=\"https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CP_018-1-scaled.jpg?resize=1024%2C795&amp;ssl=1 1024w, https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CP_018-1-scaled.jpg?resize=300%2C233&amp;ssl=1 300w, https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CP_018-1-scaled.jpg?resize=768%2C596&amp;ssl=1 768w, https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CP_018-1-scaled.jpg?resize=649%2C504&amp;ssl=1 649w, https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CP_018-1-scaled.jpg?resize=1536%2C1192&amp;ssl=1 1536w, https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CP_018-1-scaled.jpg?resize=2048%2C1590&amp;ssl=1 2048w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"1024\" height=\"804\" data-id=\"7539\" src=\"https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CV_018B-1.jpg?resize=1024%2C804&#038;ssl=1\" alt=\"\" class=\"wp-image-7539\" srcset=\"https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CV_018B-1.jpg?resize=1024%2C804&amp;ssl=1 1024w, https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CV_018B-1.jpg?resize=300%2C236&amp;ssl=1 300w, https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CV_018B-1.jpg?resize=768%2C603&amp;ssl=1 768w, https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CV_018B-1.jpg?resize=649%2C510&amp;ssl=1 649w, https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CV_018B-1.jpg?resize=1536%2C1207&amp;ssl=1 1536w, https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CV_018B-1.jpg?resize=2048%2C1609&amp;ssl=1 2048w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"1024\" height=\"751\" data-id=\"7541\" src=\"https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CV_018Ha-1.jpg?resize=1024%2C751&#038;ssl=1\" alt=\"\" class=\"wp-image-7541\" srcset=\"https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CV_018Ha-1.jpg?resize=1024%2C751&amp;ssl=1 1024w, https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CV_018Ha-1.jpg?resize=300%2C220&amp;ssl=1 300w, https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CV_018Ha-1.jpg?resize=768%2C563&amp;ssl=1 768w, https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CV_018Ha-1.jpg?resize=649%2C476&amp;ssl=1 649w, https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CV_018Ha-1.jpg?resize=1536%2C1127&amp;ssl=1 1536w, https:\/\/i0.wp.com\/yunbroidery.com\/wp-content\/uploads\/2026\/10\/CV_018Ha-1.jpg?resize=2048%2C1502&amp;ssl=1 2048w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n<\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Front View<\/strong><\/td><td><strong>Back View<\/strong><\/td><td><strong>Manuscript Grid<\/strong><\/td><\/tr><tr><td><strong>Fig 1. Front Embroidery<\/strong><br>Displaying emerald green &amp; bright yellow mirror-symmetric tension matrix.<\/td><td><strong>Fig 2. Back Structure<\/strong><br>Clean back-stitching routes and knot distribution logic.<\/td><td><strong>Fig 3. Original Manuscript<\/strong><br>Precision coordinate mapping for Regions 1\u20133 (Stitches 1\u201348).<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Module 6: Algorithm Extensions &amp; Variant Syntax<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">1. Coverage Calculation<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Unit Grid Area:<\/strong> 20 px \u00d7 20 px = 400 px\u00b2<\/li>\n\n\n\n<li><strong>Physical Line Width:<\/strong> 3.5 px (approx. 1.2 mm thread density)<\/li>\n\n\n\n<li><strong>Surface Coverage Ratio:<\/strong> Achieves 87.5% surface fill rate within dual-color overlap zones due to dense cross-hatching.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">2. Procedural Configuration<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>const Canvas018_Config = {\n  unitSize: 20,\n  stepSequence: &#91;2, 3, 3, 2],\n  colors: { primary: '#ef4444', secondary: '#3b82f6' },\n  gridDimensions: { columns: 3, rows: 2 },\n  translationVector: { dx: 80, dy: 60 }\n};\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">3. Variant Matrix<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Transposed Mirroring:<\/strong> Inverting vector angles to (+45\u00b0, -135\u00b0) yields an inverted chevron pattern.<\/li>\n\n\n\n<li><strong>Scale Invariance:<\/strong> Scaling sequence to [3, 4, 4, 3] preserves structural integrity across larger spatial canvas formats.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Case Study: Canvas-018 Yunbroidery Stitch Algorithm Syn [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"disabled","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"footnotes":""},"class_list":["post-7277","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/yunbroidery.com\/en\/wp-json\/wp\/v2\/pages\/7277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yunbroidery.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/yunbroidery.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/yunbroidery.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yunbroidery.com\/en\/wp-json\/wp\/v2\/comments?post=7277"}],"version-history":[{"count":2,"href":"https:\/\/yunbroidery.com\/en\/wp-json\/wp\/v2\/pages\/7277\/revisions"}],"predecessor-version":[{"id":7542,"href":"https:\/\/yunbroidery.com\/en\/wp-json\/wp\/v2\/pages\/7277\/revisions\/7542"}],"wp:attachment":[{"href":"https:\/\/yunbroidery.com\/en\/wp-json\/wp\/v2\/media?parent=7277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}