Shape Operations

Warping Operations

Warping modifies a surface by moving control points in a specified direction. The magnitude of the direction vector is the maximum distance which a control point may be moved. The Center argument specifies the point which is to be the center of the warp. This point, if it were a control point of the mesh, would be moved the entire distance specified by the magnitude of the Direction. Other points in the "neighborhood" of the specified point will be moved also. The amount which they are moved depends on their distance from the center of the warp, the warp factor, and the specified cutoff distance.

To get an idea of how the WFactor affects the warping, see Figures below.

  Warp Factor = -8.0  Warp Factor = -1.0  Warp Factor = 0.0  Warp Factor = 1.0  Warp Factor = 8.0

Some basic guidelines for selecting the WFactor are:

  1. A value of 0 is a simple linear warp --- the function linearly goes from 1 to 0 as the distance from the warp center goes from 0 to the cutoff distance.
  2. Increasingly negative numbers make the function drop off more rapidly. A value of -8.0 is almost a delta function; the only point that will be moved significantly is the one at the warp center. Values of -1.0 to -2.0 produce gradual dropoffs with more weight towards the central points.
  3. Increasingly positive numbers make the function drop off more rapidly, but only when it is almost at the maximum distance. A value of +8.0 is almost a box function; this time almost all of the points will be moved the maximum distance as long as they fall within the cutoff distance. Values of 1.0 to 2.0 produce slightly more gradual dropoffs.
The MInfo argument consists of a number which describes which distance measure to use. A value of N says to use the LN norm to compute distance. The LN norm is the Nth root of the sum of the Nth power of each coordinate. Various values of MInfo can be used to adjust the shape of the warp to some degree. If MInfo = 2 gives round bumps, while for larger values the bump becomes more like a rectangle aligned with the coordinate axes. The larger the value, the sharper the rectangular corners of the bump. If MInfo = 1 gives rectangularly shaped bumps too, but they are aligned at a diagonal to the coordinate axes.

warp( Obj, Direction, Center, WFactor, Cutoff, MInfo )
Returns
<surface> Construct a surface by "warping" another surface.
Obj
<surface> The surface to be warped.
Direction
<geomVector> Direction of warp.
Center
<point> The point which is to be the center of the warp.
WFactor
<number> A real number which describes how sharply the warp falls off with distance.
Cutoff
<number> Distance at which the warp effect should go to zero (roughly the radius of the bump).
MInfo
<integer> Specification of how distances are to be measured (described above).
A variant of warp, called warpR, allows an extra restriction array argument which restricts the operation to certain regions.

warpR( Obj, Direction, Center, WFactor, Cutoff, MInfo, Restrict )
Returns
<surface> Construct a surface by "warping" another surface with a warp restricted to certain regions.
Obj
<surface> The surface to be warped.
Direction
<geomVector> Direction of warp.
Center
<point> The point which is to be the center of the warp.
WFactor
<number> A real number which describes how sharply the warp falls off with distance.
Cutoff
<number> Distance at which the warp effect should go to zero (roughly the radius of the bump).
MInfo
<integer> Specification of how distances are to be measured (described above).
Restrict
<arrayOf restrictions> An array of restriction objects.
An extension of the basic warp is to allow the shape of the warp to be determined more exactly. Two operators are provided: skelWarp, which makes the warp according to some polyline shape, and regionWarp which warps according to a closed polygonal region. We first describe the skeletal warp (the polyline shape is referred to as the skeleton of the warp).

Skeletal Warp

Whereas the "bumps" imposed by the standard warp are basically square or circular in shape, skeletal warps can resemble long lines or curves of a particular width. For intuitive results, the skeleton should probably lie close to or in the surface. See below for an example.

Warp of a flat surface with a triangular skeleton.

skelWarp( Obj, Direction, WFactor, Cutoff, MInfo, Skel )
Returns
<surface> Warp an outline on a surface using a skeleton curve or polyline.
Obj
<surface> The surface to be warped.
Direction
<geomVector> Direction of the warp.
WFactor
<number> A real number which describes how sharply the warp falls off with distance.
Cutoff
<number> Distance at which warp effect should go to zero. In this case, this is roughly half the cross-sectional size of the warp.
MInfo
<integer> Information about the distance measurements.
Skel
<polyline | polygon | curve> Skeleton from which to measure. The control polygon is used as the skeleton if a curve is specified.
Like warp, a variant operation, skelWarpR allows an extra argument to restrict the regions to which the warp will be applied:

