Surface Constructors

Predefined Order Constants

A number of surface constructors and operators require arguments specifying the order(s) of the surface which is the degree plus one. A number of predefined constants are provided to make this less confusing. See Predefined Order Constants 
surface( uOrder, uEndCond, uKnotVec, vOrder, vEndCond, vKnotVec, Mesh )
Returns
<surface> Construct a surface from parametric information and a control mesh.
uOrder, vOrder
<integer> U and V order of the surface.
uEndCond, vEndCond
<string> U and V end conditions. May be "ec_open", "ec_floating" or "ec_periodic".
uKnotVec, vKnotVec
<knotVector | string> U and V knot vector specification. Can be a knotVector object or one of the following strings: "kv_bezier", "kv_uniform" or "kv_chord".
Mesh
<controlMesh | arrayOf arrayOf points> The control mesh for the surface. May be a control mesh object or an array of arrays of control points.
sRefine( OldSrf, Dir, NewKnots, Merge )
Returns
<surface> Refine a surface in a given direction using the given knot vector.
OldSrf
<surface> The original surface to refine.
Dir
<string> The direction to refine in, one of the strings "row" or "col".
NewKnots
<knotVector | arrayOf number | vectorOf number> The new knot vector to use.
Merge
<boolean | function> If boolean, indicates whether newKnots needs to be merged into the original knot vector (not necessary if the new knot vector already contains all the original knots). If a function is given, it is used to do the merging (and merging is assumed to be needed).
kRefineSrf( Srf, Resolution, Autoscale, MaxKnots )
Returns
<surface> Refined surface.
Srf
<surface> Surface to be refined.
Resolution(5.0)
<number> Resolution parameter to control refinement level. Default 5.0.
Autoscale(1.0)
<number> Width of bounding box in object space, divided by 2. Default 1.0.
MaxKnots(0)
<integer> Maximum number of knots added per interval. Default 0 (no maximum).
surfaceOpen( Srf )
Returns
<surface> Convert a surface to have open end conditions.
Srf
<surface> The surface to convert.
surfaceOpenInDir( Srf, Dir )
Returns
<surface> Convert a surface to have open end conditions in the direction specified.
Srf
<surface> The surface to convert.
Dir
<string> The direction of the surface to have open end conditions. May be "row" or "col".
reverseSrfInDir( Srf, Dir )
Returns
<surface> Reverse a surface in a certain direction by flipping it end-for-end.
Srf
<surface> The surface to flip.
Dir
<string> The direction to flip, one of "row" or "col".
sMesh( Srf )
Returns
<ctlMesh> Retrieve the control mesh used by a surface.
Srf
<surface> The surface to examine.
getBoundary( Srf, Edge )
Returns
<curve> Extract the desired boundary curve from the surface.
Srf
<surface> The surface to examine.
Edge
<string> The desired boundary curve, must be one of "top", "bottom", "left" or "right".
crvInSrf( Srf, Dir, ParamVal, LeftHand )
Returns
<curve> Extract a curve corresponding to a particular parametric value from a surface.
Srf
<surface> The surface to examine.
Dir
<string> One of "row" or "col".
ParamVal
<number> The parametric value of the desired curve.
LeftHand (false)
<boolean> Optional flag for left hand evaluation.
regionFromSrf( Srf, Dir, LowParamVal, HighParamVal )
Returns
<surface> Extract a new surface by "slicing" an existing surface.
Srf
<surface> The surface to slice.
Dir
<string> Direction in which to extract a region. One of "row" or "col".
LowParamVal, HighParamVal
<number> Parametric values for the bounds of the new surface in the indicated direction.
raiseSurface( Obj, Order, Dir )
Returns
<surface> Raise the order of a surface.
Obj
<surface> The surface to raise.
Order
<integer> The new order for the surface.
Dir (Both)
<string> Optional single direction to raise. One of "row" or "col".
srfMerge( Srf1, Srf2, Dir, JoinType, KnotSpread )
Returns
<surface> A single surface merged from the original pair.
Srf1, Srf2
<surface> The surfaces to be merged together.
Dir
<string> The direction in which to perform the merge. One of "row" or "col". If rows are specified, the rows of the meshes will be concatenated.
JoinType
<string> Can be "exact", "blend" or "exact_blend", specifying how the region at the join is to be treated. If an exact join is specified, the surfaces are assumed to share a boundary curve, and the control points along one of the surface edges are dropped.
KnotSpread
<number> Optional knot spread value for use with "exact_blend".
srfFromCrvs( Order, EndCond, KnotVec, CrvArray )
Returns
<surface> Construct a surface from a set of curves.
Order
<integer> The order of the surface.
EndCond
<string> The end conditions of the surface. One of "ec_open", "ec_floating", or "ec_periodic".
KnotVec
<string> Knot vector type. Can be "kv_bezier", "kv_uniform" or "kv_chord".
CrvArray
<arrayOf curve> The array of curves to create the surface from.
srfEval( Srf, U, V )
Returns
<point> Evaluate a point on a surface at a given (u, v) parameter value.
Srf
<surface> The surface to be evaluated.
U, V
<number> Parametric coordinates of the point to be evaluated.
diffSrf( Srf, UNum, VNum )
Returns
<surface> Compute the partial derivative of a surface, differentiating UNum times in the U direction and VNum times in the V direction. The resulting surface will have order equal to the original order minus UNum in the U direction, and the original order minus VNum in the V direction. The base point type of the surface will be R2 or R3 since derivatives are vector values. The derivative surface can be evaluated using srf_eval().
Srf
<surface> The surface to be differentiated.
UNum, VNum
<number> The number of times to differentiate in each direction.
shell( SrfArray )
Returns
<shell> A shell object containing the given surfaces.
SrfArray
<arrayOf surface> The array of surfaces which are to be placed in the shell.
mergeShell( Shl1, ... )
Returns
<shell> A new shell containing the surfaces which were in both of the original shells.
Shl1, ...
<shell> The shells to be merged. (Must be >= 2). Objects whose geometries are actually shells - e.g. mechanical features) are also valid.
srfFromShell( Shl, Index )
Returns
<surface> The surface retrieved from the shell. Shells are groups of surfaces. (see the definition). This is the method for getting the surfaces that are in the shell.
Shl
<shell> The shell to pick a surface out of.
Index
<number> The index of the surface in the shell. Surfaces start with number zero.

