pw:: SurfaceFitter

The surface fitter mode type

Derives From

pw::Object pw::Mode

Notes

This mode is used to create and fit database surface entities.

To create a mode of this type, use the pw::Application.begin command with the mode SurfaceFit specified, like this:

set fitter [pw::Application begin SurfaceFit]
Summary
The surface fitter mode type
This attribute is the tolerance to use when splitting and joining the curves specified as the boundaries, for detecting end to end connections of the boundaries, and for creating the surface from the boundaries.
This attribute controls whether tangency at boundaries should be used to build a surface.
This attribute is a list of database entities to limit which can provide tangency information when calling createSurfacesFromCurves or createPatch.
This attribute is the tolerance to use when fitting surfaces to a cloud of points.
This attribute controls whether only the interior of a surface will be fitted.
This attribute specifies the percentage of length of the boundary curves of a created surface that must be database constrained to automatically set the fitting entities.
This action automatically creates new surfaces using the given curves as boundaries for Coons patches and trimmed planes.
This action creates a single surface patch between the given rails.
This action classifies how a surface was created during the last call to createSurfacesFromCurves or createPatch.
This action gets a list of vectors that represents the locations of any gaps discovered during the last call to createSurfacesFromCurves or createPatch.
This action gets a list of floats that represents the size of any gaps discovered during the last call to createSurfacesFromCurves or createPatch.
This action gets the list of pw::DatabaseEntity objects that a surface created in this mode will be fitted to when the fitter runs.
This action sets the list of pw::DatabaseEntity objects that a surface created in this mode will be fitted to when the fitter runs.
This action runs the surface fitter.
This action returns the number of steps completed by the last call to run.
This action gets the number of iterations of fitting for a particular surface created in this mode.
This action gets the RMS distance of the fit and point cloud for a particular surface created in this mode.
This action gets the dimension of the control points of the particular surface created in this mode.
This action gets the size of the point cloud used in the fit of the particular surface created in this mode.
This action gets the status of the fit for a particular surface created in this mode.

Instance Attributes

BoundaryTolerance

$fitter get/setBoundaryTolerance tol

This attribute is the tolerance to use when splitting and joining the curves specified as the boundaries, for detecting end to end connections of the boundaries, and for creating the surface from the boundaries.

Type

This attribute is a float with the range (0, infinity).

Default

The default for this attribute is the current fit tolerance based on the model size as returned by pw::Database.getFitTolerance.

UseBoundaryTangency

$fitter get/setUseBoundaryTangency useTangency

This attribute controls whether tangency at boundaries should be used to build a surface.

Type

This attribute is a boolean.

Default

The default for this attribute is false.

TangencyEntities

$fitter get/setTangencyEntities db_list

This attribute is a list of database entities to limit which can provide tangency information when calling createSurfacesFromCurves or createPatch.

Type

This attribute is a list of pw::DatabaseEntity objects

Default

The default for this attribute is an empty list, which means the tangency information will be used from any database entities that are associated with the curves and boundaries used to create surfaces.

FitTolerance

$fitter get/setFitTolerance tol

This attribute is the tolerance to use when fitting surfaces to a cloud of points.

Type

This attribute is a float with the range (0, infinity).

Default

The default for this attribute is the current fit tolerance based on the model size as returned by pw::Database.getFitTolerance.

FitInteriorOnly

$fitter get/setFitInteriorOnly interiorOnly

This attribute controls whether only the interior of a surface will be fitted.

Type

This attribute is a boolean.

Default

The default for this attribute is false.

FitEntitiesThreshold

$fitter get/setFitEntitiesThreshold tol

This attribute specifies the percentage of length of the boundary curves of a created surface that must be database constrained to automatically set the fitting entities.

Type

This attribute is a float with the range [0, 1].

Default

The default for this attribute is 0 which means that no fit entities will be set when a surface is created.

Instance Actions

createSurfacesFromCurves

$fitter createSurfacesFromCurves curves

This action automatically creates new surfaces using the given curves as boundaries for Coons patches and trimmed planes.  If the curve boundaries selected for a patch are coplanar, a trimmed plane will be constructed instead of a Coons patch.  If the curves boundaries have a single tangent pspace entity, a tangent quilt will be untrimmmed using the curve boundaries.

Parameters

curvesThis parameter is a list of pw::Curve objects and/or boundaries.

