VWD AI Guide v3.9
制造工程Mfg. Engineering 自建应用Built an App 流程自动化Automation 单文件 · 离线Single-File · Offline

型材切割拆分器 · Profile SplitterProfile Splitter

切割优化软件(OptiCutting)导出的 XML 里,有些型材长度超过料棒上限(约 6045 mm),必须拆成两段,加工孔位和连接件(connector macro)都要按新长度重新计算——手动改 XML 极其枯燥,改错一个坐标就会切废料。Kawser(不是程序员)用 Claude 做了一个单文件工具:把 XML 拖进去,自动拆分、重算坐标、导出新文件。全程在浏览器本地完成,不上传任何内容。 In the XML exported by the cutting-optimization software (OptiCutting), some profiles exceed the max bar length (~6045 mm) and must be split in two, with machining holes and connector macros recalculated for the new lengths — editing the XML by hand is tedious, and one wrong coordinate scraps material. Kawser (not a programmer) used Claude to build a single-file tool: drop in the XML and it auto-splits, recomputes coordinates, and exports a new file — all locally in the browser, uploading nothing.

R/L
方向自动识别Direction auto-detect
1
HTML 文件HTML file
0
服务器 / 安装Servers / installs
100%
本地离线运行Runs offline, on-device

1. 背景:超长型材,手动拆分又枯燥又危险Background: Over-Length Profiles, Split by Hand — Tedious and Risky

料棒有长度上限,超过上限的型材必须拆成两段才能加工。难点不在"拆",而在拆完之后所有加工位置都要跟着重算。 Bars have a maximum length, so any profile over it must be split into two pieces before machining. The hard part isn't the split — it's that every machining position has to be recalculated afterward.

📐

拆完要重算每一个坐标Every coordinate must be recomputed after the split

处理孔位、连接件位置都要按两段新长度重新计算,还要考虑从哪一端测量(方向)。手动在 XML 里改,一处算错就切废料。Treatment holes and connector positions must be recomputed for the two new lengths, accounting for which end they're measured from (direction). Editing the XML by hand, one wrong value scraps material.

🔁

重复、枯燥、易疲劳出错Repetitive, dull, fatigue-prone

每份切割单里都可能有若干超长件,逐个手动处理既慢又容易看花眼。Every cutting list can contain several over-length pieces; handling each by hand is slow and easy to slip up on.

🚧

"这个太小,不值得专门开发""Too small to justify a real dev project"

这件事不够大到立项,却每天都在消耗时间。以前只能继续手动。Not big enough to become a project, yet it quietly ate time every day. The old option was to keep doing it by hand.

2. 怎么用 AI 的How AI Was Used

Kawser 没有写一行代码。他直接把一份真实的 OptiCutting XML 和拆分逻辑交给 Claude,让它生成一个可在浏览器里用的单文件工具,再用真实文件反复测试、修正。 Kawser didn't write a single line of code. He handed Claude a real OptiCutting XML plus the splitting logic, had it generate a single-file browser tool, then tested and refined it against real files.

1

给真实 XML + 拆分规则Provide a real XML + the splitting rules

把一份真实的切割 XML、料棒上限(约 6045 mm)、目标型材列表、连接件位置怎么算、R/L 方向怎么判断,全部讲清楚给 Claude。He gave Claude a real cutting XML, the max bar length (~6045 mm), the target-profile list, how connector positions are computed, and how R/L direction is determined.

2

让 Claude 生成单文件工具Have Claude generate a single-file tool

Claude 把文件上传/下载、拆分算法、坐标重算、逐件分析表和处理日志全部写进一个 HTML 文件——无需服务器或联网。Claude wrote the file upload/download, the splitting algorithm, coordinate recalculation, a per-piece analysis table, and a processing log — all into one HTML file, with no server or internet.

帮我做一个单文件 HTML 工具(纯前端,不联网、无外部依赖),处理 OptiCutting 导出的 XML。 功能:找出长度超过[料棒上限]的型材,拆成两段; 按[目标型材列表]过滤;重算处理孔位和连接件坐标; 支持 R/L 方向识别;导出新的 XML(原名 + "split")。 输入:[粘贴一份真实 XML] 界面:逐件分析表(拆分/正常/跳过)+ 处理日志。 要求:全部逻辑写进同一个 .html 文件,处理只在本机进行,不上传任何内容。Build me a single-file HTML tool (pure front-end — no internet, no external dependencies) that processes the XML exported by OptiCutting. What it does: find profiles longer than [max bar length] and split them in two; filter by [target-profile list]; recompute treatment holes and connector coordinates; support R/L direction detection; export a new XML (original name + "split"). Input: [paste a real XML] UI: a per-piece analysis table (split/OK/skipped) + a processing log. Requirements: put all logic in one .html file; process locally and upload nothing.
3

用真实文件测试,逐轮修正Test with real files, refine each round

Kawser 用真实切割 XML 验证输出:哪里拆分方向反了、哪个连接件坐标算错、哪种型材要特殊处理,就反馈给 Claude 调整。这样迭代到 v7,还加了可配置的拆分方向和规则。Kawser validated against real cutting XML: where a split went the wrong way, where a connector coordinate was off, which profiles needed special handling — he fed each back to Claude. That reached v7, and added configurable split direction and rules.

4

