pw::Surface

Database surface type

Derives From

pw::Object pw::Entity pw::DatabaseEntity

Summary
pw::SurfaceDatabase surface type
Static Actions
createThis action creates a new surface object.
createFromCurvesThis action automatically creates new surfaces using the given curves as boundaries for Coons patches.
revolveSurfacesThis action creates a surface by revolving curves around another curve or axis.
joinThis action joins as many of the given surfaces together as possible.
Instance Actions
getPositionThis action gets the position in the defining space of the surface at the given parameter.
getXYZThis action gets the position of the surface in model space at the given parameter.
getBoundaryCountThis action gets the number of boundaries of the surface.
getBoundaryThis action gets a surface boundary.
getBoundaryIndexThis action returns the boundary index based on UV parameterization.
getBoundariesThis action gets a surface boundary list.
getInteriorCurvesThis action gets all the curves that are at least partially on the surface.
clearThis action sets the surface to the initial cleared state.
sweepThis action sets the surface by sweeping a curve by a vector.
interpolateThis action sets the surface by interpolating between the given curves.
patchThis action sets the surface by creating a patch between the given rails.
filletThis action sets the surface by connecting two curves using a polyconic.
revolveThis action creates a surface by revolving a curve around another curve or axis.
splineThis action sets this surface to a smooth interpolation of the control points of the given surface.
fitLSQThis action sets this surface to a least squares fit approximation of the given entities.
splitThis action splits the surface in the given direction at a given parameter value.
setOrientationThis action sets the orientation of this surface by specifying the umin and vmin edges of the surface.
alignOrientationThis action aligns the UV orientation of the given surfaces with this surface.
isClosedThis action checks if the surface is closed in the given direction.
isPoleThis action checks if the surface Edge is a pole.
getDiscontinuitiesThis action returns a list of parameters in the given direction at discontinuites with a bend angle greater than the given angle.
getXYZsAtParameterThis action gets a list of points along a constant parameter of a surface suitable for rendering.
getXYZsAtIntervalsThis action gets a list of points along the U- and V-intervals.
getIntervalParametersThis action gets the list of interval parameters in the U or V direction on a surface.

Static Actions

create

pw::Surface create

This action creates a new surface object.

Parameters

none

Returns

This action returns a new pw::Surface object.

createFromCurves

pw::Surface createFromCurves ?-tolerance tol? curves

This action automatically creates new surfaces using the given curves as boundaries for Coons patches.

Parameters

-tolerance tolThis optional parameter is the tolerance used for splitting and joining the curves and for creating the surface from the boundaries.  If not given, the current fit tolerance is used.
curvesThis parameter is a list of pw::Curve objects and/or boundaries.

Returns

This action returns a list of new pw::Surface objects.

See Also

pw::Database.createSurfacesFromCurves, which works similar to this action except that it makes trimmed planes instead of Coons patches when the input curves are planar.  pw::Surface.interpolate and pw::Surface.patch also create Coons patches with more explicit control over the boundary curves.

revolveSurfaces

pw::Surface revolveSurfaces ?-angle revolve? ?-tolerance tol? ?-reject rejectVars? generatrices < axis | point normal >

This action creates a surface by revolving curves around another curve or axis.

Parameters

-angle revolveThis optional parameter is the number of degrees to revolve the generatrix around the axis; [-360, 0), (0, 360], its default is 360.
-tolerance tolThis optional parameter is the fit tolerance; if it is not present the current fit tolerance is used.
-reject rejectVarThis optional parameter is the string name of the variable to receive the list of curves that failed to generate a revolved surface.
generatricesThis parameter is a list of pw::Curve objects or boundary references for the generatrix.
axisThis parameter is a pw::Curve object or boundary defining the axis.
pointThis parameter is the axis point.
normalThis parameter is a normalized vector along the axis of revolution.

Returns

This action returns a list of new pw::Surface objects.

join

pw::Surface join ?-reject rejectVar? ?-tolerance tol? surfs

This action joins as many of the given surfaces together as possible.

Parameters

-reject rejectVarThis optional parameter is a variable name to receive a list of pw::Surface objects that were not used in joining.
-tolerance tolThis optional parameter is the fit tolerance.
surfsThis parameter is a list of pw::Surface objects to join.

Returns

This action returns a list of the pw::Surface objects that were joined.

Information

This command supports progress updates.

