Parametric Surface
Introduction
Parametric surfaces map a pair of parameters $(u, v)$ into 3D coordinates $(x, y, z)$ using mathematical expressions. They produce smooth, mesh-like geometry ideal for visualizing formulas, exploring shapes, and creating polished motion graphics.
Purpose of this guide: Help users understand the UI options, common usage patterns, and performance pitfalls.
Interface Overview
Controls are organized into four main panels in the Inspector (right sidebar):
- Geometry: Define the mathematical shape (
x,y,zequations) and spatial transform. - Parameters: Define custom constants (e.g.,
a,b) to control the shape dynamically. - Settings: Configure the simulation domain, resolution, motion speed, and rendering mode.
- Appearance: Control visual style (dots, lines, colors, trails).
Configuration Details
1. Geometry (Shape Definition)
- Equations:
x(u,v),y(u,v),z(u,v): Mathematical formulas defining the surface.- Supports standard math functions (
sin,cos,exp, etc.) and constants (PI,TWO_PI). - Example:
x = (R + r * cos(v)) * cos(u)(Torus).
- Transform:
scale_x/y/z: Multipliers for the final coordinates.offset_x/y/z: Translation of the entire surface.
2. Parameters
- Define custom variables here (e.g., name:
a, value:2.5). - Use these variables inside your Geometry equations. Changing the value here updates the shape in real-time.
3. Settings (Domain & Simulation)
- Render Mode:
- CPU: High precision, supports Trails and Line Weight. Best for high-quality video export.
- GPU: High performance, supports millions of particles. Trails are disabled. Best for real-time preview and massive point clouds.
- Simulation:
speed_u,speed_v: How fast the parameters $u$ and $v$ evolve over time (creates flow/movement).
- Domain:
u_min,u_max,v_min,v_max: The range of the parameters.u_segments,v_segments: Grid resolution (number of points). Higher values = smoother surface but higher cost.periodic_u,periodic_v: Connects the edges of the domain (e.g., for closed loops/tubes).flowing_u,flowing_v: Flow Mode. Checked = Continuous seamless flow (ideal for perfect loops). Unchecked = Ping-pong mode (particles bounce back at edges).
4. Appearance
- Style:
dot_size: Diameter of the particles/vertices.line_weight: Thickness of the wireframe lines (CPU only).
- Trails (CPU Mode Only):
show_trails: Enable motion trails.fade_trails: Trails fade out over time.trail_lifetime: Duration of trails in seconds. Warning: Values > 15s can consume excessive memory.
- Palette:
- Manage colors for the gradient.
- Use the Randomize button to generate harmonious palettes (Monochromatic, Analogous, Complementary, etc.).
Performance & Best Practices
| Goal | Recommended Settings |
|---|---|
| High Quality Video | CPU Mode. segments ~50-100. trail_lifetime 5-10s. |
| Real-time Flow | GPU Mode. segments 200+. speed_u/v > 0. |
| Smooth Surface | Increase u_segments and v_segments. |
| Closed Shapes | Enable periodic_u or periodic_v (e.g., for spheres/toruses). |
Troubleshooting:
- Laggy Interface: Lower
trail_lifetimeor switch to GPU Mode. - No Trails: Check if you are in GPU Mode (trails are disabled). Switch to CPU.
- Broken Mesh: Check
periodicsettings if the mesh edges look torn.
