Wednesday, 11 March 2015

Math behind Style Spline in Solidworks

Whether occurring in nature or in the mind of a designer, curves and surfaces that are pleasing to the eye are not necessarily easy to express mathematically. In Solidworks 2014, Solidworks introduced a new entity called Style Spline. I would like to share about mathematical concepts in style spline.

Style spline is something differs from spline which we are using currently, Because Spline curve is a piecewise cubic curve, made of pieces of different cubic curves glued together. Style spline is a Bezier curve. A Bezier curve is one of the parametric curve frequently used in computer graphics and related fields. But Bezier curves differ from other types of parametric curves by the type of basis polynomials used to form them

The study of these curves was however first developed in 1959 by mathematician Paul de Casteljau using de Casteljau algorithm at Citro├źn. The idea of this algorithm is plotting the curve through repeated linear interpolation by using given control points (P0, P1, P2, P3... Pn ). The following discussion will explain how Bezier curve has been derived mathematically. For an example, Lets we discuss about methodology of deriving Quadric Bezier curve (i.e. Parabola).

Generic Linear interpolation formula between two points P0P1 is P(u) = (1-u)P0 + uP1, for 0 ≤ u ≤ 1

For better understanding, Lets we take "u" = 0.2, 0.4, 0.6, 0.8 ,between the limit 0 to 1

We know that the value of starting (P0), control (P1) and ending (P2) points. Firstly , we have to do linear interpolation between P0 and P1 as well as P1 and P2 (for u=0.2), so we get P01 and P02 points respectively . And again we have to do linear interpolation between P01 and P02 , finally we will get P(u) point (for u=0.2). So for Quadric Bezier curve, we need three iteration to find the curve points. We have to repeat these three iteration with changing value of "u".

Note: The tangent vector formed by the starting point is tangent to the curve at point (P0). The derived lines from calculations at every stage (like P0P1 ) is tangent to the curve at point P(u). Likewise, Tangency of the curve is controlled.

Lets we see the animation of curve formation in Higher order (4 point) Bezier curve which is created... Click Here

Team EGS

No comments:

Post a Comment