Returns

This action returns a list of new pw::DatabaseEntity objects, which may include pw::Surface and pw::Quilt objects.  Note that when creating a trimmed plane, several new entities will be created, but only the quilt will be returned.

Example

Code

# Automatic selection of database entities
set fitter [pw::Application begin SurfaceFitter]
$fitter setFitEntitiesThreshold .5
set surfs [$fitter createSurfacesFromCurves
[list $curve1 $curve2 $curve3 $curve4 $curve5 $curve6]]
$fitter run 10
$fitter end

See Also

pw::Database.createSurfacesFromCurves, which works similar to this action except that it does not allow as much control over the fitting process.

createPatch

$fitter createPatch ?-tolerance tol? ?-surfaceTolerance tol? ?-fitThreshhold threshold? ?-interior? rail1 rail2 rail3 rail4

This action creates a single surface patch between the given rails.  Each rail can be one or more curves and/or boundaries and do not necessarily need to match exactly end to end, but should come within the given tolerance of each other or intersect.  If an empty list is passed in for a rail, it will be marked as a pole while creating the Coons patch.

Parameters

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 a pw::Surface object.

Example

Code

# Automatic selection of database entities
set fitter [pw::Application begin SurfaceFitter]
$fitter setFitEntitiesThreshold .5
set surf [$fitter createPatch
[list $curve1] [list $curve2 $curve3]
[list $curve4] [list $curve5 $curve6]]
$fitter run 10
$fitter end

classifySurface

$fitter classifySurface surf

This action classifies how a surface was created during the last call to createSurfacesFromCurves or createPatch.

Parameters

surfThe pw::DatabaseEntity object to classify.  It is an error to provide an object that is not part of this mode.

Returns

This action returns a string with possible values TangencyPatch, CoonsPatch, TrimmedPatch and TrimmedPlane

getCurveGapXYZs

$fitter getCurveGapXYZs

This action gets a list of vectors that represents the locations of any gaps discovered during the last call to createSurfacesFromCurves or createPatch.

Parameters

This action has no parameters.

Returns

This action returns a list of vectors.

getCurveGapSizes

$fitter getCurveGapSizes

This action gets a list of floats that represents the size of any gaps discovered during the last call to createSurfacesFromCurves or createPatch.

Parameters

This action has no parameters.

Returns

This action returns a list of floats.

getFitEntities

$fitter getFitEntities surf

This action gets the list of pw::DatabaseEntity objects that a surface created in this mode will be fitted to when the fitter runs.

Parameters

surfThe pw::DatabaseEntity object to get the fit entities that are associated with it.  It is an error to provide an object that is not part of this mode.

Returns

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

setFitEntities

$fitter setFitEntities surf entities

This action sets the list of pw::DatabaseEntity objects that a surface created in this mode will be fitted to when the fitter runs.

Parameters

surfThe pw::DatabaseEntity object to set the fit entities that are associated with it.  It is an error to provide an object that is not part of this mode.
entitiesA list of pw::DatabaseEntity objects that should be fitted to.  It is valid to set this to an empty list, which means that the surface will not be fitted.

Returns

This action returns nothing.

Example

Code

