# `plot`::`Sweep`

Sweep surface from the deformation of a 3D curve

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

## Syntax

```plot::Sweep(`[x1, y1, z1]`, <`Ground = g`>, `u = umin .. umax`, <`a = amin .. amax`>, `options`)
plot::Sweep(`A1`, <`Ground = g`>, `u = umin .. umax`, <`a = amin .. amax`>, `options`)
plot::Sweep(`C1`, <`Ground = g`>, `options`)
plot::Sweep(`[x1, y1, z1]`, `[x2, y2, z2]`, `u = umin .. umax`, <`a = amin .. amax`>, `options`)
plot::Sweep(`A1`, `A2`, `u = umin .. umax`, <`a = amin .. amax`>, `options`)
plot::Sweep(`C1`, `C2`, `options`)
```

## Description

`plot::Sweep([x_1(u), y_1(u), z_1(u)], u = `u_{min}`..`u_{max}`)` creates the surface swept out by the (linear) deformation of the parameterized curve (x1(u), y1(u), z1(u)) to its projection (x1(u), y1(u), 0) to the x-y-plane.

```plot::Sweep([x_1(u), y_1(u), z_1(u)], [x_2(u), y_2(u), z_2(u)], u = `u_{min}`..`u_{max}`)``` creates the surface swept out by the (linear) deformation of the parameterized curve (x1(u), y1(u), z1(u)) to the parameterized curve (x2(u), y2(u), z2(u)).

`plot::Sweep` creates the parametrized surface

with the two surface parameters u (ranging from `umin` to `umax`) and v (ranging from 0 to 1). This is the linear deformation of the curve (x1(u), y1(u), z1(u)) defining one border of the surface to the curve (x2(u), y2(u), z2(u)) defining the other border of the surface.

If no “target curve” (x2(u), y2(u), z2(u)) is specified, the projection x2(u) = x1(u), y2(u) = y1(u), z2(u) = g of the “source curve” (x1(u), y1(u), z1(u)) to the x-y-plane with constant value z = g is used. The value g is set by the attribute `Ground` = `g`. The default value is `g = 0`.

When a target curve [x2(u), y2(u), z2(u)] is specified, the `Ground` attribute does not have any effect.

If the curves are specified by objects ```C1, C2``` of type `plot::Curve3d`, the graphical attributes of the object created by `plot::Sweep` are copied from `C1`. The parametrization of `C2` is automatically rewritten in terms of the curve parameter used in the definition of `C1`. This, however, will only work if the parametrization of `C2` is defined by symbolic expressions.

### Note

If the parametrization of `C2` is defined by procedures, make sure that the parameter ranges of `C1` and `C2` coincide!

## Attributes

AttributePurposeDefault Value
`AdaptiveMesh`adaptive sampling`0`
`AffectViewingBox`influence of objects on the `ViewingBox` of a scene`TRUE`
`Color`the main color`RGB::Black.[0.25]`
`DiscontinuitySearch`semi-symbolic search for discontinuities`TRUE`
`Filled`filled or transparent areas and surfaces`TRUE`
`FillColor`color of areas and surfaces`RGB::Red`
`FillColor2`second color of areas and surfaces for color blends`RGB::CornflowerBlue`
`FillColorType`surface filling types`Dichromatic`
`FillColorFunction`functional area/surface coloring
`FillColorDirection`the direction of color transitions on surfaces[`0`, `0`, `1`]
`FillColorDirectionX`x-component of the direction of color transitions on surfaces`0`
`FillColorDirectionY`y-component of the direction of color transitions on surfaces`0`
`FillColorDirectionZ`z-component of the direction of color transitions on surfaces`1`
`Frames`the number of frames in an animation`50`
`Ground`base value`0`
`Legend`makes a legend entry
`LegendText`short explanatory text for legend
`LegendEntry`add this object to the legend?`TRUE`
`LineColor`color of lines`RGB::Black.[0.25]`
`LineWidth`width of lines`0.35`
`LineColor2`color of lines`RGB::DeepPink`
`LineStyle`solid, dashed or dotted lines?`Solid`
`LineColorType`line coloring types`Flat`
`LineColorFunction`functional line coloring
`LineColorDirection`the direction of color transitions on lines[`0`, `0`, `1`]
`LineColorDirectionX`x-component of the direction of color transitions on lines`0`
`LineColorDirectionY`y-component of the direction of color transitions on lines`0`
`LineColorDirectionZ`z-component of the direction of color transitions on lines`1`
`Mesh`number of sample points`25`
`Name`the name of a plot object (for browser and legend)
`ParameterEnd`end value of the animation parameter
`ParameterName`name of the animation parameter
`ParameterBegin`initial value of the animation parameter
`ParameterRange`range of the animation parameter
`PointSize`the size of points`1.5`
`PointStyle`the presentation style of points`FilledCircles`
`PointsVisible`visibility of mesh points`FALSE`
`Submesh`density of submesh (additional sample points)`4`
`TimeEnd`end time of the animation`10.0`
`TimeBegin`start time of the animation`0.0`
`TimeRange`the real time span of an animation`0.0` .. `10.0`
`Title`object title
`TitleFont`font of object titles[`" sans-serif "`, `11`]
`TitlePosition`position of object titles
`TitleAlignment`horizontal alignment of titles w.r.t. their coordinates`Center`
`TitlePositionX`position of object titles, x component
`TitlePositionY`position of object titles, y component
`TitlePositionZ`position of object titles, z component
`ULinesVisible`visibility of parameter lines (u lines)`TRUE`
`UMax`final value of parameter “u”
`UMesh`number of sample points for parameter “u”`25`
`UMin`initial value of parameter “u”
`UName`name of parameter “u”
`URange`range of parameter “u”
`USubmesh`density of additional sample points for parameter “u”`4`
`VLinesVisible`visibility of parameter lines (v lines)`TRUE`
`Visible`visibility`TRUE`
`VisibleAfter`object visible after this time value
`VisibleBefore`object visible until this time value
`VisibleFromTo`object visible during this time range
`VisibleAfterEnd`object visible after its animation time ended?`TRUE`
`VisibleBeforeBegin`object visible before its animation time starts?`TRUE`
`XFunction1`parametrization of the curves in sweep surfaces
`XFunction2`parametrization of the curves in sweep surfaces
`YFunction1`parametrization of the curves in sweep surfaces
`YFunction2`parametrization of the curves in sweep surfaces
`ZFunction1`parametrization of the curves in sweep surfaces
`ZFunction2`parametrization of the curves in sweep surfaces

