title: 一个钩子的诞生 aspect: 横屏 fps: 60 lang: zh-CN # 演示项目:把全部组件串成一条完整时间线 # 改任何一处都只影响对应场景,用 `hv 看帧 demo全组件` 快速验证 scenes: # ---------- 开场 ---------- - component: intro duration: 3.5 props: kicker: 建模演示 title: 一个钩子的诞生 subtitle: 草图 · 拉伸 · 切除 · 圆角 # ---------- 第一部分:写代码 ---------- - component: codedemo duration: 8 props: filename: hook.py language: python dimOthers: "true" highlight: "3,4" code: | def make_hook(thickness=0.4): """生成一个钩子的截面轮廓""" profile = bezier_profile() solid = extrude(profile, depth=0.6) throat = subtract(solid, sphere(r=0.92)) return fillet(throat, r=0.11) - component: terminal duration: 6 props: title: python prompt: ">>> " script: | [ { "text": "from cad import make_hook", "kind": "cmd" }, { "text": "hook = make_hook(thickness=0.4)", "kind": "cmd" }, { "text": "四个布尔操作全部成功", "kind": "ok" }, { "text": "耗时 0.42s", "kind": "dim" } ] - component: lowerthird duration: 3 props: text: 关键:轮廓必须一次性闭合 sub: 自交的草图会让拉伸直接失败 # ---------- 第二部分:三维建模 ---------- - component: cad3d duration: 16 props: spin: "true" accent: "#d97757" # ---------- 收尾 ---------- - component: textblock duration: 4 props: heading: 四个操作,[[一气呵成]] body: 草图定形状,拉伸给厚度,切除挖钩槽,圆角去毛刺。 - component: outro duration: 4 props: cta: 觉得有用就点个关注 handle: "@你的频道" foot: 每周三更新一期