{"id":7258,"date":"2026-09-10T14:47:21","date_gmt":"2026-09-10T06:47:21","guid":{"rendered":"https:\/\/yunbroidery.com\/?page_id=7258"},"modified":"2026-10-01T17:23:58","modified_gmt":"2026-10-01T09:23:58","slug":"case-study-canvas-019","status":"publish","type":"page","link":"https:\/\/yunbroidery.com\/en\/case-study-canvas-019\/","title":{"rendered":"Case Study: Canvas-019"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Case Study: Canvas-019<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">Yunbroidery Stitch Algorithm Syntax Card<\/h2>\n\n\n\n<h1 class=\"wp-block-heading\">Canvas-019 Research Case: Grid Climbing Pattern Embroidery Algorithm<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">Module 1. Metadata Table<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Property<\/strong><\/td><td><strong>Content<\/strong><\/td><\/tr><tr><td><strong>Artwork ID<\/strong><\/td><td>Canvas-019<\/td><\/tr><tr><td><strong>Perceptual Image<\/strong><\/td><td>Grid Climbing \/ Ladders (\u722c\u683c\u5b50)<\/td><\/tr><tr><td><strong>Basic Structure<\/strong><\/td><td>Stepped structure composed of 4 diagonal lines horizontally and vertically<\/td><\/tr><tr><td><strong>Syntax Type<\/strong><\/td><td>Structural Support Stitch<\/td><\/tr><tr><td><strong>Thread Specification<\/strong><\/td><td>DMC No. 25, 3 strands folded (6 strands total)<\/td><\/tr><tr><td><strong>Color Scheme<\/strong><\/td><td>Dark Green (Tertiary\/Base), Medium Green (Secondary\/Mid), Light Green (Primary\/Top)<\/td><\/tr><tr><td><strong>Stitching Direction<\/strong><\/td><td>Top-left diagonally towards bottom-center<\/td><\/tr><tr><td><strong>Starting Logic<\/strong><\/td><td>3 x 3 grid, 45-degree diagonal lines arranged in alternating horizontal and vertical steps<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Module 2. Starting &amp; Vector Operations<\/h2>\n\n\n\n<h5 class=\"wp-block-heading\">The embroidery algorithm for Canvas-019 employs a Stepped Staircase arrangement, alternating between horizontal and vertical diagonal lines to achieve a 3D &#8220;grid climbing&#8221; visual effect.<\/h5>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 1: Base 3&#215;3 Stepped Module Sequence<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Grid Placement<\/strong>: Utilizes a 20x20px grid system. The base module consists of 6 parallel line segments of equal length (L = 40 \u00d7 \u221a2 \u2248 56.57 px) angled at -45\u00b0.<\/li>\n\n\n\n<li><strong>Polar Vector<\/strong>: Each stitch vector is defined as Vector V = (\u0394x, \u0394y) = (-40, +40), vector magnitude |V| = 56.57 px, inclination angle \u03b8 = 135\u00b0 (or -45\u00b0 to horizontal axis).<\/li>\n\n\n\n<li><strong>Intra-module Shift<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Horizontal Extension (Stitches 1-4): Vector shift \u0394S_h = (+20, 0).<\/li>\n\n\n\n<li>Vertical Extension Downwards (Stitches 5-6): Vector shift \u0394S_v = (0, +20).<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 2: Group Transformations &amp; Offset Matrix<\/h3>\n\n\n\n<h5 class=\"wp-block-heading\">The full pattern consists of 3 distinct color groups (Blue Group\/Dark Green, Yellow Group\/Medium Green, Red Group\/Light Green), totaling 54 stitches (108 geometry nodes):<\/h5>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Primary Group (Group 1 &#8211; Blue\/Dark Green)<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Contains 3 base modules (Stitches 1-6, 7-12, 13-18).<\/li>\n\n\n\n<li>Module displacement within the group \u0394G1 = (+60, +60).<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Secondary Group (Group 2 &#8211; Yellow\/Medium Green)<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Parallel shift from Group 1 (Stitches 19-36).<\/li>\n\n\n\n<li>Offset vector \u0394G2 = Group 1 + (-40, +40).<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Tertiary Group (Group 3 &#8211; Red\/Light Green)<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Shifted further from Group 1 (Stitches 37-54).<\/li>\n\n\n\n<li>Offset vector \u0394G3 = Group 1 + (-80, +80).<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Module 3. Structural Mechanics &amp; Topology<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1.Structural Spine<\/h3>\n\n\n\n<h5 class=\"wp-block-heading\">Canvas-019 constructs a continuous diagonal structural spine across the fabric surface through fixed-angle (-45\u00b0) tension lines. Arranged in a stepped 3&#215;3 grid sequence, the intersection points form interlocking nodes that lock the fabric structure in place.<\/h5>\n\n\n\n<h3 class=\"wp-block-heading\">2.Tension Balance<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Unidirectional Force Vector<\/strong>: All stitches follow a -45\u00b0 vector direction, concentrating tension along the (x &#8211; y) axis.<\/li>\n\n\n\n<li><strong>Stepped Force Dissipation<\/strong>: By alternating shifts via \u0394S_h (+20, 0) and \u0394S_v (0, +20), the pull force is distributed across warp and weft threads evenly, preventing single-direction fabric puckering along diagonal axes.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">3.Stress Dissipation Mechanism<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Thread Volume Cushioning<\/strong>: Using 6 strands of embroidery thread (3 strands folded), the physical volume fills grid cavities and absorbs tension shocks during stitching.<\/li>\n\n\n\n<li><strong>Multi-layer Support Network<\/strong>: Three color groups overlap along the vertical axis, creating a three-layer mechanical support net that enhances structural stability.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Module 4. Vector API &amp; Animated Showcase Data<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1.Vector Geometry Parameters<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>ViewBox<\/strong>: <code>0 0 310 330<\/code><\/li>\n\n\n\n<li><strong>Grid System<\/strong>: <code>20px \u00d7 20px<\/code> main grid with centroid node markers<\/li>\n\n\n\n<li><strong>Dasharray Unit<\/strong>: Fixed at <code>56.57<\/code><\/li>\n\n\n\n<li><strong>Animation Mechanism<\/strong>: CSS-only <code>stroke-dashoffset<\/code> and <code>animation-delay<\/code> orchestration rendering 54 sequential stitches.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2.Interactive SVG Animation Card (Pure HTML\/CSS)<\/h3>\n\n\n\n<meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <title>Yunbroidery Canvas-019 \u523a\u7e61\u5716\u6a23\u7d50\u69cb\u52d5\u756b<\/title>\n  <style>\n    \/* Base Reset & Core Styles *\/\n    * { box-sizing: border-box; margin: 0; padding: 0; }\n    body {\n      background-color: #ffffff; \/* \ud83d\udc48 \u6539\u70ba\u767d\u8272\u80cc\u666f *\/\n    color: #1e293b; \n\n      font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n      min-height: 100vh;\n      display: flex;\n      justify-content: center;\n      align-items: center;\n      padding: 16px;\n    }\n\n    .c019_wrapper {\n      width: 100%;\n      max-width: 960px;\n      background: #1e293b;\n      border: 1px solid #334155;\n      border-radius: 16px;\n      padding: 20px;\n      box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);\n      display: flex;\n      flex-direction: column;\n      gap: 16px;\n    }\n\n    .c019_header {\n      display: flex;\n      justify-content: space-between;\n      align-items: center;\n      flex-wrap: wrap;\n      gap: 10px;\n      border-bottom: 1px solid #334155;\n      padding-bottom: 12px;\n    }\n\n    .c019_title {\n      font-size: 1.25rem;\n      font-weight: 700;\n      color: #38bdf8;\n      letter-spacing: 0.05em;\n    }\n\n    \/* Controls & Progress *\/\n    .c019_dashboard {\n      background: #0f172a;\n      border-radius: 10px;\n      padding: 14px;\n      border: 1px solid #1e293b;\n      display: flex;\n      flex-direction: column;\n      gap: 12px;\n    }\n\n    .c019_progress_bar_container {\n      display: flex;\n      align-items: center;\n      gap: 12px;\n    }\n\n    .c019_progress_bar {\n      flex: 1;\n      height: 8px;\n      background: #334155;\n      border-radius: 4px;\n      overflow: hidden;\n      cursor: pointer;\n      position: relative;\n    }\n\n    .c019_progress_fill {\n      height: 100%;\n      width: 0%;\n      background: linear-gradient(90deg, #3b82f6, #eab308, #ef4444);\n      border-radius: 4px;\n      transition: width 0.05s linear;\n    }\n\n    .c019_progress_text {\n      font-family: monospace;\n      font-size: 0.9rem;\n      font-weight: 700;\n      min-width: 60px;\n      color: #38bdf8;\n    }\n\n    .c019_stats {\n      display: flex;\n      justify-content: space-between;\n      font-size: 0.85rem;\n      color: #94a3b8;\n      flex-wrap: wrap;\n      gap: 8px;\n    }\n\n    .c019_stat_val {\n      color: #f1f5f9;\n      font-weight: 600;\n    }\n\n    .c019_controls {\n      display: flex;\n      justify-content: space-between;\n      align-items: center;\n      flex-wrap: wrap;\n      gap: 10px;\n    }\n\n    .c019_btn_group {\n      display: flex;\n      gap: 8px;\n      flex-wrap: wrap;\n    }\n\n    .c019_btn {\n      padding: 8px 14px;\n      border-radius: 6px;\n      font-size: 0.85rem;\n      font-weight: 600;\n      cursor: pointer;\n      background: #334155;\n      color: #f8fafc;\n      border: 1px solid #475569;\n      transition: all 0.2s;\n    }\n\n    .c019_btn:hover { background: #475569; }\n    .c019_btn.active { background: #0284c7; border-color: #38bdf8; }\n\n    .c019_speed_select {\n      background: #334155;\n      color: #f8fafc;\n      border: 1px solid #475569;\n      padding: 6px 10px;\n      border-radius: 6px;\n      font-size: 0.85rem;\n      font-weight: 600;\n      cursor: pointer;\n    }\n\n    \/* SVG Canvas Container *\/\n    .c019_canvas_container {\n      width: 100%;\n      background: #090d16;\n      border-radius: 12px;\n      border: 1px solid #1e293b;\n      overflow: hidden;\n      display: flex;\n      justify-content: center;\n      align-items: center;\n      position: relative;\n    }\n\n    .c019_canvas_container svg {\n      width: 100%;\n      height: auto;\n      max-height: 70vh;\n      display: block;\n    }\n\n    \/* SVG Elements Base Style *\/\n    .c019_grid { stroke: #1e293b; stroke-width: 0.5; }\n    .c019_grid_centroid { fill: #334155; }\n    \n    .c019_line { stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }\n    .c019_node { r: 2.8; }\n    \n    \/* \u653e\u5927\u7684\u6587\u5b57\u98a8\u683c *\/\n    .c019_text { \n      font-size: 6.5px; \n      font-weight: 700; \n      font-family: system-ui, -apple-system, sans-serif; \n      fill: #cbd5e1;\n      text-shadow: 0px 0px 2px #000;\n    }\n\n    .c019_blue { stroke: #3b82f6; fill: #3b82f6; }\n    .c019_yellow { stroke: #eab308; fill: #eab308; }\n    .c019_red { stroke: #ef4444; fill: #ef4444; }\n\n    \/* High Contrast Mode *\/\n    .high-contrast .c019_blue { stroke: #00ffff !important; fill: #00ffff !important; }\n    .high-contrast .c019_yellow { stroke: #ffff00 !important; fill: #ffff00 !important; }\n    .high-contrast .c019_red { stroke: #ff0055 !important; fill: #ff0055 !important; }\n    .high-contrast .c019_text { \n      fill: #ffffff !important; \n      font-size: 7.5px !important; \n      font-weight: 900 !important;\n    }\n  <\/style>\n\n\n\n  <div class=\"c019_wrapper\" id=\"c019_main\">\n    <div class=\"c019_header\">\n      <div class=\"c019_title\">Yunbroidery Canvas-019 Embroidery Pattern Structure Animation<\/div>\n      <div class=\"c019_btn_group\">\n        <button class=\"c019_btn\" id=\"c019_contrast_btn\">\ud83d\udc41 High contrast mode<\/button>\n      <\/div>\n    <\/div>\n\n    <!-- \u6578\u64da\u5100\u8868\u677f\u8207\u9032\u5ea6\u689d -->\n    <div class=\"c019_dashboard\">\n      <div class=\"c019_progress_bar_container\">\n        <div class=\"c019_progress_bar\" id=\"c019_progress_bar\">\n          <div class=\"c019_progress_fill\" id=\"c019_progress_fill\"><\/div>\n        <\/div>\n        <div class=\"c019_progress_text\" id=\"c019_progress_text\">0.0%<\/div>\n      <\/div>\n      <div class=\"c019_stats\">\n        <span>Current number of needles: <span class=\"c019_stat_val\" id=\"c019_stitch_val\">0 \/ 54<\/span><\/span>\n        <span>Current position: <span class=\"c019_stat_val\" id=\"c019_node_val\">&#8212;<\/span><\/span>\n        <span>Color group categories: <span class=\"c019_stat_val\" id=\"c019_color_val\">Waiting to play<\/span><\/span>\n      <\/div>\n    <\/div>\n\n    <!-- \u63a7\u5236\u6309\u9215\u5340 -->\n    <div class=\"c019_controls\">\n      <div class=\"c019_btn_group\">\n        <button class=\"c019_btn active\" id=\"c019_play_btn\">\u25b6 Play<\/button>\n        <button class=\"c019_btn\" id=\"c019_pause_btn\">\u23f8 pause<\/button>\n        <button class=\"c019_btn\" id=\"c019_restart_btn\">\ud83d\udd04 Reset to 0 seconds<\/button>\n      <\/div>\n      <div style=\"display: flex; align-items: center; gap: 8px;\">\n        <span style=\"font-size: 0.85rem; color: #94a3b8;\">Playback speed:<\/span>\n        <select class=\"c019_speed_select\" id=\"c019_speed_select\">\n          <option value=\"0.5\">0.5x<\/option>\n          <option value=\"1\" selected=\"\">1.0x<\/option>\n          <option value=\"1.5\">1.5x<\/option>\n          <option value=\"2\">2.0x<\/option>\n          <option value=\"4\">4.0x<\/option>\n        <\/select>\n      <\/div>\n    <\/div>\n\n    <!-- \u523a\u7e61\u756b\u5e03 -->\n    <div class=\"c019_canvas_container\">\n      <svg viewBox=\"0 0 310 330\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" id=\"c019_svg\">\n        <defs>\n          <pattern id=\"c019_grid_pattern\" width=\"20\" height=\"20\" patternUnits=\"userSpaceOnUse\">\n            <path d=\"M 20 0 L 0 0 0 20\" fill=\"none\" class=\"c019_grid\"><\/path>\n            <circle cx=\"10\" cy=\"10\" r=\"1\" class=\"c019_grid_centroid\"><\/circle>\n          <\/pattern>\n        <\/defs>\n        <rect x=\"0\" y=\"0\" width=\"310\" height=\"330\" fill=\"url(#c019_grid_pattern)\"><\/rect>\n        \n        <g id=\"c019_lines_group\"><\/g>\n        <g id=\"c019_nodes_group\"><\/g>\n        <g id=\"c019_texts_group\"><\/g>\n      <\/svg>\n    <\/div>\n  <\/div>\n\n  <script>\n    \/\/ 1. \u523a\u7e61\u57fa\u790e\u5e7e\u4f55\u6578\u64da\u8a08\u7b97\n    const baseGroup = [\n      { id: 1, p1: [130, 10], p2: [90, 50], color: 'blue' },\n      { id: 2, p1: [150, 10], p2: [110, 50], color: 'blue' },\n      { id: 3, p1: [170, 10], p2: [130, 50], color: 'blue' },\n      { id: 4, p1: [190, 10], p2: [150, 50], color: 'blue' },\n      { id: 5, p1: [190, 30], p2: [150, 70], color: 'blue' },\n      { id: 6, p1: [190, 50], p2: [150, 90], color: 'blue' }\n    ];\n\n    function shiftLines(lines, dx, dy, idOffset, forceColor) {\n      return lines.map(line => ({\n        id: line.id + idOffset,\n        p1: [line.p1[0] + dx, line.p1[1] + dy],\n        p2: [line.p2[0] + dx, line.p2[1] + dy],\n        color: forceColor || line.color\n      }));\n    }\n\n    \/\/ \u751f\u6210\u5b8c\u6574 54 \u689d\u523a\u7e61\u7dda\u6bb5\u8207 108 \u500b\u9ede\u4f4d\n    const group1 = baseGroup; \/\/ 1-6\n    const group2 = shiftLines(group1, 60, 60, 6); \/\/ 7-12\n    const group3 = shiftLines(group2, 60, 60, 6); \/\/ 13-18\n    const blueLines = [...group1, ...group2, ...group3]; \/\/ 1-18\n\n    const yellowLines = shiftLines(blueLines, -40, 40, 18, 'yellow'); \/\/ 19-36\n    const redLines = shiftLines(blueLines, -80, 80, 36, 'red'); \/\/ 37-54\n\n    const allLines = [...blueLines, ...yellowLines, ...redLines];\n\n    \/\/ DOM \u5143\u7d20\u639b\u8f09\n    const linesGroup = document.getElementById('c019_lines_group');\n    const nodesGroup = document.getElementById('c019_nodes_group');\n    const textsGroup = document.getElementById('c019_texts_group');\n\n    const elementsMap = [];\n\n    allLines.forEach((lineData, idx) => {\n      const p1Num = idx * 2 + 1;\n      const p2Num = idx * 2 + 2;\n      const len = Math.hypot(lineData.p2[0] - lineData.p1[0], lineData.p2[1] - lineData.p1[1]);\n\n      \/\/ SVG Line\n      const lineEl = document.createElementNS('http:\/\/www.w3.org\/2000\/svg', 'line');\n      lineEl.setAttribute('x1', lineData.p1[0]);\n      lineEl.setAttribute('y1', lineData.p1[1]);\n      lineEl.setAttribute('x2', lineData.p2[0]);\n      lineEl.setAttribute('y2', lineData.p2[1]);\n      lineEl.setAttribute('class', `c019_line c019_${lineData.color}`);\n      lineEl.style.strokeDasharray = len;\n      lineEl.style.strokeDashoffset = len;\n      linesGroup.appendChild(lineEl);\n\n      \/\/ Node 1 & Node 2\n      const n1El = document.createElementNS('http:\/\/www.w3.org\/2000\/svg', 'circle');\n      n1El.setAttribute('cx', lineData.p1[0]);\n      n1El.setAttribute('cy', lineData.p1[1]);\n      n1El.setAttribute('class', `c019_node c019_${lineData.color}`);\n      n1El.style.opacity = 0;\n      nodesGroup.appendChild(n1El);\n\n      const n2El = document.createElementNS('http:\/\/www.w3.org\/2000\/svg', 'circle');\n      n2El.setAttribute('cx', lineData.p2[0]);\n      n2El.setAttribute('cy', lineData.p2[1]);\n      n2El.setAttribute('class', `c019_node c019_${lineData.color}`);\n      n2El.style.opacity = 0;\n      nodesGroup.appendChild(n2El);\n\n      \/\/ Text Labels\n      const t1El = document.createElementNS('http:\/\/www.w3.org\/2000\/svg', 'text');\n      t1El.setAttribute('x', lineData.p1[0] + (lineData.p1[0] >= lineData.p2[0] ? 3 : -3));\n      t1El.setAttribute('y', lineData.p1[1] - 3);\n      t1El.setAttribute('text-anchor', lineData.p1[0] >= lineData.p2[0] ? 'start' : 'end');\n      t1El.setAttribute('class', 'c019_text');\n      t1El.textContent = p1Num;\n      t1El.style.opacity = 0;\n      textsGroup.appendChild(t1El);\n\n      const t2El = document.createElementNS('http:\/\/www.w3.org\/2000\/svg', 'text');\n      t2El.setAttribute('x', lineData.p2[0] + (lineData.p2[0] <= lineData.p1[0] ? -3 : 3));\n      t2El.setAttribute('y', lineData.p2[1] + 7);\n      t2El.setAttribute('text-anchor', lineData.p2[0] <= lineData.p1[0] ? 'end' : 'start');\n      t2El.setAttribute('class', 'c019_text');\n      t2El.textContent = p2Num;\n      t2El.style.opacity = 0;\n      textsGroup.appendChild(t2El);\n\n      elementsMap.push({ lineData, len, lineEl, n1El, n2El, t1El, t2El, p1Num, p2Num });\n    });\n\n    \/\/ 2. \u52d5\u756b\u64ad\u653e\u63a7\u5236\u6838\u5fc3\n    const totalStitches = allLines.length;\n    const stitchDuration = 0.35; \/\/ \u6bcf\u91dd\u57fa\u6e96\u6642\u9593\uff08\u79d2\uff09\n    const totalTime = totalStitches * stitchDuration;\n\n    let currentTime = 0;\n    let isPlaying = true;\n    let speedRate = 1.0;\n    let lastTimestamp = null;\n\n    const fillEl = document.getElementById('c019_progress_fill');\n    const textEl = document.getElementById('c019_progress_text');\n    const stitchValEl = document.getElementById('c019_stitch_val');\n    const nodeValEl = document.getElementById('c019_node_val');\n    const colorValEl = document.getElementById('c019_color_val');\n    const progressBar = document.getElementById('c019_progress_bar');\n\n    function renderTime(t) {\n      const progress = Math.min(Math.max(t \/ totalTime, 0), 1);\n      fillEl.style.width = `${progress * 100}%`;\n      textEl.textContent = `${(progress * 100).toFixed(1)}%`;\n\n      const currentStitchIdx = Math.min(Math.floor(t \/ stitchDuration), totalStitches - 1);\n      const activeCount = Math.min(Math.floor(t \/ stitchDuration) + 1, totalStitches);\n      \n      stitchValEl.textContent = `${t <= 0 ? 0 : activeCount} \/ ${totalStitches}`;\n\n      elementsMap.forEach((item, idx) => {\n        const itemStartTime = idx * stitchDuration;\n        const itemProgress = Math.min(Math.max((t - itemStartTime) \/ stitchDuration, 0), 1);\n\n        \/\/ \u7dda\u6bb5\u7e6a\u88fd\u9032\u5ea6\n        item.lineEl.style.strokeDashoffset = item.len * (1 - itemProgress);\n\n        \/\/ \u7bc0\u9ede\u8207\u6587\u5b57\u6f38\u986f\n        if (itemProgress > 0) {\n          item.n1El.style.opacity = 1;\n          item.t1El.style.opacity = 1;\n        } else {\n          item.n1El.style.opacity = 0;\n          item.t1El.style.opacity = 0;\n        }\n\n        if (itemProgress >= 0.8) {\n          item.n2El.style.opacity = 1;\n          item.t2El.style.opacity = 1;\n        } else {\n          item.n2El.style.opacity = 0;\n          item.t2El.style.opacity = 0;\n        }\n      });\n\n      if (t > 0 && currentStitchIdx >= 0) {\n        const activeItem = elementsMap[currentStitchIdx];\n        nodeValEl.textContent = `point ${activeItem.p1Num} \u2794 point ${activeItem.p2Num}`;\n        const colorName = activeItem.lineData.color === 'blue' ? 'Blue Group' : activeItem.lineData.color === 'yellow' ? 'Yellow Group' : 'Red Group';\n        colorValEl.textContent = colorName;\n      } else {\n        nodeValEl.textContent = '--';\n        colorValEl.textContent = '\u6e96\u5099\u4e2d';\n      }\n    }\n\n    function animLoop(timestamp) {\n      if (!lastTimestamp) lastTimestamp = timestamp;\n      const deltaTime = (timestamp - lastTimestamp) \/ 1000;\n      lastTimestamp = timestamp;\n\n      if (isPlaying) {\n        currentTime += deltaTime * speedRate;\n        if (currentTime >= totalTime) {\n          currentTime = totalTime;\n          isPlaying = false;\n          updatePlayStateUI();\n        }\n        renderTime(currentTime);\n      }\n\n      requestAnimationFrame(animLoop);\n    }\n\n    requestAnimationFrame(animLoop);\n\n    \/\/ 3. UI \u4e92\u52d5\u4e8b\u4ef6\u76e3\u807d\n    const playBtn = document.getElementById('c019_play_btn');\n    const pauseBtn = document.getElementById('c019_pause_btn');\n    const restartBtn = document.getElementById('c019_restart_btn');\n    const contrastBtn = document.getElementById('c019_contrast_btn');\n    const speedSelect = document.getElementById('c019_speed_select');\n    const mainWrapper = document.getElementById('c019_main');\n\n    function updatePlayStateUI() {\n      if (isPlaying) {\n        playBtn.classList.add('active');\n        pauseBtn.classList.remove('active');\n      } else {\n        playBtn.classList.remove('active');\n        pauseBtn.classList.add('active');\n      }\n    }\n\n    playBtn.addEventListener('click', () => {\n      if (currentTime >= totalTime) currentTime = 0;\n      isPlaying = true;\n      updatePlayStateUI();\n    });\n\n    pauseBtn.addEventListener('click', () => {\n      isPlaying = false;\n      updatePlayStateUI();\n    });\n\n    restartBtn.addEventListener('click', () => {\n      currentTime = 0;\n      isPlaying = true;\n      renderTime(0);\n      updatePlayStateUI();\n    });\n\n    speedSelect.addEventListener('change', (e) => {\n      speedRate = parseFloat(e.target.value);\n    });\n\n    contrastBtn.addEventListener('click', () => {\n      mainWrapper.classList.toggle('high-contrast');\n      contrastBtn.classList.toggle('active');\n    });\n\n    \/\/ \u62d6\u52d5\u9032\u5ea6\u689d\u5c0b\u8ecc\n    let isDragging = false;\n    function handleScrub(e) {\n      const rect = progressBar.getBoundingClientRect();\n      const clickX = e.clientX - rect.left;\n      const ratio = Math.min(Math.max(clickX \/ rect.width, 0), 1);\n      currentTime = ratio * totalTime;\n      renderTime(currentTime);\n    }\n\n    progressBar.addEventListener('mousedown', (e) => {\n      isDragging = true;\n      handleScrub(e);\n    });\n\n    window.addEventListener('mousemove', (e) => {\n      if (isDragging) handleScrub(e);\n    });\n\n    window.addEventListener('mouseup', () => {\n      isDragging = false;\n    });\n  <\/script>\n\n\n\n<h2 class=\"wp-block-heading\">Module 5. Visual Gallery<\/h2>\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>Draft \/ Path Diagram<\/strong><\/td><\/tr><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td><strong>Front Pattern<\/strong>: 3D interlocking ladder grid texture<\/td><td><strong>Back Pattern<\/strong>: Neat parallel horizontal and diagonal cross-lines<\/td><td><strong>Draft Diagram<\/strong>: Precise grid coordinates and sequence markers<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Module 6. Algorithm Extensions &amp; Variant Syntax<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Physical Coverage Rate<\/h3>\n\n\n\n<h5 class=\"wp-block-heading\">This pattern uses diagonal lines of length L = 56.57 px on a 20px grid.<\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Unit Density<\/strong>: D = (Stitch count \u00d7 Thread width) \/ Total Area = (54 \u00d7 1.2mm) \/ Area<\/li>\n\n\n\n<li><strong>Coverage Estimation<\/strong>: With 6-strand thread (~1.2mm width), the overlapping color blocks produce a 30%-40% open mesh coverage, allowing the underlying fabric texture to remain visible.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Transformation Matrix<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The embroidery pattern can be transformed via a 2D matrix: <code>[ x' ] = [ cos(\u03b8) -sin(\u03b8) ] [ x ] + [ dx ]<\/code> <code>[ y' ] [ sin(\u03b8) cos(\u03b8) ] [ y ] [ dy ]<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>45\u00b0 Tilt Variant<\/strong>: Setting \u03b8 = 45\u00b0 transforms the stepped matrix into orthogonal alignments.<\/li>\n\n\n\n<li><strong>Mirror Variant<\/strong>: Applying x-axis reflection matrix <code>[ -1, 0; 0, 1 ]<\/code> generates inverted ladder structures.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Procedural Expansion Parameter Table<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>const Canvas019_Parameters_EN = {\n  unitSize: { x: 3, y: 3 },      \/\/ Base unit grid size (3x3)\n  gridSpacing: 20,                \/\/ Grid spacing (px)\n  stitchLength: 56.57,            \/\/ Individual stitch length (px)\n  stepSequence: &#91;\"H\", \"H\", \"H\", \"H\", \"V\", \"V\"], \/\/ 4 Horizontal, 2 Vertical step sequence\n  colorGroupShift: {\n    group1: { x: 0, y: 0 },\n    group2: { x: -40, y: 40 },\n    group3: { x: -80, y: 80 }\n  },\n  threadGauge: \"DMC 25 # 6-strands\"\n};\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Case Study: Canvas-019 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-7258","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/yunbroidery.com\/en\/wp-json\/wp\/v2\/pages\/7258","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=7258"}],"version-history":[{"count":4,"href":"https:\/\/yunbroidery.com\/en\/wp-json\/wp\/v2\/pages\/7258\/revisions"}],"predecessor-version":[{"id":7551,"href":"https:\/\/yunbroidery.com\/en\/wp-json\/wp\/v2\/pages\/7258\/revisions\/7551"}],"wp:attachment":[{"href":"https:\/\/yunbroidery.com\/en\/wp-json\/wp\/v2\/media?parent=7258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}