e.g. To get the first surface, use the following:
srfFromShell( shl, 0 )
makeGeom( volume primitive )
Returns
<shell> Return a shell that represents this volume primitive.(see constructors).
volume primitive
<box, wedge, cylinder, cone, sphere, torus, ellipsoid>
Example:
Suppose you need to merge two volume primitives together, but you read the mergeShell definition and realize that you have to convert the primitives to shells. You might do something like this:

# Create a volume primitive box and a volume primitive sphere
PBox: box( pt(-1,-.1,-1), vec(2, 0, 0), vec(0, .2, 0), vec(0, 0, 2) );
PSphere: unitsphere;
# Make both of the primitives into shells, and merge the results
A: mergeShell( makegeom( PSphere), makegeom( PBox ));
show( A );
capSurface( Crv1, ... )
Returns
<shell> Construct a flat trimming surface that fills a region defined by the given trimming curve(s) (assumed to be planar). It is assumed that the orientations of all the curves describe a reasonable closed region or regions. No ordering is assumed for the trimming curves.
Crv1, ...
<curve> The trimming curves.
extrude( Crv, Pt1, Pt2, EndCapsFlg )
Returns
<surface | shell> Extrude a curve given locations for the two end points.
Crv
<curve> Curve to be extruded.
Pt1, Pt2
<point> Instancing origin at each end. The first point will be the V = 0 end, the second will be the V = 1 end.
EndCapsFlg
<boolean | string> (Optional) If not supplied then return a surface. Otherwise return a shell and add caps based on its value. Values of "top" or "bottom" cause just one of the caps to be generated.
extrudeDir( Crv, Vec, EndCapsFlg )
Returns
<surface | shell> Extrude a curve along a direction vector.
Crv
<curve> Curve to be extruded.
Vec
<geomVector> Direction of extrusion. The curve is translated by this vector and connected to Crv.
EndCapsFlag
<boolean | string> (Optional) If not supplied then return a surface. Otherwise return a shell and add caps based on its value. Values of "top" or "bottom" cause just one of the caps to be generated.
srfOfRevolution( Axis, Profile, EndCapsFlg )
Returns
<surface | shell> Sweep a profile curve around an axis.
Axis
<line> Axis of revolution.
Profile
<curve> Curve to be swept about the axis line.
EndCapsFlag
<boolean | string> (Optional) If not supplied then return a surface. Otherwise return a shell and add caps based on its value. Values of "top" or "bottom" cause just one of the caps to be generated.
ruledSrf( Crv1, Crv2, EndCapsFlg )
Returns
<surface | shell> Construct a surface from two curves by connecting the curves with a series of straight lines.
Crv1, Crv2
<curve> The two boundary curves of the surface.
EndCapsFlag
<boolean | string> (Optional) If not supplied then return a surface. Otherwise return a shell and add caps based on its value. Values of "top" or "bottom" cause just one of the caps to be generated.
boolSum( Top, Bottom, Left, Right )
Returns
<surface> Construct a surface from four boundary curves.
Top
<curve> Curve on top boundary (V = 0).
Bottom
<curve> Curve on bottom boundary (V = 1).
Left
<curve> Curve on left boundary (U = 0).
Right
<curve> Curve on right boundary (U = 1).
circTubeConstantWidth( Axis, Radius, EndCapsFlag )
Returns
<surface | shell> Creates a simple sweep of constant width and circular cross section.
Axis
<curve> The curve along which the circular cross section is to be swept.
Radius
<number> The radius of the circular cross section to use.
EndCapsFlag
<boolean | string> (Optional) If not supplied then return a surface. Otherwise return a shell and add caps based on its value. Values of "top" or "bottom" cause just one of the caps to be generated.
circTubeWithProfile( Axis, Profile, EndCapsFlag )
Returns
<surface | shell> Creates a sweep of variable width and circular cross section.
Axis
<curve> The curve along which the cross section is to be swept.
Profile
<curve> A curve specifying the scaling of the cross section as it is swept along the axis curve.
EndCapsFlag
<boolean | string> (Optional) If not supplied then return a surface. Otherwise return a shell and add caps based on its value. Values of "top" or "bottom" cause just one of the caps to be generated.
sweepConstantWidth( Axis, CrossSec, Scale, XInNormPlane, EndCapsFlg )
Returns
<surface | shell> Creates a sweep of constant width and arbitrary cross section.
Axis
<curve> The curve along which the cross section is to be swept.
CrossSec
<curve> The cross section curve that is to be swept along the axis curve.
Scale
<number> The cross section is to be scaled by this constant value before it is swept along the axis curve.
XInNormPlane
<geomVector | false> A vector giving the orientation to be used for the cross section at the first point of the axis curve. May be false, indicating no twisting of the cross-section.
EndCapsFlag
<boolean | string> (Optional) If not supplied then return a surface. Otherwise return a shell and add caps based on its value. Values of "top" or "bottom" cause just one of the caps to be generated.
sweepWithProfile( Axis, CrossSec, Profile, XInNormPlane, EndCapsFlg )
Returns
<surface | shell> Creates a sweep of variable width and arbitrary cross section.
Axis
<curve> The curve along which the cross section is to be swept.
CrossSec
<curve> The cross section curve that is to be swept along the axis curve.
Profile
<curve> A curve specifying the scaling of the cross section as it is swept along the axis curve.
XInNormPlane
<geomVector | false> A vector giving the orientation to be used for the cross section at the first point of the axis curve. May be false, indicating no twisting of the cross-section.
EndCapsFlag
<boolean | string> (Optional) If not supplied then return a surface. Otherwise return a shell and add caps based on its value. Values of "top" or "bottom" cause just one of the caps to be generated.
generalSweep( Axis, CrossSec, Param, BlendFlag, Profile, XInNormPlane, EndCapsFlag )
Returns
<surface | shell> Creates a sweep using blending of cross sections and/or variable scaling.
Axis
<curve> The curve along which the cross section is to be swept.
CrossSec
<curve | arrayOf curve> A curve specifying the cross section desired or an array containing cross section curves. (Blending information is in Param.)
Param
<number | arrayOf number> A single parameter value or an array of parameter values for cross-section placement. Values must be nondecreasing and in a particular range. If we are doing arc length blend, parameter values must be in the range 0..1, and if we are doing parameter blend they must be in the parametric domain of the axis curve.
BlendFlag
<string | false> If the CrossSec argument is a curve, then this argument should be false. Otherwise it should be "arc_length_blend" or "param_blend".
Profile
<curve | false> A curve specifying the scaling of the cross section as it is swept along the axis curve. No variable scaling is specified if this argument is false.
XInNormPlane
<geomVector | false> A vector giving the orientation to be used for the cross section at the first point of the axis curve. May be false, indicating no twisting of the cross-section.
EndCapsFlag
<boolean> (Optional) If not supplied then return a surface. Otherwise return a shell and add caps based on its value. Values of "top" or "bottom" cause just one of the caps to be generated.
rightCirCylSrf( Vertex, Height, Radius )
Returns
<surface> Creates a right circular cylinder surface. (The arguments are exactly the same as for rightCirCylinder, but this creates a surface instead of a primitive.)
Vertex
<euclidPoint> Point of origin of the cylinder.
Height
<geomVector> Vector indicating direction and height of the cylinder.
Radius
<number> Radius of the cylinder.
flatSrfBounds( uOrder, vOrder, Rows, Columns, Min, Max )
Returns
<surface> Create a surface which lies in the XY plane and has the given bounds and uniform parametrization.
uOrder, vOrder
<integer> The U and V order of the surface.
Rows, Columns
<integer> The number of control points in each direction. (Rows & columns)
Min, Max
<point> Points giving minimum and maximum X and Y coordinates of the surface.
flatSrf( uOrder, vOrder, Rows, Columns )
Returns
<surface> Create a surface which lies in the XY plane and has the bounds -1 .. 1 in both X and Y directions. It also has uniform parametrization.
uOrder, vOrder
<integer> The U and V order of the surface.
Rows, Columns
<integer> The number of control points in each direction. (Rows & columns)
axisProfileSection( Axis, Profile, CrossSec, EndCaps )
Returns
<surface | shell>
Axis
<line> Axis line along which to sweep cross-section.
Profile
<curve> Curve specifying the scaling of the cross-section as it is swept along the axis curve.
CrossSec
<curve> Cross-section curve.
EndCaps
<boolean | string> (Optional) If not supplied then return a surface. Otherwise return a shell and add caps based on its value. Values of "top" or "bottom" cause just one of the caps to be generated.
setSweepCrossSpread( CrossSpread )
Returns
<none> Sets the global variable that controls refinement to cross-section placement.
CrossSpread
<number> A real number. See documentation under "glob_cross_spread".
srfPt( Srf, Row, Column )
Returns
<point> Extracts a control point from a surface mesh.
Srf
<surface> The surface to be examined.
Row, Column
<integer> Row & column indices of the desired control point.
replaceSParmInfo( Srf, Dir, Order, EndCond )
Returns
<surface> Replace the parametric information of surface in one direction.
Srf
<surface> The surface for modification.
Dir
<string> The direction of parametric info to replace. ("row" or "col")
Order
<integer> The polynomial order of the surface in Dir.
EndCond
<string> The end condition type of the surface in Dir.
KnotVec
<knotVector | string> The knot vector of the surface in Dir. (knotVector or "kv_bezier", "kv_uniform" or "kv_chord")
vecSrf( Vec, baseRad, headRad )
Returns
<shell> Creates a shell representation of a vector.
Vec
<vector> The vector to be represented.
baseRad
<number> Optional argument specifying the radius of the base of the vector surface. Default value is 0.01.
headRad
<number> Optional argument specifying the radius of the head of the vector. Default value is 0.04 * length of Vec.

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