Equation Driven Points

Generate sketch points along any sketch curve using mathematical equations. Control point spacing, apply offset patterns, and create complex point distributions.


Getting Started

  1. Open a SOLIDWORKS Part document and edit a sketch
  2. Click the CADshift tab in the CommandManager ribbon
  3. Click the Equation Driven Points button
  4. Select a sketch segment (line, arc, spline, etc.)
  5. Set the point count , configure spacing and offset, then click OK

Variables

All equations—both spacing and offset—can use the following variables:

VariableDescription
iZero-based point index. First point is 0, last point is N - 1.
NTotal number of points you requested.
uNormalized position along the curve, from 0.0 (start) to 1.0 (end). Computed as i / (N - 1).
LTotal arc length of the selected curve segment (in meters, SOLIDWORKS internal units).
sApproximate arc length at the current point. Equal to u * L.

When to use which variable

Use u when you want to think in terms of “percentage along the curve” (0–1). Use s when you need the actual physical distance from the start. Use i when you want behavior that depends on the point number (e.g., alternating patterns).

Constants

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

Functions

FunctionDescription
sin(x), cos(x), tan(x)Trigonometric functions
asin(x), acos(x), atan(x)Inverse trigonometric functions
abs(x)Absolute value
min(a, b)Minimum of two values
max(a, b)Maximum of two values
clamp(x, lo, hi)Clamp x between lo and hi
floor(x)Round down to nearest integer
ceil(x)Round up to nearest integer
sqrt(x)Square root
pow(x, y)x raised to the power y
exp(x)e raised to the power x
log(x)Natural logarithm
rand(x)Deterministic pseudo-random number in [0, 1] based on seed and x

Point Distribution

Point count sets the total number of points to generate along the curve (2 to 2000).

Spacing Equation

When spacing equation mode is enabled, the equation maps each point’s uniform parameter u (0–1) to a new position p (also 0–1) along the curve. This lets you create non-uniform point distributions. The output is clamped to [0, 1].

EquationEffect
uUniform spacing (default)
u^2Dense at start, sparse at end
sqrt(u)Sparse at start, dense at end
u^3Very dense at start
sin(u * pi/2)Ease-in (slow start, fast end)
1 - (1-u)^2Ease-out (fast start, slow end)
0.5 - 0.5*cos(u*pi)Ease-in-out (dense at both ends)
log(u * e + 1) / log(e + 1)Logarithmic distribution
clamp(u * 2, 0, 1)All points crammed into first half

Offset

When the Offset group is checked, each generated point is displaced perpendicular to the curve. Two modes are available:

Constant Offset

Enter a fixed offset distance . All points are shifted by the same amount perpendicular to the curve. The value is in model units (meters internally; displayed in your document units).

Equation-Driven Offset

The offset equation produces a dimensionless offset value for each point. The result is then multiplied by the Scale number box to get the final perpendicular displacement.

For example, if the equation outputs sin(u * pi * 4) (which ranges from −1 to +1) and the scale is set to 5, the actual offset will range from −5 to +5 mm.

EquationEffect
0No offset (default)
sin(u * pi * 4)Sine wave—4 full cycles along the curve
sin(u * pi)Single bump—max offset at midpoint
u * 10Linearly increasing offset
(1 - u) * 5Linearly decreasing offset
sin(i)Offset varies per point index
rand(i) * 2 - 1Random scatter between −1 and +1
pow(-1, i) * 3Alternating zigzag (+3, −3, +3…)
sin(u * pi * 6) * uGrowing sine wave
sin(u * pi * 6) * (1-u)Decaying sine wave
exp(-u*3) * sin(u*pi*8)Damped oscillation

Fun Combos

Try these combinations of spacing and offset equations to create interesting patterns:

NameSpacingOffsetScale
Zigzag stitchupow(-1, i) * 31
Decaying waveuexp(-u*3) * sin(u*pi*8)5
Cluster at ends0.5 - 0.5*cos(u*pi)0—
Random scatterurand(i) * 2 - 13
Spiral-like (on a straight line)usin(u * tau * 3) * u10

Deterministic Random

When the Deterministic Random group is checked, the rand(x) function uses the specified seed value, ensuring repeatable results every time you regenerate. When unchecked, a time-based seed is used and results will vary each run.

Tip

Keep deterministic mode enabled while experimenting so you can compare results consistently. Turn it off only when you want truly different random patterns each time.
CADshift

Start typing to search the documentation

↑↓ to navigate Enter to select