## Examples

### Example 1

We deform a 3D spiral to its projection to the x-y-plane:

```plot(plot::Sweep([u*cos(u), u*sin(u), u], u = 0..4*PI), CameraDirection = [90, 50, 120])```

We use the `Ground` attribute to project the spiral to the x-y-plane with z = 9:

```plot(plot::Sweep([u*cos(u), u*sin(u), u], u = 0..4*PI, Ground = 9), CameraDirection = [130, 60, 45])```

### Example 2

We deform a circle in the x-y-plane to a planar spiral:

```plot(plot::Sweep([cos(u), sin(u), 0], [u*cos(u), u*sin(u), 0], u = PI/3..7/3*PI), Scaling = Constrained)```

With `Filled` = `FALSE`, only the lines are visible along which the mesh points of the curves are moved:

```plot(plot::Sweep([cos(u), sin(u), 0], [u*cos(u), u*sin(u), 0], u = PI/3..7/3*PI), Scaling = Constrained, Filled = FALSE)```

We increase the number of mesh points:

```plot(plot::Sweep([cos(u), sin(u), 0], [u*cos(u), u*sin(u), 0], u = PI/3..7/3*PI, Mesh = 50), Scaling = Constrained, Filled = FALSE)```

### Example 3

We deform a circle to an animated point. The resulting sweep surface is an animated cone:

```plot(plot::Sweep([cos(u), sin(u), 0], [a, 0, a], u = 0..2*PI, a = 0..2))```

## Parameters

 `x1`, `y1`, `z1` The parametrization of the initial 3D curve: real-valued expressions in `u` (and possibly the animation parameter). `x1`, `y1`, `z1` are equivalent to the attributes `XFunction1`, `YFunction1`, `ZFunction1`. `x2`, `y2`, `z2` The parametrization of the “target curve”: real-valued expressions in `u` (and possibly the animation parameter). `x2`, `y2`, `z2` are equivalent to the attributes `XFunction2`, `YFunction2`, `ZFunction2`. `u` The curve parameter: an identifier or an indexed identifier. `u` is equivalent to the attribute `UName`. `umin`, `umax` Real-valued expressions (possibly in the animation parameter). `umin`, `umax` are equivalent to the attributes `UMin`, `UMax`. `g` Real-valued expression (possibly in the animation parameter). `g` is equivalent to the attribute `Ground`. `A1`, `A2` matrices of category `Cat::Matrix` with three entries that provide the parametrizations `x1`, `y1`, `z1` and `x2`, `y2`, `z2`, respectively. `C1`, `C2` Curves of type `plot::Curve3d`. `C1` provides the “initial curve” ```[x1, y1, z1]```, `C2` provides the “target curve” ```[x2, y2, z2]```. `a` Animation parameter, specified as `a```` = amin..amax```, where `amin` is the initial parameter value, and `amax` is the final parameter value.