Math Surface
Create freeform surfaces in SOLIDWORKS by typing a mathematical equation. CADshift evaluates z = f(x, y) over a rectangular domain, builds a spline network, and optionally fits a boundary surface in one click.
Getting Started
- Open a SOLIDWORKS Part document
- Click the CADshift tab in the CommandManager ribbon
- Click the Math Surface
button - Enter an equation, adjust the domain and resolution, then click OK
The PropertyManager has four groups: Equation, Domain, Resolution, and Output.
Equation Input
Type the right-hand side of z = f(x, y) into the equation box. The z = prefix is optional and will be stripped automatically.
Variables
| Variable | Description |
|---|---|
x | Horizontal coordinate (meters) |
y | Depth coordinate (meters) |
Constants
| Constant | Value |
|---|---|
pi | 3.14159… |
e | 2.71828… (Euler’s number) |
tau | 6.28318… (2π, full turn) |
Operators
| Operator | Description | Example |
|---|---|---|
+ | Addition | x + y |
- | Subtraction / unary negation | x - y or -x |
* | Multiplication | x * y |
/ | Division | x / y |
^ | Power (right-associative) | x^2 |
Functions
All function names are case-insensitive.
Trigonometric
| Function | Arguments | Description |
|---|---|---|
sin(a) | 1 | Sine (radians) |
cos(a) | 1 | Cosine (radians) |
tan(a) | 1 | Tangent (radians) |
asin(a) | 1 | Arc sine |
acos(a) | 1 | Arc cosine |
atan(a) | 1 | Arc tangent |
sinh(a) | 1 | Hyperbolic sine |
cosh(a) | 1 | Hyperbolic cosine |
tanh(a) | 1 | Hyperbolic tangent |
Math
| Function | Arguments | Description |
|---|---|---|
abs(a) | 1 | Absolute value |
sign(a) | 1 | Sign of a value (-1, 0, or 1) |
round(a) | 1 | Round to nearest integer |
floor(a) | 1 | Round down |
ceil(a) | 1 | Round up |
sqrt(a) | 1 | Square root |
pow(a, b) | 2 | a raised to the power b |
exp(a) | 1 | e raised to the power a |
log(a) | 1 | Natural logarithm (base e) |
ln(a) | 1 | Alias for log |
log10(a) | 1 | Logarithm base 10 |
log2(a) | 1 | Logarithm base 2 |
min(a, b) | 2 | Smaller of a and b |
max(a, b) | 2 | Larger of a and b |
clamp(v, lo, hi) | 3 | Clamp v between lo and hi |
Units
Internal Units
Domain Settings
The domain defines the rectangular region over which the equation is evaluated.
| Setting | Default | Description |
|---|---|---|
| xMin | -0.03 | Left boundary (meters) |
| xMax | 0.03 | Right boundary (meters) |
| yMin | -0.02 | Near boundary (meters) |
| yMax | 0.02 | Far boundary (meters) |
xMin must be less than xMax, and yMin must be less than yMax.
Resolution Settings
Resolution controls the density of the spline network.
| Setting | Default | Range | Description |
|---|---|---|---|
| Nx | 35 | 5 - 200 | Number of sample points in x |
| Ny | 25 | 5 - 200 | Number of sample points in y |
Performance Limit
Output Options
| Option | Default | Description |
|---|---|---|
| Create Boundary Surface | On | Fit a boundary surface from the spline network |
| Keep construction curves visible | Off | Leave the 3D sketch curves visible after surface creation |
| Preview curves only (no surface) | Off | Build only the spline network without creating a surface |
When Preview curves only is checked, the surface step is skipped regardless of the Create Boundary Surface setting. This is useful for inspecting the spline network before committing to a surface.
Sample Surfaces
Try these equations with the default domain to explore different surface shapes.
| Name | Equation | Description |
|---|---|---|
| Paraboloid | (x*x + y*y) / 0.08 | Bowl shape, default equation |
| Saddle | (x*x - y*y) / 0.04 | Hyperbolic paraboloid |
| Sine wave | 0.005 * sin(x * 200) | Ripples along x |
| Cross wave | 0.003 * (sin(x*200) + sin(y*200)) | Grid of peaks and valleys |
| Radial ripple | 0.005 * sin(sqrt(x*x + y*y) * 300) | Concentric circular ripples |
| Gaussian bump | 0.01 * exp(-((x*x + y*y) / 0.0002)) | Smooth bell curve |
| Cone | 0.3 * sqrt(x*x + y*y) | Cone rising from the origin |
| Tilted plane | 5*x + 8*y | Flat inclined surface |
| Egg crate | 0.002 * (cos(x*200) + cos(y*200)) | Repeating dimple pattern |
| Monkey saddle | (x^3 - 3*x*y*y) * 5000 | Three-fold symmetric saddle |
Tips
- Start small. Use the default domain first, then widen it once the shape looks right.
- Preview first. Enable Preview curves only to check the spline network before building the surface.
- Scale carefully. Because units are meters, coefficients often need large multipliers (e.g.
sin(x * 200)) or small divisors to produce visible shapes at the default domain size. - Undo in one step. The entire operation is wrapped in a single undo block; press Ctrl+Z to revert both the surface and all construction sketches.
- Keep curves for debugging. If the boundary surface fails, construction curves remain so you can inspect the spline network in the FeatureManager tree.
- Previous
- QR Codes and Watermarks