skelWarpR( Obj, Direction, WFactor, Cutoff, MInfo, Skel, Restrict )
Returns
<surface> Warp an outline on a surface using a skeleton curve or polyline.
Obj
<surface> The surface to be warped.
Direction
<geomVector> Direction of the warp.
WFactor
<number> A real number which describes how sharply the warp falls off with distance.
Cutoff
<number> Distance at which warp effect should go to zero. In this case, this is roughly half the cross-sectional size of the warp.
MInfo
<integer> Information about the distance measurements.
Skel
<polyline | polygon | curve> Skeleton from which to measure. The control polygon is used as the skeleton if a curve is specified.
Restrict
<arrayOf restrictions> An array of restriction objects.

Region Warp

The regionWarp variation of the basic warp uses a polygonal outline of a region to determine the approximate shape of the warp. This warp allows bumps of fairly arbitrary shape, filled solidly in the interior. Note the difference between this and the skeletal warp, which leaves "interior" regions as they were. Distance is measured from the polygon provided as the region. All points which lie inside the polygon are offset by the full amount, while points outside the polygon are offset depending on their distance from the polygon. The MInfo is used as in the simple warp operation.

Region warp using the same triangular outline as the above example skelWarp example.

regionWarp( Obj, Direction, WFactor, Cutoff, MInfo, Region )
Returns
<surface> Warp a region on a surface defined by a polygonal outline.
Obj
<surface> The surface to be warped.
Direction
<geomVector> Direction of warp.
WFactor
<number> A real number which describes how sharply the warp falls off with distance.
Cutoff
<number> Distance at which the warp effect should go to zero. In this case, this is how far outside the region boundary points should be affected.
MInfo
<integer> Information about the distance measurements.
Region
<polyline | polygon | curve> Polyline polygon, or curve describing outline of warp shape. (should represent a CLOSED region).
The regionWarp function also allows the restriction array variant:

regionWarpR( Obj, Direction, WFactor, Cutoff, MInfo, Region, Restrict )
Returns
<surface> Warp a region on a surface defined by a polygonal outline.
Obj
<surface> The surface to be warped.
Direction
<geomVector> Direction of warp.
WFactor
<number> A real number which describes how sharply the warp falls off with distance.
Cutoff
<number> Distance at which the warp effect should go to zero. In this case, this is how far outside the region boundary points should be affected.
MInfo
<integer> Information about the distance measurements.
Region
<polyline | polygon | curve> Polyline polygon, or curve describing outline of warp shape. (should represent a CLOSED region).
Restrict
<arrayOf restrictions> An array of restriction objects.

Flattening Operations

The flatten operator is conceptually (but not generally in practice) an inverse of the warping operator. Where warp can add bumps to flat surfaces, the flatten operator can introduce flat areas in bumpy or rounded surfaces. All points on the positive side of the plane are projected onto the plane in the given direction. This has the effect of flattening the surface as if the plane was a large flat plate pushing on it. If OtherSide is true, then only points on the negative side are projected.

flatten( Obj, Plane, Dir, OtherSide )
Returns
<surface> Create flat areas on a surface.
Obj
<surface> Surface to be flattened.
Plane
<plane> Plane of the flattened area.
Dir
<geomVector> Direction to project affected points to the plane
OtherSide
<boolean> True means points on the negative side of the plane should be projected. False means points on the positive side of the plane should be projected.
An alternative version, flattenSrfR, has an extra restriction array argument at the end.

flattenR( Obj, Plane, Dir, OtherSide )
Returns
<surface> Create flat areas on a surface.
Obj
<surface> Surface to be flattened.
Plane
<plane> Plane of the flattened area.
Dir
<geomVector> Direction to project affected points to the plane
OtherSide
<boolean> True means points on the negative side of the plane should be projected. False means points on the positive side of the plane should be projected.

Bending Operations

The bend operator performs an idealized bending (no physical stretching or compressing of the material is calculated) of the given object according to the chosen parameters.

One can think of the bend operator as modifying the specified axis. If "x" is specified and the surface is a rod lying along the X axis, then the rod will be bent in the usual way. There are two possible directions to bend the X axis: towards Y or towards Z. The default (unless the LH flag is true) is to bend towards the next (right-handed) axis. In the case of "x", that would be bending towards Y. However, if the LH flag is true, the bend will go towards Z.

The Angle determines the total angle which the bend will occupy. The bending range specifies the distance and position along the given axis over which the bend will be spread. A very short bending range will produce a sharp bend, while longer ranges will produce more gradual bends. Finally, Center determines the point of tangency of the bent surface to the original surface --- or the fixed point of the bend. If the bending center is in the middle of the bending range, then the surface will be bent up on either side, leaving the surface tangent to the original surface at the center point. If the bending center is at the left end of the range, then the right side of the surface will be bent up, leaving the bending center (and all points to the left) tangent to the original surface.