Instance Actions

getPosition

$surface getPosition ?-parameter? value

This action gets the position in the defining space of the surface at the given parameter.

Parameters

-parameterThis optional parameter indicates to get the position at a parameter; the value is a uv parameter in the range [0.0, 1.0]; this is the default option.
valueThis parameter is the value at which to get the position.

Returns

This action returns a point giving the position on the surface (may be in the form “u v dbentity”).

getXYZ

$surface getXYZ ?-parameter? value

This action gets the position of the surface in model space at the given parameter.

Parameters

-parameterThis optional parameter indicates to get the xyz at a parameter; the value is a uv parameter [(0,0),(1,1)]; this is the default option.
valueThis parameter is the value at which to get the position.

Returns

This action returns an XYZ vector.

getBoundaryCount

$surface getBoundaryCount

This action gets the number of boundaries of the surface.

Parameters

none

Returns

This action returns the number of boundaries of the surface.

getBoundary

$surface getBoundary < index | boundary >

This action gets a surface boundary.

Parameters

indexThis parameter is the index of the boundary to get with the range [1, number of boundaries].
boundaryThis parameter is the parametric boundary with options < UMinimum | UMaximum | VMinimum | VMaximum >.

Returns

This action returns a boundary.

Information

The boundary index 1 corresponds to VMinimum, 2 corresponds to UMaximum, 3 corresponds to VMaximum and 4 corresponds to UMinimum.

getBoundaryIndex

$surface getBoundaryIndex ?< -U | -V >? parameter

This action returns the boundary index based on UV parameterization.

Parameters

-UThis indicates a boundary at a constant u parameter; the default.
-VThis indicates a boundary at a constant v parameter.
parameterThis parameter indicates if the caller wants the minimum or maximum of the parametric boundary.  Its options are < 0.0 | 1.0 >.

Returns

This action returns an index corresponding to the input direction and parameter.

getBoundaries

$surface getBoundaries

This action gets a surface boundary list.

Parameters

The action has no parameters.

Returns

This action returns a boundary list.

Information

getInteriorCurves

$surface getInteriorCurves

This action gets all the curves that are at least partially on the surface.  Curves along the boundary of the surface will be returned as well, but this function uses the name “interior” to differentiate from the boundary curves that are returned by getBoundary

Parameters

This action has no parameters.

Returns

This action returns a list of pw::Curve objects.

clear

$surface clear

This action sets the surface to the initial cleared state.

Parameters

This action has no parameters.

Returns

This action returns nothing.

sweep

$surface sweep ?-reverse? generatrix vector

This action sets the surface by sweeping a curve by a vector.

Parameters

-reverseThis optional paramter indicates to reverse the rail vector.
generatrixThis parameter is a pw::Curve object or boundary for the generatrix.
vectorThis parameter is the rail vector.

Returns

This action returns nothing.

interpolate

$surface interpolate ?-orient < Same | Opposite | Best >? ?-tolerance tol? rail1 rail2 ?rail3 rail4?

This action sets the surface by interpolating between the given curves.  If two curves are given a ruled surface is created.  If four curves are given a Coons patch is created with rail1 specifying the minimum u border and the rest of the rails arranged based on their ends being within the given tolerance, and the -orient flag is ignored.

Parameters

-orient < Same | Opposite | Best >This optional parameter specifies the orientation of the curves when interpolating two curves.  Same is the default, Best will choose the orientation that leads to the flatest surface.
-tolerance tolThis parameter is the fit tolerance; if it is not present the current fit tolerance is used.
rail1This parameter is a pw::Curve object or boundary for the first rail curve.
rail2This parameter is a pw::Curve object or boundary for the second rail curve.
rail3This parameter is a pw::Curve object or boundary for the third rail curve.
rail4This parameter is a pw::Curve object or boundary for the fourth rail curve.

Returns

This action returns nothing.

patch

$surface patch ?-tolerance tol? ?-surfaceTolerance tol? ?-fitTolerance tol? ?-fitInterior threshold? ?-fitEntities entities? ?-fitted fittedVar? rail1 rail2 rail3 rail4

This action sets the surface by creating a patch between the given rails.  The rails can be one or more curves and borders and do not necessarily need to match exactly end to end, but should come within the given tolerance of each other or intersect.

Parameter

