Turing CAD can now draw a Gundam frame as an anime cel, standing on a cutting mat.
中文版在文末,点开即可阅读。
Chest Frame 34 drawn as an anime cel, standing on a cutting mat with a soft-edged cel shadow.
Zoomed out, the mat is a 3 mm slab with inked edges and its own shadow on an endless board.
The flat cel shadow at blur 0, .35 (default) and .6.
Painted Gunpla photos often look like anime frames. Could a CAD viewport draw a model that way while you're still modelling it?
Situation: three CAD looks and a chest frame that wanted to look painted
Turing CAD is a desktop CAD app for robot parts and Gunpla-style kits, with a small Metal viewport written for modelling. It had three looks: Modeling, Clean Model and Studio. I was modelling a Barbatos chest frame (22 parts) and wanted it to read like a painted kit: white panels, blue-grey shadows, black ink.
Two small bugs came up first. A design name with a / in it, Chest Frame 34 · closed thicker sidewalls / shorter inward ledges, turned the default Export USD folder into a path through folders that don't exist, and the export failed. Clean Model also drew metal pistons as chrome.

Before · Clean Model drew the metal pistons as chrome

The two hydraulic rods on their own · reflections on (left) · off, as Clean Model now draws them (right)
Task: a cel look in a live modelling viewport
The look had to live in the viewport itself, not in an offline renderer, and stay interactive on a 22-part assembly. Every choice had to be a setting, and the other styles had to stay as they were.
What made it hard:
- Cel shading needs hard steps and crisp lines, but the viewport's shadows were soft, filtered shadow maps.
- The outline of a round part is not a B-rep edge, so CAD edges alone can't ink it.
- A floor that reads as a desk has to hold up at any zoom without showing where it ends.
Action: cel bands, a cutting mat, and shadows that stop moving
What we built
Cel Shaded style. One hard step from the lit colour to a cooler shadow tone, a hard white highlight, and metal as two flat bands. Silhouettes are inked with an inverted hull culled by normal (3 px), and CAD edges at 2 px. A round rod shows why both are needed: its long outline isn't a B-rep edge at all.

The same rods in Cel Shaded · only the inverted hull inks the round silhouette

First pass · one shadow step works, but black ink vanishes into black plastic

Fixed · housing B11 on its own, charcoal in the light so the ink reads · and with material colours off
Cutting mat. Painted once with QPainter at true millimetre scale (rulers, protractor, hexagons, a title panel) and sized to the model, A5 and up. It's a 3 mm slab with inked edges lying on an endless board.

The mat's painted layer · its 10/50 mm grid lines are drawn by the shader instead

Zoomed out · a 3 mm slab with inked edges and its own shadow on the board
Cel shadows. The filtered shadow value is cut at one half over a single pixel, so a cast shadow becomes a flat shape with a clean edge. The model's own shadow is a separate hard step. On the mat, Shadow softness then blurs that edge back in: after feedback that its maximum wasn't soft enough, it now widens the blur itself, from about 12 to 60 shadow-map texels, sampled in a rotated disc so it grains rather than bands.

Before: a soft filtered blob · After: one cut at the midpoint, a pixel wide

Housing B11 under a low light · Shadow softness 0 · and 1, after the wider blur
Light, grid and settings. Light angle and height are sliders in every style. The ground grid is endless and drawn per pixel, stepping 1, 10 and 100 mm as you zoom. Settings are remembered per style, with a one-click Reset to Default.

One part, three lights · angle 305° · 215°, with the shadow side towards the camera · a low 20° light

Before · the fixed 120 mm grid ended in a hard line

Still before · a fade fixed in world size shrank the grid to a small disc when zoomed out

After · the grid fills the view at every zoom, on Cel and on the dark Modeling style

Display · light angle and height, cel shadow, and the mat's shadow
Inspector and Browser. Each Inspector tab shows only its own content. The Browser selects and highlights whatever part you pick or hover in the viewport, even through a face, edge or vertex.

Before · the Info tab opened with the Joints pane on top of it

Before · the part is selected in the viewport, the Browser doesn't show it

After · a face of A11 picked on Geometry selects A11's row
What we tested
- Every style, rendered for real. A headed check opens a window and renders each style through Metal. It grew to 40 steps covering per-style memory, the light sliders moving the shadow and redrawing its map, Reset to Default leaving other styles alone, and the Inspector tabs not stacking.
- The Browser, without a GPU. An offscreen selection test hovers and clicks parts and faces, then checks that the right row is highlighted or selected.
- The real model at each step. I rendered Chest Frame 34 after every change, at normal zoom, zoomed out 6× and close up, and compared variants side by side.
- Single parts for single features. To show one effect at a time, parts were isolated and rendered under exactly the setting in question: the hydraulic rods for metal and outlines, the black housing B11 for charcoal, softness and light direction.
- The Info tab, profiled. The first open took 4.1 s, almost all of it in OCCT's volume and surface integrals for 22 parts, while other tabs switched in 10–25 ms.
- The whole suite before merging. 1330 tests. It surfaced two problems of my own, both fixed before the merge (see below). The two failures left are unrelated: 32 new designs without previews yet, and a downloaded model the worktree didn't have.
What surprised us
Black parts swallowed the ink. A black outline on a black part disappears. The fix was to paint dark parts charcoal in the light, the way kit painters treat black plastic.
The mat's lines went soft up close. The texture only had about 6 pixels per millimetre, so fine lines smeared when magnified. They moved into the shader, which draws them per pixel at any zoom.
A redundant integral. The mass code integrated each part twice to move inertia to the centroid. While testing a one-pass version, the numbers were off by millions, because OCCT already reports inertia about the centroid. One integral was always enough, and the result is now cached next to the cached solids: 1.4 s the first time, then about 14 ms.
The "jagged" shadow ink was real. Inked shadow edges looked rough until the cause turned out to be the shadows of a ring's gear teeth, not stair-steps from the shadow map.
The reference technique lost. I tried a painted anime-background shadow: blue multiply, fade from the contact, a warm glow along the edge. The flat cel shadow with a little blur suited the model better, so that's the default and the rest are sliders.