Here is an example of a simple bend of a flat surface

  Before Bend

After Bend

bend( Obj, Axis, Angle, Center, Min, Max, LHand )
Returns
<surface> Bend a surface along an axis with a specified angle and spread.
Obj
<surface> The surface to bend.
Axis
<string> Axis along which the bend is to take place ("X", "Y", or "Z").
Angle
<number> Bending angle, measured in degrees.
Center
<number> Coordinate along the specified axis which is the center of the bend.
Min
<number> Coordinate giving the lower limit to the extent of the bend.
Max
<number> Coordinate giving the upper limit to the extent of the bend.
LHand
<boolean> Left handed flag (optional) -- which axis to bend towards. If false (the default) a right-handed choice is made. If true, a left-handed choice is made.

Stretching Operations

A stretching operator is available which is primarily useful for adjusting the proportions of surfaces. It is no different than the graphical scaling transformations, but is presented here in the modeling context for ease of use.

stretch( Obj, XScale, YScale, ZScale )
Returns
<surface> Construct a surface by streching a reference surface by specified amounts over each axis.
Obj
<surface> The surface to be stretched.
XScale, YScale, ZScale
<number> Amount of stretch along each respective axis.

Tapering Operations

The taper operator produces a surface which is tapered along the specified axis according to the values returned by a user-provided tapering function. One can think of the taper as a variable stretch relative to a single axis, with the scaling values coming from the user-provided function. That function should map values on the specified coordinate axis to scale factors which specify how much to scale one of the other coordinates. Only one of the other coordinates is scaled. If you specify tapering relative to the Y axis, the Z coordinates normally get scaled. If LH is true, however, the X coordinates will get scaled instead. For a circularly symmetric taper about the axis, apply the taper function twice with the LH argument set to true for one of them.

taperWithSplineFn( Obj, Axis, LHand, TaperFn, BoundValue )
Returns
<surface> Construct a surface by "tapering" a reference surface.
Obj
<surface> The surface to be tapered.
Axis
<string> Axis along which taper takes place ("X", "Y", or "Z" ).
LHand
<boolean> Left handed flag -- indicates which axis to scale towards. If false, a right-handed choice is made. If true, a left-handed choice is made.
TaperFn
<curve> The curve giving the taper function. May be done using built in spline functions.
BoundValue
<number> Bound value (optional) -- value to use if a point has coordinate which is outside the domain of the curve object. Defaults to 1.0.

Twisting Operations

Just as the taper operator can be thought of as a variable scaling operation, the twist operator can be thought of as a variable rotation. Instead of rotating each point about an axis by a constant amount, the angle of rotation is determined for each point by the coordinate value along the specified axis. The user-provided twisting routine maps that value into a rotation angle in radians.

twistWithSplineFn( Obj, Axis, TwistFn, BoundValue )
Returns
<surface> Construct a surface by performing a variable rotation of another surface.
Obj
<surface> The surface to twist.
Axis
<string> Axis along which twist takes place ("X", "Y", or "Z" ).
TwistFn
<curve> The curve giving the twist function. May be done using built in spline functions.
BoundValue
<number> Bound value (optional) -- value to use if a point has a coordinate which is outside the domain of the curve object. Defaults to 0.0.

Spline functions

constantSplineFn( BeginParm, EndParm, Value )
Returns
<curve> Construct a constant spline curve for use as a function f(t).
BeginParm, EndParm
<number> Parameter values at the beginning and end of the curve respectively.
Value
<number> The constant value of the curve.
linearSplineFn( BeginParm, EndParm, BeginVal, EndVal )
Returns
<curve> Construct a linear spline curve for use as a function f(t).
BeginParm, EndParm
<number> Parameter values at the beginning and end of the curve, respectively.
BeginVal, EndVal
<number> Values of the curve at the start and end, respectively.
approxValuesSplineFn( BegParm, EndParm, ValArray )
Returns
<curve> Construct a spline curve for use as a function f(t) by approximating a set of values.
BegParm, EndParm
<number> Parameter values at the beginning and end of the curve, respectively.
ValArray
<arrayOf number> The array of values for the function to approximate.

C_Shape_Edit User's Manual Home Page 
Alpha_1 User's Manual.
Copyright © 1998, University of Utah
a1-web@gr.cs.utah.edu