-tolerance tolThis optional parameter is the tolerance used for splitting and joining the curves and for creating the surface from the boundaries.  If not given, the current fit tolerance is used.
-surfaceTolerance tolThis optional parameter is the tolerance used creating the surface from the boundaries.  If not given, the value of the -tolerance parameter is used.
-fitTolerance tolThis optional parameter is the tolerance used for fitting the surface to the database entities.  If not given, the current fit tolerance is used.
-fitInterior thresholdThis optional parameter is a float value with the range [0, 1] specifying the percentage of the boundary curves of a created surface that must be database constrained to trigger the interior to be fit to those database entities.  If this parameter is not given, no fitting will be done.
-fitEntities entitiesThis optional parameter is a list of pw::DatabaseEntity objects to limit fitting to.  If this parameter is not given, fitting will be done to the database entities that the rail curves lie on.
-fitted fittedVarThis optional parameter is a variable name to receive a boolean value if fitting was done to the patch.
rail1This parameter is a list of pw::Curve objects and/or boundaries for the first rail.
rail2This parameter is a list of pw::Curve objects and/or boundaries for the second rail.
rail3This parameter is a list of pw::Curve objects and/or boundaries for the third rail.
rail4This parameter is a list of pw::Curve objects and/or boundaries for the fourth rail.

Returns

This action returns nothing.

Examples

Code

# Simple coons surface w/ 4 curves
surf(patch1) [pw::Surface create]
$surf(patch1) patch [list $curve(1)] [list $curve(2)] \
    [list $curve(3)] [list $curve(4)]

# Coons surface with sharp angle along side
set ccrv(p1) [create2PtCurve {10 10 30} {11 15 30}]
set ccrv(p2) [create2PtCurve {11 15 30} {19 15 30}]
set ccrv(p3) [create2PtCurve {19 15 30} {20 10 30}]
set ccrv(p4) [create2PtCurve {10 0 30} {10 10 30}]
set ccrv(p5) [create2PtCurve {10 0 30} {20 0 30}]
set ccrv(p6) [create2PtCurve {20 0 30} {20 10 30}]
$surf(patch1) patch [list $ccrv(p1) $ccrv(p2) $ccrv(p3)] \
    [list $ccrv(p4)] [list $ccrv(p5)] [list $ccrv(p6)]

fillet

$surface fillet ?-rho rho? ?-tolerance tol? rail1 rail2 intersection ?spine?

This action sets the surface by connecting two curves using a polyconic.

Parameters

-rho rhoThis optional paramter is the rho of the polyconic; [0, .5) = ellipse, .5 = parabola, (.5, 1] = hyperbola, defaults to .5.
-tolerance tolThis optional parameter is the fit tolerance; if it is not present the current fit tolerance is used
rail1This parameter is a pw::Curve object or boundary for the first rail curve.
rail2This parameter is a pw::Curve object or boundary for the second rail curve.
intersectionThis parameter is a pw::Curve object or boundary for the intersection curve.
spineThis optional parameter is a pw::Curve object or boundary for the spine curve; defaults to the intersection curve.

Returns

This action returns nothing.

revolve

$surface revolve ?-angle revolve? ?-tolerance tol? generatrix < axis | point normal >

This action creates a surface by revolving a curve around another curve or axis.

Parameters

-angle revolveThis optional parameter is the number of degrees to revolve the generatrix around the axis; [-360, 0), (0, 360], default is 360.
-tolerance tolThis optional parameter is the fit tolerance; if it is not present the current fit tolerance is used.
generatrixThis parameter is a pw::Curve object or boundary for the generatrix.
axisThis parameter is a pw::Curve object or boundary for the axis.
pointThis parameter is the axis point.
normalThis parameter is a normalized vector along the axis of revolution.

Returns

This action returns nothing.

spline

$surface spline ?surface?

This action sets this surface to a smooth interpolation of the control points of the given surface.

Parameters

surfaceThis optional parameter is a pw::Surface object whose control points will be interpolated.  If not given the spline action will interpolate this surface’s own control points.

Returns

This action returns nothing.

fitLSQ

$surface fitLSQ ?-tolerance tol? ?-interior? ?entities?

This action sets this surface to a least squares fit approximation of the given entities.

Parameters

-tolerance tolThis optional parameter is the float approximation tolerance with the range [0, infinity).  The default is the current tolerance returned from <getFitTolerance>.
-interiorIf this optional flag is present, only the interior of the surface is fitted.
dbentitiesThis parameter is the optional list of database surface-like entities to fit to.  If none are given, fit to any currently enabled, visible database surface-like entities, not including itself.

