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

  1. Open a SOLIDWORKS Part document
  2. Click the CADshift tab in the CommandManager ribbon
  3. Click the Math Surface button
  4. 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

VariableDescription
xHorizontal coordinate (meters)
yDepth coordinate (meters)

Constants

ConstantValue
pi3.14159…
e2.71828… (Euler’s number)
tau6.28318… (2π, full turn)

Operators

OperatorDescriptionExample
+Additionx + y
-Subtraction / unary negationx - y or -x
*Multiplicationx * y
/Divisionx / y
^Power (right-associative)x^2

Functions

All function names are case-insensitive.

Trigonometric

FunctionArgumentsDescription
sin(a)1Sine (radians)
cos(a)1Cosine (radians)
tan(a)1Tangent (radians)
asin(a)1Arc sine
acos(a)1Arc cosine
atan(a)1Arc tangent
sinh(a)1Hyperbolic sine
cosh(a)1Hyperbolic cosine
tanh(a)1Hyperbolic tangent

Math

FunctionArgumentsDescription
abs(a)1Absolute value
sign(a)1Sign of a value (-1, 0, or 1)
round(a)1Round to nearest integer
floor(a)1Round down
ceil(a)1Round up
sqrt(a)1Square root
pow(a, b)2a raised to the power b
exp(a)1e raised to the power a
log(a)1Natural logarithm (base e)
ln(a)1Alias for log
log10(a)1Logarithm base 10
log2(a)1Logarithm base 2
min(a, b)2Smaller of a and b
max(a, b)2Larger of a and b
clamp(v, lo, hi)3Clamp v between lo and hi

Units

Internal Units

SOLIDWORKS uses meters internally. All x, y, and z values are in meters. For a surface roughly 60 mm wide, set xMin = -0.03 and xMax = 0.03.

Domain Settings

The domain defines the rectangular region over which the equation is evaluated.

SettingDefaultDescription
xMin-0.03Left boundary (meters)
xMax0.03Right boundary (meters)
yMin-0.02Near boundary (meters)
yMax0.02Far 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.

SettingDefaultRangeDescription
Nx355 - 200Number of sample points in x
Ny255 - 200Number of sample points in y

Performance Limit

Nx × Ny must not exceed 20,000. Higher resolution produces smoother surfaces but takes longer to build.

Output Options

OptionDefaultDescription
Create Boundary SurfaceOnFit a boundary surface from the spline network
Keep construction curves visibleOffLeave the 3D sketch curves visible after surface creation
Preview curves only (no surface)OffBuild 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.

NameEquationDescription
Paraboloid(x*x + y*y) / 0.08Bowl shape, default equation
Saddle(x*x - y*y) / 0.04Hyperbolic paraboloid
Sine wave0.005 * sin(x * 200)Ripples along x
Cross wave0.003 * (sin(x*200) + sin(y*200))Grid of peaks and valleys
Radial ripple0.005 * sin(sqrt(x*x + y*y) * 300)Concentric circular ripples
Gaussian bump0.01 * exp(-((x*x + y*y) / 0.0002))Smooth bell curve
Cone0.3 * sqrt(x*x + y*y)Cone rising from the origin
Tilted plane5*x + 8*yFlat inclined surface
Egg crate0.002 * (cos(x*200) + cos(y*200))Repeating dimple pattern
Monkey saddle(x^3 - 3*x*y*y) * 5000Three-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.
CADshift

Start typing to search the documentation

↑↓ to navigate Enter to select