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
- Open a SOLIDWORKS Part document and edit a sketch
- Click the CADshift tab in the CommandManager ribbon
- Click the Equation Driven Points button
- Select a sketch segment
(line, arc, spline, etc.) - Set the point count
, configure spacing and offset, then click OK
Variables
All equations—both spacing and offset—can use the following variables:
| Variable | Description |
|---|---|
i | Zero-based point index. First point is 0, last point is N - 1. |
N | Total number of points you requested. |
u | Normalized position along the curve, from 0.0 (start) to 1.0 (end). Computed as i / (N - 1). |
L | Total arc length of the selected curve segment (in meters, SOLIDWORKS internal units). |
s | Approximate arc length at the current point. Equal to u * L. |
When to use which variable
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
| Constant | Value |
|---|---|
pi | 3.14159… |
e | 2.71828… (Euler’s number) |
tau | 6.28318… (2π) |
Functions
| Function | Description |
|---|---|
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].
| Equation | Effect |
|---|---|
u | Uniform spacing (default) |
u^2 | Dense at start, sparse at end |
sqrt(u) | Sparse at start, dense at end |
u^3 | Very dense at start |
sin(u * pi/2) | Ease-in (slow start, fast end) |
1 - (1-u)^2 | Ease-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.
| Equation | Effect |
|---|---|
0 | No offset (default) |
sin(u * pi * 4) | Sine wave—4 full cycles along the curve |
sin(u * pi) | Single bump—max offset at midpoint |
u * 10 | Linearly increasing offset |
(1 - u) * 5 | Linearly decreasing offset |
sin(i) | Offset varies per point index |
rand(i) * 2 - 1 | Random scatter between −1 and +1 |
pow(-1, i) * 3 | Alternating zigzag (+3, −3, +3…) |
sin(u * pi * 6) * u | Growing 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:
| Name | Spacing | Offset | Scale |
|---|---|---|---|
| Zigzag stitch | u | pow(-1, i) * 3 | 1 |
| Decaying wave | u | exp(-u*3) * sin(u*pi*8) | 5 |
| Cluster at ends | 0.5 - 0.5*cos(u*pi) | 0 | — |
| Random scatter | u | rand(i) * 2 - 1 | 3 |
| Spiral-like (on a straight line) | u | sin(u * tau * 3) * u | 10 |
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
- Previous
- Math Surface
- Next
- BOM Manager