Returns

This action returns nothing.

Information

As a first step to fitting, the surface’s control points will be projected in the direction of the surface normal at that location in both directions on to the given dbentities.  This will inform the fitting routine what will be fitted to.  Because of this, even if an entity is given in the dbentities list

Example

Code

set b1 [create2PtCurve {70 0 0} {75 0 5}]
set b2 [create2PtCurve {75 0 5} {75 10 5}]
set b3 [create2PtCurve {75 10 5} {70 10 0}]
set b4 [create2PtCurve {70 10 0} {70 0 0}]
set surf(fit) [pw::Surface createFromCurves [list $b1 $b2 $b3 $b4]]
$surf(fit) fitLSQ -interior

split

$surface split ?< -U | -V >? parameters

This action splits the surface in the given direction at a given parameter value.

Parameters

-UThis indicates to split at a constant u parameter; the default.
-VThis indicates to split at a constant v parameter.
parametersThese are the parameters at which to split; (0.0, 1.0)

Returns

This action returns a list of the new pw::Surface objects.

Information

Any duplicate parameters will be ignored, as will parameters at the limits of the surface.

setOrientation

$surf setOrientation u_edge v_edge

This action sets the orientation of this surface by specifying the umin and vmin edges of the surface.

Parameters

u_edgeThis parameter is the index or boundary to be used as the Umin Edge.
v_edgeThis parameter is the index or boundary to be used as the Vmin Edge.

Returns

This action returns nothing.

Information

For both the u_egde and v_edge the following boundary keywords or the associated index may be used: VMinimum = 1, UMaximum = 2, VMaximum = 3, UMinimum = 4.

alignOrientation

$surf alignOrientation ?-tolerance tol? surfaces

This action aligns the UV orientation of the given surfaces with this surface.  If any surfaces in the given list are not connected within the given tolerance to this surface, they will be ignored.

Parameters

-tolerance tolThis is the tolerance used to consider surfaces adjacent; it defaults to the fit tolerance.
surfacesThis parameter is a list of pw::Surface objects to align.

Returns

This action returns nothing.

isClosed

$surface isClosed ?< -U | -V >?

This action checks if the surface is closed in the given direction.

Parameters

-UThis indicates to check in the u direction; It is the default.
-VThis indicates to check in the v direction.

Returns

This action returns a boolean, which is true if the surface is closed in the given direction.

isPole

$surface isPole ?< -UMin | -UMax | -VMin | -VMax >?

This action checks if the surface Edge is a pole.

Parameters

-UMinThis indicates to check the u minimum Edge; it is the default.
-UMaxThis indicates to check the u maximum Edge.
-VMinThis indicates to check the v minimum Edge.
-VMaxThis indicates to check the v maximum Edge.

Returns

This action returns a boolean, which is true if the given surface Edge is a pole.

getDiscontinuities

$surface getDiscontinuities ?< -U | -V >? ?angle?

This action returns a list of parameters in the given direction at discontinuites with a bend angle greater than the given angle.

Parameters

-UReturn parameters at discontinuities in the u direction; it is the default.
-VReturn parameters at discontinuities in the v direction.
angleAll discontinuies with a bend angle greater than this given angle will be returned; the default is 0.0 which will return all discontinuities.

Returns

This action returns a list of parameters at discontinuities.

getXYZsAtParameter

$surface getXYZsAtParameter ?< -U | -V >? parameter

This action gets a list of points along a constant parameter of a surface suitable for rendering.

Parameters

-UExtract points on a constant u parameter; it is the default.
-VExtract points on a constant v parameter.
parameterThis is the parameter to render at; (0.0, 1.0).

Returns

This action returns a list of the xyz points.

getXYZsAtIntervals

$surface getXYZsAtIntervals ?dimensionVar?

This action gets a list of points along the U- and V-intervals.

Parameters

dimensionVara string that signifies the variable to receive the number of U intervals and V intervals (specified as a list of 2 integer values)

Returns

This action returns xyz points representing constant U- and V-parameter lines at the surface’s intervals.  The result will be a list of lines, with each line specified as a list of XYZ vector values.  The number of lines will be equal to the number of U- and V-intervals (ie, the sum of the values returned in dimensionVar).  The U-interval lines will be listed first, followed by the V-interval lines.