set fitter [pw::Application begin SurfaceFitter]
set surfs [$fitter createSurfacesFromCurves -fitThreshold .5
[list $curve1 $curve2 $curve3 $curve4 $curve5 $curve6]
$fitter setFitEntities [lindex $surfs 0] [list $shell1 $shell2]
$fitter setFitEntities [lindex $surfs 1] [list $shell2 $shell3]
$fitter run 10
$fitter end

run

$fitter run ?steps?

This action runs the surface fitter.

Parameters

stepsThis optional parameter is the integer number of steps to run; the default is 1, and 0 is a special value that means the solver should run until stopped by the user or some other stop condition like surface tolerance.

Returns

This action returns nothing.

Information

This command supports progress updates.  Unlike most commands that support progress updates, if the user aborts this command, instead of reverting to the previous state the entities being solved will be left as is.

getCompletedSteps

$solver getCompletedSteps

This action returns the number of steps completed by the last call to run.

Parameters

This action has no parameters.

Returns

This action returns the integer number of steps completed.

getIterationCount

$fitter getIterationCount surf

This action gets the number of iterations of fitting for a particular surface created in this mode.

Parameters

surfThe pw::DatabaseEntity object to get the fit entities that are associated with it.  It is an error to provide an object that is not part of this mode.

Returns

This action returns an integer.

getRMSDistance

$fitter getRMSDistance surf

This action gets the RMS distance of the fit and point cloud for a particular surface created in this mode.

Parameters

surfThe pw::DatabaseEntity object to get the fit entities that are associated with it.  It is an error to provide an object that is not part of this mode.

Returns

This action returns a <real>.

getDimensions

$fitter getDimensions surf

This action gets the dimension of the control points of the particular surface created in this mode.

Parameters

surfThe pw::DatabaseEntity object to get the fit entities that are associated with it.  It is an error to provide an object that is not part of this mode.

Returns

This action returns the domain dimensions as a two element integer list.

getCloudSize

$fitter getCloudSize surf

This action gets the size of the point cloud used in the fit of the particular surface created in this mode.

Parameters

surfThe pw::DatabaseEntity object to get the fit entities that are associated with it.  It is an error to provide an object that is not part of this mode.

Returns

This action returns an integer.

getStatus

$fitter getStatus surf

This action gets the status of the fit for a particular surface created in this mode.

Parameters

surfThe pw::DatabaseEntity object to get the fit entities that are associated with it.  It is an error to provide an object that is not part of this mode.

Returns

This action returns a string.

$fitter get/setBoundaryTolerance tol
This attribute is the tolerance to use when splitting and joining the curves specified as the boundaries, for detecting end to end connections of the boundaries, and for creating the surface from the boundaries.
$fitter get/setUseBoundaryTangency useTangency
This attribute controls whether tangency at boundaries should be used to build a surface.
$fitter get/setTangencyEntities db_list
This attribute is a list of database entities to limit which can provide tangency information when calling createSurfacesFromCurves or createPatch.
$fitter createSurfacesFromCurves curves
This action automatically creates new surfaces using the given curves as boundaries for Coons patches and trimmed planes.
$fitter createPatch ?-tolerance tol? ?-surfaceTolerance tol? ?-fitThreshhold threshold? ?-interior? rail1 rail2 rail3 rail4
This action creates a single surface patch between the given rails.
$fitter get/setFitTolerance tol
This attribute is the tolerance to use when fitting surfaces to a cloud of points.
$fitter get/setFitInteriorOnly interiorOnly
This attribute controls whether only the interior of a surface will be fitted.
$fitter get/setFitEntitiesThreshold tol
This attribute specifies the percentage of length of the boundary curves of a created surface that must be database constrained to automatically set the fitting entities.
$fitter classifySurface surf
This action classifies how a surface was created during the last call to createSurfacesFromCurves or createPatch.
$fitter getCurveGapXYZs
This action gets a list of vectors that represents the locations of any gaps discovered during the last call to createSurfacesFromCurves or createPatch.
A vector is a list of float values.
$fitter getCurveGapSizes
This action gets a list of floats that represents the size of any gaps discovered during the last call to createSurfacesFromCurves or createPatch.
A float is a fractional number.
$fitter getFitEntities surf
This action gets the list of pw::DatabaseEntity objects that a surface created in this mode will be fitted to when the fitter runs.
Base type for all database entities
$fitter setFitEntities surf entities
This action sets the list of pw::DatabaseEntity objects that a surface created in this mode will be fitted to when the fitter runs.
$fitter run ?steps?
This action runs the surface fitter.
$solver getCompletedSteps
This action returns the number of steps completed by the last call to run.
$fitter getIterationCount surf
This action gets the number of iterations of fitting for a particular surface created in this mode.
$fitter getRMSDistance surf
This action gets the RMS distance of the fit and point cloud for a particular surface created in this mode.
$fitter getDimensions surf
This action gets the dimension of the control points of the particular surface created in this mode.
$fitter getCloudSize surf
This action gets the size of the point cloud used in the fit of the particular surface created in this mode.
$fitter getStatus surf
This action gets the status of the fit for a particular surface created in this mode.
Base type for all glyph types
The mode base type
pw::Application begin ?-mode_specific_flags? mode ?entities?
This action begins a mode in the application.
pw::Database getFitTolerance
This action gets the fit tolerance for database operations.
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.
Database curve type
Database surface type
Database quilt 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 boundary is reference to either a database curve or the edge of a database surface.
A string is an array of characters.
An integer is a whole number.