Smooth Surfaces with NVIDIA SMLib: Zebra Stripes, Curvature Combs, and Cross Sections in Flux

Smooth Surfaces with NVIDIA SMLib: Zebra Stripes, Curvature Combs, and Cross Sections in Flux

A hand-held product is judged by its surfaces. Customers feel a crease in the hand and see it as a broken reflection under a store light. A tooling engineer sees it as a polishing problem. To make these surfaces, Flux uses NVIDIA SMLib, a geometry kernel for smooth, curvature-continuous surfaces. To check them, the 3D View now has four analysis tools: zebra stripes, a curvature map, curvature combs, and a cross section.

Curvature-continuous surfaces with NVIDIA SMLib

Flux is kernel agnostic. It builds parts on OpenCascade, through build123d and CadQuery, and on NVIDIA SMLib, through smlibpy. The agent picks the kernel for each part. For hand-held and consumer products, it can build the shell with SMLib.

G2 and G3 geometry is not new. OpenCascade and build123d can make higher-order curves and surfaces. But the standard fillet() operation in build123d makes a constant-radius round, which is G1. For a G2 or G3 blend, you must construct the transition surfaces yourself. SMLib has G2 and G3 blending as a native operation on solids. This includes blends where a face is curved, for example where a round boss meets a flat top. In smlibpy, the blend is one call: fillet(edges, r, continuity="G2") or continuity="G3".

This difference is important for an AI agent that designs consumer products. One blending operation is easier to specify, automate, and check than transition geometry that the agent constructs by hand.

Four levels of continuity are important for a shell:

  • G0 (position): the surfaces touch, but they meet at a sharp edge.
  • G1 (tangent): the surfaces meet at the same angle. A circular fillet, for example from build123d fillet(), is G1. The curvature changes suddenly at the joint, so a reflection bends there.
  • G2 (curvature): the surfaces also meet with the same curvature. Reflections flow across the joint without a bend.
  • G3 (curvature rate): the curvature also changes at the same rate on the two sides. The curvature comb meets the flat faces without a kink.
The same R9 mm corner of a block in four versions, with curvature combs: a sharp G0 corner, a G1 build123d fillet with a curvature jump of 0 to 0.111 per mm at each joint, and G2 and G3 smlibpy blends with no curvature jump. Plots below show the curvature along each edge.
The same corner, built four ways. The combs show the exact curvature of the top edge, sampled from the STEP files with the code that Flux uses for curvature combs. This is an offline render, not a Flux screenshot.

The difference between G1 and G2 is hard to see in shaded 3D. The analysis tools in Flux make it visible to users and the AI agent. Open the View panel in the 3D View and find the Analysis section.

Zebra stripes

Surface Continuity with Zebra Stripes puts black and white bands on the model, like the reflection of a row of lights. Where two surfaces meet, the stripes tell you the continuity:

  • The stripes break at the joint: G0.
  • The stripes meet, but they bend at the joint: G1.
  • The stripes continue smoothly across the joint: G2.
Zebra Stripes on a hand-held shell that the agent built with NVIDIA SMLib: wide black and white bands run across the top face and continue into the rounded end, where they curve and get narrow

Curvature map

The Curvature mode of Surface Continuity colors each area of the model by how much it curves. Flat areas have one color. Tight radii have a different color. On a G2 blend, the color changes gradually. On a G1 fillet, the color changes suddenly at the fillet edge.

Curvature map of the same shell: the flat top and side faces are green, and the rounded end and the blend along the bottom edge are orange

Curvature combs

Curvature Combs draw a line at points along each edge of the model. The length of each line shows the curvature at that point. A smooth curve has a comb with a smooth outline. A step in the outline shows a sudden change in curvature.

  • Comb Length and Line Density set the scale and the number of lines.
  • Inflections marks the points where a curve changes direction.
  • Curvature Jumps marks the points where the curvature changes suddenly.
  • The curve list shows the edges of the selected model in groups. You can show only some of them, for example only the outside curves.
Curvature Combs on the selected shell with one curve turned on: a cyan comb on the R12.0 mm arc at the front-right corner nearest the camera, pink markers show curvature jumps, and the curve list shows 28 outside curves, with 4 R12.0 mm arcs and 24 spline curves

Cross section through the enclosure

Cross Section cuts the 3D View on a plane. Select the Axis, move the Depth slider, and use Flip to keep the other half. You see half of the enclosure, with the board and its parts inside. Use it to check the wall thickness, the gap between the board and the shell, and the fit of bosses and openings. Turn on Cut Layout to cut the board and its components too.

Cross Section on the Y axis at a depth of 7.5 mm: the enclosure is cut open, and the board with three display modules, a knob, and a USB-C connector shows inside

The agent sees the curvature too

The analysis is not only for people. When the agent builds or changes a model from code, the result includes curvature findings: curvature jumps, inflections, and very tight radii, each with its location in millimeters. The agent can also read the full curvature data. This is the same data that draws the curvature combs: the position, radius, and curvature at each sample on every curved edge.

So the agent can check its own work. For example, it can find a G1 round on a grip edge, change it to a G2 blend, and then confirm that the curvature jump is gone.

What the tools show, and what they do not

The analysis tools are visual checks of the model geometry. The zebra stripes and the curvature map use the displayed mesh of the model. The curvature combs use the exact edges of the CAD model. The tools do not replace a tooling review, a draft analysis, or a mold-flow simulation. Use them to find surface problems early, before you send a part to a supplier. The curvature data for the agent covers the edges of the model. It does not include the zebra stripes or the curvature map.

Prompts to try

  • "This is a hand-held product. Rebuild the top shell with curvature-continuous blends into the side walls, and keep the board fit."
  • "Give the top face a soft crown, and keep the wall thickness at 1.8 mm."
  • "Change the fillets on the grip edges to G2 blends."
  • "Check the curvature of the grip edges, and fix every curvature jump."

Open a project in Flux, ask the agent for a smooth enclosure, and check it in the 3D View with the analysis tools.

About the author

Matthias Wagner

Founder & CEO at Flux

Matthias is the Founder and CEO of Flux, a hardware design platform that's revolutionizing how teams create and iterate on circuits. Find him on Flux @natarius.

Let’s start building.

Let’s build your idea together. All you need to do is describe what you want to make, or what problem you want to solve. Flux will work with you to make it a reality.

Try it Free
Close-up of a Flux-designed printed circuit board