getIntervalParameters

$surface getIntervalParameters ?< -U | -V >

This action gets the list of interval parameters in the U or V direction on a surface.

Parameters

-UInterval parameters in the U direction; it is the default.
-VInterval parameters in the V direction.

Returns

This action returns a list of parameters for the specified direction.

pw::Surface create
This action creates a new surface object.
pw::Surface createFromCurves ?-tolerance tol? curves
This action automatically creates new surfaces using the given curves as boundaries for Coons patches.
pw::Surface revolveSurfaces ?-angle revolve? ?-tolerance tol? ?-reject rejectVars? generatrices < axis | point normal >
This action creates a surface by revolving curves around another curve or axis.
pw::Surface join ?-reject rejectVar? ?-tolerance tol? surfs
This action joins as many of the given surfaces together as possible.
$surface getPosition ?-parameter? value
This action gets the position in the defining space of the surface at the given parameter.
$surface getXYZ ?-parameter? value
This action gets the position of the surface in model space at the given parameter.
$surface getBoundaryCount
This action gets the number of boundaries of the surface.
$surface getBoundary < index | boundary >
This action gets a surface boundary.
A boundary is reference to either a database curve or the edge of a database surface.
$surface getBoundaryIndex ?< -U | -V >? parameter
This action returns the boundary index based on UV parameterization.
$surface getBoundaries
This action gets a surface boundary list.
$surface getInteriorCurves
This action gets all the curves that are at least partially on the surface.
$surface clear
This action sets the surface to the initial cleared state.
$surface sweep ?-reverse? generatrix vector
This action sets the surface by sweeping a curve by a vector.
$surface interpolate ?-orient < Same | Opposite | Best >? ?-tolerance tol? rail1 rail2 ?rail3 rail4?
This action sets the surface by interpolating between the given curves.
$surface patch ?-tolerance tol? ?-surfaceTolerance tol? ?-fitTolerance tol? ?-fitInterior threshold? ?-fitEntities entities? ?-fitted fittedVar? rail1 rail2 rail3 rail4
This action sets the surface by creating a patch between the given rails.
$surface fillet ?-rho rho? ?-tolerance tol? rail1 rail2 intersection ?spine?
This action sets the surface by connecting two curves using a polyconic.
$surface revolve ?-angle revolve? ?-tolerance tol? generatrix < axis | point normal >
This action creates a surface by revolving a curve around another curve or axis.
$surface spline ?surface?
This action sets this surface to a smooth interpolation of the control points of the given surface.
$surface fitLSQ ?-tolerance tol? ?-interior? ?entities?
This action sets this surface to a least squares fit approximation of the given entities.
$surface split ?< -U | -V >? parameters
This action splits the surface in the given direction at a given parameter value.
$surf setOrientation u_edge v_edge
This action sets the orientation of this surface by specifying the umin and vmin edges of the surface.
$surf alignOrientation ?-tolerance tol? surfaces
This action aligns the UV orientation of the given surfaces with this surface.
$surface isClosed ?< -U | -V >?
This action checks if the surface is closed in the given direction.
$surface isPole ?< -UMin | -UMax | -VMin | -VMax >?
This action checks if the surface Edge is a pole.
$surface getDiscontinuities ?< -U | -V >? ?angle?
This action returns a list of parameters in the given direction at discontinuites with a bend angle greater than the given angle.
$surface getXYZsAtParameter ?< -U | -V >? parameter
This action gets a list of points along a constant parameter of a surface suitable for rendering.
$surface getXYZsAtIntervals ?dimensionVar?
This action gets a list of points along the U- and V-intervals.
$surface getIntervalParameters ?< -U | -V >
This action gets the list of interval parameters in the U or V direction on a surface.
Base type for all glyph types
Entity type
Base type for all database entities
Database surface type
Database curve type
pw::Database createSurfacesFromCurves ?-tolerance tol? ?-surfaceTolerance tol? ?-fitTolerance tol? ?-fitInterior threshold? ?-fitEntities entities? ?-fittedSurfaces fittedVar? curves
This action automatically creates new surfaces using the given curves as boundaries for Coons patches and trimmed planes.
A string is an array of characters.
A point is a position either in model space or database parameter space.
A vector is a list of float values.
A float is a fractional number.
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.
Close