直接分发:发个文件就能用Distribute by just sending a file

单个 HTML 文件,同事收到双击即用,不用装环境、不用联网。数据全程留在本机,符合安全要求。A single HTML file — a colleague double-clicks and it just works, with no environment to install and no internet. Data stays on-device, which keeps it inside security rules.

3. 工具长什么样What the Tool Looks Like

把 OptiCutting 导出的 XML 拖进来,工具自动找出超过料棒上限的型材,按目标型材列表拆成两段,根据方向(R/L)和连接件规则重新计算每个加工位置,最后导出一份可直接使用的新 XML。 Drop in the XML exported by OptiCutting; the tool finds profiles over the max bar length, splits them per the target-profile list, recomputes every machining position by direction (R/L) and connector rules, then exports a ready-to-use new XML.

  • 按目标型材过滤,只拆需要拆的件Filters by target profile — splits only what needs splitting
  • 自动重算处理孔位 & 连接件(connector macro)坐标Auto-recomputes treatment holes & connector-macro coordinates
  • R/L 方向识别 + 可配置的拆分方向/规则R/L direction detection + configurable split direction/rules
  • 逐件分析表:拆分件 / 正常 / 跳过,一目了然Per-piece analysis table: split / OK / skipped at a glance
  • 处理日志,方便核对每一步Processing log to verify every step
  • 一键导出新 XML(原名 + "split")One-click export of the new XML (original name + "split")
⚙
Profile Splitter
OptiCutting XML Tool · v7
● COMPLETE
42Bars
118Pieces
9Splits
109OK
0Skip
→ Piece 1AUC-MTST16045.1 mm
← Piece 2AUC-MTST11236.4 mm
✓ OKALMD-NB3480.0 mm
> Extracted 42 bar blocks
> SPLIT [AUC-MTST1] 7281.5mm dir=L → 6045.1mm first
> ✓ DONE — 9 splits | 109 OK | 42 bars | 118 pieces
📥 想用这个工具?它是一个单独的 HTML 文件,双击即可在浏览器里打开,无需安装、无需联网。因为内嵌了公司专有的型材与连接件参数,工具文件不随本站分发——向 Kawser 或 IT 索取最新版本即可。想自己做类似的工具?看 《自己动手做工具》 指南。 📥 Want to use this tool? It's a single HTML file — double-click to open it in a browser, no install and no internet. Because it embeds proprietary profile and connector parameters, the file is not distributed through this site; request the latest version from Kawser or IT. Want to build one yourself? See the Build Your Own Tool guide.

4. 前后对比Before vs. After

使用 AI 之前Before AI

  • 超长型材手动改 XMLOver-length profiles edited by hand in the XML
  • 坐标靠人算,易出错、易切废Coordinates computed by hand — error-prone, scrap risk
  • 重复枯燥,容易看花眼Repetitive and dull — easy to slip up
  • 小工具排不上 IT 开发Small tools never made the IT roadmap

使用 AI 之后After AI

  • 拖进 XML,自动拆分Drop in the XML — splitting is automatic
  • 坐标由工具重算,方向自动识别The tool recomputes coordinates; direction auto-detected
  • 逐件分析表 + 日志,便于复核Per-piece table + log make it easy to verify
  • 自己就能把小需求做成工具Small needs become tools without waiting on anyone

5. 最值得学的一点The Takeaway Worth Copying

真正的价值不是这一个工具,而是这套人人可复用的模式:把一件重复、易错的工作讲清楚,给出真实数据样例(而不只是描述),就能让 Claude 帮你做出一个自己的单文件工具,再用真实文件逐轮修正。 The real value isn't this one tool — it's the repeatable pattern anyone can copy: describe a repetitive, error-prone task clearly, give a real data sample (not just a description), and Claude builds you a single-file tool — then refine it against real files.

🏛️

同一位同事的另一个工具:加州门窗规范速查器 →Another tool by the same colleague: CA Code Pro →

用同样的"单文件 + 纯本地"思路,把散落的加州门窗规范整理成一键可搜。Same single-file, local-only approach — folds scattered California window/door codes into one searchable reference.

6. 分享人Contributor

K

Kawser Hossain

制造工程师 / 项目经理 · kawserh@valuewds.com

Manufacturing Engineer / Project Manager · kawserh@valuewds.com

我不会编程。以前遇到"做个小工具就能解决"的问题,只能一直手动,或者去求别人帮忙。用 Claude 之后,我发现只要把要做的事讲清楚、给它一份真实的 XML,它就能帮我把整个工具做出来——单个文件,双击就能用,同事拿去也能直接用。最难的那部分(写代码)它替我做了,我负责我最懂的那部分:这件事到底该怎么做对。 I don't code. Before, when I hit one of those "a small tool would fix this" problems, my only options were to keep doing it by hand or go ask someone. With Claude, I found that if I just describe what needs to happen and give it a real XML, it builds the whole tool for me — a single file that opens with a double-click, that colleagues can use directly too. It handles the hard part (writing the code); I handle the part I know best: what it actually takes to get this right. — Kawser Hossain, 制造工程师 / 项目经理Manufacturing Engineer / Project Manager

VWD AI Guide v3.9 | VWD | 2026 | Created by IT depart. | 有问题发邮件到Questions? Email it@valuewds.com