Documentation

Spline

Cubic interpolating plane curve or space curve

  • Library:
  • Curves and Surfaces

Description

This block represents a continuous spline curve based on cubic interpolation between the points specified. The curve can be two-dimensional, such as a planar cam profile, or three-dimensional, such as a roller coaster track. Depending on the end conditions selected, the curve can be either open or closed.

Cam profile — An Example of a 2-D Spline Curve

Whether a spline curve is two- or three-dimensional depends solely on the coordinate matrix dimensions. A two-column matrix specifies a two-dimensional curve in the xy plane. Each row in this matrix provides the [x, y] coordinates of a point. A three-column matrix specifies a three-dimensional curve. Each row in this matrix provides the [x, y, z] coordinates of a point. All coordinates are resolved in the local reference frame of the block.

The spline curve is a piecewise function of third-order polynomial segments connected end-to-end. The curve is built such that adjacent polynomial segments have the same first and second derivatives at the shared end point. If the curve is periodic, an additional curve segment connects the last point specified to the first point. The first and second derivatives of this segment matches those of the adjacent segments at the shared end point.

Ports

Frame

expand all

Spline curve reference frame. Connect this frame port to that of another block to resolve the placement of the spline curve in a model.

Spline curve geometry. Connect this geometry port to that of a Point On Curve Constraint block to provide that block with a spline curve specification.

Parameters

expand all

Coordinates of the interpolation points specified as an [x, y] matrix for a 2-D curve or [x, y, x] matrix for a 3-D curve. Coordinates are resolved in the reference frame of the block.

If you set the end conditions to Periodic (Closed), the block joins the first and last data points with an additional spline segment. Like all spline segments, the additional segment and its first two derivatives are continuous at the shared point.

Each data point in the coordinate matrix must be unique. If the curve is closed, you must ensure that the first and last data points have different coordinates.

Type of end conditions to use. Periodic end conditions correspond to a closed curve. Natural end conditions correspond to an open curve. The default setting is Periodic (Closed).

Graphic

Visualization setting for this solid. Use the default setting, From Geometry, to show the solid geometry. Select Marker to show a graphic marker such as a sphere or frame. Select None to disable visualization for this solid.

Geometrical shape of the graphic marker. Mechanics Explorer shows the marker using the selected shape.

Absolute size of the graphic marker in screen pixels. The marker size is invariant with zoom level.

Parameterization for specifying visual properties. Select Simple to specify color and opacity. Select Advanced to add specular highlights, ambient shadows, and self-illumination effects.

RGB color vector with red (R), green (G), and blue (B) color amounts specified on a 0–1 scale. A color picker provides an alternative interactive means of specifying a color. If you change the Visual Properties setting to Advanced, the color specified in this parameter becomes the Diffuse Color vector.

Graphic opacity specified on a scale of 0–1. An opacity of 0 corresponds to a completely transparent graphic and an opacity of 1 to a completely opaque graphic.

True color under direct white light specified as an [R,G,B] or [R,G,B,A] vector on a 0–1 scale. An optional fourth element specifies the color opacity also on a scale of 0–1. Omitting the opacity element is equivalent to specifying a value of 1.

Color of specular highlights specified as an [R,G,B] or [R,G,B,A] vector on a 0–1 scale. The optional fourth element specifies the color opacity. Omitting the opacity element is equivalent to specifying a value of 1.

Color of shadow areas in diffuse ambient light, specified as an [R,G,B] or [R,G,B,A] vector on a 0–1 scale. The optional fourth element specifies the color opacity. Omitting the opacity element is equivalent to specifying a value of 1.

Surface color due to self illumination, specified as an [R,G,B] or [R,G,B,A] vector on a 0–1 scale. The optional fourth element specifies the color opacity. Omitting the opacity element is equivalent to specifying a value of 1.

Sharpness of specular light reflections, specified as a scalar number on a 0–128 scale. Increase the shininess value for smaller but sharper highlights. Decrease the value for larger but smoother highlights.

Introduced in R2015b

Was this topic helpful?