{"id":50395,"date":"2026-10-09T14:15:29","date_gmt":"2026-10-09T14:15:29","guid":{"rendered":"https:\/\/hollandmechanics.com\/?page_id=50395"},"modified":"2026-10-13T10:01:13","modified_gmt":"2026-10-13T10:01:13","slug":"wheel-lacing-calculator","status":"publish","type":"page","link":"https:\/\/hollandmechanics.com\/en\/wheel-lacing-calculator\/","title":{"rendered":"Wheel Lacing Calculator"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"50395\" class=\"elementor elementor-50395\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-d3f3ce5 e-flex e-con-boxed e-con e-parent\" data-id=\"d3f3ce5\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-d610ccc e-con-full e-flex e-con e-child\" data-id=\"d610ccc\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t<div class=\"elementor-element elementor-element-fca3a7d e-flex e-con-boxed e-con e-child\" data-id=\"fca3a7d\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-51bd97c elementor-widget__width-inherit elementor-widget elementor-widget-html\" data-id=\"51bd97c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<!-- Holland Mechanics lacing explainer: paste into one HTML widget. Options as data attributes on the section,\n     e.g. <section id=\"hmlx-app\" class=\"hm-lx\" data-machine=\"ct\" data-rim=\"angle\" data-bare> -->\n<!--noptimize-->\n<link rel=\"preconnect\" href=\"https:\/\/fonts.googleapis.com\">\n<link rel=\"preconnect\" href=\"https:\/\/fonts.gstatic.com\" crossorigin>\n<link href=\"https:\/\/fonts.googleapis.com\/css2?family=Inter:opsz,wght@14..32,400..800&family=Montserrat:wght@700;800&display=swap\" rel=\"stylesheet\">\n<style>\n  \n  \n  \/* the page theme must not restyle the widget *\/\n  #hmlx-app button{margin:0;box-shadow:none;text-transform:none;letter-spacing:normal;min-height:0;line-height:1.2;border-radius:0;font-family:inherit;text-decoration:none}\n  #hmlx-app table,#hmlx-app th,#hmlx-app td{border:0;margin:0}\n  #hmlx-app p,#hmlx-app h2,#hmlx-app h3{padding:0;letter-spacing:normal;color:inherit;font-family:inherit;line-height:1.5}\n  #hmlx-app label,#hmlx-app output,#hmlx-app small,#hmlx-app b,#hmlx-app strong,#hmlx-app i{font-family:inherit;color:inherit;margin:0;padding:0;background:none}\n  #hmlx-app label{display:inline;font-weight:inherit;font-size:inherit}\n  #hmlx-app svg{overflow:hidden;max-width:none}\n  #hmlx-app input[type=range]{padding:0;border:0;background:none;box-shadow:none}\n  #hmlx-app{\n    --hm-blue:#005389; --label-blue:#1F5F7C; --sub-blue:#317A9E; --accent:#B3E9FF; --red:#D63031;\n    --tint:#F3F8FD; --border:#DFE3E7; --hair:#E6EEF3; --body:#53585B; --muted:#787979; --white:#FFFFFF;\n    --ok:#119915; --warn:#C26A00;\n    --ink-2:#53585B; --line:#DFE3E7;\n  }\n  #hmlx-app,#hmlx-app *{box-sizing:border-box}\n  #hmlx-app{background:var(--white);color:var(--body);font:400 15px\/1.5 Inter, Arial, sans-serif;text-align:left}\n  #hmlx-app{max-width:1180px;margin:0 auto;padding:26px 16px}\n  #hmlx-app .lx-head{margin-bottom:26px}\n  #hmlx-app .mark{display:flex;align-items:center;gap:10px;margin-bottom:14px}\n  #hmlx-app .mark svg{width:26px;height:26px}\n  #hmlx-app .mark i{display:block;width:44px;height:2px;background:var(--red)}\n  #hmlx-app .eyebrow{margin:0 0 6px;font:700 12px\/1.3 Inter, Arial, sans-serif;letter-spacing:.12em;text-transform:uppercase;color:var(--label-blue)}\n  #hmlx-app .lx-head h2{margin:0 0 14px;max-width:640px;font:800 clamp(22px,3vw,32px)\/1.15 Montserrat, Arial, sans-serif;text-transform:uppercase;color:var(--hm-blue)}\n  #hmlx-app .lead{margin:0;max-width:720px;font-size:16px}\n  #hmlx-app .rule{height:2px;background:var(--hair);margin:26px 0 0}\n\n  #hmlx-app .controls{display:flex;flex-wrap:wrap;gap:14px 26px;align-items:flex-end;padding:14px;border:2px solid var(--border);border-radius:8px;background:var(--tint)}\n  #hmlx-app .ctl{display:flex;flex-direction:column;gap:6px}\n  #hmlx-app .ctl>span{font:700 11px\/1 Inter, Arial, sans-serif;letter-spacing:.1em;text-transform:uppercase;color:var(--label-blue)}\n  #hmlx-app .seg{display:inline-flex;border:2px solid var(--border);border-radius:8px;background:var(--white);overflow:hidden}\n  #hmlx-app .seg button{appearance:none;border:0;background:transparent;padding:8px 14px;font:700 13px\/1.2 Inter, Arial, sans-serif;color:var(--hm-blue);cursor:pointer}\n  #hmlx-app .seg button+button{border-left:2px solid var(--border)}\n  #hmlx-app .seg button[aria-pressed=\"true\"]{background:var(--hm-blue);color:var(--white)}\n  #hmlx-app .seg button:focus-visible,#hmlx-app .play:focus-visible{outline:3px solid var(--accent);outline-offset:-3px}\n  #hmlx-app .ctl.range input{width:170px;margin:6px 0;accent-color:var(--hm-blue)}\n  #hmlx-app .ctl.off{opacity:.45}\n  #hmlx-app .ctl output{margin-left:8px;color:var(--hm-blue);letter-spacing:0;text-transform:none;font-size:13px}\n  #hmlx-app .transport{margin-left:auto;flex-direction:row;align-items:center;gap:8px}\n  #hmlx-app .play{appearance:none;border:2px solid var(--hm-blue);border-radius:8px;background:var(--hm-blue);color:var(--white);padding:8px 16px;font:700 13px\/1.2 Inter, Arial, sans-serif;cursor:pointer;min-width:84px}\n  #hmlx-app .play.ghost{background:var(--white);color:var(--hm-blue);min-width:0}\n\n  #hmlx-app .stage{margin-top:14px;border:2px solid var(--border);border-radius:8px;background:#EEF2F8;padding:8px}\n  #hmlx-app .view{position:relative}\n  #hmlx-app .view+.view{margin-top:6px;padding-top:6px;border-top:2px solid var(--white)}\n  #hmlx-app .view-label{position:absolute;right:10px;top:8px;font:700 11px\/1.2 Inter, Arial, sans-serif;letter-spacing:.1em;text-transform:uppercase;color:var(--label-blue)}\n  #hmlx-app .view svg{display:block;width:100%;height:auto}\n  #hmlx-app .drill{display:flex;gap:0}\n  #hmlx-app .drill svg{min-width:0}\n  #hmlx-app #hmlx-drillA{flex:325 1 0} #hmlx-app #hmlx-drillB{flex:490 1 0}\n  #hmlx-app .advice{margin:8px 6px 6px;background:var(--white);border:2px solid var(--border);border-radius:8px;padding:12px 14px}\n  #hmlx-app .advice h4{margin:0 0 6px;font:700 11px\/1.3 Inter, Arial, sans-serif;letter-spacing:.1em;text-transform:uppercase;color:var(--label-blue)}\n  #hmlx-app .advice p{margin:0 0 10px;font-size:13px}\n  #hmlx-app .advice .wrap{overflow-x:auto}\n  #hmlx-app .adv{width:100%;border-collapse:collapse;font-size:13px;min-width:680px}\n  #hmlx-app .adv th{text-align:left;padding:6px 8px;font:700 10.5px\/1.3 Inter, Arial, sans-serif;letter-spacing:.06em;text-transform:uppercase;color:var(--label-blue);border-bottom:2px solid var(--border)}\n  #hmlx-app .adv td{padding:6px 8px;border-top:1px solid var(--hair)}\n  #hmlx-app .adv td small{display:block;color:var(--muted);font-size:11.5px}\n  #hmlx-app .advice .play{margin-top:10px}\n  #hmlx-app .specs{display:flex;flex-wrap:wrap;gap:6px 8px;margin:4px 6px 6px}\n  #hmlx-app .spec{background:var(--white);border:2px solid var(--border);border-radius:8px;padding:4px 10px;font-size:13px;color:var(--body)}\n  #hmlx-app .spec b{color:var(--label-blue);font-weight:700;margin-right:6px}\n\n  #hmlx-app .info{display:grid;grid-template-columns:1fr 1fr 1fr;gap:14px;margin-top:14px}\n  #hmlx-app .card{border:2px solid var(--border);border-radius:8px;padding:14px;background:var(--white)}\n  #hmlx-app .card b{display:block;font:700 11px\/1.3 Inter, Arial, sans-serif;letter-spacing:.1em;text-transform:uppercase;color:var(--label-blue);margin-bottom:6px}\n  #hmlx-app .card .v{font:800 18px\/1.25 Montserrat, Arial, sans-serif;color:var(--hm-blue)}\n  #hmlx-app .card .v.ok{color:var(--ok)} #hmlx-app .card .v.warn{color:var(--warn)} #hmlx-app .card .v.bad{color:var(--red)}\n  #hmlx-app .card p{margin:6px 0 0;font-size:14px}\n  #hmlx-app .explain{margin:14px 0 0;font-size:16px;max-width:900px}\n  #hmlx-app .status{margin-top:14px;font-size:14px;color:var(--muted)}\n  #hmlx-app .status strong{color:var(--hm-blue)}\n  #hmlx-app .cmp-title{margin:26px 0 10px;font:800 18px\/1.2 Montserrat, Arial, sans-serif;text-transform:uppercase;color:var(--hm-blue)}\n  #hmlx-app .tbl-wrap{overflow-x:auto;border:2px solid var(--border);border-radius:8px}\n  #hmlx-app .cmp{width:100%;border-collapse:collapse;font-size:14px;min-width:760px}\n  #hmlx-app .cmp th{text-align:left;padding:10px 12px;font:700 11px\/1.3 Inter, Arial, sans-serif;letter-spacing:.08em;text-transform:uppercase;color:var(--label-blue);background:var(--tint);border-bottom:2px solid var(--border)}\n  #hmlx-app .cmp td{padding:10px 12px;border-top:1px solid var(--hair);vertical-align:top}\n  #hmlx-app .cmp tr.sel td{background:var(--tint)} #hmlx-app .cmp tr.sel td:first-child{box-shadow:inset 4px 0 0 var(--hm-blue)}\n  #hmlx-app .cmp tbody tr{cursor:pointer} #hmlx-app .cmp tbody tr:hover td{background:#F8FBFE}\n  #hmlx-app .cmp td b{display:block;color:var(--hm-blue);font-weight:700}\n  #hmlx-app .cmp small{display:block;color:var(--muted);font-size:12px}\n  #hmlx-app .st{display:inline-flex;align-items:center;gap:6px;font-weight:700}\n  #hmlx-app .st i{width:9px;height:9px;border-radius:50%;flex:none}\n  #hmlx-app .st.ok{color:var(--ok)} #hmlx-app .st.ok i{background:var(--ok)} #hmlx-app .st.opt{color:var(--warn)} #hmlx-app .st.opt i{background:var(--warn)} #hmlx-app .st.no{color:var(--red)} #hmlx-app .st.no i{background:var(--red)}\n  #hmlx-app .note{margin:8px 0 0;font-size:12px;color:var(--muted)}\n  #hmlx-app .warn-line{color:var(--red);font-weight:700}\n  #hmlx-app .risk-line,#hmlx-app small.risk{color:var(--warn);font-weight:700}\n  #hmlx-app .legend{display:flex;flex-wrap:wrap;gap:6px 18px;margin-top:14px;font-size:13px;color:var(--muted)}\n  #hmlx-app .legend span{display:inline-flex;align-items:center;gap:6px}\n  #hmlx-app .legend i{display:inline-block;width:16px;height:4px;border-radius:2px}\n  @media (max-width:760px){ #hmlx-app .info{grid-template-columns:1fr} #hmlx-app .transport{margin-left:0} #hmlx-app .seg button{padding:8px 10px} #hmlx-app .view-label{position:static;display:block;margin:2px 4px 6px} #hmlx-app .drill{flex-direction:column} #hmlx-app #hmlx-drillA,#hmlx-app #hmlx-drillB{flex:none;width:100%} }\n  #hmlx-app.bare .lx-head{display:none}\n\n  \/* ===== modern layer, as on the spoke & wheel configurator (v31 \/ v32): the same HM colours, a refined treatment.\n     Segmented tracks with a white thumb for modes, solid HM blue for the values you choose, filled controls,\n     cards on hairlines with a soft lift, a blue header band with a laced wheel, fluid width and a two-pane\n     layout when the widget gets the room (a container query, so it follows the block it is embedded in). ===== *\/\n  #hmlx-app{--track:#E3EAF1; --fill:#F4F7FA; --hairA:rgba(0,83,137,.11); --hairB:rgba(0,83,137,.18); --ring:rgba(0,83,137,.14);\n    --tintA:rgba(0,83,137,.07); --tintB:rgba(0,83,137,.11);\n    --shadow-1:0 1px 2px rgba(15,39,66,.05),0 10px 24px -14px rgba(15,39,66,.16);\n    --shadow-thumb:0 1px 2px rgba(15,39,66,.14),0 2px 6px rgba(15,39,66,.08);\n    --shadow-press:0 6px 16px -6px rgba(0,83,137,.55);\n    --r-card:18px; --r-ctl:11px; --r-thumb:8px}\n  #hmlx-app{max-width:2200px;padding:clamp(16px,2vw,32px) clamp(16px,3vw,48px);font-feature-settings:\"cv11\",\"ss01\";letter-spacing:-.003em;text-rendering:optimizeLegibility;container:hmlx \/ inline-size}\n\n  \/* header band: HM blue with a laced wheel drawn in white *\/\n  #hmlx-app .lx-head{margin-bottom:22px;padding:clamp(24px,3vw,40px) clamp(22px,3vw,44px);border-radius:var(--r-card);color:#fff;overflow:hidden;\n    background:url(\"data:image\/svg+xml,%3Csvg xmlns=%22http:\/\/www.w3.org\/2000\/svg%22 viewBox=%220 0 400 400%22%3E%3Ccircle cx=%22200%22 cy=%22200%22 r=%22176%22 fill=%22none%22 stroke=%22white%22 stroke-opacity=%22.16%22 stroke-width=%2212%22\/%3E%3Ccircle cx=%22200%22 cy=%22200%22 r=%22160%22 fill=%22none%22 stroke=%22white%22 stroke-opacity=%22.10%22 stroke-width=%221.5%22\/%3E%3Ccircle cx=%22200%22 cy=%22200%22 r=%2226%22 fill=%22none%22 stroke=%22white%22 stroke-opacity=%22.22%22 stroke-width=%223%22\/%3E%3Ccircle cx=%22200%22 cy=%22200%22 r=%228%22 fill=%22white%22 fill-opacity=%22.18%22\/%3E%3Cline x1=%22220.0%22 y1=%22200.0%22 x2=%22262.0%22 y2=%22349.7%22 stroke=%22white%22 stroke-opacity=%220.2%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22218.5%22 y1=%22207.7%22 x2=%22314.6%22 y2=%2285.4%22 stroke=%22white%22 stroke-opacity=%220.2%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22214.1%22 y1=%22214.1%22 x2=%22138.0%22 y2=%22349.7%22 stroke=%22white%22 stroke-opacity=%220.2%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22207.7%22 y1=%22218.5%22 x2=%22362.0%22 y2=%22200.0%22 stroke=%22white%22 stroke-opacity=%220.2%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22200.0%22 y1=%22220.0%22 x2=%2250.3%22 y2=%22262.0%22 stroke=%22white%22 stroke-opacity=%220.2%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22192.3%22 y1=%22218.5%22 x2=%22314.6%22 y2=%22314.6%22 stroke=%22white%22 stroke-opacity=%220.2%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22185.9%22 y1=%22214.1%22 x2=%2250.3%22 y2=%22138.0%22 stroke=%22white%22 stroke-opacity=%220.2%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22181.5%22 y1=%22207.7%22 x2=%22200.0%22 y2=%22362.0%22 stroke=%22white%22 stroke-opacity=%220.2%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22180.0%22 y1=%22200.0%22 x2=%22138.0%22 y2=%2250.3%22 stroke=%22white%22 stroke-opacity=%220.2%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22181.5%22 y1=%22192.3%22 x2=%2285.4%22 y2=%22314.6%22 stroke=%22white%22 stroke-opacity=%220.2%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22185.9%22 y1=%22185.9%22 x2=%22262.0%22 y2=%2250.3%22 stroke=%22white%22 stroke-opacity=%220.2%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22192.3%22 y1=%22181.5%22 x2=%2238.0%22 y2=%22200.0%22 stroke=%22white%22 stroke-opacity=%220.2%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22200.0%22 y1=%22180.0%22 x2=%22349.7%22 y2=%22138.0%22 stroke=%22white%22 stroke-opacity=%220.2%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22207.7%22 y1=%22181.5%22 x2=%2285.4%22 y2=%2285.4%22 stroke=%22white%22 stroke-opacity=%220.2%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22214.1%22 y1=%22185.9%22 x2=%22349.7%22 y2=%22262.0%22 stroke=%22white%22 stroke-opacity=%220.2%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22218.5%22 y1=%22192.3%22 x2=%22200.0%22 y2=%2238.0%22 stroke=%22white%22 stroke-opacity=%220.2%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22219.6%22 y1=%22203.9%22 x2=%22290.0%22 y2=%2265.3%22 stroke=%22white%22 stroke-opacity=%220.13%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22216.6%22 y1=%22211.1%22 x2=%22168.4%22 y2=%22358.9%22 stroke=%22white%22 stroke-opacity=%220.13%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22211.1%22 y1=%22216.6%22 x2=%22358.9%22 y2=%22168.4%22 stroke=%22white%22 stroke-opacity=%220.13%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22203.9%22 y1=%22219.6%22 x2=%2265.3%22 y2=%22290.0%22 stroke=%22white%22 stroke-opacity=%220.13%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22196.1%22 y1=%22219.6%22 x2=%22334.7%22 y2=%22290.0%22 stroke=%22white%22 stroke-opacity=%220.13%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22188.9%22 y1=%22216.6%22 x2=%2241.1%22 y2=%22168.4%22 stroke=%22white%22 stroke-opacity=%220.13%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22183.4%22 y1=%22211.1%22 x2=%22231.6%22 y2=%22358.9%22 stroke=%22white%22 stroke-opacity=%220.13%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22180.4%22 y1=%22203.9%22 x2=%22110.0%22 y2=%2265.3%22 stroke=%22white%22 stroke-opacity=%220.13%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22180.4%22 y1=%22196.1%22 x2=%22110.0%22 y2=%22334.7%22 stroke=%22white%22 stroke-opacity=%220.13%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22183.4%22 y1=%22188.9%22 x2=%22231.6%22 y2=%2241.1%22 stroke=%22white%22 stroke-opacity=%220.13%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22188.9%22 y1=%22183.4%22 x2=%2241.1%22 y2=%22231.6%22 stroke=%22white%22 stroke-opacity=%220.13%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22196.1%22 y1=%22180.4%22 x2=%22334.7%22 y2=%22110.0%22 stroke=%22white%22 stroke-opacity=%220.13%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22203.9%22 y1=%22180.4%22 x2=%2265.3%22 y2=%22110.0%22 stroke=%22white%22 stroke-opacity=%220.13%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22211.1%22 y1=%22183.4%22 x2=%22358.9%22 y2=%22231.6%22 stroke=%22white%22 stroke-opacity=%220.13%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22216.6%22 y1=%22188.9%22 x2=%22168.4%22 y2=%2241.1%22 stroke=%22white%22 stroke-opacity=%220.13%22 stroke-width=%221.4%22\/%3E%3Cline x1=%22219.6%22 y1=%22196.1%22 x2=%22290.0%22 y2=%22334.7%22 stroke=%22white%22 stroke-opacity=%220.13%22 stroke-width=%221.4%22\/%3E%3C\/svg%3E\") no-repeat right -70px center\/400px auto,linear-gradient(118deg,#0a6aa8 0%,var(--hm-blue) 46%,#003a61 100%)}\n  #hmlx-app .lx-head .mark svg circle,#hmlx-app .lx-head .mark svg path{stroke:#fff} #hmlx-app .lx-head .mark svg circle:last-of-type{fill:#fff}\n  #hmlx-app .lx-head .eyebrow{color:var(--accent)}\n  #hmlx-app .lx-head h2{color:#fff;margin-bottom:12px}\n  #hmlx-app .lx-head .lead{color:rgba(255,255,255,.86)}\n  #hmlx-app .lx-head .rule{display:none}\n\n  \/* settings: one white card, labels in sentence case *\/\n  #hmlx-app .controls{gap:18px 28px;padding:22px 24px;border:1px solid var(--hairA);border-radius:var(--r-card);background:var(--white);box-shadow:var(--shadow-1)}\n  #hmlx-app .ctl{gap:8px}\n  #hmlx-app .ctl>span{font:600 13px\/1.2 Inter,Arial,sans-serif;letter-spacing:-.005em;text-transform:none;color:var(--label-blue)}\n  #hmlx-app .ctl output{font-weight:700;font-variant-numeric:tabular-nums}\n\n  \/* mode switches: a segmented track with a white thumb *\/\n  #hmlx-app .seg{background:var(--track);border:0;border-radius:var(--r-ctl);padding:3px;gap:2px;overflow:visible;flex-wrap:wrap}\n  #hmlx-app .seg button{border-radius:var(--r-thumb);font:600 13px\/1.2 Inter,Arial,sans-serif;color:var(--muted);padding:7px 14px;transition:background .15s,color .15s,box-shadow .15s}\n  #hmlx-app .seg button+button{border-left:0}\n  #hmlx-app .seg button[aria-pressed=\"true\"]{background:var(--white);color:var(--hm-blue);box-shadow:var(--shadow-thumb)}\n  #hmlx-app .seg button:not([aria-pressed=\"true\"]):hover{background:rgba(255,255,255,.55);color:var(--hm-blue)}\n  \/* value choices (machine, wheel size, spoke, hub): calm at rest, solid HM blue when chosen *\/\n  #hmlx-app .seg:is([data-key=\"mach\"],[data-key=\"bsd\"],[data-key=\"gauge\"],[data-key=\"hub\"]){background:transparent;padding:0;gap:6px}\n  #hmlx-app .seg:is([data-key=\"mach\"],[data-key=\"bsd\"],[data-key=\"gauge\"],[data-key=\"hub\"]) button{background:var(--fill);box-shadow:inset 0 0 0 1px var(--hairA);color:var(--hm-blue);border-radius:var(--r-ctl);padding:9px 14px}\n  #hmlx-app .seg:is([data-key=\"mach\"],[data-key=\"bsd\"],[data-key=\"gauge\"],[data-key=\"hub\"]) button:not([aria-pressed=\"true\"]):hover{background:var(--white);box-shadow:inset 0 0 0 1px var(--hairB)}\n  #hmlx-app .seg:is([data-key=\"mach\"],[data-key=\"bsd\"],[data-key=\"gauge\"],[data-key=\"hub\"]) button[aria-pressed=\"true\"]{background:var(--hm-blue);color:#fff;box-shadow:var(--shadow-press)}\n\n  \/* sliders: a filled track (the page sets --p) and a white thumb *\/\n  #hmlx-app .ctl.range input{-webkit-appearance:none;appearance:none;width:180px;height:22px;margin:2px 0;background:transparent;cursor:pointer}\n  #hmlx-app .ctl.range input::-webkit-slider-runnable-track{height:6px;border-radius:999px;background:linear-gradient(to right,var(--hm-blue) var(--p,50%),var(--track) var(--p,50%))}\n  #hmlx-app .ctl.range input::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;margin-top:-7px;border-radius:50%;background:#fff;border:0;box-shadow:0 0 0 1px var(--hairB),var(--shadow-thumb)}\n  #hmlx-app .ctl.range input::-moz-range-track{height:6px;border-radius:999px;background:var(--track)}\n  #hmlx-app .ctl.range input::-moz-range-progress{height:6px;border-radius:999px;background:var(--hm-blue)}\n  #hmlx-app .ctl.range input::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:#fff;border:0;box-shadow:0 0 0 1px var(--hairB),var(--shadow-thumb)}\n  #hmlx-app .ctl.range input:focus-visible{outline:none}\n  #hmlx-app .ctl.range input:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 4px var(--ring),0 0 0 1px var(--hm-blue)}\n\n  \/* buttons *\/\n  #hmlx-app .play{border:0;border-radius:12px;min-height:40px;padding:0 18px;font:600 14px\/1 Inter,Arial,sans-serif;box-shadow:var(--shadow-press);transition:filter .12s,transform .12s,background .12s}\n  #hmlx-app .play:hover{filter:brightness(1.1);transform:translateY(-1px)}\n  #hmlx-app .play:active{transform:none;filter:brightness(.95)}\n  #hmlx-app .play.ghost{background:var(--tintA);color:var(--hm-blue);box-shadow:none;min-width:40px}\n  #hmlx-app .play.ghost:hover{background:var(--tintB);filter:none}\n\n  \/* the drawings: one canvas card, view names as soft chips *\/\n  #hmlx-app .stage{margin-top:20px;border:1px solid var(--hairA);border-radius:var(--r-card);box-shadow:var(--shadow-1);padding:10px}\n  #hmlx-app .view+.view{border-top:1px solid rgba(255,255,255,.9)}\n  #hmlx-app .view-label{top:10px;right:12px;padding:4px 11px;border-radius:999px;background:rgba(255,255,255,.78);box-shadow:inset 0 0 0 1px var(--hairA);font:600 11.5px\/1.3 Inter,Arial,sans-serif;letter-spacing:.01em;text-transform:none;color:var(--hm-blue)}\n  #hmlx-app .specs{gap:6px;margin:6px 6px 8px}\n  #hmlx-app .spec{border:0;box-shadow:inset 0 0 0 1px var(--hairA);border-radius:12px;padding:6px 12px}\n  #hmlx-app .advice{margin:8px 6px 6px;border:1px solid var(--hairA);border-radius:16px;box-shadow:var(--shadow-1);padding:18px 20px}\n  #hmlx-app .advice h4{font:700 15px\/1.3 Inter,Arial,sans-serif;letter-spacing:-.01em;text-transform:none;color:var(--hm-blue);margin-bottom:8px}\n  #hmlx-app .advice p{font-size:13.5px}\n  #hmlx-app .adv th{font:600 11px\/1.3 Inter,Arial,sans-serif;letter-spacing:.04em;border-bottom:1px solid var(--hairB)}\n  #hmlx-app .adv td{border-top:1px solid var(--hairA)}\n\n  \/* the three answers: cards with a bolder statement *\/\n  #hmlx-app .info{gap:18px;margin-top:18px}\n  #hmlx-app .card{border:1px solid var(--hairA);border-radius:var(--r-card);box-shadow:var(--shadow-1);padding:20px 22px 22px}\n  #hmlx-app .card b{font:600 12px\/1.3 Inter,Arial,sans-serif;letter-spacing:.06em;margin-bottom:8px}\n  #hmlx-app .card .v{font:700 21px\/1.2 Inter,Arial,sans-serif;letter-spacing:-.022em}\n  #hmlx-app .card p{font-size:14px;line-height:1.55}\n  #hmlx-app .explain{font-size:16.5px;line-height:1.55;letter-spacing:-.006em}\n  #hmlx-app .status{padding:10px 14px;border-radius:12px;background:var(--fill);box-shadow:inset 0 0 0 1px var(--hairA)}\n\n  \/* machine table *\/\n  #hmlx-app .cmp-title{margin:30px 0 12px;font:700 22px\/1.2 Inter,Arial,sans-serif;letter-spacing:-.02em;text-transform:none}\n  #hmlx-app .tbl-wrap{border:1px solid var(--hairA);border-radius:var(--r-card);box-shadow:var(--shadow-1);background:var(--white)}\n  #hmlx-app .cmp th{font:600 11px\/1.3 Inter,Arial,sans-serif;letter-spacing:.05em;background:var(--fill);border-bottom:1px solid var(--hairB)}\n  #hmlx-app .cmp td{border-top:1px solid var(--hairA)}\n  #hmlx-app .cmp tr.sel td{background:rgba(0,83,137,.045)}\n  #hmlx-app .cmp tbody tr:hover td{background:rgba(0,83,137,.03)}\n  #hmlx-app .legend span{padding:4px 10px;border-radius:999px;background:var(--fill)}\n\n  @media (max-width:760px){ #hmlx-app .controls{padding:18px 16px} #hmlx-app .card{padding:18px} #hmlx-app .lx-head{background-size:280px auto,auto;background-position:right -110px center,0 0} }\n\n  \/* wide: the settings as a sticky column at the left, the drawings and answers to the right *\/\n  @container hmlx (min-width:1320px){\n    #hmlx-app .lx-body{display:flex;gap:24px;align-items:flex-start}\n    #hmlx-app .lx-body>.controls{flex:0 0 360px;position:sticky;top:16px;max-height:calc(100vh - 32px);overflow:auto;flex-direction:column;align-items:stretch;flex-wrap:nowrap;gap:16px}\n    #hmlx-app .lx-body>.controls .ctl.range input{width:100%}\n    #hmlx-app .lx-body>.controls .transport{margin-left:0;flex-wrap:wrap}\n    #hmlx-app .lx-main{flex:1 1 auto;min-width:0}\n    #hmlx-app .lx-main>.stage{margin-top:0}\n  }\n\n  \/* Elementor \/ theme guards *\/\n  #hmlx-app button:hover,#hmlx-app button:focus{background-image:none;box-shadow:none;text-decoration:none}\n  #hmlx-app .seg button:hover{background:transparent;color:var(--hm-blue)}\n  #hmlx-app .seg button[aria-pressed=\"true\"]:hover{background:var(--hm-blue);color:var(--white)}\n  #hmlx-app .play:hover{background:var(--hm-blue);color:var(--white);border-color:var(--hm-blue)}\n  #hmlx-app .play.ghost:hover{background:var(--white);color:var(--hm-blue)}\n  #hmlx-app input[type=range]{height:auto;min-height:0;border-radius:0;-webkit-appearance:auto;appearance:auto;font-size:inherit;transition:none}\n  #hmlx-app tbody>tr:nth-child(odd)>td,#hmlx-app tbody>tr:nth-child(even)>td{background-color:transparent}\n  #hmlx-app .cmp tr.sel td{background:var(--tint)} #hmlx-app .cmp tbody tr:not(.sel):hover td{background:#F8FBFE}\n  #hmlx-app img,#hmlx-app svg{border:0;box-shadow:none}\n  #hmlx-app h4{padding:0;letter-spacing:normal}\n  \/* full screen width (remove with data-boxed on the section) *\/\n  #hmlx-app:not([data-boxed]){width:100vw;max-width:none;margin-left:calc(50% - 50vw);margin-right:0;padding-left:max(clamp(16px,3vw,48px),calc((100vw - 2200px) \/ 2));padding-right:max(clamp(16px,3vw,48px),calc((100vw - 2200px) \/ 2))}\n<\/style>\n<section id=\"hmlx-app\" class=\"hm-lx\" aria-label=\"Lacing machine: straight or angled screwdriver\">\n<svg id=\"hmlx-defs\" width=\"0\" height=\"0\" style=\"position:absolute;width:0;height:0;overflow:hidden\" aria-hidden=\"true\"><\/svg>\n  <header class=\"lx-head\">\n    <div class=\"mark\"><svg viewBox=\"0 0 26 26\" aria-hidden=\"true\"><circle cx=\"13\" cy=\"13\" r=\"11\" fill=\"none\" stroke=\"#1F5F7C\" stroke-width=\"2.4\"\/><circle cx=\"13\" cy=\"13\" r=\"2.6\" fill=\"#1F5F7C\"\/><path d=\"M13 2v22M2 13h22M5.2 5.2l15.6 15.6M20.8 5.2 5.2 20.8\" stroke=\"#1F5F7C\" stroke-width=\"1.2\"\/><\/svg><i><\/i><\/div>\n    <p class=\"eyebrow\">Wheel lacing<\/p>\n    <h2>Straight or angled screwdriver<\/h2>\n    <p class=\"lead\">Rims are drilled either radially or along each spoke line. See how the screwdriver of the ECL, ISL, Inline Lacer and CT Twin Lacer meets the nipple in each case, and which machine fits your wheel.<\/p>\n    <div class=\"rule\"><\/div>\n  <\/header>\n\n  <div class=\"lx-body\">\n  <div class=\"controls\" role=\"group\" aria-label=\"Animation settings\">\n    <div class=\"ctl\"><span id=\"hmlx-l-rim\">Rim drilling<\/span><div class=\"seg\" data-key=\"drill\" aria-labelledby=\"hmlx-l-rim\"><button data-v=\"straight\">Straight-drilled<\/button><button data-v=\"angle\">Angle-drilled<\/button><\/div><\/div>\n    <div class=\"ctl\"><span id=\"hmlx-l-mac\">Machine<\/span><div class=\"seg\" data-key=\"mach\" aria-labelledby=\"hmlx-l-mac\"><button data-v=\"ecl\">ECL<\/button><button data-v=\"isl\">ISL<\/button><button data-v=\"inline\">Inline Lacer<\/button><button data-v=\"ct\">CT Twin Lacer<\/button><\/div><\/div>\n    <div class=\"ctl\"><span id=\"hmlx-l-size\">Wheel size (inch)<\/span><div class=\"seg\" data-key=\"bsd\" aria-labelledby=\"hmlx-l-size\"><button data-v=\"203\" title=\"ECL with option\">12<\/button><button data-v=\"254\" title=\"ECL with option\">14<\/button><button data-v=\"305\">16<\/button><button data-v=\"406\">20<\/button><button data-v=\"507\">24<\/button><button data-v=\"559\">26<\/button><button data-v=\"584\">27.5<\/button><button data-v=\"622\">28 \/ 29<\/button><button data-v=\"686\">32<\/button><\/div><\/div>\n    <div class=\"ctl\"><span id=\"hmlx-l-gauge\">Spoke \u00d8 (mm)<\/span><div class=\"seg\" data-key=\"gauge\" aria-labelledby=\"hmlx-l-gauge\"><button data-v=\"1.8\" title=\"15G\">1.8<\/button><button data-v=\"2\" title=\"14G\">2.0<\/button><button data-v=\"2.3\" title=\"13G\">2.3<\/button><button data-v=\"2.6\" title=\"12G\">2.6<\/button><button data-v=\"3.2\" title=\"10G, cargo \/ moped\">3.2<\/button><\/div><\/div>\n    <div class=\"ctl\"><span id=\"hmlx-l-hub\">Hub<\/span><div class=\"seg\" data-key=\"hub\" aria-labelledby=\"hmlx-l-hub\"><button data-v=\"std\">Standard<\/button><button data-v=\"igh\">Internal gear<\/button><button data-v=\"motor\">E-bike motor<\/button><\/div><\/div>\n    <div class=\"ctl range\"><span><label for=\"hmlx-r-depth\">Rim depth<\/label><output id=\"hmlx-o-depth\"><\/output><\/span><input type=\"range\" id=\"hmlx-r-depth\" min=\"20\" max=\"90\" step=\"1\"><\/div>\n    <div class=\"ctl range\"><span><label for=\"hmlx-r-width\">Rim width<\/label><output id=\"hmlx-o-width\"><\/output><\/span><input type=\"range\" id=\"hmlx-r-width\" min=\"20\" max=\"100\" step=\"1\"><\/div>\n    <div class=\"ctl range\" title=\"Flange size: diameter of the NDS flange (spoke hole circle)\"><span><label for=\"hmlx-r-dL\">Flange \u00d8 NDS<\/label><output id=\"hmlx-o-dL\"><\/output><\/span><input type=\"range\" id=\"hmlx-r-dL\" min=\"30\" max=\"200\" step=\"1\"><\/div>\n    <div class=\"ctl range\" title=\"Flange size: diameter of the DS flange (spoke hole circle)\"><span><label for=\"hmlx-r-dR\">Flange \u00d8 DS<\/label><output id=\"hmlx-o-dR\"><\/output><\/span><input type=\"range\" id=\"hmlx-r-dR\" min=\"30\" max=\"200\" step=\"1\"><\/div>\n    <div class=\"ctl range\" title=\"Hub width over the locknuts (OLD): the flanges move outwards with it\"><span><label for=\"hmlx-r-old\">Hub width (OLD)<\/label><output id=\"hmlx-o-old\"><\/output><\/span><input type=\"range\" id=\"hmlx-r-old\" min=\"100\" max=\"200\" step=\"1\"><\/div>\n    <div class=\"ctl\"><span id=\"hmlx-l-wall\">Rim wall<\/span><div class=\"seg\" data-key=\"wall\" aria-labelledby=\"hmlx-l-wall\"><button data-v=\"double\" title=\"Double-wall rim: the nipple is reached through an access hole in the tyre bed\">Double wall<\/button><button data-v=\"single\" title=\"Single-wall rim with dimpled holes, as on motorcycle rims: no tyre bed, the screwdriver meets the nipple directly; the dimple lets the nipple follow the spoke\">Single, dimpled<\/button><button data-v=\"plain\" title=\"Single-wall rim with plain holes: no tyre bed, the screwdriver meets the nipple directly; the nipple seats on a flat bed, so the hole angle stays small\">Single, plain<\/button><\/div><\/div>\n    <div class=\"ctl range\" id=\"hmlx-c-holeO\" title=\"Diameter of the access hole in the tyre bed (outer wall)\"><span><label for=\"hmlx-r-holeO\">Outer hole \u00d8<\/label><output id=\"hmlx-o-holeO\"><\/output><\/span><input type=\"range\" id=\"hmlx-r-holeO\" min=\"4\" max=\"14\" step=\"0.5\"><\/div>\n    <div class=\"ctl range\" title=\"Diameter of the nipple hole in the spoke bed (inner wall)\"><span><label for=\"hmlx-r-holeI\">Inner hole \u00d8<\/label><output id=\"hmlx-o-holeI\"><\/output><\/span><input type=\"range\" id=\"hmlx-r-holeI\" min=\"3\" max=\"6\" step=\"0.1\"><\/div>\n    <div class=\"ctl\"><span id=\"hmlx-l-pat\">Hole pattern<\/span><div class=\"seg\" data-key=\"holePat\" aria-labelledby=\"hmlx-l-pat\"><button data-v=\"zigzag\" title=\"Holes alternate: + towards each spoke's own flange, \u2212 towards the opposite flange\">Zigzag<\/button><button data-v=\"side\" title=\"All holes shifted to one side (offset-centre rim): + towards the DS, \u2212 towards the NDS\">One side<\/button><\/div><\/div>\n    <div class=\"ctl range\" title=\"Nipple hole offset, both ways. Zigzag: + towards each spoke's own flange, \u2212 towards the opposite flange. One side: + towards the DS, \u2212 towards the NDS. Automatic (zigzag) on wide rims until you set it.\"><span><label for=\"hmlx-r-holeOff\">Nipple hole offset<\/label><output id=\"hmlx-o-holeOff\"><\/output><\/span><input type=\"range\" id=\"hmlx-r-holeOff\" min=\"-15\" max=\"15\" step=\"0.5\"><\/div>\n    <div class=\"ctl transport\"><button class=\"play\" id=\"hmlx-play\">Pause<\/button><button class=\"play ghost\" id=\"hmlx-restart\" aria-label=\"Restart\">\u27f2<\/button><div class=\"seg\" data-key=\"speed\" aria-label=\"Speed\"><button data-v=\"1\">1\u00d7<\/button><button data-v=\"2\">2\u00d7<\/button><button data-v=\"4\">4\u00d7<\/button><\/div><\/div>\n  <\/div>\n\n  <div class=\"lx-main\">\n  <div class=\"stage\">\n    <div class=\"view\"><span class=\"view-label\">Top view<\/span><svg id=\"hmlx-side\" viewBox=\"-250 0 1080 560\" role=\"img\" aria-label=\"Lacing machine, top view: the wheel lies flat\"><\/svg><\/div>\n    <div class=\"view\"><span class=\"view-label\">Side view \u00b7 sideways angles drawn \u00d72<\/span><svg id=\"hmlx-dish\" viewBox=\"-250 0 1080 176\" role=\"img\" aria-label=\"Lacing machine, side view: the wheel edge-on\"><\/svg><\/div>\n    <div class=\"view\"><span class=\"view-label\">Rim drilling<\/span><div class=\"drill\"><svg id=\"hmlx-drillA\" viewBox=\"0 0 325 262\" role=\"img\" aria-label=\"Rim drilling: section through a hole\"><\/svg><svg id=\"hmlx-drillB\" viewBox=\"320 0 490 262\" role=\"img\" aria-label=\"Rim drilling: the spoke bed seen from the hub\"><\/svg><\/div>\n      <div class=\"specs\" id=\"hmlx-specs\"><\/div>\n      <div class=\"advice\" id=\"hmlx-advice\"><\/div><\/div>\n  <\/div>\n\n  <p class=\"explain\" id=\"hmlx-explain\"><\/p>\n  <div class=\"info\">\n    <div class=\"card\"><b>Screwdriver on the nipple<\/b><div class=\"v\" id=\"hmlx-c-drv\"><\/div><p id=\"hmlx-c-drv-t\"><\/p><\/div>\n    <div class=\"card\"><b>Spoke at the nipple<\/b><div class=\"v\" id=\"hmlx-c-bend\"><\/div><p id=\"hmlx-c-bend-t\"><\/p><\/div>\n    <div class=\"card\"><b>Machine<\/b><div class=\"v\" id=\"hmlx-c-mac\"><\/div><p id=\"hmlx-c-mac-t\"><\/p><\/div>\n  <\/div>\n  <div class=\"status\" id=\"hmlx-status\"><\/div>\n  <h3 class=\"cmp-title\">Which machine fits this wheel?<\/h3>\n  <div class=\"tbl-wrap\"><table class=\"cmp\" id=\"hmlx-cmp\"><\/table><\/div>\n  <p class=\"note\" id=\"hmlx-camnote\"><\/p>\n  <p class=\"note\">Wheel and rim ranges as published on the Holland Mechanics product pages. Options are available on request; ask us about your wheel. <span style=\"opacity:.6\">Version 2026-10-13 11:37<\/span><\/p>\n  <div class=\"legend\">\n    <span><i style=\"background:#084490\"><\/i>NDS leading<\/span><span><i style=\"background:#4F8FE6\"><\/i>NDS trailing<\/span>\n    <span><i style=\"background:#D9530A\"><\/i>DS leading<\/span><span><i style=\"background:#F5A23F\"><\/i>DS trailing<\/span>\n    <span><i style=\"background:#084591;height:2px\"><\/i>hole and nipple axis<\/span>\n    <span><i style=\"background:#D63031\"><\/i>screwdriver off the nipple axis<\/span><span><i style=\"background:#C26A00\"><\/i>spoke bend at the nipple<\/span>\n  <\/div>\n  <\/div><\/div>\n<\/section>\n\n<script data-no-optimize=\"1\" data-no-defer=\"1\" data-no-minify=\"1\" data-cfasync=\"false\" data-pagespeed-no-defer nowprocket>\n(()=>{ 'use strict';\n\/\/ everything stays inside this function: no global names that a page script (e.g. a tracker) could overwrite;\n\/\/ a second copy of the script (editor previews) finds no new widget and does nothing\nconst root=[...document.querySelectorAll('.hm-lx')].find(r=>!r.dataset.hmlxInit); if(!root) return; root.dataset.hmlxInit='1';\n\n\/* Lacing machine explainer. The wheel (32-hole road rear, 3-cross) and its lacing order come from the\n   Holland Mechanics Wheel Line Simulator; the animation is the simulator's 2D lacing view. *\/\nconst D = {\"rimDepth\":24,\"wheel\":{\"count\":32,\"erd\":601,\"rimWidth\":22,\"cross\":3},\"nipple\":{\"type\":\"round\",\"len\":12,\"head\":2.2,\"add\":2,\"threadStart\":3.5,\"mat\":\"brass\"},\"spokes\":[{\"side\":\"L\",\"group\":\"Sa\",\"hub\":{\"x\":-35,\"r\":22.5,\"a\":-1.5708},\"rim\":{\"x\":0,\"r\":300.5,\"a\":-0.3927},\"brace\":6.82049},{\"side\":\"L\",\"group\":\"Sb\",\"hub\":{\"x\":-35,\"r\":22.5,\"a\":-1.1781},\"rim\":{\"x\":0,\"r\":300.5,\"a\":-2.35619},\"brace\":6.82049},{\"side\":\"L\",\"group\":\"Sa\",\"hub\":{\"x\":-35,\"r\":22.5,\"a\":-0.7854},\"rim\":{\"x\":0,\"r\":300.5,\"a\":0.3927},\"brace\":6.82049},{\"side\":\"L\",\"group\":\"Sb\",\"hub\":{\"x\":-35,\"r\":22.5,\"a\":-0.3927},\"rim\":{\"x\":0,\"r\":300.5,\"a\":-1.5708},\"brace\":6.82049},{\"side\":\"L\",\"group\":\"Sa\",\"hub\":{\"x\":-35,\"r\":22.5,\"a\":0},\"rim\":{\"x\":0,\"r\":300.5,\"a\":1.1781},\"brace\":6.82049},{\"side\":\"L\",\"group\":\"Sb\",\"hub\":{\"x\":-35,\"r\":22.5,\"a\":0.3927},\"rim\":{\"x\":0,\"r\":300.5,\"a\":-0.7854},\"brace\":6.82049},{\"side\":\"L\",\"group\":\"Sa\",\"hub\":{\"x\":-35,\"r\":22.5,\"a\":0.7854},\"rim\":{\"x\":0,\"r\":300.5,\"a\":1.9635},\"brace\":6.82049},{\"side\":\"L\",\"group\":\"Sb\",\"hub\":{\"x\":-35,\"r\":22.5,\"a\":1.1781},\"rim\":{\"x\":0,\"r\":300.5,\"a\":0},\"brace\":6.82049},{\"side\":\"L\",\"group\":\"Sa\",\"hub\":{\"x\":-35,\"r\":22.5,\"a\":1.5708},\"rim\":{\"x\":0,\"r\":300.5,\"a\":2.74889},\"brace\":6.82049},{\"side\":\"L\",\"group\":\"Sb\",\"hub\":{\"x\":-35,\"r\":22.5,\"a\":1.9635},\"rim\":{\"x\":0,\"r\":300.5,\"a\":0.7854},\"brace\":6.82049},{\"side\":\"L\",\"group\":\"Sa\",\"hub\":{\"x\":-35,\"r\":22.5,\"a\":2.35619},\"rim\":{\"x\":0,\"r\":300.5,\"a\":3.53429},\"brace\":6.82049},{\"side\":\"L\",\"group\":\"Sb\",\"hub\":{\"x\":-35,\"r\":22.5,\"a\":2.74889},\"rim\":{\"x\":0,\"r\":300.5,\"a\":1.5708},\"brace\":6.82049},{\"side\":\"L\",\"group\":\"Sa\",\"hub\":{\"x\":-35,\"r\":22.5,\"a\":3.14159},\"rim\":{\"x\":0,\"r\":300.5,\"a\":4.31969},\"brace\":6.82049},{\"side\":\"L\",\"group\":\"Sb\",\"hub\":{\"x\":-35,\"r\":22.5,\"a\":3.53429},\"rim\":{\"x\":0,\"r\":300.5,\"a\":2.35619},\"brace\":6.82049},{\"side\":\"L\",\"group\":\"Sa\",\"hub\":{\"x\":-35,\"r\":22.5,\"a\":3.92699},\"rim\":{\"x\":0,\"r\":300.5,\"a\":5.10509},\"brace\":6.82049},{\"side\":\"L\",\"group\":\"Sb\",\"hub\":{\"x\":-35,\"r\":22.5,\"a\":4.31969},\"rim\":{\"x\":0,\"r\":300.5,\"a\":3.14159},\"brace\":6.82049},{\"side\":\"R\",\"group\":\"Sd\",\"hub\":{\"x\":19,\"r\":22.5,\"a\":-1.37445},\"rim\":{\"x\":0,\"r\":300.5,\"a\":-0.19635},\"brace\":3.71492},{\"side\":\"R\",\"group\":\"Sc\",\"hub\":{\"x\":19,\"r\":22.5,\"a\":-0.98175},\"rim\":{\"x\":0,\"r\":300.5,\"a\":-2.15984},\"brace\":3.71492},{\"side\":\"R\",\"group\":\"Sd\",\"hub\":{\"x\":19,\"r\":22.5,\"a\":-0.58905},\"rim\":{\"x\":0,\"r\":300.5,\"a\":0.58905},\"brace\":3.71492},{\"side\":\"R\",\"group\":\"Sc\",\"hub\":{\"x\":19,\"r\":22.5,\"a\":-0.19635},\"rim\":{\"x\":0,\"r\":300.5,\"a\":-1.37445},\"brace\":3.71492},{\"side\":\"R\",\"group\":\"Sd\",\"hub\":{\"x\":19,\"r\":22.5,\"a\":0.19635},\"rim\":{\"x\":0,\"r\":300.5,\"a\":1.37445},\"brace\":3.71492},{\"side\":\"R\",\"group\":\"Sc\",\"hub\":{\"x\":19,\"r\":22.5,\"a\":0.58905},\"rim\":{\"x\":0,\"r\":300.5,\"a\":-0.58905},\"brace\":3.71492},{\"side\":\"R\",\"group\":\"Sd\",\"hub\":{\"x\":19,\"r\":22.5,\"a\":0.98175},\"rim\":{\"x\":0,\"r\":300.5,\"a\":2.15984},\"brace\":3.71492},{\"side\":\"R\",\"group\":\"Sc\",\"hub\":{\"x\":19,\"r\":22.5,\"a\":1.37445},\"rim\":{\"x\":0,\"r\":300.5,\"a\":0.19635},\"brace\":3.71492},{\"side\":\"R\",\"group\":\"Sd\",\"hub\":{\"x\":19,\"r\":22.5,\"a\":1.76715},\"rim\":{\"x\":0,\"r\":300.5,\"a\":2.94524},\"brace\":3.71492},{\"side\":\"R\",\"group\":\"Sc\",\"hub\":{\"x\":19,\"r\":22.5,\"a\":2.15984},\"rim\":{\"x\":0,\"r\":300.5,\"a\":0.98175},\"brace\":3.71492},{\"side\":\"R\",\"group\":\"Sd\",\"hub\":{\"x\":19,\"r\":22.5,\"a\":2.55254},\"rim\":{\"x\":0,\"r\":300.5,\"a\":3.73064},\"brace\":3.71492},{\"side\":\"R\",\"group\":\"Sc\",\"hub\":{\"x\":19,\"r\":22.5,\"a\":2.94524},\"rim\":{\"x\":0,\"r\":300.5,\"a\":1.76715},\"brace\":3.71492},{\"side\":\"R\",\"group\":\"Sd\",\"hub\":{\"x\":19,\"r\":22.5,\"a\":3.33794},\"rim\":{\"x\":0,\"r\":300.5,\"a\":4.51604},\"brace\":3.71492},{\"side\":\"R\",\"group\":\"Sc\",\"hub\":{\"x\":19,\"r\":22.5,\"a\":3.73064},\"rim\":{\"x\":0,\"r\":300.5,\"a\":2.55254},\"brace\":3.71492},{\"side\":\"R\",\"group\":\"Sd\",\"hub\":{\"x\":19,\"r\":22.5,\"a\":4.12334},\"rim\":{\"x\":0,\"r\":300.5,\"a\":5.30144},\"brace\":3.71492},{\"side\":\"R\",\"group\":\"Sc\",\"hub\":{\"x\":19,\"r\":22.5,\"a\":4.51604},\"rim\":{\"x\":0,\"r\":300.5,\"a\":3.33794},\"brace\":3.71492}],\"order\":[14,0,2,4,6,8,10,12,5,7,9,11,13,15,1,3,30,16,18,20,22,24,26,28,19,21,23,25,27,29,31,17],\"valveA\":4.81056,\"pulses\":{\"Sa\":110,\"Sb\":110,\"Sd\":120,\"Sc\":120},\"taut\":{\"Sa\":104.31153,\"Sb\":104.31153,\"Sd\":110.52208,\"Sc\":110.52208},\"mmPulse\":0.0756};\n\nconst TAU=2*Math.PI, norm=a=>((a%TAU)+TAU)%TAU, f=v=>v.toFixed(1);\nconst clamp=x=>Math.max(0,Math.min(1,x)), ease=x=>1-Math.pow(1-clamp(x),3);\nconst angDiff=(a,b)=>Math.atan2(Math.sin(a-b),Math.cos(a-b));\nconst GC={Sa:'#084490',Sb:'#4F8FE6',Sd:'#D9530A',Sc:'#F5A23F',NDS:'#084490',DS:'#D9530A'};\nconst HOLE='#084591', AMBER='#C26A00', RED='#D63031', GREEN='#119915';\nconst halo='paint-order=\"stroke\" stroke=\"#fff\" stroke-width=\"3\" stroke-linejoin=\"round\"';\nconst N=D.spokes.length, nip=D.nipple, mm=D.mmPulse;\n\/\/ the wheel: 32 holes, bead seat (wheel size) chosen in the page, the simulator's lacing pattern; rim depth, rim width and hub are chosen in the page\n\/\/ (hub values are typical, for illustration)\n\/\/ fcL \/ fcR: hub centre to flange at the hub's own OLD; a wider OLD moves both flanges out by half the difference (the dish stays)\nconst HUBS={std:{name:'Standard hub', d:45, old:130, fcL:35, fcR:19, cross:3, shell:.45},\n  igh:{name:'Internal gear hub', d:95, old:135, fcL:27, fcR:27, cross:3, shell:.78},\n  motor:{name:'E-bike motor hub', d:160, old:142, fcL:30, fcR:30, cross:2, shell:.86}};\nconst BASE=D.spokes.map(s=>({side:s.side, group:s.group, rimA:s.rim.a, lead:Math.sign(angDiff(s.hub.a,s.rim.a))}));\nlet S, R, fs, WH;\nconst SIZE=560, PAD=250, RATE=160, INSERT=0.5, INDEX=0.35;\nconst c=SIZE\/2;\nconst rFl=s=>s.side==='L'?fs.rFlL:fs.rFlR;\n\/\/ metal finishes, shared by all three drawings\nfunction setDefs(){ const g=(id,stops,v=true)=>`<linearGradient id=\"hmlx-${id}\" x1=\"0\" y1=\"0\" x2=\"${v?0:1}\" y2=\"${v?1:0}\">${stops.map(([o,c])=>`<stop offset=\"${o}\" stop-color=\"${c}\"\/>`).join('')}<\/linearGradient>`;\n  const f0=fs.rimIn\/fs.rimOut, Dp=opt.depth, m=mmFromBed=>(f0+(1-f0)*mmFromBed\/Dp).toFixed(4);   \/\/ stop at a distance (mm) out from the spoke bed\n  document.getElementById('hmlx-defs').innerHTML=`<defs>\n    ${g('gSteel',[[0,'#f8fafc'],[.35,'#d4dae1'],[.7,'#8e99a5'],[1,'#c0c8d0']])}\n    ${g('gBody',[[0,'#eef2f5'],[.2,'#ffffff'],[.6,'#b4bec8'],[1,'#6e7a87']])}\n    ${g('gDark',[[0,'#7d8995'],[.45,'#4c5661'],[1,'#2a3139']])}\n    ${g('gBlue',[[0,'#3b80b8'],[.5,'#0b4f86'],[1,'#062f52']])}\n    ${g('gBlack',[[0,'#5b636c'],[.25,'#3a4048'],[.7,'#1d2126'],[1,'#30363d']])}\n    ${g('gYellow',[[0,'#ffe066'],[.5,'#f2c200'],[1,'#c99a00']])}\n    ${g('gWhite',[[0,'#ffffff'],[.6,'#eef1f4'],[1,'#c9d0d7']])}\n    ${g('gWhiteH',[[0,'#ffffff'],[.6,'#eef1f4'],[1,'#c9d0d7']],false)}\n    <linearGradient id=\"hmlx-gGlass\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\"><stop offset=\"0\" stop-color=\"#3a63e0\" stop-opacity=\".78\"\/><stop offset=\".55\" stop-color=\"#1f3fb8\" stop-opacity=\".72\"\/><stop offset=\"1\" stop-color=\"#16308f\" stop-opacity=\".8\"\/><\/linearGradient>\n    ${g('gNip',[[0,'#f4f6f8'],[.4,'#d9dee4'],[.75,'#9aa4ae'],[1,'#c7ced5']])}\n    ${g('gNipH',[[0,'#f4f6f8'],[.4,'#d9dee4'],[.75,'#9aa4ae'],[1,'#c7ced5']],false)}\n    ${g('gSteelH',[[0,'#f8fafc'],[.35,'#d4dae1'],[.7,'#8e99a5'],[1,'#c0c8d0']],false)}\n    ${g('gSpoke',[[0,'#e9edf1'],[.5,'#b7c0c9'],[1,'#7c8794']])}\n    ${g('gSpokeH',[[0,'#e9edf1'],[.5,'#b7c0c9'],[1,'#7c8794']],false)}\n    ${g('gRail',[[0,'#e6ebf0'],[.5,'#c3cbd3'],[1,'#98a3ae']])}\n    ${g('gRailV',[[0,'#e6ebf0'],[.5,'#c3cbd3'],[1,'#98a3ae']],false)}\n    ${g('gDarkV',[[0,'#7d8995'],[.45,'#4c5661'],[1,'#2a3139']],false)}\n    ${g('gRimBar',[[0,'#2a3037'],[.1,'#aab3bc'],[.2,'#3a424b'],[.5,'#59626d'],[.8,'#3a424b'],[.9,'#aab3bc'],[1,'#2a3037']])}\n    <radialGradient id=\"hmlx-gRim\" gradientUnits=\"userSpaceOnUse\" cx=\"${c}\" cy=\"${c}\" r=\"${fs.rimOut.toFixed(2)}\">\n      <stop offset=\"${m(0)}\" stop-color=\"#15191e\"\/><stop offset=\"${m(1.5)}\" stop-color=\"#2c333b\"\/><stop offset=\"${m(Dp*.42)}\" stop-color=\"#525b66\"\/>\n      <stop offset=\"${m(Dp-10)}\" stop-color=\"#2a3037\"\/><stop offset=\"${m(Dp-9)}\" stop-color=\"#9aa3ad\"\/><stop offset=\"${m(Dp-6)}\" stop-color=\"#dde2e7\"\/>\n      <stop offset=\"${m(Dp-3)}\" stop-color=\"#a5aeb7\"\/><stop offset=\"${m(Dp-2.4)}\" stop-color=\"#2f363e\"\/><stop offset=\"1\" stop-color=\"#4a525b\"\/><\/radialGradient>\n    <linearGradient id=\"hmlx-gRimLight\" gradientUnits=\"userSpaceOnUse\" x1=\"${f(c-fs.rimOut)}\" y1=\"${f(c-fs.rimOut)}\" x2=\"${f(c+fs.rimOut)}\" y2=\"${f(c+fs.rimOut)}\">\n      <stop offset=\"0\" stop-color=\"#fff\" stop-opacity=\".22\"\/><stop offset=\".5\" stop-color=\"#fff\" stop-opacity=\"0\"\/><stop offset=\"1\" stop-color=\"#000\" stop-opacity=\".2\"\/><\/linearGradient>\n    <radialGradient id=\"hmlx-gHub\" cx=\".4\" cy=\".35\" r=\".75\"><stop offset=\"0\" stop-color=\"#f4f6f8\"\/><stop offset=\".65\" stop-color=\"#c4ccd4\"\/><stop offset=\"1\" stop-color=\"#7f8a96\"\/><\/radialGradient>\n    <radialGradient id=\"hmlx-gShell\" cx=\".4\" cy=\".35\" r=\".8\"><stop offset=\"0\" stop-color=\"#8a95a1\"\/><stop offset=\"1\" stop-color=\"#2e353d\"\/><\/radialGradient>\n    <pattern id=\"hmlx-gAlu\" width=\"5\" height=\"5\" patternUnits=\"userSpaceOnUse\" patternTransform=\"rotate(45)\"><rect width=\"5\" height=\"5\" fill=\"#bcc4cc\"\/><line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"5\" stroke=\"#8a95a0\" stroke-width=\"1.2\"\/><\/pattern>\n    <clipPath id=\"hmlx-insetClip\"><rect x=\"-229\" y=\"11\" width=\"210\" height=\"146\" rx=\"11\"\/><\/clipPath>\n    <clipPath id=\"hmlx-stripClip\"><rect x=\"330\" y=\"82\" width=\"310\" height=\"88\" rx=\"8\"\/><\/clipPath><\/defs>`; }\n\n\/\/ a screwdriver unit in its own frame: the bit tip at the origin, the rim towards +x\nfunction driverG({on, spin, led, name, ext=0}){\n  const ph=(spin\/360)*2.6;\n  const knurl=Array.from({length:9},(_,k)=>{ const x=-48+k*2.6+ph; return x>-47&&x<-27?`<line x1=\"${f(x)}\" y1=\"-7\" x2=\"${f(x)}\" y2=\"7\" stroke=\"#59636e\" stroke-width=\".8\" opacity=\".55\"\/>`:''; }).join('');\n  const fins=Array.from({length:9},(_,k)=>`<rect x=\"${-180+k*6}\" y=\"-22\" width=\"2.4\" height=\"44\" rx=\"1\" fill=\"#fff\" opacity=\".09\"\/>`).join('');\n  return `<rect x=\"${f(-27-ext)}\" y=\"-3\" width=\"${f(21+ext)}\" height=\"6\" fill=\"url(#hmlx-gSteel)\" stroke=\"#8792a0\" stroke-width=\".4\"\/><g transform=\"translate(${f(-ext)} 0)\"><path d=\"M-205 5 C-226 7 -232 21 -254 27\" fill=\"none\" stroke=\"#23282e\" stroke-width=\"5\" stroke-linecap=\"round\"\/>\n    <rect x=\"-207\" y=\"-17\" width=\"19\" height=\"34\" rx=\"6\" fill=\"url(#hmlx-gDark)\"\/>\n    <rect x=\"-192\" y=\"-24\" width=\"114\" height=\"48\" rx=\"11\" fill=\"url(#hmlx-gBlack)\" stroke=\"#111418\" stroke-width=\".8\"\/>${fins}\n    <rect x=\"-122\" y=\"-24\" width=\"24\" height=\"48\" fill=\"url(#hmlx-gYellow)\"\/><circle cx=\"-110\" cy=\"-13\" r=\"3.2\" fill=\"${led}\" stroke=\"#fff\" stroke-width=\".8\"\/>\n    <rect x=\"-80\" y=\"-15\" width=\"24\" height=\"30\" rx=\"4\" fill=\"url(#hmlx-gDark)\"\/>\n    <rect x=\"-58\" y=\"-10\" width=\"11\" height=\"20\" rx=\"2\" fill=\"url(#hmlx-gSteel)\" stroke=\"#6e7a87\" stroke-width=\".6\"\/>\n    <rect x=\"-48\" y=\"-8\" width=\"22\" height=\"16\" rx=\"3\" fill=\"url(#hmlx-gSteel)\" stroke=\"#6e7a87\" stroke-width=\".6\"\/>${knurl}\n    <\/g><rect x=\"-7\" y=\"-4.5\" width=\"7\" height=\"9\" rx=\"1.5\" fill=\"url(#hmlx-gSteel)\" stroke=\"${on?'#005389':'#5e6e7e'}\" stroke-width=\"${on?1.3:.6}\"\/>\n    ${name?`<text x=\"${f(-135-ext)}\" y=\"-31\" font-size=\"10\" font-weight=\"700\" fill=\"#084591\" text-anchor=\"middle\">${name}<\/text>`:''}`;\n}\n\/\/ a linear guide along the screwdriver axis, from its rear end, in the same frame turned by deg\nconst guideG=(x,y,deg,len)=>`<g transform=\"translate(${f(x)} ${f(y)}) rotate(${f(deg)})\"><rect x=\"0\" y=\"-6\" width=\"${len}\" height=\"12\" rx=\"2\" fill=\"url(#hmlx-gRail)\" stroke=\"#8d98a3\" stroke-width=\".6\"\/><line x1=\"6\" y1=\"0\" x2=\"${len-6}\" y2=\"0\" stroke=\"#7c8794\" stroke-width=\"1\"\/><\/g>`;\nconst pulsesOf=i=>D.pulses[S[i].group];\n\nconst opt={drill:'straight', mach:'ecl', speed:2, bsd:622, gauge:2, hub:'std', depth:24, width:22, dL:45, dR:45, old:130, holeO:7, holeI:4.5, holeOff:null, holePat:'zigzag', wall:'double'};   \/\/ holeOff: nipple hole offset, mm (null = automatic for wide rims)   \/\/ holeO \/ holeI: tyre-bed and spoke-bed hole \u00d8, mm   \/\/ flange diameters and hub width over the locknuts, mm\nfunction applyWheel(){\n  const hub=HUBS[opt.hub], Dp=opt.depth, Wd=opt.width, step=2*TAU\/N;\n  const erd=opt.bsd+27-2*Dp, autoOff=opt.holePat==='zigzag'&&Wd>30?(Wd-30)*0.18:0, off=opt.holeOff!=null?opt.holeOff:autoOff;     \/\/ a deeper rim has a smaller ERD; wide (fat) rims drill their holes off-centre, towards the spoke's flange\n  R=erd\/2; const fcL=Math.max(8,hub.fcL+(opt.old-hub.old)\/2), fcR=Math.max(8,hub.fcR+(opt.old-hub.old)\/2);\n  S=BASE.map(b=>{ const hubA=b.rimA+b.lead*hub.cross*step, hx=b.side==='L'?-fcL:fcR, rx=opt.holePat==='side'?off:(b.side==='L'?-off:off),   \/* zigzag: + to the spoke's own flange; one side: + to the DS *\/ hr=(b.side==='L'?opt.dL:opt.dR)\/2;\n    const inPlane=Math.max(5,Math.sqrt(R*R+hr*hr-2*R*hr*Math.cos(hubA-b.rimA)));\n    return {side:b.side, group:b.group, hub:{x:hx, r:hr, a:hubA}, rim:{x:rx, r:R, a:b.rimA}, brace:Math.atan(Math.abs(hx-rx)\/inPlane)*180\/Math.PI, len:Math.hypot(inPlane,hx-rx)}; });\n  \/\/ one scale for every wheel size, set by the biggest (32\", BSD 686): a smaller wheel is drawn smaller. The rim's outside\n  \/\/ radius is (BSD+19)\/2 whatever the depth. The nipple holes at 9 o'clock stay at the screwdriver (dx moves the wheel)\n  const sc=(SIZE\/2-16)\/((686+19)\/2), fl=r=>Math.max(r*sc, Math.min(r*sc*1.6, 30));   \/\/ small flanges drawn up to 1.6\u00d7 oversize, big hubs to scale\n  fs={c, sc, rIn:R*sc, rimIn:(R-4)*sc, rimOut:(R-4+Dp)*sc, rFlL:fl(opt.dL\/2), rFlR:fl(opt.dR\/2), dx:(R-(686+27-2*Dp)\/2)*sc};\n  WH={erd, off, autoOff, hub, fcL, fcR};\n  setDefs();\n}\n\/\/ how much longer the bit is than on a 24 mm rim, in drawing units: the screwdriver stays outside the rim\nconst reach=()=>Math.max(0,(opt.depth-24)*fs.sc);\n\/\/ a screwdriver that cannot follow the hole axis works along its own line through the nipple. In a double-wall rim the nipple\n\/\/ is fed, and the bit reaches it, through the outer hole (tyre bed) into the inner hole (spoke bed); both are drilled on the\n\/\/ hole axis. A straight line through the inner hole passes the outer hole only while its offset there, gap \u00d7 tan(angle),\n\/\/ stays within (outer \u00d8 \u2212 inner \u00d8) \/ 2: with angle-drilled holes that is possible only for very slight angles.\n\/\/ A single-wall rim (motorcycle rims, with dimpled holes) has no tyre bed: the screwdriver meets the nipple head directly, so\n\/\/ the angle freedom is much bigger. A bit off the nipple axis still drives it up to SW_FREE\u00b0, and the dimple lets the hole (and\n\/\/ the nipple) follow the spoke up to DIMPLE_MAX\u00b0; the camera sees the nipple hole directly. Both values are illustrative.\nconst single=()=>opt.wall!=='double', dimpled=()=>opt.wall==='single';   \/\/ wall: double | single (dimpled holes) | plain (single wall, plain holes)\nconst seatWord=()=>dimpled()?'dimple':'hole';\nconst SW_FREE=12, DIMPLE_MAX=20, SW_REACH=6, DIMPLE_ADD=4, DEPTH_MIN={double:20, single:10, plain:10}, PLAIN_MAX=8;   \/\/ PLAIN_MAX: a plain single-wall hole, the nipple on a flat seat (deg, illustrative)   \/\/ single-wall rims can be shallower (mm)     \/\/ deg, deg, mm (bit engagement at the nipple head), mm (dimple \u00d8 over the hole)\nconst dimpleD=()=>opt.holeI+(dimpled()?DIMPLE_ADD:0);   \/\/ the seat round the nipple hole\nconst reachMM=()=>single()?SW_REACH:Math.max(1,opt.depth-7.9);   \/\/ double wall: from the spoke-bed hole to the tyre-bed hole, mm\nconst clear=()=>single()?SW_REACH*Math.tan(SW_FREE*Math.PI\/180):Math.max(0,(opt.holeO-opt.holeI)\/2);\nconst maxStraight=()=>Math.atan(clear()\/reachMM())*180\/Math.PI;\n\/\/ an angle-drilled hole runs along the spoke's axial angle from the spoke bed out to the tyre bed. On a deep (aero) rim with a\n\/\/ wide hub that axis can reach the side wall instead of the tyre bed: a failed rim hole. A narrower hub (smaller axial angle) or\n\/\/ a nipple hole offset (the spoke-bed hole moved towards the spoke's flange) brings it back inside.\nconst rimExit=i=>single()?S[i].rim.x:S[i].rim.x+(S[i].side==='L'?1:-1)*Math.tan(holeBrace(i)*Math.PI\/180)*reachMM();   \/\/ axial position at the tyre bed, mm\n\/\/ some material must stay on the tyre bed between the outer hole and the rim's leg (side wall): you cannot drill next to the legs\nconst MIN_LAND=3;                                       \/\/ mm, illustrative\nconst landLeft=i=>(opt.width\/2-1.6)-(Math.abs(rimExit(i))+(single()?dimpleD():opt.holeO)\/2);   \/\/ material between hole edge and leg, mm (negative: the axis is in the wall)\nconst failedHole=i=>opt.drill==='angle'&&landLeft(i)<MIN_LAND;\nconst minLand=()=>Math.min(...S.map((_,i)=>landLeft(i)));\nconst anyFailed=()=>S.some((_,i)=>failedHole(i));\n\/\/ hole detection: the camera looks radially through the rim hole and must see the nipple hole inside it. On angle-drilled holes\n\/\/ the radial angle (rim hole pitch) and the axial angle shift the nipple hole by gap \u00d7 tan(angle).\nconst camShift=i=>{ if(opt.drill!=='angle'||single()) return [0,0]; const g=reachMM(); return [-g*Math.tan(holeTilt(i)), (S[i].side==='L'?-1:1)*g*Math.tan(holeBrace(i)*Math.PI\/180)]; };\nconst camState=i=>{ const d=Math.hypot(...camShift(i)), rO=(single()?dimpleD():opt.holeO)\/2, rI=opt.holeI\/2; return d+rI<=rO?'ok':d-rI<rO?'warn':'bad'; };\nconst camWorst=()=>{ const st=S.map((_,i)=>camState(i)); return st.includes('bad')?'bad':st.includes('warn')?'warn':'ok'; };\n\/\/ ECL \/ ISL: straight engagement, one head. Inline Lacer: one head that tilts onto every hole, in the wheel plane and sideways.\n\/\/ CT Twin Lacer: two heads; their angle in the wheel plane is set once per wheel, sideways they do not tilt (they only move up\n\/\/ and down, about 1 cm, for offset-drilled holes)\nconst MACH={ecl:{heads:1, name:'STRAIGHT SCREWDRIVER'}, isl:{heads:1, name:'STRAIGHT SCREWDRIVER'}, inline:{heads:1, name:'ANGLED SCREWDRIVER'}, ct:{heads:2, name:'CT SCREWDRIVER'}};\nconst straightM=m=>m==='ecl'||m==='isl';\n\/\/ wheel and rim ranges from the product pages on hollandmechanics.com (rim width \u00d7 depth in mm; options: Fat up to 100 mm wide,\n\/\/ High up to 60 \/ 90 mm deep). The Inline Lacer's screwdriver moves up to 15\u00b0 radially and 25\u00b0 axially.\nconst SPEC={\n  ecl:{name:'ECL', full:'Easy Cam Lacer (ECL)', inch:[16,32], optInch:[12,14], w:35, h:25, cap:'40\u201360', drv:'straight screwdriver'},\n  isl:{name:'ISL', full:'Intelligent Lacing (ISL)', inch:[16,32], w:50, h:32, optW:100, optH:[60,90], cap:'45\u201365', drv:'straight screwdriver'},\n  inline:{name:'Inline Lacer', full:'Inline Lacer (IL)', inch:[16,32], w:50, h:40, optW:100, optH:[60,90], cap:'45\u201365', drv:'screwdriver tilts 15\u00b0 radial \u00b7 25\u00b0 axial', tilt:[15,25]},\n  ct:{name:'CT Twin Lacer', full:'CT Twin Lacer', gripMax:2.3, inch:[20,32], w:30, h:35, cap:'70\u2013100', drv:'2 screwdrivers, set per wheel in the wheel plane'}};\nconst SIZES={203:['12\"',12], 254:['14\"',14], 305:['16\"',16], 406:['20\"',20], 507:['24\"',24], 559:['26\"',26], 584:['27.5\"',27.5], 622:['28\"\/29\"',29], 686:['32\"',32]};\n\n\/* ---- geometry: true angles from the wheel model; drawn angles follow the drawing (hub flanges drawn 1.6\u00d7 oversize) ---- *\/\nconst spokeTilt=i=>{ const s=S[i], a=s.rim.a; const hx=s.hub.r*Math.cos(s.hub.a)-R*Math.cos(a), hy=s.hub.r*Math.sin(s.hub.a)-R*Math.sin(a); return angDiff(Math.atan2(hy,hx), a+Math.PI); };\nconst drawnTilt=i=>{ const s=S[i], a=s.rim.a, rf=rFl(s); const hx=rf*Math.cos(s.hub.a)-fs.rIn*Math.cos(a), hy=rf*Math.sin(s.hub.a)-fs.rIn*Math.sin(a); return angDiff(Math.atan2(hy,hx), a+Math.PI); };\nconst comb=(t,b)=>Math.atan(Math.hypot(Math.tan(t),Math.tan(b*Math.PI\/180)))*180\/Math.PI;\nconst spokeAngle=i=>comb(spokeTilt(i),S[i].brace);                 \/\/ the spoke against the radial line, deg\n\/\/ angle-drilled holes point towards their spoke, but never further than the camera can see through: the nipple hole must stay\n\/\/ fully inside the rim hole, gap \u00d7 tan(drill angle) \u2264 (outer \u00d8 \u2212 inner \u00d8) \/ 2, so hole scanning never fails. The spoke bends\n\/\/ whatever angle is left into the nipple.\nconst drillLimit=()=>(single()?Math.min(dimpled()?DIMPLE_MAX:PLAIN_MAX,SW_FREE):maxStraight())*0.995;   \/\/ single wall: so a straight screwdriver still drives every nipple                              \/\/ deg, just inside the limit\nconst drillQ=i=>{ if(opt.drill!=='angle') return 0; const a=spokeAngle(i)*Math.PI\/180, l=drillLimit()*Math.PI\/180; return a<=l||a<1e-9?1:Math.tan(l)\/Math.tan(a); };\nconst holeTilt=i=>Math.atan(drillQ(i)*Math.tan(spokeTilt(i)));          \/\/ in the wheel plane, rad\nconst holeBrace=i=>Math.atan(drillQ(i)*Math.tan(S[i].brace*Math.PI\/180))*180\/Math.PI;   \/\/ towards the spoke's flange, deg\nconst holeAngle=i=>comb(holeTilt(i),holeBrace(i));                     \/\/ the hole (and nipple) against the radial line, deg\nconst drawnHole=i=>Math.atan(drillQ(i)*Math.tan(drawnTilt(i)));\n\/\/ the nipple has a little play in the rim's nipple hole: it tilts towards its spoke until the shank touches the hole's edge,\n\/\/ which takes up part of the bend. Play = atan(((hole \u00d8 \u2212 shank \u00d8) \/ 2) \/ guided length); about 2.5\u00b0 for a \u00d84.5 mm hole (illustrative)\nconst NIP_SHANK=3.4, NIP_GUIDE=12.5;                                    \/\/ mm\nconst playDeg=()=>Math.atan(Math.max(0,(opt.holeI-NIP_SHANK)\/2)\/NIP_GUIDE)*180\/Math.PI;\nconst playUsed=i=>Math.min(playDeg(),Math.max(0,spokeAngle(i)-holeAngle(i)));   \/\/ deg the nipple tilts towards its spoke\nconst bendAngle=i=>Math.max(0,spokeAngle(i)-holeAngle(i)-playDeg());   \/\/ what the spoke still bends into the nipple, deg\nconst bendQ=i=>{ const d=spokeAngle(i)-holeAngle(i); return d>1e-6?bendAngle(i)\/d:0; };   \/\/ share of the spoke-to-hole angle still bent\nconst limited=()=>opt.drill==='angle'&&S.some((_,i)=>drillQ(i)<0.999);\nconst mean=a=>a.reduce((x,y)=>x+y,0)\/Math.max(1,a.length);\nconst headSpokes=h=>plan.cycles.map(cy=>cy.sp[h]).filter(i=>i!=null);\n\/\/ the screwdriver of head h on spoke i: its angle in the wheel plane (drawn and true, rad) and sideways (deg)\nconst TILT=SPEC.inline.tilt, lim=(a,maxDeg)=>Math.max(-maxDeg*Math.PI\/180,Math.min(maxDeg*Math.PI\/180,a));\nconst drvTiltDrawn=(i,h)=>opt.mach==='inline'?(holeTilt(i)===0?0:drawnHole(i)*lim(holeTilt(i),TILT[0])\/holeTilt(i)):opt.mach==='ct'?mean(headSpokes(h).map(drawnHole)):0;\nconst drvTiltTrue=(i,h)=>opt.mach==='inline'?lim(holeTilt(i),TILT[0]):opt.mach==='ct'?mean(headSpokes(h).map(holeTilt)):0;\nconst drvBrace=i=>opt.mach==='inline'?Math.min(holeBrace(i),TILT[1]):0;\n\/\/ the angle between screwdriver and nipple axis, deg\nconst missAt=(i,h)=>{ const inP=Math.abs(holeTilt(i)-drvTiltTrue(i,h)), side=Math.abs(holeBrace(i)-drvBrace(i))*Math.PI\/180; return reachMM()*Math.hypot(Math.tan(inP),Math.tan(side)); };\nconst maxMiss=()=>Math.max(...plan.off.map((_,h)=>Math.max(...headSpokes(h).map(i=>missAt(i,h)))));\n\/\/ feeding into a radial hole: the spoke has to flex by its angle at the nipple. A spoke flexes like a rod: the force for a\n\/\/ given bend grows with \u00d8\u2074 and the angle, and falls with length\u00b2. Relative to a standard road spoke (\u00d82.0 mm, 293 mm,\n\/\/ bending 7.9\u00b0) = 1\u00d7; up to 2.5\u00d7 it feeds easily (the feed has play), up to 8\u00d7 it needs effort, above that angle drilling is advised.\nconst FLEX_REF={d:2, len:293, deg:7.9-Math.atan((4.5-3.4)\/2\/12.5)*180\/Math.PI},   \/\/ the road spoke's bend after the nipple's play in a \u00d84.5 mm hole\n      FLEX_EASY=2.5, FLEX_HARD=8;\nconst flexAt=(i,deg)=>Math.pow(opt.gauge\/FLEX_REF.d,4)*Math.pow(FLEX_REF.len\/S[i].len,2)*(deg\/FLEX_REF.deg);\nconst flexIdx=i=>flexAt(i,bendAngle(i));\nconst lenRange=()=>{ const a=Math.min(...S.map(x=>x.len)).toFixed(0), b=Math.max(...S.map(x=>x.len)).toFixed(0); return a===b?`${a} mm`:`${a}\u2013${b} mm`; };\nconst flexCat=x=>x<=FLEX_EASY?'ok':x<=FLEX_HARD?'warn':'bad';\nconst flexCol=x=>({ok:GREEN, warn:AMBER, bad:RED})[flexCat(x)];\nconst flexTxt=x=>flexCat(x)==='ok'?'flexes in easily':flexCat(x)==='warn'?`harder to feed (${x.toFixed(1)}\u00d7)`:`too stiff (${x.toFixed(0)}\u00d7), angle drilling advised`;\n\/\/ the first two groups go into a loose wheel, so their spokes flex into line; once they are screwed on the wheel is under\n\/\/ pre-tension, and the spokes of groups 3\u20134 are tighter: they flex less and are harder to feed (here: up to 4\u00d7 the force)\nconst wheelT=i=>{ let n=0; for(const cy of plan.cycles){ if(cy.sp.includes(i)) return n\/N; n+=cy.sp.length; } return 0; };\nconst loose=i=>wheelT(i)<0.4;\nconst feedIdx=i=>flexIdx(i)*(1+3*wheelT(i));\nconst tensTxt=i=>loose(i)?'wheel still loose':'wheel under tension';\nconst radialFeedMax=()=>Math.max(...S.map((_,i)=>flexAt(i,Math.max(0,spokeAngle(i)-playDeg()))*(1+3*wheelT(i))));   \/\/ the same spokes in radial holes\nconst feedRange=()=>{ const a=Math.max(...S.map((_,i)=>loose(i)?feedIdx(i):0)), b=Math.max(...S.map((_,i)=>loose(i)?0:feedIdx(i))); return [a,b]; };\nconst offAngle=(i,h)=>{ const v=(t,b)=>{ const x=[1,Math.tan(t),Math.tan(b*Math.PI\/180)], n=Math.hypot(...x); return x.map(q=>q\/n); };\n  const a=v(holeTilt(i),holeBrace(i)), b=v(drvTiltTrue(i,h),drvBrace(i)); return Math.acos(Math.min(1,a[0]*b[0]+a[1]*b[1]+a[2]*b[2]))*180\/Math.PI; };\n\n\/* ---- the lacing plan: one spoke per index (single head) or a pre-crossed pair (CT Twin): a leading spoke and the trailing spoke it crosses, two holes apart ---- *\/\nlet plan;\nfunction buildPlan(){\n  const step=2*TAU\/N; let cycles;\n  \/\/ ECL \/ ISL \/ Inline Lacer: the wheel indexes counter-clockwise (top view), group by group: trailing, leading, trailing, leading\n  \/\/ (Sb, Sa, Sc, Sd: NDS first). The CT Twin Lacer turns counter-clockwise for groups\n  \/\/ 1\u20132 (the NDS pairs), indexes on counter-clockwise to the first DS pair, then turns clockwise for groups 3\u20134. dir: +1 clockwise, \u22121 counter-clockwise\n  const around=(list,key,dir)=>{ const a0=key(list[0]), gap=x=>dir>0?norm(a0-key(x)):norm(key(x)-a0); return list.slice().sort((x,y)=>gap(x)-gap(y)); };   \/\/ from the first, onwards in dir\n  if(MACH[opt.mach].heads===1){ cycles=[];\n    for(const g of ['Sb','Sa','Sc','Sd']){ const ids=D.order.filter(i=>S[i].group===g); if(ids.length) around(ids,i=>S[i].rim.a,-1).forEach(i=>cycles.push({sp:[i], mid:S[i].rim.a, dir:-1})); } }\n  else {\n    const used=new Set(); cycles=[];\n    for(const i of D.order){ const g=S[i].group; if(used.has(i)||(g!=='Sa'&&g!=='Sd')) continue;\n      const pg=g==='Sa'?'Sb':'Sc'; let best=-1, bd=1e9;\n      const lead=Math.sign(angDiff(S[i].hub.a,S[i].rim.a));   \/\/ the trailing spoke it crosses has its rim hole on the side of the leading spoke's hub hole\n      S.forEach((s,j)=>{ if(s.group!==pg||used.has(j)) return; const d=Math.abs(angDiff(s.rim.a,S[i].rim.a)-lead*step); if(d<bd){ bd=d; best=j; } });\n      if(best<0||bd>0.05) continue; used.add(i); used.add(best);\n      const mid=S[i].rim.a+angDiff(S[best].rim.a,S[i].rim.a)\/2;\n      const pair=[i,best].sort((a,b)=>angDiff(S[a].rim.a,mid)-angDiff(S[b].rim.a,mid));   \/\/ head 1 takes the hole before the middle\n      cycles.push({sp:pair, mid}); }\n    D.order.forEach(i=>{ if(!used.has(i)) cycles.push({sp:[i], mid:S[i].rim.a}); });\n    const nds=cycles.filter(cy=>S[cy.sp[0]].side==='L'), ds=cycles.filter(cy=>S[cy.sp[0]].side!=='L');\n    cycles=[...(nds.length?around(nds,cy=>cy.mid,-1):[]).map(cy=>({...cy, dir:-1})), ...(ds.length?around(ds,cy=>cy.mid,1):[]).map((cy,k)=>({...cy, dir:k?1:-1}))];   \/\/ dir: how the wheel indexes into this cycle; it moves on counter-clockwise to the first DS pair\n  }\n  let t0=0;\n  cycles.forEach(cy=>{ cy.dur=INDEX+INSERT+Math.max(...cy.sp.map(i=>pulsesOf(i)))\/RATE; cy.start=t0; t0+=cy.dur; cy.rot=norm(Math.PI-norm(cy.mid)); });\n  const off=MACH[opt.mach].heads===1?[0]:[-step\/2, step\/2];      \/\/ where the heads sit, relative to 9 o'clock\n  plan={cycles, off, total:t0+1.5, end:t0};\n}\n\nfunction state(t){\n  const {cycles}=plan; const frac=new Float64Array(N), pul=new Float64Array(N); let k0=-1;\n  cycles.forEach((cy,k)=>{ const tt=t-cy.start; if(tt<=0) return; if(tt<cy.dur) k0=k; const tIn=tt-INDEX;\n    cy.sp.forEach(i=>{ frac[i]=clamp(tIn\/INSERT); pul[i]=Math.round(clamp((tIn-INSERT)\/(pulsesOf(i)\/RATE))*pulsesOf(i)); }); });\n  const done=t>=plan.end; let rot=cycles[0].rot, idxP=1;\n  if(k0>=0){ const cy=cycles[k0], r0=k0>0?cycles[k0-1].rot:cycles[0].rot; let d=norm(cy.rot-r0); if(d>TAU-1e-6) d=0; if(cy.dir<0&&d>0) d-=TAU;   \/* clockwise: rot grows; counter-clockwise: it falls *\/ idxP=clamp((t-cy.start)\/INDEX); rot=r0+d*(1-Math.pow(1-idxP,2)); }\n  else if(done) rot=cycles[cycles.length-1].rot;\n  const heads=plan.off.map((_,h)=>{ if(k0<0) return null; const cy=cycles[k0], i=cy.sp[h]; if(i==null) return null;\n    const thr=clamp((t-cy.start-INDEX-INSERT)\/(pulsesOf(i)\/RATE)); let adv=0, spinning=false;\n    if(frac[i]>=1){ if(thr<0.12) adv=ease(thr\/0.12); else if(thr>0.9) adv=1-ease((thr-0.9)\/0.1); else { adv=1; spinning=true; } }\n    const prev=k0>0?cycles[k0-1].sp[h]:null;\n    return {i, thr, adv, spinning, engaging:frac[i]>=1, prev:prev==null?null:prev}; });\n  const loaded=cycles.reduce((n,cy)=>n+(t>=cy.start+cy.dur?cy.sp.length:0),0), steps=cycles.filter(cy=>t>cy.start).length;\n  return {frac, pul, k0, done, rot, idxP, heads, loaded, steps};\n}\n\n\/* ---- top view (the wheel lies flat in the machine): the wheel turns, the screwdriver(s) stay at the left ---- *\/\nfunction wheelSVG(st){\n  const P=(r,a)=>[c+r*Math.cos(a), c+r*Math.sin(a)];\n  const active=new Set(st.heads.filter(Boolean).map(h=>h.i));\n  const colorOf=i=>{ const g=S[i].group, col=GC[g]; if(st.done||active.has(i)||st.pul[i]>D.taut[g]) return col; const n=parseInt(col.slice(1),16); return `rgba(${(n>>16)&255},${(n>>8)&255},${n&255},0.42)`; };\n  let back='', front='', nips='', eyelets='', holesL='', holesR='';\n  S.forEach((s,i)=>{ const [ex0,ey0]=P(fs.rimIn+2.6,s.rim.a); eyelets+=`<circle cx=\"${f(ex0)}\" cy=\"${f(ey0)}\" r=\"1.9\" fill=\"#0b0e11\" stroke=\"#a9b2bb\" stroke-width=\".7\"\/>`;\n    const [hx0,hy0]=P(rFl(s)-2.2,s.hub.a), hole=`<circle cx=\"${f(hx0)}\" cy=\"${f(hy0)}\" r=\"1.2\" fill=\"#2e353d\"\/>`; if(s.side==='L') holesL+=hole; else holesR+=hole;\n    const fr=st.frac[i]; if(fr<=0) return;\n    const [hx,hy]=P(rFl(s),s.hub.a), [fx,fy]=P(fs.rIn,s.rim.a), ex=hx+(fx-hx)*fr, ey=hy+(fy-hy)*fr;\n    if(st.pul[i]>0){ const [n1x,n1y]=P(fs.rimIn+1,s.rim.a), [n2x,n2y]=P(fs.rimIn-5,s.rim.a);\n      nips+=`<line x1=\"${f(n1x)}\" y1=\"${f(n1y)}\" x2=\"${f(n2x)}\" y2=\"${f(n2y)}\" stroke=\"#6f7a86\" stroke-width=\"3.4\" stroke-linecap=\"round\"\/><line x1=\"${f(n1x)}\" y1=\"${f(n1y)}\" x2=\"${f(n2x)}\" y2=\"${f(n2y)}\" stroke=\"#e3e8ec\" stroke-width=\"1.8\" stroke-linecap=\"round\"\/>`; }\n    const gw=opt.gauge\/2, w=(active.has(i)?2.6:1.4)*gw, col=colorOf(i);\n    const ln=`<line x1=\"${f(hx)}\" y1=\"${f(hy)}\" x2=\"${f(ex)}\" y2=\"${f(ey)}\" stroke=\"#fff\" stroke-width=\"${(w+1.4).toFixed(1)}\" stroke-opacity=\".9\" stroke-linecap=\"round\"\/><line x1=\"${f(hx)}\" y1=\"${f(hy)}\" x2=\"${f(ex)}\" y2=\"${f(ey)}\" stroke=\"${col}\" stroke-width=\"${w}\" stroke-linecap=\"round\"\/>`;\n    if(s.side==='R') back+=ln; else front+=ln; });\n  const [v1x,v1y]=P(fs.rimIn-.5,D.valveA), [v2x,v2y]=P(fs.rimIn-8,D.valveA);\n  const f2=v=>v.toFixed(2), ring=(r1,r2)=>`M${f2(c-r2)} ${c}a${f2(r2)} ${f2(r2)} 0 1 0 ${f2(2*r2)} 0a${f2(r2)} ${f2(r2)} 0 1 0 ${f2(-2*r2)} 0Z M${f2(c-r1)} ${c}a${f2(r1)} ${f2(r1)} 0 1 0 ${f2(2*r1)} 0a${f2(r1)} ${f2(r1)} 0 1 0 ${f2(-2*r1)} 0Z`;\n  const flange=(r,holes)=>`<circle cx=\"${c}\" cy=\"${c}\" r=\"${f(r)}\" fill=\"url(#hmlx-gHub)\" stroke=\"#6e7a87\" stroke-width=\".8\"\/>${holes}`;\n  \/\/ anodised rim with a machined brake track, eyelets on every hole, aluminium hub flanges; the light stays fixed\n  \/\/ the rim ring is round, so it is drawn once, not turned: only the spokes, hub, eyelets, nipples and valve turn with the wheel\n  const rot=`rotate(${(st.rot*180\/Math.PI).toFixed(2)} ${c} ${c})`;\n  return `<g transform=\"${rot}\">${back}${flange(fs.rFlR,holesR)}${front}${flange(fs.rFlL,holesL)}\n    <circle cx=\"${c}\" cy=\"${c}\" r=\"${f(fs.rFlL*WH.hub.shell)}\" fill=\"url(#hmlx-gShell)\"\/><circle cx=\"${c}\" cy=\"${c}\" r=\"3\" fill=\"#dfe4e9\" stroke=\"#6f7a86\" stroke-width=\".6\"\/><\/g>\n    <path fill-rule=\"evenodd\" d=\"${ring(fs.rimIn,fs.rimOut)}\" fill=\"url(#hmlx-gRim)\" stroke=\"#111418\" stroke-width=\".8\"\/>\n    <g transform=\"${rot}\">${eyelets}${nips}\n    <line x1=\"${f(v1x)}\" y1=\"${f(v1y)}\" x2=\"${f(v2x)}\" y2=\"${f(v2y)}\" stroke=\"#d5dbe1\" stroke-width=\"3\" stroke-linecap=\"round\"\/><\/g>\n    <path fill-rule=\"evenodd\" d=\"${ring(fs.rimIn,fs.rimOut)}\" fill=\"url(#hmlx-gRimLight)\"\/>`;\n}\n\n\/\/ one screwdriver head, drawn as if its hole were at 9 o'clock, then turned to where the head sits\nfunction headSVG(st, h){\n  const hd=st.heads[h], off=plan.off[h], twin=plan.off.length>1;\n  const sp=hd?S[hd.i]:null, engaging=!!hd&&hd.engaging&&!st.done;\n  const prevT=hd&&hd.prev!=null?drvTiltDrawn(hd.prev,h):0, ang=hd?prevT+(drvTiltDrawn(hd.i,h)-prevT)*(1-Math.pow(1-st.idxP,3)):0;\n  const vTilt=hd?drawnTilt(hd.i):0, vHole=hd?drawnHole(hd.i):0, tTilt=hd?spokeTilt(hd.i):0, tOff=hd?Math.abs(holeTilt(hd.i)-drvTiltTrue(hd.i,h)):0;\n  const px=fs.c-fs.rIn, py=fs.c, ux=Math.cos(ang), uy=Math.sin(ang), ext=reach();\n  const pulsesNow=hd?st.pul[hd.i]:0, on=engaging&&hd.spinning;\n  const retract=-46*(1-(hd?hd.adv:0)), creep=hd&&hd.spinning?hd.thr*10:0;\n  const P=(d,s=0)=>[px+ux*d-uy*s, py+uy*d+ux*s];\n  const bitTip=retract+creep-2;\n  const spin=(pulsesNow*60)%360;\n  const [tx,ty]=P(bitTip), [gx,gy]=P(-250-ext), angD=ang*180\/Math.PI;\n  const led=on?'#119915':(engaging?'#d68910':'#8a9bb0');\n  const arcs=on?[1,2,3].map(k=>{ const r=14+k*7, a0=(spin+k*110)*Math.PI\/180; return `<path d=\"M${f(tx+r*Math.cos(a0))} ${f(ty+r*Math.sin(a0))} A${r} ${r} 0 0 1 ${f(tx+r*Math.cos(a0+0.9))} ${f(ty+r*Math.sin(a0+0.9))}\" fill=\"none\" stroke=\"#084591\" stroke-opacity=\"${(0.55-k*0.12).toFixed(2)}\" stroke-width=\"2\" stroke-linecap=\"round\"\/>`; }).join(''):'';\n  \/\/ mount: the angled screwdriver rides an X-Y stage whose Y carriage follows the rear of the driver (it tilts about the nipple\n  \/\/ seat); the straight one sits on a plate. A single head has its own column, the twin heads share one (drawn once).\n  const rail=twin?'':(!straightM(opt.mach)\n    ?`<rect x=\"${f(px-250-ext)}\" y=\"${f(py-120)}\" width=\"18\" height=\"240\" rx=\"4\" fill=\"url(#hmlx-gRailV)\" stroke=\"#8d98a3\"\/>`\n    :`<rect x=\"${f(px-250-ext)}\" y=\"${f(py-120)}\" width=\"18\" height=\"240\" rx=\"4\" fill=\"url(#hmlx-gDarkV)\"\/>`);\n  const mount=!straightM(opt.mach)\n    ?`<rect x=\"${f(px-250-ext)}\" y=\"${f(P(-241-ext)[1]-16)}\" width=\"34\" height=\"32\" rx=\"5\" fill=\"url(#hmlx-gDark)\"\/>`\n    :`<rect x=\"${f(px-240-ext)}\" y=\"${f(py-10)}\" width=\"22\" height=\"20\" rx=\"4\" fill=\"url(#hmlx-gDark)\"\/>`;\n  const name=MACH[opt.mach].name+(twin?` ${h+1}`:'');\n  const unit=guideG(gx,gy,angD,190)+`<g transform=\"translate(${f(tx)} ${f(ty)}) rotate(${f(angD)})\">${driverG({on,spin,led,name:'',ext})}<\/g>${arcs}`;\n  \/\/ wedges on the hub side, where the screwdriver does not cover them\n  const arc=(a0,a1,rad,col)=>{ const A=[px+rad*Math.cos(a0), py+rad*Math.sin(a0)], B=[px+rad*Math.cos(a1), py+rad*Math.sin(a1)];\n    return `<path d=\"M${f(px)} ${f(py)} L${f(A[0])} ${f(A[1])} A${rad} ${rad} 0 0 ${a1>a0?1:0} ${f(B[0])} ${f(B[1])} Z\" fill=\"${col}\" fill-opacity=\".18\" stroke=\"${col}\" stroke-width=\"1\"\/>`; };\n  const holeAxis=hd?`<line x1=\"${f(px-120*Math.cos(vHole))}\" y1=\"${f(py-120*Math.sin(vHole))}\" x2=\"${f(px+150*Math.cos(vHole))}\" y2=\"${f(py+150*Math.sin(vHole))}\" stroke=\"${HOLE}\" stroke-width=\"1.4\" stroke-dasharray=\"7 3 2 3\"\/>`:'';\n  const offW=hd&&engaging&&tOff>0.001;\n  const holeW=hd&&opt.drill==='angle'&&Math.abs(vHole)>0.002;\n  const bendW=hd&&bendAngle(hd.i)>0.05&&Math.abs(vTilt-vHole)>0.002;\n  const inLine=hd&&engaging&&opt.drill==='angle'&&!offW&&!straightM(opt.mach);\n  const dg=a=>(Math.abs(a)*180\/Math.PI).toFixed(1);\n  \/\/ angles in the wheel plane, on the hub side: the hole against the radial line (blue), the screwdriver against the hole (red),\n  \/\/ the spoke bending into a radial hole (amber); the notes stack on the side the wedges open to\n  let marks='', notes=[];\n  if(holeW||offW) marks+=`<line x1=\"${f(px)}\" y1=\"${f(py)}\" x2=\"${f(px+150)}\" y2=\"${f(py)}\" stroke=\"#9aa5b0\" stroke-width=\"1.2\" stroke-dasharray=\"4 4\"\/>`;\n  if(holeW){ marks+=arc(0,vHole,64,HOLE); notes.push([`hole drilled ${dg(holeTilt(hd.i))}\u00b0`,'along the spoke, in the wheel plane',HOLE]); }\n  if(offW){ marks+=`<line x1=\"${f(px)}\" y1=\"${f(py)}\" x2=\"${f(P(150)[0])}\" y2=\"${f(P(150)[1])}\" stroke=\"#7f93a8\" stroke-width=\"1.4\" stroke-dasharray=\"5 4\"\/>`+arc(ang,vHole,96,RED);\n    notes.push([`screwdriver ${dg(tOff)}\u00b0 off`,'the nipple axis',RED]); }\n  if(inLine) notes.push([opt.mach==='ct'?`screwdriver set to ${dg(drvTiltTrue(hd.i,h))}\u00b0`:'screwdriver tilted onto the hole','in line with the nipple',GREEN]);\n  if(bendW){ const fx=feedIdx(hd.i); marks+=arc(vHole,vTilt,64,AMBER); notes.push([`spoke bends ${dg((tTilt-holeTilt(hd.i))*bendQ(hd.i))}\u00b0 into the nipple`,`${tensTxt(hd.i)}: ${flexTxt(fx)}`,AMBER,flexCol(fx)]); }\n  const dn=(holeW?vHole:bendW?vTilt:vHole-ang)>0, n=notes.length*2;\n  const labels=notes.flatMap(([b,sm,col,smCol],q)=>[[b,col,1],[sm,smCol||col,0]]).map(([t2,col,b],k)=>[px+30, dn?py+40+13*k:py-17-13*(n-1-k), t2, col, b]);\n  \/\/ labels stay level: their anchor turns with the head, the text does not\n  const co=Math.cos(off), si=Math.sin(off), rp=(x,y)=>[c+(x-c)*co-(y-c)*si, c+(x-c)*si+(y-c)*co];\n  \/\/ the top view is drawn mirrored (screwdriver on the right, as on the machines): text is placed at the mirrored point, unmirrored\n  const txt=labels.map(([x,y,s,col,b])=>{ const [X,Y]=rp(x,y); return `<text x=\"${f(MX(X))}\" y=\"${f(Y)}\" font-size=\"${b?10.5:9}\" font-weight=\"${b?700:400}\" fill=\"${col}\" text-anchor=\"${AN}\" ${halo}>${s}<\/text>`; }).join('');\n  const nl=[tx+Math.cos(ang)*(-135-ext)-Math.sin(ang)*(-31), ty+Math.sin(ang)*(-135-ext)+Math.cos(ang)*(-31)], [NX,NY]=rp(nl[0],nl[1]);\n  const nameTxt=`<text x=\"${f(MX(NX))}\" y=\"${f(NY)}\" font-size=\"10\" font-weight=\"700\" fill=\"#084591\" text-anchor=\"middle\" ${halo}>${name}<\/text>`;\n  return {g:`<g transform=\"rotate(${(off*180\/Math.PI).toFixed(3)} ${c} ${c})\">${rail}${mount}${holeAxis}${marks}${unit}<\/g>`, t:nameTxt, notes};   \/\/ the notes go to the panel\n}\n\n\/\/ the angle notes of the screwdriver(s), in the open corner at the top right instead of over the wheel and spokes\nfunction notesPanel(heads){\n  const wrap=(t,n)=>{ const out=[]; let line=''; for(const w of t.split(' ')){ if(line&&(line+' '+w).length>n){ out.push(line); line=w; } else line=line?line+' '+w:w; } if(line) out.push(line); return out; };\n  const x0=616, x1=826, tx=x0+12, rows=[];\n  heads.forEach((hd,h)=>{ if(!hd.notes.length) return;\n    if(heads.length>1) rows.push([`SCREWDRIVER ${h+1}`,'#084591',2]);\n    hd.notes.forEach(([b,sm,col,smCol])=>{ wrap(b,34).forEach(l=>rows.push([l,col,1])); wrap(sm,42).forEach(l=>rows.push([l,smCol||col,0])); rows.push(null); }); });\n  while(rows.length&&rows[rows.length-1]===null) rows.pop();\n  if(!rows.length) return '';\n  let y=66+16, body='';\n  rows.forEach(r=>{ if(!r){ y+=5; return; } const [t,col,b]=r; if(b===2&&y>82) y+=6;\n    body+=`<text x=\"${tx}\" y=\"${f(y)}\" font-size=\"${b===2?9.5:b?10.5:9}\" font-weight=\"${b?700:400}\" fill=\"${col}\" ${b===2?'letter-spacing=\".08em\"':''}>${t}<\/text>`; y+=b?14:12; });\n  return `<rect x=\"${x0}\" y=\"66\" width=\"${x1-x0}\" height=\"${f(y-66+2)}\" rx=\"12\" fill=\"#fff\" fill-opacity=\".92\" stroke=\"#d4dce7\"\/>${body}`;\n}\n\n\/\/ the nipple of head 1, magnified six times\nfunction insetSVG(st){\n  const hd=st.heads[0], sp=hd?S[hd.i]:null, engaging=!!hd&&hd.engaging&&!st.done, on=engaging&&hd.spinning;\n  const pulsesNow=hd?st.pul[hd.i]:0, spin=(pulsesNow*60)%360;\n  const sc6=6, X0=-150, Y0=70, wall=single()?3:2.2, head=nip.head||2.2, len=nip.len, z0=-(len-head)+nip.threadStart, travel=pulsesNow*mm, tip=z0+travel, taut=nip.add;\n  const x=z=>X0-z*sc6, r=3.4*sc6\/2, rh=(nip.type==='internal'?2.2:3.2)*sc6\/2, rs=opt.gauge\/2*sc6;\n  const sgn=sp&&sp.side==='R'?1:-1;\n  const aHole=hd?holeAngle(hd.i):0, aSpoke=hd?spokeAngle(hd.i):0, aPlay=hd?playUsed(hd.i):0, aNip=aHole+aPlay, off=hd?offAngle(hd.i,0):0, aDrv=aHole-off;\n  const th=sgn*aHole*Math.PI\/180, xe=x(-(len-head)), edge=X0+126;\n  const xa=x(0), xb=x(-wall), tn=Math.tan(th), hw=Math.max(r+.6,opt.holeI\/2*sc6)\/Math.cos(th), yc=xx=>Y0+tn*(xx-X0);\n  const wallPoly=`<polygon points=\"${f(xa)},${Y0-40} ${f(xb)},${Y0-40} ${f(xb)},${f(yc(xb)-hw)} ${f(xa)},${f(yc(xa)-hw)}\" fill=\"url(#hmlx-gAlu)\" stroke=\"#6e7a87\" stroke-width=\".6\"\/><polygon points=\"${f(xa)},${f(yc(xa)+hw)} ${f(xb)},${f(yc(xb)+hw)} ${f(xb)},${Y0+40} ${f(xa)},${Y0+40}\" fill=\"url(#hmlx-gAlu)\" stroke=\"#6e7a87\" stroke-width=\".6\"\/>`;\n  \/\/ double-wall rim: the nipple seats on the spoke bed (above); the tyre bed sits 7 mm further out and has a wider access hole\n  \/\/ (\u00d87.2 mm) for the nipple and the screwdriver bit, drilled on the same axis as the spoke-bed hole\n  const gapT=opt.depth-9.8, brk=gapT>9.6, zb=brk?9.5:gapT;     \/\/ spoke bed to tyre bed, mm; deeper rims are drawn with a break\n  const xo0=x(zb), xo1=x(zb+1.8), hwO=opt.holeO\/2*sc6\/Math.cos(th), xk=x(8.6);\n  const zig=dx=>Array.from({length:15},(_,q)=>`${f(xk+dx+(q%2?2:-2))},${Y0-42+q*6}`).join(' ');\n  const breakG=brk&&!single()?`<rect x=\"${f(xk-2)}\" y=\"${Y0-42}\" width=\"7\" height=\"84\" fill=\"#fff\"\/><polyline points=\"${zig(-2)}\" fill=\"none\" stroke=\"#6e7a87\" stroke-width=\".8\"\/><polyline points=\"${zig(5)}\" fill=\"none\" stroke=\"#6e7a87\" stroke-width=\".8\"\/>\n    <text x=\"${f(xk+1.5)}\" y=\"${Y0-30}\" font-size=\"8\" font-weight=\"700\" fill=\"#56687f\" text-anchor=\"middle\" ${halo}>${gapT.toFixed(0)} mm<\/text>`:'';\n  const bedPoly=`<polygon points=\"${f(xo1)},${Y0-40} ${f(xo0)},${Y0-40} ${f(xo0)},${f(yc(xo0)-hwO)} ${f(xo1)},${f(yc(xo1)-hwO)}\" fill=\"url(#hmlx-gAlu)\" stroke=\"#6e7a87\" stroke-width=\".6\"\/><polygon points=\"${f(xo1)},${f(yc(xo1)+hwO)} ${f(xo0)},${f(yc(xo0)+hwO)} ${f(xo0)},${Y0+40} ${f(xo1)},${Y0+40}\" fill=\"url(#hmlx-gAlu)\" stroke=\"#6e7a87\" stroke-width=\".6\"\/>`;\n  const bedLabels=single()?`<text x=\"${f((xa+xb)\/2)}\" y=\"${Y0+50}\" font-size=\"8\" fill=\"#56687f\" text-anchor=\"middle\">${dimpled()?'dimpled rim bed':'rim bed'}<\/text>`\n    :`<text x=\"${f((xo0+xo1)\/2)}\" y=\"${Y0+50}\" font-size=\"8\" fill=\"#56687f\" text-anchor=\"middle\">tyre bed<\/text><text x=\"${f((xa+xb)\/2)}\" y=\"${Y0+50}\" font-size=\"8\" fill=\"#56687f\" text-anchor=\"middle\">spoke bed<\/text>`;\n  const sx=hd?x(tip):x(z0), thEnd=x(tip-9.5);\n  const threads=(x0,x1)=>Array.from({length:60},(_,q)=>{ const xx=x0+2+q*2.7; return xx<x1&&xx<edge?`<line x1=\"${f(xx)}\" y1=\"${f(Y0-rs)}\" x2=\"${f(xx-1.6)}\" y2=\"${f(Y0+rs)}\" stroke=\"#465C73\" stroke-width=\".7\" opacity=\".75\"\/>`:''; }).join('');\n  const outer=hd?sgn*(aSpoke-aNip):0;                     \/\/ the spoke beyond the nipple, against the nipple axis\n  const spokeIn=`<rect x=\"${f(sx)}\" y=\"${f(Y0-rs)}\" width=\"${f(Math.max(0,xe-sx))}\" height=\"${f(2*rs)}\" fill=\"url(#hmlx-gSpoke)\" stroke=\"#5d6874\" stroke-width=\".7\"\/>${threads(sx,Math.min(xe,thEnd))}`;\n  const spokeOut=rot=>`<g transform=\"rotate(${f(rot)} ${f(xe)} ${Y0})\"><rect x=\"${f(Math.max(sx,xe))}\" y=\"${f(Y0-rs)}\" width=\"${f(edge+30-Math.max(sx,xe))}\" height=\"${f(2*rs)}\" fill=\"url(#hmlx-gSpoke)\" stroke=\"#5d6874\" stroke-width=\".7\"\/>${threads(Math.max(sx,xe),thEnd)}<\/g>`;\n  \/\/ a radial hole: the spoke must bend by its angle. In a loose wheel (groups 1\u20132) it flexes and enters the nipple in line,\n  \/\/ the bend spread along the spoke; in a wheel under tension (groups 3\u20134) it stays straighter, kinked at the nipple. As the\n  \/\/ nipple is screwed on, the spoke pulls taut and straight. Thin, long spokes flex more than short, thick ones.\n  let spokeCurve='', flexNow=0;\n  if(hd&&aSpoke-aNip>0.05){ const T=wheelT(hd.i), tg=D.taut[S[hd.i].group], own=clamp((pulsesNow-0.5*tg)\/(0.5*tg));\n    flexNow=clamp((1-0.65*T)\/Math.sqrt(Math.max(1,flexIdx(hd.i))))*(1-own);\n    const o=outer*Math.PI\/180, xs=Math.max(sx,xe), L=edge+30-xs, us=[Math.cos(o),Math.sin(o)];\n    const tn=[(1-flexNow)*us[0]+flexNow,(1-flexNow)*us[1]], tl=Math.hypot(tn[0],tn[1]), t0=[tn[0]\/tl,tn[1]\/tl];\n    const E=[xs,Y0], F=[xs+L*us[0],Y0+L*us[1]], C1=[E[0]+t0[0]*L*.45,E[1]+t0[1]*L*.45], C2=[F[0]-us[0]*L*.3,F[1]-us[1]*L*.3];\n    const pd=`M${f(E[0])} ${f(E[1])} C${f(C1[0])} ${f(C1[1])} ${f(C2[0])} ${f(C2[1])} ${f(F[0])} ${f(F[1])}`, nt=Math.floor(Math.max(0,thEnd-xs)\/2.7);\n    spokeCurve=`<path d=\"${pd}\" fill=\"none\" stroke=\"#5d6874\" stroke-width=\"${f(2*rs+1.4)}\"\/><path d=\"${pd}\" fill=\"none\" stroke=\"#c3cbd3\" stroke-width=\"${f(2*rs-.6)}\"\/>`\n      +(nt>0?`<path d=\"${pd}\" fill=\"none\" stroke=\"#465C73\" stroke-width=\"${f(2*rs-1)}\" stroke-opacity=\".55\" stroke-dasharray=\"${Array(nt).fill('.8 1.9').join(' ')} 0 3000\"\/>`:''); }\n  const nippleG=`<g transform=\"rotate(${f(sgn*aNip)} ${X0} ${Y0})\">\n      <rect x=\"${f(x(0))}\" y=\"${f(Y0-r)}\" width=\"${f((len-head)*sc6)}\" height=\"${f(2*r)}\" rx=\"2\" fill=\"url(#hmlx-gNip)\" stroke=\"#5e6e7e\" stroke-width=\".8\"\/>\n      <rect x=\"${f(x(head))}\" y=\"${f(Y0-rh)}\" width=\"${f(head*sc6)}\" height=\"${f(2*rh)}\" rx=\"3\" fill=\"url(#hmlx-gNip)\" stroke=\"#5e6e7e\" stroke-width=\".8\"\/><rect x=\"${f(x(head))}\" y=\"${f(Y0-1.2)}\" width=\"${f(head*sc6*.55)}\" height=\"2.4\" fill=\"#4a525b\"\/>\n      ${spokeIn}${spokeCurve||spokeOut(0)}<\/g>`;\n  \/\/ the nipple bit: a sleeve over the nipple head with the blade in its slot, on a steel shank; the dark line turns with it\n  const slotY=Y0+8*Math.sin(spin*Math.PI\/180);\n  const driverG=`<g transform=\"rotate(${f(sgn*aDrv)} ${X0} ${Y0})\">\n      <rect x=\"${f(x(head)-90)}\" y=\"${Y0-5}\" width=\"73\" height=\"10\" fill=\"url(#hmlx-gSteel)\" stroke=\"#6e7a87\" stroke-width=\".6\"\/>\n      <rect x=\"${f(x(head)-18)}\" y=\"${Y0-11}\" width=\"19\" height=\"22\" rx=\"3\" fill=\"url(#hmlx-gSteel)\" stroke=\"${on?'#005389':'#5e6e7e'}\" stroke-width=\"${on?1.4:.8}\"\/>\n      <line x1=\"${f(x(head)-17)}\" y1=\"${f(slotY)}\" x2=\"${f(x(head))}\" y2=\"${f(slotY)}\" stroke=\"#3c4650\" stroke-width=\"1.2\" opacity=\".55\"\/><\/g>`;\n  const axisL=`<line x1=\"${f(X0-70)}\" y1=\"${f(Y0-70*tn)}\" x2=\"${f(X0+120)}\" y2=\"${f(Y0+120*tn)}\" stroke=\"${HOLE}\" stroke-width=\"1\" stroke-dasharray=\"7 3 2 3\" opacity=\".7\"\/>`;\n  const line1=!hd?(opt.drill==='straight'?'radially drilled hole':'hole drilled along the spoke')\n    :opt.drill==='straight'?`radial hole \u00b7 spoke bends ${bendAngle(hd.i).toFixed(1)}\u00b0 into the nipple`\n    :`${drillQ(hd.i)<0.999?`hole ${aHole.toFixed(1)}\u00b0 of ${aSpoke.toFixed(1)}\u00b0`:'hole along the spoke'} \u00b7 ${off<0.05?'screwdriver in line':`screwdriver ${off.toFixed(1)}\u00b0 off`}`;\n  const col1=!hd?'#56687f':opt.drill==='straight'?AMBER:(off<0.05?GREEN:RED);\n  const fxi=hd?feedIdx(hd.i):0;\n  const line2=!hd?'waiting for the next spoke':aSpoke-aNip>0.05?`${tensTxt(hd.i)}: ${flexCat(fxi)==='ok'?(flexNow>.7?'spoke flexes into line':flexNow>.15?'spoke flexes partly into line':'spoke pulled taut'):flexCat(fxi)==='warn'?'harder to feed':'too stiff to feed easily'}`:`${(pulsesNow*mm).toFixed(1)} mm of thread screwed on`;\n  const col2=hd&&aSpoke-aNip>0.05?flexCol(fxi):'#56687f';\n  return `<rect x=\"-230\" y=\"${Y0-60}\" width=\"212\" height=\"148\" rx=\"12\" fill=\"#fff\" stroke=\"#d4dce7\"\/>\n    <text x=\"-124\" y=\"${Y0-44}\" font-size=\"10\" font-weight=\"700\" fill=\"#56687f\" text-anchor=\"middle\">NIPPLE \u00d76 \u00b7 ${single()?(dimpled()?'single-wall rim, dimpled':'single-wall rim, plain hole'):'double-wall rim'}${plan.off.length>1?' \u00b7 head 1':''}<\/text>\n    <g clip-path=\"url(#hmlx-insetClip)\">${axisL}${wallPoly}${single()?'':bedPoly}${nippleG}${driverG}${breakG}${bedLabels}<\/g>\n    <text x=\"-124\" y=\"${Y0+62}\" font-size=\"9.5\" font-weight=\"700\" fill=\"${col1}\" text-anchor=\"middle\">${line1}<\/text>\n    <text x=\"-124\" y=\"${Y0+77}\" font-size=\"9.5\" font-weight=\"700\" fill=\"${col2}\" text-anchor=\"middle\">${line2}<\/text>`;\n}\n\nfunction sideSVG(st){\n  const twin=plan.off.length>1, px=fs.c-fs.rIn, py=fs.c, ext=reach();\n  const column=twin?(!straightM(opt.mach)\n    ?`<rect x=\"${f(px-250-ext)}\" y=\"${f(py-150)}\" width=\"18\" height=\"300\" rx=\"4\" fill=\"url(#hmlx-gRailV)\" stroke=\"#8d98a3\"\/>`\n    :`<rect x=\"${f(px-250-ext)}\" y=\"${f(py-150)}\" width=\"18\" height=\"300\" rx=\"4\" fill=\"url(#hmlx-gDarkV)\"\/>`):'';\n  const heads=plan.off.map((_,h)=>headSVG(st,h)), M=MIRROR?`translate(${2*c} 0) scale(-1 1)`:'translate(0 0)';\n  return `<g transform=\"translate(${f(fs.dx)} 0)\">${machineSVG('under')}<g transform=\"${M}\">${wheelSVG(st)}${column}${heads.map(x=>x.g).join('')}<\/g><\/g>${machineSVG('hood')}<g transform=\"translate(${f(fs.dx)} 0)\">${heads.map(x=>x.t).join('')}<\/g>${notesPanel(heads)}\n    <g transform=\"translate(844.5 354.5) scale(1.25)\">${insetSVG(st)}<\/g>   <!-- the nipple close-up, bottom right -->`;\n}\nconst MIRROR=false, MX=x=>MIRROR?2*c-x:x, AN=MIRROR?'end':'start';   \/\/ the views can be drawn mirrored; the machines lace at the left\n\/\/ the lacing machine seen from above, after the product photos: the lacing head with its screwdriver works at the left of the\n\/\/ rim (9 o'clock), under the hood, with white rim guide rollers; the wheel lies on a hub stud. ECL: grey cabinet, blue\n\/\/ translucent hood, black rail at hub height out to the right with the hub carriage and a black rim support (yellow sensor).\n\/\/ ISL: white hood with a window, the hub stud on a black arm from a white beam at the back, the rim support at the beam's end.\n\/\/ Inline Lacer: like the ISL with a bigger hood (room to tilt the screwdriver). CT Twin Lacer: like the Inline Lacer, slightly\n\/\/ bigger, with the two lacing heads (A, B) under the hood.\nfunction machineSVG(layer){\n  const m=opt.mach;\n  const ecl=m==='ecl', il=m==='inline', ct=m==='ct', yS=c;                                   \/\/ hub height\n  const rimR=fs.rimOut, xr=c+rimR;                                               \/\/ right edge of the rim\n  if(layer==='under'){\n    const support=`<rect x=\"${f(xr+18)}\" y=\"${yS-22}\" width=\"44\" height=\"44\" rx=\"6\" fill=\"url(#hmlx-gBlack)\" stroke=\"#0d0f12\"\/>\n      <rect x=\"${f(xr+4)}\" y=\"${yS-6}\" width=\"20\" height=\"12\" rx=\"3\" fill=\"url(#hmlx-gSteel)\" stroke=\"#5d6874\" stroke-width=\".6\"\/>\n      <rect x=\"${f(xr+44)}\" y=\"${yS-30}\" width=\"16\" height=\"12\" rx=\"2\" fill=\"url(#hmlx-gYellow)\" stroke=\"#8a6d00\" stroke-width=\".8\"\/>`;\n    if(ecl) return `<g>\n      <rect x=\"-70\" y=\"${yS-12}\" width=\"${f(xr+80+70)}\" height=\"24\" rx=\"5\" fill=\"url(#hmlx-gBlack)\"\/>\n      <rect x=\"${c-34}\" y=\"${yS-20}\" width=\"68\" height=\"40\" rx=\"6\" fill=\"url(#hmlx-gBlack)\" stroke=\"#0d0f12\"\/>\n      <circle cx=\"${c}\" cy=\"${yS}\" r=\"12\" fill=\"#2a3037\" stroke=\"#0d0f12\"\/>${support}<\/g>`;\n    return `<g>\n      <rect x=\"-70\" y=\"22\" width=\"${f(xr+80+70)}\" height=\"34\" rx=\"6\" fill=\"url(#hmlx-gWhite)\" stroke=\"#b9c1ca\" stroke-width=\"1.2\"\/>\n      <path d=\"M${c-12} 52 L${c-12} ${yS-14} L${c+12} ${yS-14} L${c+12} 52 Z\" fill=\"url(#hmlx-gBlack)\"\/>\n      <circle cx=\"${c}\" cy=\"${yS}\" r=\"14\" fill=\"#2a3037\" stroke=\"#0d0f12\"\/>\n      <path d=\"M${f(xr+62)} 52 L${f(xr+62)} ${yS-22} L${f(xr+40)} ${yS-22} L${f(xr+40)} 52 Z\" fill=\"url(#hmlx-gBlack)\"\/>${support}<\/g>`;\n  }\n  \/\/ the hood over the lacing head and the screwdriver, with the cabinet behind it; translucent where the screwdriver works\n  \/\/ the hood ends roughly where the screwdrivers meet the rim (the nipple holes at 9 o'clock); the machines differ in depth (y)\n  const hx1=fs.c+fs.dx-fs.rIn+(ct?12:8), hy0=ct?58:il?70:ecl?104:92, hy1=ct?504:il?490:ecl?456:468;\n  const rollers=[-1,1].map(k=>{ const a=Math.PI+k*0.16, x=c+fs.dx+(fs.rimOut+5)*Math.cos(a), y=c+(fs.rimOut+5)*Math.sin(a); return `<circle cx=\"${f(x)}\" cy=\"${f(y)}\" r=\"7\" fill=\"url(#hmlx-gWhite)\" stroke=\"#9aa5b0\"\/><circle cx=\"${f(x)}\" cy=\"${f(y)}\" r=\"2.2\" fill=\"#5d6874\"\/>`; }).join('');\n  const cabinet=ct?`<path d=\"M-216 ${hy0-26} L-128 ${hy0-26} L-128 ${hy1+26} L-216 ${hy1+26} L-248 ${hy1-6} L-248 ${hy0+6} Z\" fill=\"url(#hmlx-gWhiteH)\" stroke=\"#b9c1ca\" stroke-width=\"1.2\"\/>`\n    +`<rect x=\"-236\" y=\"${hy1-28}\" width=\"60\" height=\"40\" rx=\"4\" fill=\"#20262d\" stroke=\"#0d0f12\"\/><rect x=\"-232\" y=\"${hy1-24}\" width=\"52\" height=\"32\" rx=\"2\" fill=\"#3b5d8a\"\/><circle cx=\"-150\" cy=\"${hy1+6}\" r=\"7\" fill=\"#d63031\" stroke=\"#7a1414\"\/><rect x=\"-158\" y=\"${hy0+4}\" width=\"18\" height=\"10\" rx=\"2\" fill=\"url(#hmlx-gYellow)\"\/>`\n    :`<rect x=\"-248\" y=\"${hy0-26}\" width=\"120\" height=\"${hy1-hy0+52}\" rx=\"10\" fill=\"url(#hmlx-gWhiteH)\" stroke=\"#b9c1ca\" stroke-width=\"1.2\"\/>\n    <rect x=\"-236\" y=\"${hy1-28}\" width=\"60\" height=\"40\" rx=\"4\" fill=\"#20262d\" stroke=\"#0d0f12\"\/><rect x=\"-232\" y=\"${hy1-24}\" width=\"52\" height=\"32\" rx=\"2\" fill=\"#3b5d8a\"\/>\n    <circle cx=\"-150\" cy=\"${hy1+6}\" r=\"7\" fill=\"#d63031\" stroke=\"#7a1414\"\/><rect x=\"-158\" y=\"${hy0+4}\" width=\"18\" height=\"10\" rx=\"2\" fill=\"url(#hmlx-gYellow)\"\/>`;\n  const shape=`M-130 ${hy0} L${hx1-34} ${hy0} L${hx1} ${hy0+34} L${hx1} ${hy1-34} L${hx1-34} ${hy1} L-130 ${hy1} Z`;\n  const win=`M-118 ${hy0+20} L${hx1-44} ${hy0+20} L${hx1-14} ${hy0+50} L${hx1-14} ${hy1-50} L${hx1-44} ${hy1-20} L-118 ${hy1-20} Z`;\n  const GLASS='#3a63e0';                                                         \/\/ the transparent hood, the same tint on every machine\n  const hood=ecl\n    ? `<path d=\"${shape}\" fill=\"${GLASS}\" fill-opacity=\".16\" stroke=\"#7fa8c2\" stroke-width=\"1.4\"\/><path d=\"M-120 ${hy0+10} L${hx1-38} ${hy0+10}\" stroke=\"#fff\" stroke-opacity=\".5\" stroke-width=\"3\"\/>`\n    : `<path d=\"${shape} ${win}\" fill-rule=\"evenodd\" fill=\"url(#hmlx-gWhiteH)\" stroke=\"#b9c1ca\" stroke-width=\"1.4\"\/><path d=\"${win}\" fill=\"${GLASS}\" fill-opacity=\".16\" stroke=\"#7fa8c2\" stroke-width=\"1\"\/>`;\n  return `<g>${cabinet}${rollers}${hood}<text x=\"-188\" y=\"${hy0+30}\" font-size=\"13\" font-weight=\"800\" fill=\"#53585B\" text-anchor=\"middle\" letter-spacing=\".08em\">${({ecl:'ECL',isl:'ISL',inline:'IL',ct:'CT'})[m]}<\/text><\/g>`;\n}\n\n\/* ---- side view: the rim edge-on, the hub with its flanges, the screwdriver's angle in the bracing plane ---- *\/\nfunction dishSVG(st){\n  const H=176, yc=96, maxFc=Math.max(20,opt.width\/2,...S.map(s=>Math.abs(s.hub.x))), AX=Math.min(2.4, 60\/(maxFc*fs.sc));\n  const X=(r,a)=>fs.c+r*Math.cos(a+st.rot), Y=x=>yc+x*fs.sc*AX;\n  const mean=a=>a.reduce((x,y)=>x+y,0)\/Math.max(1,a.length);\n  const yL=Y(mean(S.filter(s=>s.side==='L').map(s=>s.hub.x))), yR=Y(mean(S.filter(s=>s.side==='R').map(s=>s.hub.x)));\n  const rimW=opt.width*fs.sc*AX, x0=fs.c-fs.rimOut, x1=fs.c+fs.rimOut;\n  const active=new Set(st.heads.filter(Boolean).map(h=>h.i));\n  const colorOf=i=>{ const g=S[i].group, col=GC[g]; if(st.done||active.has(i)||st.pul[i]>D.taut[g]) return col; const n=parseInt(col.slice(1),16); return `rgba(${(n>>16)&255},${(n>>8)&255},${n&255},0.42)`; };\n  let spokes='', nips='';\n  S.forEach((s,i)=>{ const fr=st.frac[i]; if(fr<=0) return; const hx=X(rFl(s),s.hub.a), hy=Y(s.hub.x), rx=X(fs.rIn,s.rim.a), ry=Y(s.rim.x);\n    const ex=hx+(rx-hx)*fr, ey=hy+(ry-hy)*fr, act=active.has(i);\n    spokes+=`<line x1=\"${f(hx)}\" y1=\"${f(hy)}\" x2=\"${f(ex)}\" y2=\"${f(ey)}\" stroke=\"#fff\" stroke-width=\"${f((act?4:2.2)*opt.gauge\/2)}\" stroke-opacity=\".8\" stroke-linecap=\"round\"\/><line x1=\"${f(hx)}\" y1=\"${f(hy)}\" x2=\"${f(ex)}\" y2=\"${f(ey)}\" stroke=\"${colorOf(i)}\" stroke-width=\"${f((act?2.6:1.1)*opt.gauge\/2)}\" stroke-linecap=\"round\"\/>`;\n    if(st.pul[i]>0) nips+=`<rect x=\"${f(rx-2)}\" y=\"${f(ry-3.5)}\" width=\"4\" height=\"7\" rx=\"1\" fill=\"url(#hmlx-gNipH)\" stroke=\"#5e6e7e\" stroke-width=\".6\"\/>`; });\n  const outward=s=>Math.atan2((s.rim.x-s.hub.x)*fs.sc*AX, rFl(s)*Math.cos(s.hub.a-s.rim.a)-fs.rIn);\n  const holeOut=s=>{ if(opt.drill!=='angle') return Math.PI; const d=angDiff(outward(s),Math.PI); return Math.PI+Math.atan(drillQ(S.indexOf(s))*Math.tan(d)); };\n  let drv='', note='', noteTxt='';\n  const hd=st.heads[0];\n  if(hd){ const sp=S[hd.i], px=fs.c-fs.rIn, py=Y(sp.rim.x), engaging=hd.engaging&&!st.done;\n    const bang=outward(sp), hang=holeOut(sp);\n    const a0=opt.mach==='inline'&&hd.prev!=null?holeOut(S[hd.prev]):Math.PI, a1=opt.mach==='inline'?hang:Math.PI;   \/\/ only the Inline Lacer tilts sideways\n    const ang=a0+angDiff(a1,a0)*(1-Math.pow(1-st.idxP,3)), ux=Math.cos(ang), uy=Math.sin(ang), deg=ang*180\/Math.PI;\n    const d0=46*(1-hd.adv)-(hd.spinning?hd.thr*10:0);\n    const P=d=>[px+ux*d, py+uy*d];\n    const [tx,ty]=P(d0+2), [gx,gy]=P(250+reach()), spin=(st.pul[hd.i]*60)%360;\n    const on=engaging&&hd.spinning, led=on?'#119915':(engaging?'#d68910':'#8a9bb0'), braceDeg=Math.abs(sp.brace);\n    drv=guideG(gx,gy,deg+180,190)+`<g transform=\"translate(${f(tx)} ${f(ty)}) rotate(${f(deg+180)})\">${driverG({on,spin,led,name:'',ext:reach()})}<\/g>\n      <line x1=\"${f(px+110*Math.cos(hang))}\" y1=\"${f(py+110*Math.sin(hang))}\" x2=\"${f(px-120*Math.cos(hang))}\" y2=\"${f(py-120*Math.sin(hang))}\" stroke=\"${HOLE}\" stroke-width=\"1.4\" stroke-dasharray=\"7 3 2 3\"\/>\n      <g transform=\"rotate(${f(hang*180\/Math.PI-180)} ${f(px)} ${f(py)})\"><rect x=\"${f(px)}\" y=\"${f(py-2.6)}\" width=\"13\" height=\"5.2\" rx=\"1.5\" fill=\"url(#hmlx-gNip)\" stroke=\"#5e6e7e\" stroke-width=\".8\"\/><rect x=\"${f(px-3.2)}\" y=\"${f(py-3.4)}\" width=\"3.6\" height=\"6.8\" rx=\"1.4\" fill=\"url(#hmlx-gNip)\" stroke=\"#5e6e7e\" stroke-width=\".8\"\/><\/g>`;\n    const wedge=(a0,a1,rad,col)=>{ const A=[px+rad*Math.cos(a0),py+rad*Math.sin(a0)], B=[px+rad*Math.cos(a1),py+rad*Math.sin(a1)], d=angDiff(a1,a0);\n      return `<path d=\"M${f(px)} ${f(py)} L${f(A[0])} ${f(A[1])} A${rad} ${rad} 0 0 ${d>0?1:0} ${f(B[0])} ${f(B[1])} Z\" fill=\"${col}\" fill-opacity=\".18\" stroke=\"${col}\" stroke-width=\"1\"\/>`; };\n    \/\/ CT Twin Lacer: the spoke gripper (concept). A two-link arm with a double hinge on a base below the rim. Parked, the\n    \/\/ gripper head sits underneath the screwdriver; while the wheel indexes it swings counter-clockwise up to the hole, rising\n    \/\/ into the spoke from below and turning in line with it, grabs the spoke once its end has arrived and places it exactly\n    \/\/ on the hole axis where the nipple arrives; when the nipple has caught the thread it opens and folds back down.\n    if(opt.mach==='ct'){ const fr=st.frac[hd.i], thr=hd.thr, hIn=hang-Math.PI;\n      const go=ease(st.idxP*1.15)*(1-ease((thr-0.24)\/0.22)), closed=clamp((fr-0.82)\/0.12)*(1-clamp((thr-0.16)\/0.1));\n      \/\/ the head's path in the hole's frame (u along the hole axis, n square to it, down): parked upright under the screwdriver's\n      \/\/ nose, straight along underneath, then a counter-clockwise quarter turn up into the hole, turning in line with the spoke\n      const G=[px+13*Math.cos(hIn), py+13*Math.sin(hIn)], u=[Math.cos(hIn),Math.sin(hIn)], n=[-u[1],u[0]], at=(a,b)=>[G[0]+a*u[0]+b*n[0], G[1]+a*u[1]+b*n[1]];\n      const Rc=30, run=65, arcL=Math.PI\/2*Rc, sP=go*(run+arcL);\n      let tip, turn;\n      if(sP<run){ tip=at(-Rc-run+sP, Rc); turn=1; } else { const q=(sP-run)\/arcL, ph=Math.PI\/2*(1-q); tip=at(-Rc+Rc*Math.cos(ph), Rc*Math.sin(ph)); turn=1-q; }\n      const B=at(-20, 66), L1=44, L2=44, dx=tip[0]-B[0], dy=tip[1]-B[1], dd=Math.min(L1+L2-0.5, Math.hypot(dx,dy));\n      const aB=Math.atan2(dy,dx), k=Math.acos((L1*L1+dd*dd-L2*L2)\/(2*L1*dd)), E=[B[0]+L1*Math.cos(aB+k), B[1]+L1*Math.sin(aB+k)];  \/\/ elbow toward the hub\n      const ja=(hIn+turn*Math.PI\/2)*180\/Math.PI, g=2.6+(1-closed)*11;                          \/\/ upright, then turning counter-clockwise in line\n      const pin=(q,r)=>`<circle cx=\"${f(q[0])}\" cy=\"${f(q[1])}\" r=\"${r}\" fill=\"url(#hmlx-gSteel)\" stroke=\"#3a4048\" stroke-width=\".9\"\/>`;\n      drv+=`<rect x=\"${f(B[0]-13)}\" y=\"${f(B[1]-3)}\" width=\"26\" height=\"14\" rx=\"3\" fill=\"url(#hmlx-gBlack)\" stroke=\"#0d0f12\"\/>\n        <path d=\"M${f(B[0])} ${f(B[1])} L${f(E[0])} ${f(E[1])} L${f(tip[0])} ${f(tip[1])}\" fill=\"none\" stroke=\"#2a3037\" stroke-width=\"7\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/>\n        ${pin(B,3.6)}${pin(E,3.6)}\n        <g transform=\"translate(${f(tip[0])} ${f(tip[1])}) rotate(${f(ja)})\">\n          <rect x=\"-12\" y=\"${f(-g\/2-6)}\" width=\"24\" height=\"6\" rx=\"2.5\" fill=\"#E8692D\" stroke=\"#a8461a\" stroke-width=\".8\"\/><rect x=\"-12\" y=\"${f(g\/2)}\" width=\"24\" height=\"6\" rx=\"2.5\" fill=\"#E8692D\" stroke=\"#a8461a\" stroke-width=\".8\"\/>\n          <rect x=\"-10\" y=\"${f(-g\/2-1.6)}\" width=\"20\" height=\"1.6\" fill=\"#f4f6f8\"\/><rect x=\"-10\" y=\"${f(g\/2)}\" width=\"20\" height=\"1.6\" fill=\"#f4f6f8\"\/><\/g>${pin(tip,2.6)}`;\n      if(go>0.4) noteTxt+=`<text x=\"${f(MX(Math.min(tip[0],E[0],B[0]-13)-8))}\" y=\"${f(Math.min(170,B[1]+4))}\" font-size=\"9.5\" font-weight=\"700\" fill=\"#c4551d\" text-anchor=\"${MIRROR?'start':'end'}\" ${halo}>${closed>0.5?'gripper holds the spoke at the nipple':'spoke gripper'}${opt.gauge>SPEC.ct.gripMax?` \u00b7 risk: \u00d8${opt.gauge.toFixed(1)} often too thick`:''}<\/text>`; }\n    const hB=holeBrace(hd.i), rB=(braceDeg-hB)*bendQ(hd.i), offD=engaging&&opt.mach!=='inline'&&opt.drill==='angle'&&hB>0.05, bendD=rB>0.05, inward=bang-Math.PI, hIn=hang-Math.PI;\n    const lines=[];\n    if(offD) lines.push([`${hB.toFixed(1)}\u00b0 off the nipple axis`,RED,1],['screwdriver, sideways (bracing)',RED,0]);\n    if(bendD){ const fx=feedIdx(hd.i); lines.push([`spoke bends ${rB.toFixed(1)}\u00b0`,AMBER,1],['into the nipple, sideways (bracing)',AMBER,0],[`${tensTxt(hd.i)}: ${flexTxt(fx)}`,flexCol(fx),0]); }\n    if(engaging&&!offD) lines.push(['screwdriver in line',GREEN,1]);\n    const ly=k=>sp.side==='L'?py+34+13*k:py-27-13*(lines.length-1-k);\n    note=(offD?`<line x1=\"${f(px)}\" y1=\"${f(py)}\" x2=\"${f(px+120)}\" y2=\"${f(py)}\" stroke=\"#7f93a8\" stroke-width=\"1.4\" stroke-dasharray=\"5 4\"\/>`+wedge(0,hIn,70,RED):'')\n      +(bendD?wedge(hIn,inward,58,AMBER):'')\n;\n    const lx=fs.c-Math.max(fs.rFlL,fs.rFlR)-px<200?fs.c+Math.max(fs.rFlL,fs.rFlR)+44:px+40;   \/\/ small wheels: the notes go right of the hub, clear of the flange labels\n    noteTxt+=lines.map(([s,col,b],k)=>`<text x=\"${f(MX(lx))}\" y=\"${f(ly(k))}\" font-size=\"${b?10.5:9}\" font-weight=\"${b?700:400}\" fill=\"${col}\" text-anchor=\"${AN}\" ${halo}>${s}<\/text>`).join('');\n  }\n  return `<g transform=\"${MIRROR?`translate(${2*c} 0) scale(-1 1)`:'translate(0 0)'}\">    <line x1=\"${f(x0-30)}\" y1=\"${yc}\" x2=\"${f(x1+30)}\" y2=\"${yc}\" stroke=\"#c9d3dd\" stroke-dasharray=\"4 4\"\/>\n    <rect x=\"${f(x0)}\" y=\"${f(yc-rimW\/2)}\" width=\"${f(x1-x0)}\" height=\"${f(rimW)}\" rx=\"${f(rimW\/2)}\" fill=\"url(#hmlx-gRimBar)\" stroke=\"#111418\" stroke-width=\".8\"\/>\n    ${spokes}\n    <line x1=\"${fs.c}\" y1=\"${f(yL-14)}\" x2=\"${fs.c}\" y2=\"${f(yR+14)}\" stroke=\"#7f93a8\" stroke-width=\"4\" stroke-linecap=\"round\"\/>\n    <rect x=\"${fs.c-7}\" y=\"${f(Math.min(yL,yR)-3)}\" width=\"14\" height=\"${f(Math.abs(yR-yL)+6)}\" rx=\"5\" fill=\"url(#hmlx-gRailV)\" stroke=\"#5e6e7e\" stroke-width=\"1\"\/>\n    <rect x=\"${f(fs.c-fs.rFlL)}\" y=\"${f(yL-3)}\" width=\"${f(2*fs.rFlL)}\" height=\"6\" rx=\"2\" fill=\"url(#hmlx-gSteel)\" stroke=\"${GC.NDS}\" stroke-width=\"1.2\"\/><rect x=\"${f(fs.c-fs.rFlR)}\" y=\"${f(yR-3)}\" width=\"${f(2*fs.rFlR)}\" height=\"6\" rx=\"2\" fill=\"url(#hmlx-gSteel)\" stroke=\"${GC.DS}\" stroke-width=\"1.2\"\/>\n    ${nips}${drv}${note}<\/g>\n    <text x=\"${f(MX(fs.c+fs.rFlL+8))}\" y=\"${f(yL+3.5)}\" font-size=\"10\" font-weight=\"800\" fill=\"${GC.NDS}\" text-anchor=\"${AN}\">NDS<\/text><text x=\"${f(MX(fs.c+fs.rFlR+8))}\" y=\"${f(yR+3.5)}\" font-size=\"10\" font-weight=\"800\" fill=\"${GC.DS}\" text-anchor=\"${AN}\">DS<\/text>${noteTxt}`;\n}\n\n\/* ---- rim drilling: a section through the hole of screwdriver 1, and the spoke bed seen from the hub ---- *\/\nconst holesByAngle=[...BASE.keys()].sort((a,b)=>norm(BASE[a].rimA)-norm(BASE[b].rimA)), holeNo=new Map(holesByAngle.map((h,k)=>[h,k]));\nfunction drillSVG(st){\n  const hd=st.heads[0], i=hd?hd.i:(st.done?plan.cycles[plan.cycles.length-1].sp[0]:plan.cycles[0].sp[0]);\n  const sp=S[i], s=sp.side==='L'?1:-1, ang=opt.drill==='angle', EX=1;          \/\/ NDS flange to the left; true angles, so the side-wall check is drawn as it is\n  const bd=Math.atan(EX*Math.tan(sp.brace*Math.PI\/180)), hb=ang?Math.atan(EX*Math.tan(holeBrace(i)*Math.PI\/180)):0;\n  const Dp=opt.depth, W=opt.width\/2, k=Math.min(4.6, 140\/opt.width, 205\/(Dp+24)), ox=185, oy=42, a0=sp.rim.x;\n  const X=a=>ox+a*k, Y=r=>oy+r*k, ax=r=>a0-s*Math.tan(hb)*(r-(Dp-1));           \/\/ the hole axis: axial position (mm) at depth r\n  \/\/ sides run straight, then curve in to the spoke bed: a short radius on shallow and fat rims, a long taper on deep rims\n  const rr=Math.min(W-4, Dp*.35), bw=W-rr, yT=Dp-Math.max(rr, .55*(Dp-24)+rr), Wi=W-1.6, bwi=Math.max(1,bw-1.6), yTi=Math.max(9.8,yT);\n  const outer=`M${f(X(-W))} ${f(Y(0))} L${f(X(-Wi))} ${f(Y(0))} L${f(X(-Wi))} ${f(Y(6))} L${f(X(Wi))} ${f(Y(6))} L${f(X(Wi))} ${f(Y(0))} L${f(X(W))} ${f(Y(0))} L${f(X(W))} ${f(Y(yT))} Q${f(X(W))} ${f(Y(Dp))} ${f(X(bw))} ${f(Y(Dp))} L${f(X(-bw))} ${f(Y(Dp))} Q${f(X(-W))} ${f(Y(Dp))} ${f(X(-W))} ${f(Y(yT))} Z`\n    +`M${f(X(-Wi))} ${f(Y(0))} h${f(k)} v${f(1.3*k)} h${f(-k)} Z M${f(X(Wi))} ${f(Y(0))} h${f(-k)} v${f(1.3*k)} h${f(k)} Z`;\n  const cavity=`M${f(X(-Wi))} ${f(Y(7.8))} L${f(X(Wi))} ${f(Y(7.8))} L${f(X(Wi))} ${f(Y(yTi))} Q${f(X(Wi))} ${f(Y(Dp-2))} ${f(X(bwi))} ${f(Y(Dp-2))} L${f(X(-bwi))} ${f(Y(Dp-2))} Q${f(X(-Wi))} ${f(Y(Dp-2))} ${f(X(-Wi))} ${f(Y(yTi))} Z`;\n  \/\/ single wall: an open channel (no tyre bed) with hooked edges; the hole is pressed into a dimple along the hole axis\n  const tw=2.6, outerS=`M${f(X(-W))} ${f(Y(0))} L${f(X(-W))} ${f(Y(yT))} Q${f(X(-W))} ${f(Y(Dp))} ${f(X(-bw))} ${f(Y(Dp))} L${f(X(bw))} ${f(Y(Dp))} Q${f(X(W))} ${f(Y(Dp))} ${f(X(W))} ${f(Y(yT))} L${f(X(W))} ${f(Y(0))} L${f(X(W-2*tw))} ${f(Y(0))} L${f(X(W-2*tw))} ${f(Y(1.4))} L${f(X(W-tw))} ${f(Y(1.4))} L${f(X(W-tw))} ${f(Y(yT))} Q${f(X(W-tw))} ${f(Y(Dp-tw))} ${f(X(bwi))} ${f(Y(Dp-tw))} L${f(X(-bwi))} ${f(Y(Dp-tw))} Q${f(X(-W+tw))} ${f(Y(Dp-tw))} ${f(X(-W+tw))} ${f(Y(yT))} L${f(X(-W+tw))} ${f(Y(1.4))} L${f(X(-W+2*tw))} ${f(Y(1.4))} L${f(X(-W+2*tw))} ${f(Y(0))} Z`;\n  const cut=(r0,r1,hw)=>`<polygon points=\"${[[r0,-hw],[r0,hw],[r1,hw],[r1,-hw]].map(([r,w])=>`${f(X(ax(r)+w\/Math.cos(hb)))},${f(Y(r))}`).join(' ')}\" fill=\"#EEF2F8\"\/>`;\n  const dimple=dimpled()?`<polygon points=\"${[[Dp-tw,-dimpleD()\/2-1.2],[Dp-tw,dimpleD()\/2+1.2],[Dp+1.8,opt.holeI\/2+1.4],[Dp+1.8,-opt.holeI\/2-1.4]].map(([r,w])=>`${f(X(ax(r)+w\/Math.cos(hb)))},${f(Y(r))}`).join(' ')}\" fill=\"url(#hmlx-gAlu)\" stroke=\"#5d6874\" stroke-width=\".9\"\/>`:'';\n  const nipT=hb+Math.atan(EX*Math.tan((sp.brace-holeBrace(i))*(1-bendQ(i))*Math.PI\/180));   \/\/ the nipple tilts in its hole by the play\n  const G=[X(ax(Dp-2)),Y(Dp-2)], hl=(nip.len-nip.head)*k, dirH=[-s*Math.sin(nipT),Math.cos(nipT)], E=[G[0]+dirH[0]*hl,G[1]+dirH[1]*hl];\n  const nippleS=`<g transform=\"translate(${f(G[0])} ${f(G[1])}) rotate(${f(s*nipT*180\/Math.PI)})\">\n      <rect x=\"${f(-1.7*k)}\" y=\"0\" width=\"${f(3.4*k)}\" height=\"${f(hl)}\" rx=\"1.5\" fill=\"url(#hmlx-gNipH)\" stroke=\"#5e6e7e\" stroke-width=\".7\"\/>\n      <rect x=\"${f(-2*k)}\" y=\"${f(-nip.head*k)}\" width=\"${f(4*k)}\" height=\"${f(nip.head*k)}\" rx=\"2.5\" fill=\"url(#hmlx-gNipH)\" stroke=\"#5e6e7e\" stroke-width=\".7\"\/>\n      <rect x=\"${f(-.4*k)}\" y=\"${f(-nip.head*k)}\" width=\"${f(.8*k)}\" height=\"${f(.9*k)}\" fill=\"#4a525b\"\/><\/g>`;\n  const spokeS=`<g transform=\"translate(${f(E[0])} ${f(E[1])}) rotate(${f(s*bd*180\/Math.PI)})\"><rect x=\"${f(-opt.gauge\/2*k)}\" y=\"-2\" width=\"${f(opt.gauge*k)}\" height=\"62\" fill=\"url(#hmlx-gDarkV)\" stroke=\"#2a3139\" stroke-width=\".6\"\/><\/g>`;\n  const C=[X(a0),Y(Dp-1)];\n  \/\/ where the hole axis meets the side wall when it misses the tyre bed\n  let failMark='';\n  if(failedHole(i)&&Math.abs(Math.tan(hb))>1e-6){ const xs=Math.sign(ax(6.9))*(W-1.6), rr=(Dp-1)-(xs-a0)\/(s*Math.tan(hb));\n    failMark=`<circle cx=\"${f(X(xs))}\" cy=\"${f(Y(Math.max(6.9,rr)))}\" r=\"9\" fill=\"none\" stroke=\"${RED}\" stroke-width=\"2.2\"\/>`; }\n  \/\/ the screwdriver bit, sideways: radial on the ECL \/ ISL and the CT, along the hole on the Inline Lacer; it must pass the access hole\n  const db=Math.atan(EX*Math.tan(drvBrace(i)*Math.PI\/180)), up=[s*Math.sin(db),-Math.cos(db)];\n  const Ht=[G[0]-dirH[0]*nip.head*k, G[1]-dirH[1]*nip.head*k], bl=(Ht[1]-Math.max(Y(-5),36))\/Math.cos(db);   \/\/ the shank runs out above the rim, below the title\n  const miss=missAt(i,0), hit=miss>clear(), hd2=(Ht[1]-Y(6.9))\/Math.cos(db), Hb=[Ht[0]+up[0]*hd2, Ht[1]+up[1]*hd2];\n  const bitS=`<g transform=\"translate(${f(Ht[0])} ${f(Ht[1])}) rotate(${f(s*db*180\/Math.PI)})\"><rect x=\"${f(-opt.holeI\/2*k)}\" y=\"${f(-bl)}\" width=\"${f(opt.holeI*k)}\" height=\"${f(bl)}\" fill=\"url(#hmlx-gSteelH)\" stroke=\"${hit?RED:'#5e6e7e'}\" stroke-width=\"${hit?1.4:.7}\" opacity=\".95\"\/><\/g>`\n    +(hit?`<circle cx=\"${f(single()?Ht[0]:Hb[0])}\" cy=\"${f(single()?Ht[1]:Hb[1])}\" r=\"${f(Math.max(7,(single()?3:opt.holeO\/2)*k+3))}\" fill=\"none\" stroke=\"${RED}\" stroke-width=\"2\"\/>`:'');\n  const wedge=(P0,a1,rad,col)=>{ const A=[P0[0],P0[1]+rad], B=[P0[0]-s*rad*Math.sin(a1),P0[1]+rad*Math.cos(a1)];\n    return `<path d=\"M${f(P0[0])} ${f(P0[1])} L${f(A[0])} ${f(A[1])} A${rad} ${rad} 0 0 ${s>0?1:0} ${f(B[0])} ${f(B[1])} Z\" fill=\"${col}\" fill-opacity=\".16\" stroke=\"${col}\" stroke-width=\"1\"\/>`; };\n  const side=sp.side==='L'?'NDS':'DS', bTxt=(ang?holeBrace(i):sp.brace*bendQ(i)).toFixed(1);   \/\/ straight: the sideways bend left after the nipple's play\n  const lab=(x,y,t,anchor='end',col='#56687f',w=400,size=9.5)=>`<text x=\"${f(x)}\" y=\"${f(y)}\" font-size=\"${size}\" font-weight=\"${w}\" fill=\"${col}\" text-anchor=\"${anchor}\" ${halo}>${t}<\/text>`;\n  const ys=[Y(1.5)]; ys.push(Math.max(Y(7.4),ys[0]+11)); ys.push(Math.max(Y(Dp-.6),ys[1]+(single()?24:11)));   \/\/ left labels at least 11 px apart\n  const lx=Math.max(X(-W)-8,150), ly=Math.max(Y(Dp+12),ys[2]+24);   \/\/ under the rim: room for the text on wide rims\n  const angLab=ang\n    ? wedge(C,hb,86,HOLE)+lab(lx,ly,`drilled ${bTxt}\u00b0`,'end',HOLE,700,10.5)+lab(lx,ly+13,drillQ(i)<0.999?`spoke ${sp.brace.toFixed(1)}\u00b0 \u00b7 limited`:`towards the ${side} flange`,'end',HOLE)\n      +lab(lx,ly+28,`${Math.max(0,landLeft(i)).toFixed(1)} mm to the leg, min ${MIN_LAND}`,'end',landLeft(i)<MIN_LAND?RED:GREEN,700,9)\n    : wedge(E,bd,46,AMBER)+lab(lx,ly,`spoke bends ${bTxt}\u00b0`,'end',AMBER,700,10.5)+lab(lx,ly+13,'leaving the nipple','end',AMBER)+lab(lx,ly+26,`${tensTxt(i)}: ${flexCat(feedIdx(i))==='ok'?'flexes in':flexCat(feedIdx(i))==='warn'?`harder (${feedIdx(i).toFixed(1)}\u00d7)`:`too stiff (${feedIdx(i).toFixed(0)}\u00d7)`}`,'end',flexCol(feedIdx(i)),700);\n  const section=`<text x=\"10\" y=\"16\" font-size=\"11\" font-weight=\"700\" fill=\"#1F5F7C\" letter-spacing=\".08em\">SECTION THROUGH THE HOLE<\/text>\n    <text x=\"10\" y=\"29\" font-size=\"9\" fill=\"#787979\">${side} spoke \u00b7 true angles<\/text>\n    <line x1=\"${f(C[0])}\" y1=\"${f(Y(-3))}\" x2=\"${f(C[0])}\" y2=\"258\" stroke=\"#9aa5b0\" stroke-width=\"1\" stroke-dasharray=\"4 4\"\/>\n    ${single()?`<path d=\"${outerS}\" fill=\"url(#hmlx-gAlu)\" stroke=\"#5d6874\" stroke-width=\".9\"\/>${dimple}${cut(Dp-tw-.3,Dp+2.1,opt.holeI\/2)}`\n      :`<path fill-rule=\"evenodd\" d=\"${outer} ${cavity}\" fill=\"url(#hmlx-gAlu)\" stroke=\"#5d6874\" stroke-width=\".9\"\/>${failedHole(i)?'':cut(5.6,8.2,opt.holeO\/2)}${cut(Dp-2.3,Dp+.3,opt.holeI\/2)}`}${failMark}\n    ${spokeS}${nippleS}${bitS}\n    <line x1=\"${f(X(ax(-3)))}\" y1=\"${f(Y(-3))}\" x2=\"${f(X(ax(Dp+22)))}\" y2=\"${f(Y(Dp+22))}\" stroke=\"${HOLE}\" stroke-width=\"1.3\" stroke-dasharray=\"7 3 2 3\"\/>\n    ${angLab}\n    ${lab(X(-W)-8,ys[0],'tyre side')}${single()?lab(X(-W)-8,ys[1],'open channel')+lab(X(-W)-8,ys[1]+13,hit?'bit too far off':'bit meets the nipple','end',hit?RED:GREEN,700):lab(X(-W)-8,ys[1],'tyre bed')}${lab(X(-W)-8,ys[2],single()?(dimpled()?'dimpled rim bed':'rim bed'):'spoke bed')}${lab(X(W)+8,Y(Dp+5),'nipple','start')}\n    ${failedHole(i)?lab(X(W)+8,Y(7.4),'failed rim hole','start',RED,700)+lab(X(W)+8,Y(7.4)+13,landLeft(i)<0?'hits the side wall':'too near the leg','start',RED):(single()?'':lab(X(W)+8,Y(7.4),'access hole','start')+lab(X(W)+8,Y(7.4)+13,hit?'no straight path':'bit passes','start',hit?RED:GREEN,700))}${lab(C[0]+(s>0?5:-5),250,'radial',s>0?'start':'end','#787979')}`;\n  \/\/ the spoke bed, unrolled: a window of holes round the one at screwdriver 1, sliding as the wheel indexes\n  const x0=330, x1=640, y0=82, y1=170, cy=(y0+y1)\/2, sx=52, KT=230;\n  const kc=holeNo.get(i), kp=hd&&hd.prev!=null?holeNo.get(hd.prev):kc; let dk=kc-kp; if(dk>N\/2) dk-=N; if(dk<-N\/2) dk+=N;\n  const centre=kp+dk*(1-Math.pow(1-st.idxP,2)), xc=(x0+x1)\/2, at=new Set(st.heads.filter(Boolean).map(h=>h.i));\n  let holes='', marks='';\n  for(let q=Math.floor(centre)-6;q<=Math.ceil(centre)+6;q++){ const j=holesByAngle[((q%N)+N)%N], sj=S[j], xp=xc+(q-centre)*sx, yh=cy+sj.rim.x*Math.min(2.6,80\/opt.width);\n    const vx=-Math.tan(holeTilt(j))*KT, vy=(sj.side==='L'?-1:1)*Math.tan(holeBrace(j)*Math.PI\/180)*KT, va=Math.atan2(vy,vx)*180\/Math.PI, vl=Math.hypot(vx,vy);\n    holes+=ang&&vl>9\n      ? `<ellipse cx=\"${f(xp)}\" cy=\"${f(yh)}\" rx=\"8\" ry=\"6\" transform=\"rotate(${f(va)} ${f(xp)} ${f(yh)})\" fill=\"#0b0e11\" stroke=\"#c9d0d7\" stroke-width=\"1.6\"\/>\n         <line x1=\"${f(xp)}\" y1=\"${f(yh)}\" x2=\"${f(xp+vx*(vl-6)\/vl)}\" y2=\"${f(yh+vy*(vl-6)\/vl)}\" stroke=\"#fff\" stroke-width=\"4.4\" stroke-linecap=\"round\"\/>\n         <line x1=\"${f(xp)}\" y1=\"${f(yh)}\" x2=\"${f(xp+vx*(vl-6)\/vl)}\" y2=\"${f(yh+vy*(vl-6)\/vl)}\" stroke=\"${GC[sj.group]}\" stroke-width=\"2.4\" stroke-linecap=\"round\"\/>\n         <polygon points=\"0,0 -8,-4.5 -8,4.5\" transform=\"translate(${f(xp+vx)} ${f(yh+vy)}) rotate(${f(va)})\" fill=\"${GC[sj.group]}\" stroke=\"#fff\" stroke-width=\"1\"\/>`\n      : `<circle cx=\"${f(xp)}\" cy=\"${f(yh)}\" r=\"6.5\" fill=\"#0b0e11\" stroke=\"#c9d0d7\" stroke-width=\"1.6\"\/><circle cx=\"${f(xp)}\" cy=\"${f(yh)}\" r=\"1.6\" fill=\"${GC[sj.group]}\"\/>`;\n    if(xp>x0+6&&xp<x1-6) marks+=`<circle cx=\"${f(xp)}\" cy=\"${y1+12}\" r=\"4\" fill=\"${GC[sj.group]}\"\/>`;\n    if(at.has(j)) marks+=`<text x=\"${f(xp)}\" y=\"${y0-8}\" font-size=\"9.5\" font-weight=\"700\" fill=\"#005389\" text-anchor=\"middle\">${plan.off.length>1?'screwdriver '+(st.heads.findIndex(h=>h&&h.i===j)+1):'screwdriver'}<\/text>`;\n    if(at.has(j)) holes+=`<circle cx=\"${f(xp)}\" cy=\"${f(yh)}\" r=\"15\" fill=\"none\" stroke=\"#B3E9FF\" stroke-width=\"2.4\"\/>`; }\n  const strip=`<text x=\"${x0}\" y=\"16\" font-size=\"11\" font-weight=\"700\" fill=\"#1F5F7C\" letter-spacing=\".08em\">SPOKE BED, SEEN FROM THE HUB<\/text>\n    <text x=\"${x0}\" y=\"29\" font-size=\"9\" fill=\"#787979\">${ang?'arrow: drill direction of each hole (exaggerated)':'every hole drilled radially'}<\/text>\n    <rect x=\"${x0}\" y=\"${y0}\" width=\"${x1-x0}\" height=\"${y1-y0}\" rx=\"8\" fill=\"url(#hmlx-gRimBar)\"\/>\n    <g clip-path=\"url(#hmlx-stripClip)\">${holes}<\/g>${marks}\n    <text x=\"${x0+2}\" y=\"${y0-8}\" font-size=\"9.5\" font-weight=\"800\" fill=\"${GC.NDS}\">\u2191 NDS flange<\/text><text x=\"${x0+2}\" y=\"${y1+30}\" font-size=\"9.5\" font-weight=\"800\" fill=\"${GC.DS}\">\u2193 DS flange<\/text>\n    <text x=\"${x0}\" y=\"${y1+48}\" font-size=\"9\" fill=\"#787979\">${ang?'leading \/ trailing, and towards its own flange':'the spokes bend into their nipples'}<\/text>`;\n  \/\/ camera view: radial, through the rim hole (tyre bed) onto the nipple hole (spoke bed)\n  const ccx=728, ccy=134, CR=46, [shx,shy]=camShift(i), rO=(single()?Math.max(dimpleD(),opt.holeI+3):opt.holeO)\/2,   \/* plain hole: show the bed round it *\/ rI=opt.holeI\/2, cst=camState(i);\n  const csc=CR*0.78\/Math.max(rO, Math.hypot(shx,shy)+rI), ccol=cst==='ok'?GREEN:cst==='warn'?AMBER:RED, nx=ccx+shx*csc, ny=ccy+shy*csc;\n  const camera=`<text x=\"660\" y=\"44\" font-size=\"11\" font-weight=\"700\" fill=\"#1F5F7C\" letter-spacing=\".08em\">CAMERA VIEW<\/text>\n    <text x=\"660\" y=\"57\" font-size=\"9\" fill=\"#787979\">${single()?`radial, straight onto the ${seatWord()}`:'radial, through the rim hole'}<\/text>\n    <defs><clipPath id=\"hmlx-camHole\"><circle cx=\"${ccx}\" cy=\"${ccy}\" r=\"${f(rO*csc)}\"\/><\/clipPath><\/defs>\n    <circle cx=\"${ccx}\" cy=\"${ccy}\" r=\"${CR}\" fill=\"#1b2026\"\/>\n    <circle cx=\"${ccx}\" cy=\"${ccy}\" r=\"${f(rO*csc)}\" fill=\"#c9d0d7\" stroke=\"#eef2f5\" stroke-width=\"1.2\"\/>\n    <circle cx=\"${f(nx)}\" cy=\"${f(ny)}\" r=\"${f(rI*csc)}\" fill=\"#11161b\" clip-path=\"url(#hmlx-camHole)\"\/>\n    <circle cx=\"${f(nx)}\" cy=\"${f(ny)}\" r=\"${f(rI*csc)}\" fill=\"none\" stroke=\"${ccol}\" stroke-width=\"1.6\" stroke-dasharray=\"${cst==='ok'?'none':'3 2'}\"\/>\n    <line x1=\"${ccx-8}\" y1=\"${ccy}\" x2=\"${ccx+8}\" y2=\"${ccy}\" stroke=\"#B3E9FF\" stroke-width=\"1\"\/><line x1=\"${ccx}\" y1=\"${ccy-8}\" x2=\"${ccx}\" y2=\"${ccy+8}\" stroke=\"#B3E9FF\" stroke-width=\"1\"\/>\n    <text x=\"${ccx}\" y=\"${ccy+CR+16}\" font-size=\"9.5\" font-weight=\"700\" fill=\"${ccol}\" text-anchor=\"middle\">${cst==='ok'?'nipple hole visible':cst==='warn'?'nipple hole partly hidden':'nipple hole not visible'}<\/text>\n    <text x=\"${ccx}\" y=\"${ccy+CR+29}\" font-size=\"8.5\" fill=\"#787979\" text-anchor=\"middle\">${cst==='ok'?(single()?`single wall \u00b7 nipple hole \u00d8${opt.holeI}`:`rim hole \u00d8${opt.holeO} \u00b7 nipple hole \u00d8${opt.holeI}`):'bigger nipple or rim hole,'}<\/text>\n    ${cst==='ok'?'':`<text x=\"${ccx}\" y=\"${ccy+CR+40}\" font-size=\"8.5\" fill=\"#787979\" text-anchor=\"middle\">or a second rim hole<\/text>`}`;\n  return section+strip+camera;\n}\nfunction updateSpecs(){\n  const ang=opt.drill==='angle', tilt=Math.max(...S.map((_,i)=>Math.abs(spokeTilt(i))))*180\/Math.PI;\n  const br=sd=>S.find(x=>x.side===sd).brace.toFixed(1);\n  const mx=maxMiss();\n  const items=[['Wheel',`${SIZES[opt.bsd][0]} (${opt.bsd} mm bead seat) \u00b7 ${N} holes \u00b7 ERD ${WH.erd} mm`],['Rim',`${opt.width} \u00d7 ${opt.depth} mm, ${single()?`single wall, ${dimpled()?'dimpled':'plain'} holes`:'double wall'}${Math.abs(WH.off)>0.05?(opt.holePat==='side'?` \u00b7 holes ${Math.abs(WH.off).toFixed(1)} mm off-centre to the ${WH.off>0?'DS':'NDS'}`:` \u00b7 zigzag holes \u00b1${Math.abs(WH.off).toFixed(1)} mm, towards ${WH.off>0?'their own':'the opposite'} flange`):''}`],\n    ['Hub',`${WH.hub.name} \u00b7 flanges \u00d8${opt.dL} \/ \u00d8${opt.dR} mm \u00b7 OLD ${opt.old} mm, flanges ${WH.fcL.toFixed(0)} \/ ${WH.fcR.toFixed(0)} mm from centre \u00b7 ${WH.hub.cross}-cross`],\n    ['Hole direction',ang?'along each spoke':'radial'],\n    ['In the wheel plane',ang?`\u00b1${tilt.toFixed(1)}\u00b0 (leading \/ trailing)`:'0\u00b0'],\n    ['Sideways (bracing)',ang?`${br('L')}\u00b0 to NDS \u00b7 ${br('R')}\u00b0 to DS`:'0\u00b0'],\n    [ang?'Hole angle':'Spoke bend at the nipple',ang?`up to ${maxOf(holeAngle).toFixed(1)}\u00b0 (spokes ${maxOf(spokeAngle).toFixed(1)}\u00b0, max ${drillLimit().toFixed(1)}\u00b0 ${single()?(dimpled()?'so every screwdriver drives the nipple':'for a plain hole, flat seat'):'for hole scanning'})`:`up to ${maxOf(bendAngle).toFixed(1)}\u00b0 (spokes ${maxOf(spokeAngle).toFixed(1)}\u00b0, ${playDeg().toFixed(1)}\u00b0 taken up by the nipple's play in its \u00d8${opt.holeI} mm hole)`],\n    ['Spokes',`\u00d8${opt.gauge.toFixed(1)} mm \u00b7 ${lenRange()} \u00b7 bending force into ${opt.drill==='angle'?'the nipple':'a radial hole'}: groups 1\u20132 ${feedRange()[0].toFixed(1)}\u00d7, groups 3\u20134 ${feedRange()[1].toFixed(1)}\u00d7 a road spoke`],\n    ['Holes',single()?`nipple hole \u00d8${opt.holeI} mm${dimpled()?` in a \u00d8${dimpleD()} mm dimple`:', plain (flat seat)'}, no tyre-bed hole \u00b7 a straight screwdriver still drives the nipple up to ${SW_FREE}\u00b0 off its axis${opt.drill==='angle'?(maxMiss()>clear()?' \u00b7 not possible for this machine':' \u00b7 engages'):''}${opt.drill==='angle'?` \u00b7 material next to the leg ${Math.max(0,minLand()).toFixed(1)} mm (min ${MIN_LAND})`:''}`:`outer \u00d8${opt.holeO} \/ inner \u00d8${opt.holeI} mm, ${reachMM().toFixed(0)} mm apart \u00b7 a straight path through both allows up to ${maxStraight().toFixed(1)}\u00b0${opt.drill==='angle'?(maxMiss()>clear()?' \u00b7 not possible for this machine':' \u00b7 passes'):''}${opt.drill==='angle'?` \u00b7 material next to the leg ${Math.max(0,minLand()).toFixed(1)} mm (min ${MIN_LAND})`:''}`],\n    ['Camera view',`${single()?'the camera sees the nipple hole directly (no tyre bed)':camWorst()==='ok'?'nipple hole visible through the rim hole':camWorst()==='warn'?'nipple hole partly hidden: bigger nipple or rim hole, or a second rim hole':'nipple hole not visible: bigger nipple or rim hole, or a second rim hole'}`]];\n  document.getElementById('hmlx-specs').innerHTML=items.map(([a,b])=>`<span class=\"spec\"><b>${a}<\/b>${b}<\/span>`).join('');\n}\n\n\/* ---- text under the animation ---- *\/\nconst maxOf=fn=>Math.max(...S.map((_,i)=>fn(i)));\nfunction updateText(){\n  const maxBend=maxOf(bendAngle), m=straightM(opt.mach)?'ecl':opt.mach, ang=opt.drill==='angle';\n  const off=Math.max(...plan.off.map((_,h)=>Math.max(...headSpokes(h).map(i=>offAngle(i,h)))));\n  const set=(id,txt,cls)=>{ const e=document.getElementById('hmlx-'+id); e.textContent=txt; if(cls!=null) e.className='v '+cls; };\n  if(off>0.05) set('c-drv',`Up to ${off.toFixed(1)}\u00b0 off the nipple axis`,'bad');\n  else set('c-drv','In line with every nipple','ok');\n  set('c-drv-t',{\n    'ecl\/straight':'Radial holes: the nipples sit radially, like the screwdriver.',\n    'ecl\/angle':'The screwdriver works radially, the nipples point along their spokes.',\n    'inline\/straight':'Radial holes: the angled screwdriver simply works straight.',\n    'inline\/angle':off>0.05?'The screwdriver tilts onto each hole, but this wheel needs more than its 15\u00b0 radial \/ 25\u00b0 axial range.':'The screwdriver tilts onto each hole before it engages.',\n    'ct\/straight':'Both screwdrivers are set radially for radial holes.',\n    'ct\/angle':'Set to the hole angle in the wheel plane, but they do not tilt sideways (bracing).',\n  }[m+'\/'+opt.drill]);\n  const [fa,fx]=feedRange(), fc=flexCat(fx), lenTxt=`\u00d8${opt.gauge.toFixed(1)} mm, ${lenRange()} long`;\n  const grp=`Groups 1\u20132 go into a loose wheel and flex into line (${fa.toFixed(1)}\u00d7 the force of a road spoke); groups 3\u20134 go into a wheel under tension and are harder to feed (${fx.toFixed(fx>=10?0:1)}\u00d7).`;\n  if(!ang) { set('c-bend',`Bends up to ${maxBend.toFixed(1)}\u00b0`,fc==='ok'?'ok':fc);\n    set('c-bend-t',`The nipple sits radially, so the spoke bends into it (${lenTxt}); the nipple's play in its \u00d8${opt.holeI} mm hole lets it tilt about ${playDeg().toFixed(1)}\u00b0 towards the spoke, which takes up part of the bend. ${grp} `+(fc==='ok'?'All feed easily.':fc==='warn'?'Groups 3\u20134 take more effort.':'Angle drilling is advised.')); }\n  else if(maxOf(bendAngle)>0.05){ const rb=maxOf(bendAngle); set('c-bend',`Bends up to ${rb.toFixed(1)}\u00b0`,fc==='ok'?'ok':fc);\n    set('c-bend-t',`The holes are drilled up to ${maxOf(holeAngle).toFixed(1)}\u00b0 towards the spoke, ${single()?(dimpled()?`limited to ${drillLimit().toFixed(1)}\u00b0 so a straight screwdriver still drives every nipple`:`limited to ${drillLimit().toFixed(1)}\u00b0, as the nipple seats on a flat bed in a plain hole`):'limited so the camera always sees the nipple hole'}; the spoke bends the remaining ${rb.toFixed(1)}\u00b0 into the nipple (${lenTxt}). ${grp} `+(fc==='ok'?'All feed easily.':fc==='warn'?'Groups 3\u20134 take more effort.':single()?'Thinner or longer spokes feed more easily.':'A bigger rim hole allows a larger drill angle.')); }\n  else { const rf=radialFeedMax(); set('c-bend','Straight into the nipple','ok'); set('c-bend-t',flexCat(rf)==='ok'?'Each hole is drilled along its spoke line: spoke and nipple are in line.':`Each hole is drilled along its spoke line, so these spokes (${lenTxt}) need not bend. In radial holes, groups 3\u20134 would need ${rf.toFixed(rf>=10?0:1)}\u00d7 the force of a road spoke.`); }\n  const noPath=ang&&maxMiss()>clear(), need=Math.atan(maxMiss()\/reachMM())*180\/Math.PI;\n  if(noPath){ set('c-drv','Not possible: no straight path','bad');\n    set('c-drv-t',single()?`In a single-wall rim the bit meets the nipple directly: a screwdriver that does not follow the nipple still drives it up to ${SW_FREE}\u00b0 off its axis; these spokes need ${need.toFixed(1)}\u00b0.`:`The outer hole (\u00d8${opt.holeO} mm) and the inner hole (\u00d8${opt.holeI} mm) are drilled along the spoke, ${reachMM().toFixed(0)} mm apart. A screwdriver that does not follow the hole fits through both only up to ${maxStraight().toFixed(1)}\u00b0; these spokes need ${need.toFixed(1)}\u00b0.`); }\n  updateSpecs(); document.getElementById('hmlx-advice').innerHTML=adviceHTML();\n  const fit=evaluate(opt.mach);\n  set('c-mac',SPEC[opt.mach].full,fit.verdict==='no'?'bad':fit.verdict==='opt'||fit.risk?'warn':'');\n  set('c-mac-t',{\n    ecl:`Straight engagement: one screwdriver works radially. One spoke per index step: ${plan.cycles.length} steps for ${N} spokes.`,\n    inline:`One angled screwdriver tilts onto every hole, in the wheel plane and sideways. One spoke per index step: ${plan.cycles.length} steps for ${N} spokes.`,\n    ct:`Two screwdrivers screw on a pre-crossed pair at a time, a leading spoke and the trailing spoke it crosses, in both lacing rounds: ${plan.cycles.length} index steps for ${N} spokes. Their angle in the wheel plane is set per wheel; for offset-drilled holes they move up and down by about 1 cm.`,\n  }[m]+(fit.verdict==='no'?` Not for this wheel: ${fit.why}.`:fit.verdict==='opt'?` For this wheel: ${fit.why}.`:'')+(fit.risk?` Risk: ${fit.risk}.`:''));\n  document.getElementById('hmlx-explain').textContent={\n    'ecl\/straight':`The holes are drilled radially, so every nipple sits radially and the straight screwdriver meets it in line. The spoke enters the nipple at an angle of up to ${maxBend.toFixed(1)}\u00b0.`,\n    'ecl\/angle':holePhrase()+` The straight screwdriver works radially and meets the nipples up to ${off.toFixed(1)}\u00b0 off their axis.`,\n    'inline\/straight':`With radially drilled holes the Inline Lacer's angled screwdriver simply works straight: it meets every nipple in line. The spoke still enters the nipple at an angle of up to ${maxBend.toFixed(1)}\u00b0.`,\n    'inline\/angle':holePhrase()+(off>0.05?` The Inline Lacer's screwdriver tilts onto every hole, but this wheel needs more than its 15\u00b0 radial \/ 25\u00b0 axial range, so it still meets the nipples up to ${off.toFixed(1)}\u00b0 off.`:` The Inline Lacer's screwdriver tilts onto every hole: screwdriver and nipple are in line.`),\n    'ct\/straight':`The holes are drilled radially and both CT screwdrivers are set radially, so each meets its nipple in line, two spokes at a time. The spokes enter the nipples at an angle of up to ${maxBend.toFixed(1)}\u00b0.`,\n    'ct\/angle':holePhrase()+` The CT screwdrivers are set to the hole angle in the wheel plane, but they do not tilt sideways, so they meet the nipples up to ${off.toFixed(1)}\u00b0 off their axis.`,\n  }[m+'\/'+opt.drill]+flexText()+deepText();\n  const fail=anyFailed(), maxB=Math.max(...S.map(x=>x.brace)), cw=camWorst();\n  if(fail){ set('c-drv','Not possible: failed rim hole','bad');\n    set('c-drv-t',`On this ${opt.depth} mm deep, ${opt.width} mm wide rim the hole axis, drilled along the spoke's axial angle (up to ${maxB.toFixed(1)}\u00b0), ${minLand()<0?(single()?'reaches the side wall':'reaches the side wall instead of the tyre bed'):`leaves only ${minLand().toFixed(1)} mm of material between the ${single()?seatWord():'outer hole'} and the rim's leg; at least ${MIN_LAND} mm is needed`}.`); }\n  if(noPath&&!fail&&single()) document.getElementById('hmlx-explain').textContent=`Each hole is ${dimpled()?'dimpled':'drilled'} along its spoke. In a single-wall rim there is no tyre bed, so the bit meets the nipple head directly and a screwdriver that does not follow the nipple still drives it up to ${SW_FREE}\u00b0 off its axis, far more than through a double-wall rim. These spokes need up to ${need.toFixed(1)}\u00b0, so this rim is not possible on the ${SPEC[opt.mach].full}: choose straight-drilled holes, or the Inline Lacer, whose screwdriver tilts onto every hole.`;\n  else if(noPath&&!fail) document.getElementById('hmlx-explain').textContent=`Each hole is drilled along its spoke, through the tyre bed (\u00d8${opt.holeO} mm) and the spoke bed (\u00d8${opt.holeI} mm), ${reachMM().toFixed(0)} mm apart. The ${m==='ct'?'CT screwdrivers do not tilt sideways, so they':`${SPEC[opt.mach].name}'s straight screwdriver`} need${m==='ct'?'':'s'} a straight path through both holes: that works only up to ${maxStraight().toFixed(1)}\u00b0, and these spokes need up to ${need.toFixed(1)}\u00b0. This rim is not possible on the ${SPEC[opt.mach].full}: choose straight-drilled rims, or the Inline Lacer, whose screwdriver tilts onto every hole.`;\n  if(fail&&single()) document.getElementById('hmlx-explain').textContent=`Each hole is ${dimpled()?'dimpled':'drilled'} along its spoke. On this ${opt.width} mm wide rim the ${minLand()<0?'hole runs into the side wall':`${seatWord()} comes within ${minLand().toFixed(1)} mm of the rim's leg, and at least ${MIN_LAND} mm of material must stay next to it`}: a failed rim hole. A narrower hub (smaller axial angle) or a nipple hole offset brings it back inside; otherwise choose straight-drilled holes.`;\n  else if(fail) document.getElementById('hmlx-explain').textContent=`Each hole is drilled along its spoke. On this ${opt.depth} mm deep, ${opt.width} mm wide rim the axial angle (up to ${maxB.toFixed(1)}\u00b0) ${minLand()<0?'carries the hole axis into the side wall before it reaches the tyre bed':`brings the outer hole within ${minLand().toFixed(1)} mm of the rim's leg, and at least ${MIN_LAND} mm of material must stay on the tyre bed`}, so the outer hole cannot be drilled there: a failed rim hole. The hole position is set by the components: a narrower hub (smaller axial angle) or a nipple hole offset brings the axis back inside; otherwise choose straight-drilled holes.`;\n  if(cw!=='ok'&&!fail) document.getElementById('hmlx-explain').textContent+=` Hole detection: the camera looks radially through the rim hole, and at this angle the nipple hole is ${cw==='warn'?'partly hidden':'not visible'} behind it. Solutions: a bigger nipple hole, a bigger rim hole or a second rim hole, and holes free of carbon dust or burrs.`;\n  renderCompare();\n}\n\n\/* ---- which machine fits this wheel: published ranges, screwdriver on the nipple, bit through the tyre bed ---- *\/\nfunction evaluate(m){\n  const keep={mach:opt.mach, plan}; opt.mach=m; buildPlan();\n  const off=Math.max(...plan.off.map((_,h)=>Math.max(...headSpokes(h).map(i=>offAngle(i,h))))), miss=maxMiss(), steps=plan.cycles.length;\n  opt.mach=keep.mach; plan=keep.plan;\n  const sp=SPEC[m], inch=SIZES[opt.bsd][1], res={off, miss, steps, checks:{}};\n  const chk=(k,st,txt)=>res.checks[k]={st,txt};\n  const inOpt=sp.optInch&&inch>=sp.optInch[0]&&inch<=sp.optInch[1];          \/\/ ECL: 12\u201314\" with an option\n  chk('size', inch>=sp.inch[0]&&inch<=sp.inch[1]?'ok':inOpt?'opt':'no', inOpt?`${sp.optInch[0]}\u2013${sp.optInch[1]}\" option`:`${sp.inch[0]}\u2013${sp.inch[1]}\"${sp.optInch?`, ${sp.optInch[0]}\u2013${sp.optInch[1]}\" option`:''}`);\n  chk('width', opt.width<=sp.w?'ok':(sp.optW&&opt.width<=sp.optW?'opt':'no'), opt.width<=sp.w?`up to ${sp.w} mm`:sp.optW&&opt.width<=sp.optW?`Fat option, up to ${sp.optW} mm`:`max ${sp.optW||sp.w} mm`);\n  const hOpt=sp.optH&&sp.optH.find(h=>opt.depth<=h);\n  chk('depth', opt.depth<=sp.h?'ok':(hOpt?'opt':'no'), opt.depth<=sp.h?`up to ${sp.h} mm`:hOpt?`High option, up to ${hOpt} mm`:`max ${sp.optH?sp.optH[sp.optH.length-1]:sp.h} mm`);\n  const why=[];\n  if(res.checks.size.st==='no') why.push(`wheel size ${SIZES[opt.bsd][0]} outside ${sp.inch[0]}\u2013${sp.inch[1]}\"`);\n  if(res.checks.size.st==='opt') why.push(`wheel size ${SIZES[opt.bsd][0]} needs the ${sp.optInch[0]}\u2013${sp.optInch[1]}\" option`);\n  if(res.checks.width.st!=='ok') why.push(res.checks.width.st==='opt'?`rim width ${opt.width} mm needs the Fat option`:`rim width ${opt.width} mm, max ${sp.optW||sp.w} mm`);\n  if(res.checks.depth.st!=='ok') why.push(res.checks.depth.st==='opt'?`rim depth ${opt.depth} mm needs the High ${hOpt} mm option`:`rim depth ${opt.depth} mm, max ${sp.optH?sp.optH[sp.optH.length-1]:sp.h} mm`);\n  if(opt.drill==='angle'){ const need=Math.atan(miss\/reachMM())*180\/Math.PI;\n    chk('path', miss<=clear()?'ok':'no', miss<=clear()?(single()?'meets the nipple directly':'straight path through both holes'):`needs ${need.toFixed(1)}\u00b0, max ${maxStraight().toFixed(1)}\u00b0`);\n    if(miss>clear()&&single()) why.push(`angle-drilled holes: in a single-wall rim a screwdriver that does not follow the nipple drives it up to ${SW_FREE}\u00b0, these spokes need ${need.toFixed(1)}\u00b0`);\n    else if(miss>clear()) why.push(`angle-drilled holes: a straight path through the \u00d8${opt.holeO} outer and \u00d8${opt.holeI} inner hole allows ${maxStraight().toFixed(1)}\u00b0, these spokes need ${need.toFixed(1)}\u00b0`); }\n  if(anyFailed()){ chk('rimhole','no','failed rim hole'); why.push(minLand()<0?`the angle-drilled hole axis reaches the side wall${single()?'':' instead of the tyre bed'} (failed rim hole)`:`the angle-drilled ${single()?seatWord():'outer hole'} leaves only ${minLand().toFixed(1)} mm of material next to the rim's leg, min ${MIN_LAND} mm (failed rim hole)`); }\n  const sts=Object.values(res.checks).map(c=>c.st);\n  res.verdict=sts.includes('no')?'no':sts.includes('opt')?'opt':'ok'; res.why=why.join(', ');\n  \/\/ CT: thick spokes (\u00d82.6 and \u00d83.2 mm) are often too thick for its spoke grippers: a risk, not a hard limit\n  res.risk=sp.gripMax&&opt.gauge>sp.gripMax?`\u00d8${opt.gauge.toFixed(1)} mm spokes are often too thick for the CT spoke grippers; check with Holland Mechanics`:'';\n  return res;\n}\nfunction renderCompare(){\n  const dot=(st,txt)=>`<span class=\"st ${st}\"><i><\/i>${txt}<\/span>`;\n  const rows=Object.keys(SPEC).map(m=>{ const e=evaluate(m), sp=SPEC[m], c=e.checks;\n    const fitTxt=e.verdict==='ok'&&e.risk?dot('opt','risk'):e.verdict==='ok'?dot('ok','fits'):e.verdict==='opt'?dot('opt','with option'):dot('no',(e.checks.path&&e.checks.path.st==='no')||e.checks.rimhole?'not possible':'not in range');\n    const engage=e.off>0.05?dot('no',`up to ${e.off.toFixed(1)}\u00b0 off`):dot('ok','in line');\n    const bit=opt.drill!=='angle'?dot('ok','radial, passes'):e.miss>clear()?dot('no','not possible'):dot('ok','passes');\n    return `<tr data-m=\"${m}\" class=\"${m===opt.mach?'sel':''}\"><td><b>${sp.full}<\/b><small>${sp.drv}<\/small><\/td><td>${fitTxt}${e.why?`<small>${e.why}<\/small>`:''}${e.risk?`<small class=\"risk\">Risk: ${e.risk}<\/small>`:''}<\/td>\n      <td>${dot(c.size.st,SIZES[opt.bsd][0])}<small>${c.size.txt}<\/small><\/td><td>${dot(c.width.st,opt.width+' mm')}<small>${c.width.txt}<\/small><\/td><td>${dot(c.depth.st,opt.depth+' mm')}<small>${c.depth.txt}<\/small><\/td>\n      <td>${engage}<small>${opt.drill==='angle'?'angle-drilled holes':'radial holes'}<\/small><\/td><td>${bit}<small>${single()?(opt.drill==='angle'&&e.miss>clear()?`needs ${(Math.atan(e.miss\/reachMM())*180\/Math.PI).toFixed(1)}\u00b0, max ${SW_FREE}\u00b0`:'single wall: no tyre-bed hole'):opt.drill==='angle'&&e.miss>clear()?`${e.miss.toFixed(1)} mm off the outer hole (max ${clear().toFixed(1)})`:`\u00d8${opt.holeO} \/ \u00d8${opt.holeI} mm, ${reachMM().toFixed(0)} mm apart`}<\/small><\/td>\n      <td>${e.steps}<small>index steps<\/small><\/td><td>${sp.cap}<small>wheels \/ hour<\/small><\/td><\/tr>`; }).join('');\n  const cw=camWorst(), cn=document.getElementById('hmlx-camnote');\n  cn.innerHTML=`<span class=\"st ${cw==='ok'?'ok':cw==='warn'?'opt':'no'}\"><i><\/i>Hole detection (camera, all machines): ${single()?'single wall: the camera sees the nipple hole directly':cw==='ok'?'the nipple hole is visible through the rim hole':cw==='warn'?'the nipple hole is partly hidden behind the rim hole':'the nipple hole is not visible through the rim hole'}<\/span>${cw==='ok'?'':' \u00b7 solutions: bigger nipple hole, bigger rim hole, second rim hole, holes free of carbon dust or burrs'}`;\n  const tb=document.getElementById('hmlx-cmp');\n  tb.innerHTML=`<thead><tr><th>Machine<\/th><th>For this wheel<\/th><th>Wheel size<\/th><th>Rim width<\/th><th>Rim depth<\/th><th>Screwdriver on the nipple<\/th><th>${single()?'Bit on the nipple':'Path through both holes'}<\/th><th>Cycle<\/th><th>Capacity<\/th><\/tr><\/thead><tbody>${rows}<\/tbody>`;\n}\ndocument.getElementById('hmlx-cmp').addEventListener('click',e=>{ const tr=e.target.closest('tr[data-m]'); if(!tr) return; const was=MACH[opt.mach].heads; opt.mach=tr.dataset.m;\n  if(MACH[opt.mach].heads!==was){ buildPlan(); t=0; } syncButtons(); updateText(); draw(); });\n\/\/ the advised drill pattern: every hole drilled towards its spoke as far as hole scanning allows, per spoke group, plus the\n\/\/ nipple hole offset that keeps enough material next to the rim's legs\nfunction adviceHTML(){\n  const keep=opt.drill; opt.drill='angle';\n  const gap=single()?0:reachMM(), lim=drillLimit(), rO=(single()?dimpleD():opt.holeO)\/2;\n  const rows=['Sa','Sb','Sd','Sc'].map(g=>{ const i=S.findIndex(x=>x.group===g); if(i<0) return '';\n    const t=spokeTilt(i)*180\/Math.PI, ht=holeTilt(i)*180\/Math.PI, hb=holeBrace(i);\n    return `<tr><td><b style=\"color:${GC[g]}\">${g}<\/b><small>${({Sa:'NDS leading',Sb:'NDS trailing',Sd:'DS leading',Sc:'DS trailing'})[g]}<\/small><\/td>\n      <td>${Math.abs(t).toFixed(1)}\u00b0 \u00b7 ${S[i].brace.toFixed(1)}\u00b0<small>wheel plane \u00b7 axial<\/small><\/td>\n      <td><b>${holeAngle(i).toFixed(1)}\u00b0<\/b><small>${Math.abs(ht).toFixed(1)}\u00b0 in the wheel plane \u00b7 ${hb.toFixed(1)}\u00b0 to the ${S[i].side==='L'?'NDS':'DS'} flange<\/small><\/td>\n      <td>${single()?'\u2013<small>no tyre-bed hole<\/small>':`${(gap*Math.tan(Math.abs(ht)*Math.PI\/180)).toFixed(1)} \u00b7 ${(gap*Math.tan(hb*Math.PI\/180)).toFixed(1)} mm<small>along the rim \u00b7 sideways<\/small>`}<\/td>\n      <td>${bendAngle(i).toFixed(1)}\u00b0<small>spoke bends into the nipple<\/small><\/td><\/tr>`; }).join('');\n  \/\/ the outer hole's sideways shift per side; one nipple hole offset (towards each spoke's flange) must keep both within reach\n  const eS=sd=>Math.max(0,...S.map((x,i)=>x.side===sd?gap*Math.tan(holeBrace(i)*Math.PI\/180):0)), eL=Math.max(eS('L'),eS('R')), eR=Math.min(eS('L'),eS('R'));\n  const room=opt.width\/2-1.6-MIN_LAND;                                        \/\/ from the rim centre to where the hole edge may go, mm\n  const A=room-rO, offMin=eL-A, feasible=offMin<=eR+A, oMax=Math.floor(2*(room-(eL-eR)\/2)*2)\/2;\n  const offAdv=offMin<=0?0:feasible?Math.min(Math.ceil(offMin*2)\/2, Math.floor((eR+A)*10)\/10):null, offMid=Math.round((eL+eR)\/2*10)\/10;   \/\/ with the smaller rim hole: centre the two sides\n  const full=Math.max(...S.map((_,i)=>spokeAngle(i))), oFull=Math.ceil((opt.holeI+2*gap*Math.tan(full*Math.PI\/180))*2)\/2;\n  opt.drill=keep;\n  return `<h4>Advised drill pattern for this wheel<\/h4>\n    <p>${single()?`${dimpled()?'Dimple':'Drill'} each hole towards its spoke, up to <b>${lim.toFixed(1)}\u00b0<\/b>: a single-wall rim has no tyre bed, so the camera sees the nipple hole directly, and a straight screwdriver still drives a nipple up to ${SW_FREE}\u00b0 off its axis.${dimpled()?'':` Without a dimple the nipple seats on a flat bed, so a plain hole stops at ${PLAIN_MAX}\u00b0.`}\n    ${lim+0.05<full?`The spokes lean up to ${full.toFixed(1)}\u00b0; the spoke bends the rest into the nipple.`:'That covers the full spoke angle.'}`:`Drill each hole towards its spoke, up to <b>${lim.toFixed(1)}\u00b0<\/b>: with a \u00d8${opt.holeO} mm rim hole and a \u00d8${opt.holeI} mm nipple hole ${gap.toFixed(0)} mm apart, the camera then always sees the nipple hole.\n    ${lim+0.05<full?`The spokes lean up to ${full.toFixed(1)}\u00b0; drilling the full angle needs a \u00d8${oFull} mm rim hole.`:'That covers the full spoke angle.'}`}\n    ${offAdv===0?` No nipple hole offset is needed: at least ${MIN_LAND} mm of material stays next to the rim's legs.`:offAdv!=null?` Use a nipple hole offset of <b>${offAdv.toFixed(1)} mm<\/b> towards each spoke's flange, so ${MIN_LAND} mm of material stays next to the rim's legs.`:single()?` This ${opt.width} mm wide rim is too narrow for these ${seatWord()}s: a nipple hole offset of <b>${offMid.toFixed(1)} mm<\/b> leaves the most material next to the rim's legs.`:` A \u00d8${opt.holeO} mm rim hole is too large for this ${opt.width} mm wide rim: at most <b>\u00d8${oMax.toFixed(1)} mm<\/b>, with a nipple hole offset of <b>${offMid.toFixed(1)} mm<\/b>, leaves ${MIN_LAND} mm of material next to the rim's legs.`}<\/p>\n    <div class=\"wrap\"><table class=\"adv\"><thead><tr><th>Group<\/th><th>Spoke angle<\/th><th>Drill angle<\/th><th>Rim hole shift<\/th><th>Remaining bend<\/th><\/tr><\/thead><tbody>${rows}<\/tbody><\/table><\/div>\n    <button class=\"play\" type=\"button\" data-advice=\"${offAdv==null?offMid:offAdv}\" data-holeo=\"${offAdv==null&&!single()?Math.max(opt.holeI+0.5,oMax):''}\">Use the advised drilling<\/button>`;\n}\nfunction holePhrase(){ return limited()?`Each hole is drilled up to ${maxOf(holeAngle).toFixed(1)}\u00b0 towards its spoke (the spokes lean up to ${maxOf(spokeAngle).toFixed(1)}\u00b0): ${single()?(dimpled()?'no more, so a straight screwdriver still drives every nipple.':'no more, as the nipple seats on a flat bed in a plain hole.'):`no more, so the camera always sees the nipple hole through the \u00d8${opt.holeO} mm rim hole.`}`:'Each hole is drilled along its spoke, so spoke and nipple are in line.'; }\nfunction flexText(){ const [fa,fx]=feedRange(), fc=flexCat(fx);\n  if(opt.drill==='straight'||maxOf(bendAngle)>0.05) return ` The first two groups go into a loose wheel, so their spokes flex into the holes (${fa.toFixed(1)}\u00d7 the force of a road spoke). Groups 3\u20134 go into a wheel that is already under pre-tension: they flex less and are harder to feed (${fx.toFixed(fx>=10?0:1)}\u00d7)`\n    +(fc==='ok'?', but still feed easily.':fc==='warn'?'.':', so angle drilling is advised.');\n  const rf=radialFeedMax(); return flexCat(rf)==='ok'?'':` With these spokes the angle drilling matters: in radial holes, groups 3\u20134 would need ${rf.toFixed(rf>=10?0:1)}\u00d7 the bending force of a road spoke.`; }\nfunction deepText(){ if(single()) return ''; const mx=maxMiss(), rm=reachMM().toFixed(0);\n  if(mx>clear()&&opt.drill==='angle') return ''; if(mx>clear()) return ` On this ${opt.depth} mm deep rim the bit reaches about ${rm} mm through the rim to the nipple; at this angle it runs up to ${mx.toFixed(1)} mm off the access hole in the tyre bed.`;\n  if(opt.depth>=45) return ` On this ${opt.depth} mm deep rim the bit reaches about ${rm} mm through the rim and passes straight through the access hole.`;\n  return ''; }\n\n\/* ---- clock, controls, embedding ---- *\/\nconst side=document.getElementById('hmlx-side'), dish=document.getElementById('hmlx-dish'), drillA=document.getElementById('hmlx-drillA'), drillB=document.getElementById('hmlx-drillB'), playBtn=document.getElementById('hmlx-play');\nlet t=0, playing=!matchMedia('(prefers-reduced-motion: reduce)').matches, visible=true, last=performance.now();\nfunction draw(){ const st=state(t); side.innerHTML=sideSVG(st); dish.innerHTML=`<g transform=\"translate(${f(fs.dx)} 0)\">${dishSVG(st)}<\/g>`; { const h=drillSVG(st); drillA.innerHTML=h; drillB.innerHTML=h; }\n  const st2=st.done?`<strong>All ${N} spokes<\/strong> screwed on`:`Spokes screwed on: <strong>${st.loaded} \/ ${N}<\/strong> \u00b7 index step <strong>${Math.max(1,st.steps)} \/ ${plan.cycles.length}<\/strong>`;\n  const fit=evaluate(opt.mach);\n  document.getElementById('hmlx-status').innerHTML=st2+(fit.verdict==='no'?` \u00b7 <span class=\"warn-line\">${SPEC[opt.mach].full}: not possible for this wheel (${fit.why})<\/span>`:'')+(fit.risk?` \u00b7 <span class=\"risk-line\">Risk: ${fit.risk}<\/span>`:''); }\nfunction frame(now){ const dt=Math.min(0.1,(now-last)\/1000); last=now;\n  if(playing&&visible){ t+=dt*opt.speed; if(t>=plan.total) t=0; draw(); }\n  if(root.isConnected) requestAnimationFrame(frame); }\nfunction syncButtons(){ root.querySelectorAll('.seg[data-key]').forEach(g=>{ const k=g.dataset.key; g.querySelectorAll('button').forEach(b=>b.setAttribute('aria-pressed', String(String(opt[k])===b.dataset.v))); });\n  playBtn.textContent=playing?'Pause':'Play';\n  { const ho=document.getElementById('hmlx-r-holeOff'); ho.value=WH.off; document.getElementById('hmlx-o-holeOff').textContent=(WH.off>0?'+':'')+WH.off.toFixed(1)+' mm'+(opt.holeOff==null?' (auto)':''); }\n  document.getElementById('hmlx-r-depth').min=DEPTH_MIN[opt.wall];   \/\/ before the value, or the browser clamps it\n  for(const key of ['depth','width','dL','dR','old','holeO','holeI']){ document.getElementById('hmlx-r-'+key).value=opt[key]; document.getElementById('hmlx-o-'+key).textContent=opt[key]+' mm'; }\n  { const c=document.getElementById('hmlx-c-holeO'); c.classList.toggle('off',single()); document.getElementById('hmlx-r-holeO').disabled=single(); if(single()) document.getElementById('hmlx-o-holeO').textContent='none'; }\n  root.querySelectorAll('.ctl.range input').forEach(el=>el.style.setProperty('--p',((el.value-el.min)\/((el.max-el.min)||1)*100).toFixed(1)+'%'));   \/\/ the filled part of each slider\n}\ndocument.getElementById('hmlx-r-holeOff').addEventListener('input',e=>{ opt.holeOff=+e.target.value; applyWheel(); syncButtons(); updateText(); draw(); });\nfor(const key of ['depth','width','dL','dR','old','holeO','holeI']) document.getElementById('hmlx-r-'+key).addEventListener('input',e=>{ opt[key]=+e.target.value; applyWheel(); syncButtons(); updateText(); draw(); });\nroot.querySelectorAll('.seg[data-key]').forEach(g=>g.addEventListener('click',e=>{ const b=e.target.closest('button'); if(!b) return; const k=g.dataset.key;\n  const was=MACH[opt.mach].heads; opt[k]=(k==='speed'||k==='bsd'||k==='gauge')?+b.dataset.v:b.dataset.v;\n  if(k==='wall') opt.depth=Math.max(opt.depth,DEPTH_MIN[opt.wall]);   \/\/ back to double wall: at least its minimum depth\n  if(k==='bsd'||k==='holePat'||k==='wall') applyWheel();\n  if(k==='mach'&&MACH[opt.mach].heads!==was){ buildPlan(); t=0; }\n  if(k==='hub'){ const H=HUBS[opt.hub]; opt.dL=opt.dR=H.d; opt.old=H.old; applyWheel(); }   \/\/ a hub type loads its typical flanges and width\n  syncButtons(); updateText(); draw(); }));\nplayBtn.addEventListener('click',()=>{ playing=!playing; syncButtons(); });\ndocument.getElementById('hmlx-advice').addEventListener('click',e=>{ const b=e.target.closest('button[data-advice]'); if(!b) return; opt.drill='angle'; opt.holePat='zigzag'; if(b.dataset.holeo) opt.holeO=+b.dataset.holeo; if(+b.dataset.advice>0||opt.holeOff!=null) opt.holeOff=+b.dataset.advice; applyWheel(); syncButtons(); updateText(); draw(); });\ndocument.getElementById('hmlx-restart').addEventListener('click',()=>{ t=0; draw(); });\nif('IntersectionObserver' in window) new IntersectionObserver(es=>{ visible=es[0].isIntersecting; }).observe(side);\n\/\/ options from the embed URL: ?bare (no heading), ?rim=angle, ?machine=ecl|isl|inline|ct, ?size=12|14|16|20|24|26|27.5|28|29|32, ?spoke=1.8|2|2.3|2.6|3.2, ?hub=std|igh|motor, ?depth=20\u201390 (single wall 10\u201390), ?width=20\u2013100, ?fnds=30\u2013200 ?fds=30\u2013200 (flange \u00d8), ?old=100\u2013200 (hub width), ?outer=4\u201314 ?inner=3\u20136 (hole \u00d8), ?wall=single|plain, ?offset=-15\u201315 (nipple hole offset) ?pattern=zigzag|side\n\/\/ options: data-* attributes on the widget, or the page URL for the stand-alone page (data-url-options)\nconst q=new URLSearchParams(root.hasAttribute('data-url-options')?location.search:'');\nfor(const [k,v] of Object.entries(root.dataset)) if(k!=='hmlxInit'&&k!=='urlOptions'&&!q.has(k)) q.set(k,v);\nif(q.has('bare')) root.classList.add('bare');\nif(q.get('rim')==='angle') opt.drill='angle';\n{ const w=(q.get('wall')||'').toLowerCase(); if(w==='single'||w==='dimpled') opt.wall='single'; if(w==='plain') opt.wall='plain'; }\n{ const hq=(q.get('hub')||'').toLowerCase(); if(hq==='igh'||hq==='enviolo'||hq==='internal') opt.hub='igh'; if(hq==='motor'||hq==='ebike') opt.hub='motor';\n  const num=(k,lo,hi)=>{ const v=+q.get(k); if(q.has(k)&&v>=lo&&v<=hi) opt[k]=Math.round(v); }; num('depth',DEPTH_MIN[opt.wall],90); num('width',20,100);\n  opt.dL=opt.dR=HUBS[opt.hub].d; opt.old=HUBS[opt.hub].old;\n  for(const [k,key,lo,hi] of [['fnds','dL',30,200],['fds','dR',30,200],['old','old',100,200]]){ const v=+q.get(k); if(q.has(k)&&v>=lo&&v<=hi) opt[key]=Math.round(v); }\n  { const v=+q.get('offset'); if(q.has('offset')&&v>=-15&&v<=15) opt.holeOff=Math.round(v*2)\/2; if(q.get('pattern')==='side') opt.holePat='side'; }\n  for(const [k,key,lo,hi] of [['outer','holeO',4,14],['inner','holeI',3,6]]){ const v=+q.get(k); if(q.has(k)&&v>=lo&&v<=hi) opt[key]=Math.round(v*10)\/10; } }\n{ const mq=(q.get('machine')||'').toLowerCase(); if(mq==='isl') opt.mach='isl'; if(mq==='inline'||mq==='il') opt.mach='inline'; if(mq==='ct'||mq==='twin') opt.mach='ct';\n  { const g=+q.get('spoke'); if([1.8,2,2.3,2.6,3.2].includes(g)) opt.gauge=g; }\n  const sz={'12':203,'14':254,'16':305,'20':406,'24':507,'26':559,'27.5':584,'28':622,'29':622,'32':686}[q.get('size')]; if(sz) opt.bsd=sz; }\n\/\/ tell a parent page our height, so its iframe can fit the content\nconst post=()=>{ if(window.parent===window) return; try{ parent.postMessage({type:'hm-lacing-height', height:document.documentElement.scrollHeight},'*'); }catch(e){} };\nif(root.hasAttribute('data-url-options')&&'ResizeObserver' in window) new ResizeObserver(post).observe(document.body);\n\/\/ a handle for testing, on the widget element only (nothing global)\nroot.hmlx={opt, applyWheel, buildPlan, updateText, syncButtons, draw, get plan(){ return plan; }, get S(){ return S; }, setT:v=>{ t=v; }, setPlaying:v=>{ playing=v; syncButtons(); }, evaluate};\napplyWheel(); buildPlan(); t=plan.cycles[0].dur*0.6; syncButtons(); updateText(); draw(); requestAnimationFrame(frame);\n\n})();\n<\/script>\n<script data-no-optimize=\"1\" data-no-defer=\"1\" data-no-minify=\"1\" data-cfasync=\"false\" data-pagespeed-no-defer nowprocket>\n(()=>{ const r=document.getElementById(\"hmlx-app\"); if(!r||r.hasAttribute(\"data-boxed\")||r.dataset.hmlxFull) return; r.dataset.hmlxFull=\"1\";\n  \/\/ exact fit: viewport width without the scrollbar, aligned to the screen edge wherever the column sits\n  const fit=()=>{ if(!r.isConnected) return; const w=document.documentElement.clientWidth, x=r.parentElement.getBoundingClientRect().left;\n    r.style.width=w+\"px\"; r.style.marginLeft=(-x)+\"px\"; };\n  fit(); addEventListener(\"resize\",fit); if(\"ResizeObserver\" in window) new ResizeObserver(fit).observe(r.parentElement); })();\n<\/script>\n<!--\/noptimize-->\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-fea1a66 elementor-widget elementor-widget-spacer\" data-id=\"fea1a66\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"spacer.default\">\n\t\t\t\t\t\t\t<div class=\"elementor-spacer\">\n\t\t\t<div class=\"elementor-spacer-inner\"><\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Wheel lacing Straight or angled screwdriver Rims are drilled either radially or along each spoke line. See how the screwdriver of the ECL, ISL, Inline Lacer and CT Twin Lacer meets the nipple in each case, and which machine fits your wheel. Rim drillingStraight-drilledAngle-drilled MachineECLISLInline LacerCT Twin Lacer Wheel size (inch)12141620242627.528 \/ 2932 Spoke \u00d8 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_header_footer","meta":{"content-type":"","inline_featured_image":false,"footnotes":""},"class_list":["post-50395","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Wheel Lacing Calculator - Holland Mechanics<\/title>\n<meta name=\"description\" content=\"The Holland Mechanics wheel lacing calculator measure every angle and spoke for optimal results, You will be able to see what is possible.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hollandmechanics.com\/en\/wheel-lacing-calculator\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Wheel Lacing Calculator - Holland Mechanics\" \/>\n<meta property=\"og:description\" content=\"The Holland Mechanics wheel lacing calculator measure every angle and spoke for optimal results, You will be able to see what is possible.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hollandmechanics.com\/en\/wheel-lacing-calculator\/\" \/>\n<meta property=\"og:site_name\" content=\"Holland Mechanics\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-13T10:01:13+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"40 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/hollandmechanics.com\\\/en\\\/wheel-lacing-calculator\\\/\",\"url\":\"https:\\\/\\\/hollandmechanics.com\\\/en\\\/wheel-lacing-calculator\\\/\",\"name\":\"Wheel Lacing Calculator - Holland Mechanics\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hollandmechanics.com\\\/#website\"},\"datePublished\":\"2026-10-09T14:15:29+00:00\",\"dateModified\":\"2026-10-13T10:01:13+00:00\",\"description\":\"The Holland Mechanics wheel lacing calculator measure every angle and spoke for optimal results, You will be able to see what is possible.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/hollandmechanics.com\\\/en\\\/wheel-lacing-calculator\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/hollandmechanics.com\\\/en\\\/wheel-lacing-calculator\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/hollandmechanics.com\\\/en\\\/wheel-lacing-calculator\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/hollandmechanics.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Wheel Lacing Calculator\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/hollandmechanics.com\\\/#website\",\"url\":\"https:\\\/\\\/hollandmechanics.com\\\/\",\"name\":\"Holland Mechanics\",\"description\":\"Go to homepage\",\"publisher\":{\"@id\":\"https:\\\/\\\/hollandmechanics.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/hollandmechanics.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/hollandmechanics.com\\\/#organization\",\"name\":\"Holland Mechanics\",\"url\":\"https:\\\/\\\/hollandmechanics.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/hollandmechanics.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/hollandmechanics.com\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/cropped-HMLogo-1-e1672838939593.png\",\"contentUrl\":\"https:\\\/\\\/hollandmechanics.com\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/cropped-HMLogo-1-e1672838939593.png\",\"width\":200,\"height\":70,\"caption\":\"Holland Mechanics\"},\"image\":{\"@id\":\"https:\\\/\\\/hollandmechanics.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/company\\\/holland-mechanics-b.v.\\\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Wheel Lacing Calculator - Holland Mechanics","description":"The Holland Mechanics wheel lacing calculator measure every angle and spoke for optimal results, You will be able to see what is possible.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hollandmechanics.com\/en\/wheel-lacing-calculator\/","og_locale":"en_US","og_type":"article","og_title":"Wheel Lacing Calculator - Holland Mechanics","og_description":"The Holland Mechanics wheel lacing calculator measure every angle and spoke for optimal results, You will be able to see what is possible.","og_url":"https:\/\/hollandmechanics.com\/en\/wheel-lacing-calculator\/","og_site_name":"Holland Mechanics","article_modified_time":"2026-10-13T10:01:13+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"40 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/hollandmechanics.com\/en\/wheel-lacing-calculator\/","url":"https:\/\/hollandmechanics.com\/en\/wheel-lacing-calculator\/","name":"Wheel Lacing Calculator - Holland Mechanics","isPartOf":{"@id":"https:\/\/hollandmechanics.com\/#website"},"datePublished":"2026-10-09T14:15:29+00:00","dateModified":"2026-10-13T10:01:13+00:00","description":"The Holland Mechanics wheel lacing calculator measure every angle and spoke for optimal results, You will be able to see what is possible.","breadcrumb":{"@id":"https:\/\/hollandmechanics.com\/en\/wheel-lacing-calculator\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hollandmechanics.com\/en\/wheel-lacing-calculator\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/hollandmechanics.com\/en\/wheel-lacing-calculator\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hollandmechanics.com\/"},{"@type":"ListItem","position":2,"name":"Wheel Lacing Calculator"}]},{"@type":"WebSite","@id":"https:\/\/hollandmechanics.com\/#website","url":"https:\/\/hollandmechanics.com\/","name":"Holland Mechanics","description":"Go to homepage","publisher":{"@id":"https:\/\/hollandmechanics.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hollandmechanics.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/hollandmechanics.com\/#organization","name":"Holland Mechanics","url":"https:\/\/hollandmechanics.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hollandmechanics.com\/#\/schema\/logo\/image\/","url":"https:\/\/hollandmechanics.com\/wp-content\/uploads\/2023\/01\/cropped-HMLogo-1-e1672838939593.png","contentUrl":"https:\/\/hollandmechanics.com\/wp-content\/uploads\/2023\/01\/cropped-HMLogo-1-e1672838939593.png","width":200,"height":70,"caption":"Holland Mechanics"},"image":{"@id":"https:\/\/hollandmechanics.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/company\/holland-mechanics-b.v.\/"]}]}},"_links":{"self":[{"href":"https:\/\/hollandmechanics.com\/en\/wp-json\/wp\/v2\/pages\/50395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hollandmechanics.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/hollandmechanics.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/hollandmechanics.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hollandmechanics.com\/en\/wp-json\/wp\/v2\/comments?post=50395"}],"version-history":[{"count":37,"href":"https:\/\/hollandmechanics.com\/en\/wp-json\/wp\/v2\/pages\/50395\/revisions"}],"predecessor-version":[{"id":50492,"href":"https:\/\/hollandmechanics.com\/en\/wp-json\/wp\/v2\/pages\/50395\/revisions\/50492"}],"wp:attachment":[{"href":"https:\/\/hollandmechanics.com\/en\/wp-json\/wp\/v2\/media?parent=50395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}