Tried · the painted background technique (right) against the flat cel shadow (left)

Shipped · the flat shadow with a little blur · 0, .35 (default), .6
Shadows kept swinging. With the light turning with the camera, shadows moved on every orbit. Cel now keeps a fixed light. Old saved settings kept bringing the moving light back until startup learned to read each style's own memory.
My own test crashed the suite. A new test created a bare QGuiApplication; a later test found it, tried to build a widget on it, and Qt aborted the whole run. Separately, tutorial steps pointed at sliders that the new Inspector tabs now hid. Both were fixed before the merge.
Result: four styles, a mat to stand on, and a suite that runs to the end
On Chest Frame 34 the viewport now reads like a painted kit photo: material colours, blue-grey shadow sides, black ink, and a crisp, slightly blurred shadow on a cutting mat that scales with the model. Opening the Info tab went from 4.1 s to 1.4 s, then about 14 ms. The work is merged to main, and the same look has since been ported to the offline renderer in the Turing Render series.

Close-up · crisp printed grid · cel shadow on the mat and on the model
Limits remain:
- The cel look lives in the modelling viewport; Turing CAD can't export a cel render yet.
- The mat's printed templates still soften at extreme close-up.
- The merge also carried another session's uncommitted work, which needs its own review.
Next: model the next Barbatos unit in Cel Shaded, and see whether the mat's templates deserve the same per-pixel treatment as its grid.
Turing CAD 现在能把高达骨架画成动画赛璐珞,放在切割垫上。 涂装好的高达照片常常像一帧动画。CAD 视口能不能在建模的同时,就把模型画成这样? Turing CAD 是一个用来做机器人零件和高达风格模型的桌面 CAD,视口是一个为建模写的小型 Metal 渲染器,原有三种样式:Modeling、Clean Model 和 Studio。我在做 Barbatos 胸部骨架(22 个零件),希望它看起来像涂装好的模型:白色板件、蓝灰阴影、黑色墨线。 先冒出两个小问题。设计名里带 效果要直接做在视口里,而不是放进离线渲染器,在 22 个零件的装配体上也要保持实时。每种效果都要是设置项,其他样式原样不动。 难点有三个: 在 Chest Frame 34 上,视口现在像一张涂装好的模型照片:材质颜色、蓝灰暗部、黑色墨线,以及落在切割垫上、略带模糊的清晰阴影,垫子随模型大小变化。打开 Info 面板从 4.1 秒变成 1.4 秒,之后约 14 毫秒。这批改动已合并进 main,同样的风格后来也移植到了离线渲染器,见 Turing Render 系列。 还有这些限制: 下一步:用 Cel Shaded 做下一个 Barbatos 部件,再看看垫子上的印刷图案是否也值得像网格一样改成逐像素绘制。中文版 · Chinese version(点击展开)
背景:三种 CAD 样式,和一个想看起来像涂装件的胸部骨架
/(Chest Frame 34 · closed thicker sidewalls / shorter inward ledges)时,Export USD 的默认文件夹会变成一串不存在的目录,导出失败;Clean Model 还把金属活塞杆画成了镜面。
单独渲染的两根活塞杆 · 左:开启金属反射 · 右:关闭,也就是 Clean Model 现在的画法
目标与难点:在实时建模视口里做出赛璐珞质感
解决思路与行动:色阶、切割垫,以及不再乱动的阴影
做了什么

单独渲染的黑色外壳 B11 · 亮部画成炭灰,墨线清晰可见 · 以及关闭材质颜色的样子

缩小视角 · 3 mm 厚、描墨线边缘的垫子,在板面上投下自己的阴影

低角度光源下的外壳 B11 · Shadow softness 0 · 以及加大模糊后的 1

同一个零件,三种光源 · 角度 305° · 215°,暗面朝向镜头 · 20° 低角度光
测了什么
意外发现

最终采用 · 略带模糊的平涂阴影 · 0、.35(默认)、.6
QGuiApplication,后面的测试拿到它去创建窗口部件,Qt 直接中止了整轮运行。另一个问题是教程步骤指向的滑杆被新的检查器标签页藏了起来。两个都在合并前修好了。
结果与下一步:四种样式、一张可以站的垫子,以及能跑完的测试集



Top comments (0)