科研 Skill
点阵结构刚度逆向设计
lattice-inverse-design
Designs 3D-printable lattice unit cells for a target stiffness using TPMS cells, printability checks, and voxel homogenization. Use for lattice infill or metamaterial design.
SKILL.md
Lattice inverse design (GLU3D)
GLU3D (Jadhav et al., Adv. Funct. Mater. 34 (2024) 2404165) works like this:
- It builds a dataset of unit cells from implicit equations: 22 TPMS families, plus hybrids that blend 2–4 families (Eqs. 3–7).
- It homogenises each cell to its 6 × 6 stiffness matrix.
- It trains a 3D conditional DDPM that turns a target stiffness into a new cell's implicit field. A tanh scaling (Eq. 9) keeps the surface at level set 0, which raised mesh yield from 33–51% to 100%.
- Printed PLA cells followed the requested modulus.
scripts/glu3d.py covers the whole loop. Everything except the neural models runs on numpy and
scipy; scikit-image and trimesh are needed for meshes, pyamg is optional for speed, and PyTorch is
needed for the models. Paper numbers and the interpretation choices are in
references/paper-notes.md.
Stiffness is relative to the solid (E/Es) unless you pass --Es. The cell is one period of
side 1; choose its printed size at export.
Workflow
- Pin down the target.
- Ask for E (or E1, E2, E3), optionally G, and either a density budget or "as light as possible".
- Ask for the process and its minimum wall or strut thickness, and the cell size. Convert walls to the cell scale: 0.5 mm walls in a 10 mm cell is 0.05 of the cell.
- Express targets relative to the solid: printed PLA ≈ 3.5 GPa, Ti-6Al-4V LPBF ≈ 110 GPa.
- Try a known cell first (seconds):
python scripts/glu3d.py families python scripts/glu3d.py cell --families gyroid --h 0.25 --png g.png python scripts/glu3d.py cell --families gyroid,primitive --mode H2 --t 0.3 --h 0.2 python scripts/glu3d.py cell --families gyroid --h 0.25 --freq 2,2,1 # anisotropic: E3 ≈ 2.8 E1 python scripts/glu3d.py compare --cells '[["gyroid sheet", {"families":["gyroid"]}]]' --png cmp.pngcellreports the printability checks, the periodicity error, the full C^H, E1–E3, G, ν, the Zener anisotropy ratio and the weakest and strongest directional modulus.comparesweeps the thickness against simple-cubic and BCC strut lattices.
- Inverse design without a GPU:
search --target E=0.08,G=0.03 [--data ds.npz] [--density-weight 0.2].- It ranks dataset cells (or random ones) by mean |log error| against the target.
- It then refines the thickness
hand biasaof the best three by re-homogenising. - This is the dependable route for one-off designs.
- Generative route (paper):
python scripts/glu3d.py dataset --n 3000 --res 65 --hres 32 --out ds.npz # paper: 3723 cells, 64^3 python scripts/glu3d.py train-surrogate --data ds.npz --out sur.pt python scripts/glu3d.py train --data ds.npz --out glu3d.pt --size 64 --chans 1,4,8,16,32,64 --surrogate sur.pt --device cuda python scripts/glu3d.py generate --model glu3d.pt --target E=0.1,G=0.04 --vfrac 0.3 --n 8 --steps 100 python scripts/glu3d.py evaluate --gen generated.npz --data ds.npz # success, periodicity, Dice/Chamfer/Hausdorff, FEM error- The defaults match the paper: cosine schedule, T = 500, Huber loss, 20% unconditional
training, stiffness entries standardised to mean 50, φ̂min = 0.75, and an ancestral DDPM
sampler with 500 steps (
--steps 100 --eta 0for fast DDIM). - The networks train on the periodic grid with circular padding, so generated cells are
exactly periodic. Other small-data fixes are listed in
references/paper-notes.md. - Generation also conditions on volume fraction by default, because the paper names its absence
as the reason high-modulus targets failed. Use
--paper-condfor the paper's stiffness-only setting. --guidance > 1turns on classifier-free guidance.- Always re-homogenise the generated cells (
evaluatedoes this) and keep only those that hit the target. The surrogate is for guidance, not for acceptance.
- The defaults match the paper: cosine schedule, T = 500, Huber loss, 20% unconditional
training, stiffness entries standardised to mean 50, φ̂min = 0.75, and an ancestral DDPM
sampler with 500 steps (
- Export:
stl --npz generated.npz --index 2 --cell-mm 10 --tiles 4,4,4 --out part.stl, orcell --spec '<spec JSON from search>' --stl part.stl --cell-mm 10 --tiles 4,4,4.- The mesh is watertight and capped at the boundary, with volume ≈ vfrac × box (tested).
- Check printability in the slicer: minimum wall, and whether trapped powder or resin can drain.
The
dfm-revieworagentscad-fdm-dfamskills can help.
Judgement calls
- Elastic only. C^H is the small-strain stiffness. The paper's claims about energy absorption and peak load came from compression tests. For crash or impact use, test coupons or run nonlinear FEA.
- Hand over the directional modulus, not just E1. A simple-cubic lattice has a high axial E, but
it is very weak in shear and off-axis (see
compare). - Resolution. The node grid is what you print. The voxel grid used for homogenisation needs at
least 3–4 voxels through each wall.
cell_stiffnessfalls back to full resolution if coarsening loses material. 24³ is within about 1% of 32³ for a gyroid at vf 0.25. - Printability filters, used for the dataset and for search:
- the solid must be one periodic piece that reaches every face;
- every void region must open to the faces, so there are no sealed cavities;
- 0.05 < vf < 0.95;
- Dice > 0.75 against an accepted cell counts as a duplicate.
- Cost and data. A 32³ homogenisation takes about 5–10 s on a laptop CPU, and a 24³ one about
3 s. The paper's 64³ DDPM took 16 h on 4 GPUs with 3723 cells.
- A CPU rehearsal with 300 cells at 16³ produces periodic but unusable cells: stiffness error of about 200%.
- Use
searchfor real designs until you have paper-scale data and a GPU.
Cite: Jadhav, Berthel, Hu, Panat, Beuth, Barati Farimani, Generative Lattice Units with 3D Diffusion for Inverse Design: GLU3D, Adv. Funct. Mater. 34 (2024) 2404165.
示例提示词
帮我设计一个目标刚度的TPMS点阵单元,并检查是否可打印。
所属插件
安装该插件会一并获得同领域的 35 个 Skill / MCP。
同插件的其他科研 Skill
- FDM增材制造可制造性设计Checks an existing STEP part for FDM printability with the AgentsCAD method: overhang detection, reorientation, chamfers, and kernel plus visual verification. Use for DFAM review before 3D printing.
- 激光粉末床合金可打印性筛选Screens metal alloy compositions for laser powder bed fusion printability using CALPHAD or built-in thermophysical data and Rosenthal melt pools. Use when choosing or qualifying an AM alloy.
- 增材制造文献问答检索Answers additive-manufacturing questions from the user’s own PDF library with page-cited evidence via retrieval. Use for literature-grounded AM questions instead of relying on memory.
- CADSmith文本生成CADGenerates dimensionally exact CadQuery CAD from natural language using the CADSmith plan-code-validate-refine loop. Use when the user describes a part in words and wants a CAD model.
- OpenFOAM CFD仿真自动搭建Sets up, runs, diagnoses, and reports OpenFOAM CFD cases from a plain-language request using registered flow families and deterministic accept/reject validators. Use for guided OpenFOAM case setup.
- 机械设计评审文档汇编Assembles a mechanical design-review package: requirements traceability, design FMEA with RPN, costed multi-level BOM, risk register, and a PDR/CDR checklist. Use when preparing a design review.
- 面向制造的可制造性评审Reviews a part or assembly for CNC machining, sheet metal, injection molding, casting, or 3D printing manufacturability, flagging rule violations. Use when the user asks for a DFM/DFMA check.
- 工程图纸与GD&T审查Reviews mechanical drawings (PDF, image, or DXF) for dimensioning errors, GD&T misuse, datum problems, and ASME Y14.5/ISO GPS compliance. Use when checking a drawing before release.
- 工程计算报告生成Turns engineering calculations or scripts into a formal calculation report with objective, assumptions, equations, and unit-checked results. Use for a calc report ready for sign-off.
- LLM-SR方程发现Discovers interpretable equations from engineering data with the LLM-SR loop: skeleton proposals, constant fitting, and out-of-domain scoring. Use for symbolic regression on experimental data.
- 疲劳断裂寿命分析Estimates fatigue life and crack-growth life for metal parts from S-N data, load histories, and fracture-mechanics inputs. Use for Miner’s-rule damage, rainflow counting, or Paris-law crack growth.
- 图像直接生成FDM G代码Converts a photo, sketch, or slice image of a flat or near-flat part directly into FDM G-code without CAD, via silhouette and toolpath extraction. Use for sketch-to-print without modeling.
- 平面连杆机构综合Synthesizes planar four-bar or six-bar linkages whose end-effector traces a target curve, using graph-based topology and forward-kinematics search. Use for mechanism path-generation problems.
- LLM驱动FDM打印逐层监控Monitors an FDM print layer by layer through Klipper/Moonraker, diagnosing defects from camera images and applying safety-bounded G-code corrections. Use to watch or fix a live 3D print.
- LLM迭代桁架优化设计Designs and optimizes 2D trusses with an LLM-in-the-loop FEM workflow where proposed members are scored by an exact truss FEM. Use for iterative truss topology or sizing optimization.
- L-PBF缺陷区间预测Predicts L-PBF defect regime (keyholing, lack of fusion, balling, or none) from process parameters and checks melt-pool dimensions against standard criteria. Use when selecting LPBF parameters.
- L-PBF熔池图像超分辨率Upscales low-cost webcam images of an L-PBF build plate to high resolution via registration and a trained diffusion or CNN model. Use for in-situ L-PBF monitoring with cheap cameras.
- 机械零件强度校核Sizes and checks machine elements: bolted joints, shafts for fatigue, bearings for L10 life, springs, welds, and gears, with shown work and safety factors. Use to size or verify a machine element.
- Ashby材料选型Selects engineering materials with the Ashby method: translate function and constraints into a performance index, then screen and rank a shortlist. Use when choosing between candidate materials.
- 产品逆向拆解分析Reverse-engineers a physical product as an engineering system: function structure, costed BOM, DFA index, should-cost, FMEA, and a printable HTML report. Use when asked to tear down a product.
- 力学教学图绘制Produces mechanics teaching figures such as Mohr’s circle, shear/moment diagrams, S-N curves, and free-body diagrams as PNG/SVG. Use when asked to draw or plot a mechanics concept.
- 增材制造熔池几何预测Predicts metal AM melt-pool depth, width, length, and mode (keyhole, lack of fusion, balling, desirable) from laser power, speed, and beam size. Use for LPBF parameter prediction.
- 自然语言参数化CAD建模Turns a plain-English or dimensioned part description into a parametric CadQuery script and exports STEP, STL, and a mass/volume report. Use when asked to model or generate a CAD part.
- FreeCAD自然语言建模Generates FreeCAD models from natural-language queries using the Query2CAD self-refinement loop: macro generation, error repair, and image-text scoring. Use for text-to-CAD in FreeCAD.
常见问题
点阵结构刚度逆向设计能做什么?
Designs 3D-printable lattice unit cells for a target stiffness using TPMS cells, printability checks, and voxel homogenization. Use for lattice infill or metamaterial design。
如何安装点阵结构刚度逆向设计?
在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「点阵结构刚度逆向设计」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。
点阵结构刚度逆向设计需要哪些权限?
该科研 Skill没有声明额外权限;执行具体操作时仍由 Agent 按自身规则请求确认。
点阵结构刚度逆向设计经过官方审核吗?
是。SpeedSkills 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。