pw:: DatabaseMesher

The database mesher mode type

Derives From

pw::Object pw::Mode

Notes

This mode is used to create grid entities on database entities.

Unlike other modes, the state of the mode is saved when it is ended and subsequent modes will be created with the same state.  This state is also saved in the application project file, so a new mode created after a file is loaded will have the same state as the last mode ended before saving the file.

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

set mesher [pw::Application begin DatabaseMesher $models]
Summary
The database mesher mode type
This attribute is the tolerance to use when merging connectors.
This attribute is the turning angle to use when joining domains.
This attribute is the preferred method for setting the minimum spacing.
This attribute is the minimum number of mesh subdivisions per database boundary.
This attribute is the minimum edge spacing for the mesh.
This attribute is the preferred method for setting the maximum spacing.
This attribute is the maximum number of mesh subdivisions per the extents of the entities being meshed.
This attribute is the maximum edge spacing for the mesh.
This attribute is the curvature angle resolution in degrees.
This attribute specifies the maximum aspect ratio.
This attribute specifies the boundary growth rate.
This attribute determines the algorithm to use when meshing domains.
This attribute is the refinement factor used to globally scale the parameters of the mesher in order to increase the refinement.
This attribute is the ratio between the number of subdivisions used to detect domains that can be initialized from structured domains.
This attribute controls how nearby boundaries influence clustering on a surface.
This attribute is the turning angle to use when grouping boundaries.
This attribute is the ratio between the surface and curve curvature along a boundary to use when detecting Curvature boundaries.
This attribute controls whether TRex growth should occur along curvature manifold boundaries.
This attribute is the factor used to scale the spacing of curvature manifold boundaries.
This attribute is the angle between normals to use when detecting Convex and Concave manifold boundaries.
This attribute controls whether TRex growth should occur along convex manifold boundaries.
This attribute is the factor used to scale the spacing of convex manifold boundaries.
This attribute controls whether TRex growth should occur along concave manifold boundaries.
This attribute is the factor used to scale the spacing of concave manifold boundaries.
This attribute is the metric threshold for domain area ratio.
This attribute is the metric threshold for domain aspect ratio.
This attribute is the metric threshold for domain maximum angle.
This attribute controls whether any pre-existing domains constrained to the quilts in the mode are retained or destroyed.
This action gets the extents of the models of the mode.
This action gets the quilt boundary group with the minimum length.
This action gets the length of the minimum boundary group.
This action gets a list of symmetry loops, where each loop is a list of quilt boundaries that are lamina and lie on a symmetry plane.
This action gets a list of lamina quilt boundary lists of a certain classification.
This action gets a list of manifold quilt boundary lists of a certain classification.
This action creates grid entities on the database entities of this mode.
This action gets a list of database entities that a surface mesh was not able to be constructed on during the <createSurfaceMesh> action.
This action gets a list of domains that are dependent upon the quilts included in the mode.
This action gets a list of sources that are dependent upon the quilts included in the mode.
This action gets whether or not a created unstructured domain was mapped to a structured domain.
This action returns a list of supported filter type names.
This action adds a new, mesher mode filter to a filter queue.
This action deletes a filter.
This action returns a list of filter names defined in the mesher mode filter_type.
This action returns the number of filters of the given filter_type defined in the mesher mode.
This action gets the definition of a filter identified by index or name.
This action gets a list of all filter definitions of the given filter_type.
This action matches the name of each mode entity against the filter patterns in filter priority order and returns the match count for each filter.
This action sets the priority of one or more existing filters.
This action sets the patterns of an existing filters.
This action modifies filter patterns as needed to guarantee that the entities in dbentity_list are captured by the specified filter.
This action sets a filter’s value.
This action renames a filter.

Instance Attributes

MergeTolerance

$mesher get/setMergeTolerance tol

This attribute is the tolerance to use when merging connectors.

Type

This attribute is a float with the range [0, infinity), where 0 means no merging will be done.

Default

The default for this attribute is 0.

JoinDomainAngle

$mesher get/setJoinDomainAngle angle

This attribute is the turning angle to use when joining domains.  This is only applicable to unstructured domains

Type

This attribute is a float with the range [0, 180), where 0 means no joining will be done.

Default

The default for this attribute is 0.

MinimumSpacingMode

$mesher get/setMinimumSpacingMode mode

This attribute is the preferred method for setting the minimum spacing.

Type

This attribute is of type string with values < Subdivisions | Spacing >.

Default

The default for this attribute is Subdivisions.

Information

This attribute will be set to match the last attribute set between MinimumBoundarySubdivisions and MinimumEdgeSpacing.

MinimumBoundarySubdivisions

This attribute is the minimum number of mesh subdivisions per database boundary.

Type

This attribute is an integer with the range [2, inf) that specifies the minimum number of boundary subdivisions.

Default

The default for this attribute is 2.

Information

This attribute and the MinimumEdgeSpacing attribute will be adjusted to match each other depending on the last one set, and the MinimumSpacingMode will be set to Subdivisions.

MinimumEdgeSpacing

$mesher get/setMinimumEdgeSpacing spacing

This attribute is the minimum edge spacing for the mesh.

Type

This attribute is a positive float that specifies the minimum edge spacing for the mesh.

Default

The default for this attribute is the minimum edge spacing based on the default for the <MinimumBoundarySubdivision> attribute.

Information

This attribute and the MinimumBoundarySubdivisions attribute will be adjusted to match each other depending on the last one set, and the MinimumSpacingMode will be set to Spacing.

MaximumSpacingMode

$mesher get/setMaximumSpacingMode mode

This attribute is the preferred method for setting the maximum spacing.

Type

This attribute is of type string with values < Subdivisions | Spacing >.

Default

The default for this attribute is Subdivisions.

Information

This attribute will be set to match the last attribute set between MaximumExtentsSubdivisions and MaximumEdgeSpacing.

MaximumExtentsSubdivisions

$mesher get/setMaximumExtentsSubdivisions subdivisions

This attribute is the maximum number of mesh subdivisions per the extents of the entities being meshed.

Type

This attribute is an integer with the range [2, inf) that specifies the maximum number of mesh subdivisions.

Default

The default for this attribute is 150.

Information

This attribute and the MaximumEdgeSpacing attribute will be adjusted to match each other depending on the last one set, and the MaximumSpacingMode will be set to Subdivisions.

MaximumEdgeSpacing

$mesher get/setMaximumEdgeSpacing spacing

This attribute is the maximum edge spacing for the mesh.

Type

This attribute is a positive float that specifies the maximum edge spacing for the mesh.

Default

The default for this attribute is the maximum spacing based on the default for the <MaximumExtentsSubdivision> attribute.

Information

This attribute and the MaximumExtentsSubdivisions attribute will be adjusted to match each other depending on the last one set, and the MaximumSpacingMode will be set to Spacing.

CurvatureResolutionAngle

$mesher get/setCurvatureResolutionAngle angle

This attribute is the curvature angle resolution in degrees.

Type

This attribute is a float with the range [0, 180), where 0 means the curvature resolution will not be applied.

Default

The default for this attribute is 15.

MaximumAspectRatio

$mesher get/setMaximumAspectRatio ratio

This attribute specifies the maximum aspect ratio.

Type

This attribute is a float with the range [0, infinity), where 0 means the aspect ratio will not be enforced.

Default

The default for this attribute is 10.

BoundaryGrowthRate

$mesher get/setBoundaryGrowthRate rate

This attribute specifies the boundary growth rate.

Type

This attribute is a float with the range [1.0, 2.0].

Default

The default for this attribute is 1.2.

DomainAlgorithm

$mesher get/setDomainAlgorithm < AdvancingFront | QuadDominant >

This attribute determines the algorithm to use when meshing domains.

Type

This attribute is of type string with values < AdvancingFront | QuadDominant >.

Default

The default for this attribute is AdvancingFront.

RefinementFactor

$mesher get/setRefinementFactor factor

This attribute is the refinement factor used to globally scale the parameters of the mesher in order to increase the refinement.

Type

This attribute is a float with the range [0.125, 8], where 1 means no refinement, 2 means 2x refinement, 0.5 means 2x coarser, etc.

Default

The default for this attribute is 1.

MappedSurfaceSubdivisionRatio

$mesher get/setMappedSurfaceSubdivisionRatio factor

This attribute is the ratio between the number of subdivisions used to detect domains that can be initialized from structured domains.

Type

This attribute is a float with the range [0, infinity), where a value of 0.0 disables thin surface detection.

Default

The default for this attribute is 10.

BoundaryProximityInfluence

$mesher get/setBoundaryProximityInfluence < Orientation | All | None >

This attribute controls how nearby boundaries influence clustering on a surface.

Type

This attribute is of type string with values < Orientation | All | None >.

Default

The default for this attribute is Orientation.

Note

If the value is set to All, then all boundaries influence the mesh on a surface.  If the value is set to None, then no boundaries influence the mesh.  If the value is set to the default value of Orientation, then a boundary only contributes to the clustering on the surface if the majority of the boundary is on the outward side of the surface.  For example, this would prevent boundaries on a wing pylon from influencing the clustering on the other side of the wing.  Be aware that this computation can be very expensive for very large numbers of surfaces.

BoundaryGroupAngle

$mesher get/setBoundaryGroupAngle angle

This attribute is the turning angle to use when grouping boundaries.  A connector will be built on each boundary group.

Type

This attribute is a float with the range [0, 180), where 0 means no grouping will be done.

Default

The default for this attribute is 40.

BoundaryCurvatureRatio

$mesher get/setBoundaryCurvatureRatio ratio

This attribute is the ratio between the surface and curve curvature along a boundary to use when detecting Curvature boundaries.

Type

This attribute is a float with the range [0, infinity), where 0 means no Curvature boundaries will be detected.

Default

The default for this attribute is 2.5.

BoundaryCurvatureUseGrowth

$mesher get/setBoundaryCurvatureUseGrowth growth

This attribute controls whether TRex growth should occur along curvature manifold boundaries.

Type

This attribute is a boolean.

Default

The default for this attribute is True.

BoundaryCurvatureSpacingFactor

$mesher get/setBoundaryCurvatureSpacingFactor factor

This attribute is the factor used to scale the spacing of curvature manifold boundaries.

Type

This attribute is a float with the range (0, 1], where 1 means no refinement, 0.5 means 2x refinement, etc.

Default

The default for this attribute is 1.

BoundaryHardAngle

$mesher get/setBoundaryHardAngle angle

This attribute is the angle between normals to use when detecting Convex and Concave manifold boundaries.

Type

This attribute is a float with the range [0, 180), where 0 means no Convex and Concave boundaries will be detected.

Default

The default for this attribute is 45.

BoundaryConvexUseGrowth

$mesher get/setBoundaryConvexUseGrowth growth

This attribute controls whether TRex growth should occur along convex manifold boundaries.

Type

This attribute is a boolean.

Default

The default for this attribute is True.

BoundaryConvexSpacingFactor

$mesher get/setBoundaryConvexSpacingFactor factor

This attribute is the factor used to scale the spacing of convex manifold boundaries.

Type

This attribute is a float with the range (0, 1], where 1 means no refinement, 0.5 means 2x refinement, etc.

Default

The default for this attribute is 1.

BoundaryConcaveUseGrowth

$mesher get/setBoundaryConcaveUseGrowth growth

This attribute controls whether TRex growth should occur along concave manifold boundaries.

Type

This attribute is a boolean.

Default

The default for this attribute is False.

BoundaryConcaveSpacingFactor

$mesher get/setBoundaryConcaveSpacingFactor factor

This attribute is the factor used to scale the spacing of concave manifold boundaries.

Type

This attribute is a float with the range (0, 1], where 1 means no refinement, 0.5 means 2x refinement, etc.

Default

The default for this attribute is 0.5.

DomainAreaRatioThreshold

$mesher get/setDomainAreaRatioThreshold threshold

This attribute is the metric threshold for domain area ratio.

Type

This attribute is a float with the range [1, inf)

Default

The default for this attribute is 1.0.

Information

This attribute has no effect on the meshing algorithm, and is used by the GUI when displaying metrics on the resulting mesh.

DomainAspectRatioThreshold

$mesher get/setDomainAspectRatioThreshold threshold

This attribute is the metric threshold for domain aspect ratio.

Type

This attribute is a float with the range [1, inf)

Default

The default for this attribute is 1.0.

Information

This attribute has no effect on the meshing algorithm, and is used by the GUI when displaying metrics on the resulting mesh.

DomainMaximumAngleThreshold

$mesher get/setDomainMaximumAngleThreshold threshold

This attribute is the metric threshold for domain maximum angle.

Type

This attribute is a float with the range [1, inf)

Default

The default for this attribute is 1.0.

Information

This attribute has no effect on the meshing algorithm, and is used by the GUI when displaying metrics on the resulting mesh.

KeepExistingDomains

$mesher get/setKeepExistingDomains value

This attribute controls whether any pre-existing domains constrained to the quilts in the mode are retained or destroyed.  If this attribute is true (the default) and new grid entities are created through the createGridEntities function, then any previously existing domains that were constrained to the models’ quilts will be destroyed, along with any blocks that used those domains and any connectors that were used exclusively by those domains.

Type

This attribute is a boolean value.

Default

The default for this attribute is false.

Instance Actions

getExtents

$mesher getExtents

This action gets the extents of the models of the mode.

Parameters

This action has no parameters.

Returns

This action returns a list of two vectors representing the min and max points of the extents.

Example

Code

# $mesher is a DatabaseMesher mode
puts [$mesher getExtents]

Output

{-1.0408340855860843e-16 -8.537024980200823e-18 1.0376479089327297} {1.3993905942253984 0.5000000036000275 1.1816511795199895}

getMinimumBoundaryGroup

$mesher getMinimumBoundaryGroup

This action gets the quilt boundary group with the minimum length.

Parameters

This action has no parameters.

Returns

This action returns a list of quilt boundaries forming the group with the minimum length.

Example

Code

# $mesher is a DatabaseMesher mode
puts [$mesher getMinimumBoundaryGroup]

Output

{::pw::Quilt_1 1}

getMinimumBoundaryGroupLength

$mesher getMinimumBoundaryGroupLength

This action gets the length of the minimum boundary group.

Parameters

This action has no parameters.

Returns

This action returns a float minimum length.

Example

Code

# $mesher is a DatabaseMesher mode
puts [$mesher getMinimumBoundaryGroupLength]

Output

5.9917162670408274e-5

getSymmetryLoops

$mesher getSymmetryLoops ?symmetry?

This action gets a list of symmetry loops, where each loop is a list of quilt boundaries that are lamina and lie on a symmetry plane.

Parameters

symmetryThis optional parameter is a string with options < MinimumX | MaximumX | MinimumY | MaximumY | MinimumZ | MaximumZ > that specifies the symmetry plane to get the boundary loops for.  If not given, the boundary loops for all symmetry planes are returned.

Returns

This action returns a list of quilt boundary lists.

Example

Code

# $mesher is a DatabaseMesher mode
foreach sym {{} MinimumX MaximumX MinimumY MaximumY MinimumZ MaximumZ} {
set loops [$mesher getSymmetryLoops {*}$sym]
puts [format "%-10.10s: %s" $sym $loops]
}

Output

          :
MinimumX :
MaximumX :
MinimumY :
MaximumY :
MinimumZ :
MaximumZ :

getLaminaBoundaryGroups

$mesher getLaminaBoundaryGroups classify

This action gets a list of lamina quilt boundary lists of a certain classification.

Parameters

classifyThis parameter is a string with options < Symmetry | NonSymmetry | Curvature > of the classification of the boundaries to retrieve.

Returns

This action returns a list of quilt boundary lists.

Note

It is possible for boundary groups to be classified as both Curvature and Symmetry or NonSymmetry, but Symmetry and NonSymmetry groups will always be distinct.  Also, the Symmetry groups will be returned as loops using the getSymmetryLoops action.

Example

Code

# $mesher is a DatabaseMesher mode
foreach classifyType {Symmetry NonSymmetry Curvature} {
puts [format "%12.12s: %s" $classifyType [$mesher getLaminaBoundaryGroups $classifyType]]
}

Output

   Symmetry:
NonSymmetry:
Curvature:

getManifoldBoundaryGroups

$mesher getManifoldBoundaryGroups classify

This action gets a list of manifold quilt boundary lists of a certain classification.  Since all of the boundaries returned are manifold, they will be organized in pairs of boundaries that are topologically the same, one from each neighboring quilt.

Parameters

classifyThis parameter is a string with options < None | Curvature | Convex | Concave > of the classification of the boundaries to retrieve.

Returns

This action returns a list of quilt boundary lists.

Example

Code

# $mesher is a DatabaseMesher mode
foreach classify {None Curvature Convex Concave} {
set grps [$mesher getManifoldBoundaryGroups $classify]
puts "$classify:"
if { 0 == [llength $grps] } {
lappend grps {<none>}
}
foreach grp $grps {
puts " $grp"
}
}

Output

None:
{::pw::Quilt_3 3} {::pw::Quilt_8 4}
{::pw::Quilt_5 3} {::pw::Quilt_6 2}
{::pw::Quilt_6 4} {::pw::Quilt_7 2}
{::pw::Quilt_7 4} {::pw::Quilt_8 2}
Curvature:
<none>
Convex:
{::pw::Quilt_1 1} {::pw::Quilt_2 1}
{::pw::Quilt_1 2} {::pw::Quilt_3 1}
...SNIP...
{::pw::Quilt_4 5} {::pw::Quilt_6 3}
{::pw::Quilt_4 6} {::pw::Quilt_5 2}
Concave:
<none>

createGridEntities

$mesher createGridEntities ent_type

This action creates grid entities on the database entities of this mode.  The current settings of the mode will control how the connectors, domains, and/or blocks will be created and the parameters to use.  The grid entities created by previous invocations of this action will be deleted as part of the process.

Parameters

ent_typeThis parameter is the string type of the highest level of grid entities to create with options < Connector | Domain >.

Returns

This action returns a list of new pw::Connector or pw::Domain objects, depending on the ent_type parameter.

See Also

pw::Connector.createOnDatabase, pw::DomainStructured.createOnDatabase and pw::DomainUnstructured.createOnDatabase, which work similar to this action except that it does not allow as much control over the process.

Example

Code

# $mesher is a DatabaseMesher mode
foreach ent_type {Domain} {
set ents [$mesher createGridEntities $ent_type]
foreach ent $ents {
puts " $ent ([$ent getName])"
}
}

Output

::pw::DomainUnstructured_1 (dom-1)
::pw::DomainUnstructured_2 (dom-2)
::pw::DomainUnstructured_3 (dom-3)
::pw::DomainUnstructured_4 (dom-4)
::pw::DomainUnstructured_5 (dom-5)
::pw::DomainUnstructured_6 (dom-6)
::pw::DomainUnstructured_7 (dom-7)
::pw::DomainUnstructured_8 (dom-8)
::pw::DomainStructured_1 (dom-9)

getRejectedEntities

$mesher getRejectedEntities

This action gets a list of database entities that a surface mesh was not able to be constructed on during the <createSurfaceMesh> action.

Parameters

This action has no parameters.

Returns

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

Example

Code

# $mesher is a DatabaseMesher mode
puts "rejected: [$mesher getRejectedEntities]"

Output

rejected:

getExistingDomains

$mesher getExistingDomains

This action gets a list of domains that are dependent upon the quilts included in the mode.  If <createSurfaceMesh> is called and the mode is ended through the <end> call, these domains, along with any connectors used exclusively by the domains, will be destroyed.

Parameters

This action has no parameters.

Returns

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

getExistingSources

$mesher getExistingSources

This action gets a list of sources that are dependent upon the quilts included in the mode.  If <createSurfaceMesh> is called and the mode is ended through the <end> call, these sources will be destroyed.

Parameters

This action has no parameters.

Returns

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

getMappingResult

$mesher getMappingResult ?-details detailVar? domain

This action gets whether or not a created unstructured domain was mapped to a structured domain.  It also optionally provides details as to why a domain was not mapped.

Parameters

domainThis argument is expected to be pw::DomainUnstructured object created by the mode.
-detailsIf present, this flag specifies a variable to receive details of the result.  If the domain was mapped, this description will be the name of the structured domain to which the domain was mapped along with the point dimension ratio used to evaluate whether it could be mapped.  If the domain was not mapped, this description will provide a brief description of why the domain was not mapped.

Returns

This action returns a boolean value of true if the domain was mapped.

getFilterTypes

$mesher getFilterTypes

This action returns a list of supported filter type names.

Parameters

This action has no parameters.

Returns

A list of strings of the filter type names.  These names are suitable for use as -type filter_type parameters.

Example

Code

# $mesher is a DatabaseMesher mode
puts "\$mesher getFilterTypes: [list [$mesher getFilterTypes]]"

Output

$mesher getFilterTypes: MaximumEdgeSpacing

addFilter

$mesher addFilter ?-type filter_type? ?-priority < index | name >? ?-name name? value ?pattern_list?

This action adds a new, mesher mode filter to a filter queue.

Parameters

-type filter_typeThis optional parameter specifies the string type of the value parameter.  One of < MaximumEdgeSpacing >.  Each filter_type has an associated filter queue.
-priority < index | name >This optional parameter specifies the priority of the new filter.  The new filter will be inserted into the filter_type queue before the (existing) filter identified by its integer index or string name.  If not specified, the new filter is appended to the filter queue (lowest priority).
-name nameThis optional parameter is the string filter name.  If not provided, a unique “filter-N” name will be assigned.
valueThis required parameter is the filter’s value.
pattern_listThis optional parameter defines the list of string patterns that will be used to match against database entity names.  The default is an empty list (matches nothing).

Returns

This action returns the name of the added filter.

Notes

When applying filters, each entity’s name is matched against each filter in a queue.  Within a queue, each filter is tried in priority order.  The first match within a queue stops searching, applies the filter to the matched entity, and then continues matching with the next filter queue.

MaximumEdgeSpacing filters are matched against quilts.  For each match, a quilt source with the specified max edge length is created.

Ranges

MaximumEdgeSpacingvalue is a float in the range [0, infinity).

See Also

getFilterDefinition, getFilterDefinitions

Example

Code

# $mesher is a DatabaseMesher mode
$mesher addFilter -name F3 0.3 {quilt-1* quilt-2 quilt-4 !quilt-11}
$mesher addFilter -priority 1 -name F1 0.1 {quilt-4 quilt-5}
$mesher addFilter -priority F3 -name F2 0.2 quilt-3

puts "\$mesher getFilterDefinitions -dict"
dict for {priority filterDefn} [$mesher getFilterDefinitions -dict] {
puts "$priority [list $filterDefn]"
dict for {key val} $filterDefn {
puts [format " %-10.10s = %-s" $key $val]
}
puts ""
}

# Global filter always exists and always lowest priority
puts "\$mesher addFilter -name Global 0.2 bad*"
catch {$mesher addFilter -name Global 0.2 bad*} err
puts $err

Output

$mesher getFilterDefinitions -dict
1 {Type MaximumEdgeSpacing Priority 1 Name F1 Value 0.1 Patterns {quilt-4 quilt-5}}
Type = MaximumEdgeSpacing
Priority = 1
Name = F1
Value = 0.1
Patterns = quilt-4 quilt-5

2 {Type MaximumEdgeSpacing Priority 2 Name F2 Value 0.2 Patterns quilt-3}
Type = MaximumEdgeSpacing
Priority = 2
Name = F2
Value = 0.2
Patterns = quilt-3

3 {Type MaximumEdgeSpacing Priority 3 Name F3 Value 0.3 Patterns {quilt-1* quilt-2 quilt-4 !quilt-11}}
Type = MaximumEdgeSpacing
Priority = 3
Name = F3
Value = 0.3
Patterns = quilt-1* quilt-2 quilt-4 !quilt-11

4 {Type MaximumEdgeSpacing Priority 4 Name Global Value 0.0 Patterns *}
Type = MaximumEdgeSpacing
Priority = 4
Name = Global
Value = 0.0
Patterns = *

$mesher addFilter -name Global 0.2 bad*
ERROR: Filter Global already exists.

deleteFilter

$mesher deleteFilter ?-type filter_type? < index | name >

This action deletes a filter.

Parameters

-type filter_typeThis optional parameter specifies the string filter type.  One of < MaximumEdgeSpacing >.
indexThis parameter is the integer index of the filter in the range [1, number of filters].
nameThis parameter is the string filter name.

Returns

This action returns nothing.

See Also

addFilter, getFilterDefinition, getFilterDefinitions

Example

Code

# $mesher is a DatabaseMesher mode
puts "\$mesher addFilter F1 0.1 {quilt-1*}"
$mesher addFilter F1 0.1 {quilt-1*}

puts "\$mesher addFilter F2 0.2 {quilt-2*}"
$mesher addFilter F2 0.2 {quilt-2*}
puts "\$mesher getFilterCount: [$mesher getFilterCount]"

puts "\$mesher deleteFilter F1"
$mesher deleteFilter F1
puts "\$mesher getFilterCount: [$mesher getFilterCount]"

puts "\$mesher deleteFilter F2"
$mesher deleteFilter F2
puts "\$mesher getFilterCount: [$mesher getFilterCount]"

puts "\$mesher deleteFilter F1"
catch {$mesher deleteFilter F1} err
puts " [join [split [string trim $err] "\n"] "\n "]"

puts "\$mesher deleteFilter Global"
catch {$mesher deleteFilter Global} err
puts " [join [split [string trim $err] "\n"] "\n "]"

Output

$mesher addFilter F1 0.1 {quilt-1*}
$mesher addFilter F2 0.2 {quilt-2*}
$mesher getFilterCount: 3
$mesher deleteFilter F1
$mesher getFilterCount: 2
$mesher deleteFilter F2
$mesher getFilterCount: 1
$mesher deleteFilter F1
ERROR: Filter 'F1' does not exist.
ERROR: usage (argument 2): ::pw::DatabaseMesher_1 deleteFilter ?-type filter_type? < index | name >
$mesher deleteFilter Global
ERROR: Cannot delete the Global filter.

getFilterNames

$mesher getFilterNames ?-type filter_type? ?-regex? ?pattern?

This action returns a list of filter names defined in the mesher mode filter_type.

Parameters

-type filter_typeThis optional parameter specifies the string filter type.  One of < MaximumEdgeSpacing >.
-regexThis optional flag signifies that the given pattern should be considered a regular expression pattern rather than a glob pattern.
patternThis optional parameter is the string pattern used to filter the returned filter names.

Returns

A list of strings of the filter names that match the pattern.  If a pattern is not given, all filter names will be returned.

Example

Code

# $mesher is a DatabaseMesher mode
$mesher addFilter F1 0.1 {quilt-1*}
$mesher addFilter F2 0.2 {quilt-2*}
$mesher addFilter F3 0.3 {quilt-3*}

puts "\$mesher getFilterNames: [list [$mesher getFilterNames]]"

Output

$mesher getFilterNames: {F1 F2 F3 Global}

getFilterCount

$mesher getFilterCount ?-type filter_type?

This action returns the number of filters of the given filter_type defined in the mesher mode.

Parameters

-type filter_typeThis optional parameter specifies the string filter type.  One of < MaximumEdgeSpacing >.

Returns

The integer number of filters.

Example

Code

# $mesher is a DatabaseMesher mode
puts "\$mesher getFilterCount: [$mesher getFilterCount]"

$mesher addFilter F1 0.1 {quilt-1*}
$mesher addFilter F2 0.2 {quilt-2*}
$mesher addFilter F3 0.3 {quilt-3*}

puts "\$mesher getFilterCount: [$mesher getFilterCount]"

Output

$mesher getFilterCount: 1
$mesher getFilterCount: 4

getFilterDefinition

$mesher getFilterDefinition ?-type filter_type? ?-dict? < index | name >

This action gets the definition of a filter identified by index or name.

Parameters

-type filter_typeThis optional parameter specifies the string filter type.  One of < MaximumEdgeSpacing >.
-dictThis optional flag signifies that the return value should be formatted as a dictionary instead of a plain old list.
indexThis parameter is the integer index of the filter in the range [1, number of filters].
nameThis parameter is the string filter name.

Returns

This action returns the filter definition as a list.

A returned list contains { type priority name value patterns }.

A return dictionary is suitable for use with the dict command and is of the form: { Type type Priority priority Name name Value value Patterns patterns }

Where,

  • type is the string type of the filter.
  • priority is the integer priority of the filter.
  • name is the string name of the filter
  • value is the float max edge length override value
  • patterns is a string list of glob patterns matched againt entity names.

See Also

addFilter, getFilterDefinitions

Example

Code

# $mesher is a DatabaseMesher mode
$mesher addFilter F1 0.1 {quilt-1* wing-1*}
$mesher addFilter F2 0.2 {quilt-2* wing-2*}

foreach name [$mesher getFilterNames] {
puts ""
puts "\$mesher getFilterDefinition [list $name]:"
puts " list[list [$mesher getFilterDefinition $name]]"
puts "\$mesher getFilterDefinition -dict [list $name]:"
dict for {key val} [$mesher getFilterDefinition -dict $name] {
puts [format " %-10.10s: %-s" $key $val]
}
}
puts ""
for {set ii 1} {$ii <= [$mesher getFilterCount]} {incr ii} {
puts ""
puts "\$mesher getFilterDefinition $ii:"
puts " list[list [$mesher getFilterDefinition $ii]]"
puts "\$mesher getFilterDefinition -dict $ii:"
dict for {key val} [$mesher getFilterDefinition -dict $ii] {
puts [format " %-10.10s: %-s" $key $val]
}
}

Output

$mesher getFilterDefinition F1:
list{MaximumEdgeSpacing 1 F1 0.1 {quilt-1* wing-1*}}
$mesher getFilterDefinition -dict F1:
Type : MaximumEdgeSpacing
Priority : 1
Name : F1
Value : 0.1
Patterns : quilt-1* wing-1*

$mesher getFilterDefinition F2:
list{MaximumEdgeSpacing 2 F2 0.2 {quilt-2* wing-2*}}
$mesher getFilterDefinition -dict F2:
Type : MaximumEdgeSpacing
Priority : 2
Name : F2
Value : 0.2
Patterns : quilt-2* wing-2*

$mesher getFilterDefinition Global:
list{MaximumEdgeSpacing 3 Global 0.0 *}
$mesher getFilterDefinition -dict Global:
Type : MaximumEdgeSpacing
Priority : 3
Name : Global
Value : 0.0
Patterns : *


$mesher getFilterDefinition 1:
list{MaximumEdgeSpacing 1 F1 0.1 {quilt-1* wing-1*}}
$mesher getFilterDefinition -dict 1:
Type : MaximumEdgeSpacing
Priority : 1
Name : F1
Value : 0.1
Patterns : quilt-1* wing-1*

$mesher getFilterDefinition 2:
list{MaximumEdgeSpacing 2 F2 0.2 {quilt-2* wing-2*}}
$mesher getFilterDefinition -dict 2:
Type : MaximumEdgeSpacing
Priority : 2
Name : F2
Value : 0.2
Patterns : quilt-2* wing-2*

$mesher getFilterDefinition 3:
list{MaximumEdgeSpacing 3 Global 0.0 *}
$mesher getFilterDefinition -dict 3:
Type : MaximumEdgeSpacing
Priority : 3
Name : Global
Value : 0.0
Patterns : *

getFilterDefinitions

$mesher getFilterDefinitions ?-type filter_type? ?-dict?

This action gets a list of all filter definitions of the given filter_type.

Parameters

-type filter_typeThis optional parameter specifies the string filter type.  One of < MaximumEdgeSpacing >.
-dictThis optional flag signifies that the return value should be formatted as a dictionary instead of a plain old list.

Returns

This action returns a list of all filter definitions in priority order.  See getFilterDefinition

See Also

addFilter, getFilterDefinition

Example

Code

# $mesher is a DatabaseMesher mode
$mesher addFilter F1 0.1 {quilt-1* wing-1*}
$mesher addFilter F2 0.2 {quilt-2* wing-2*}

puts "\n\$mesher getFilterDefinitions:"
foreach filterDefn [$mesher getFilterDefinitions] {
puts " [list $filterDefn]"
}

puts "\n\$mesher getFilterDefinitions -dict:"
dict for {priority filterDefn} [$mesher getFilterDefinitions -dict] {
puts " $priority [list $filterDefn]"
dict for {key val} $filterDefn {
puts [format " %-10.10s: %-s" $key $val]
}
}

Output

$mesher getFilterDefinitions:
{MaximumEdgeSpacing 1 F1 0.1 {quilt-1* wing-1*}}
{MaximumEdgeSpacing 2 F2 0.2 {quilt-2* wing-2*}}
{MaximumEdgeSpacing 3 Global 0.0 *}

$mesher getFilterDefinitions -dict:
1 {Type MaximumEdgeSpacing Priority 1 Name F1 Value 0.1 Patterns {quilt-1* wing-1*}}
Type : MaximumEdgeSpacing
Priority : 1
Name : F1
Value : 0.1
Patterns : quilt-1* wing-1*
2 {Type MaximumEdgeSpacing Priority 2 Name F2 Value 0.2 Patterns {quilt-2* wing-2*}}
Type : MaximumEdgeSpacing
Priority : 2
Name : F2
Value : 0.2
Patterns : quilt-2* wing-2*
3 {Type MaximumEdgeSpacing Priority 3 Name Global Value 0.0 Patterns *}
Type : MaximumEdgeSpacing
Priority : 3
Name : Global
Value : 0.0
Patterns : *

getFilterEntityCounts

$mesher getFilterEntityCounts ?-type filter_type? ?-includeEntities? ?-dict?

This action matches the name of each mode entity against the filter patterns in filter priority order and returns the match count for each filter.

Parameters

-type filter_typeThis optional parameter specifies the string filter type.  One of < MaximumEdgeSpacing >.
-includeEntitiesThis optional flag signifies that the matching entities should also be included in the return value.
-dictThis optional flag signifies that the return value should be formatted as a dictionary instead of a plain old list.

Returns

This action returns the entity match count for each filter as a list or dictionary.

See Also

addFilter, getFilterDefinition

Note

Once an entity matches a filter, it is removed from consideration for lower priority filters.  That is, each entity is only counted once.

A return list is of the form: {filtername entcnt ?entitylist?  ... filtername entcnt ?entitylist?}

A return dictionary is suitable for use with the dict command and is of the form: {filtername {Count entcnt ?Entities entitylist?}  ... filtername {Count entcnt ?Entities entitylist?}}

Filters that do not match any mode entity names, are not included in the return.

Mode entities that do not match any filter are included in the return in the Global filter.

Example

Code

# $mesher is a DatabaseMesher mode
# $dbEnts is a list of database entities

proc toNames { ents } {
set ret [list]
foreach ent $ents {
lappend ret [$ent getName]
}
return $ret
}

puts "All Database Entities:"
puts " [toNames $dbEnts]"
puts ""

$mesher addFilter F1 0.1 {quilt-4 quilt-5 {WING X*}}
$mesher addFilter F2 0.2 quilt-3
$mesher addFilter F3 0.3 {quilt-1* quilt-2 quilt-4 !quilt-11}

# format template
set fmt "| %-6.6s | %3.3s | %-30.30s | %-35.35s |"
set hr [string repeat - 50]

puts "\$mesher getFilterEntityCounts -includeEntities"
puts [format $fmt Filter Cnt "Matched Entities" Patterns]
puts [format $fmt $hr $hr $hr $hr]
foreach {name entCnt ents} [$mesher getFilterEntityCounts -includeEntities] {
set patterns [dict get [$mesher getFilterDefinition -dict $name] Patterns]
puts [format $fmt $name $entCnt [list [toNames $ents]] $patterns]
}

puts ""
puts "\$mesher getFilterEntityCounts -dict -includeEntities"
puts [format $fmt Filter Cnt "Matched Entities" Patterns]
puts [format $fmt $hr $hr $hr $hr]
dict for {name keyVals} [$mesher getFilterEntityCounts -dict -includeEntities] {
set entCnt [dict get $keyVals Count]
set ents [dict get $keyVals Entities]
set patterns [dict get [$mesher getFilterDefinition -dict $name] Patterns]
puts [format $fmt $name $entCnt [list [toNames $ents]] $patterns]
}

Output

All Database Entities:
body_0 quilt-1 quilt-2 quilt-3 quilt-4 quilt-5 quilt-12 {WING XL} quilt-11

$mesher getFilterEntityCounts -includeEntities
| Filter | Cnt | Matched Entities | Patterns |
| ------ | --- | ------------------------------ | ----------------------------------- |
| F1 | 3 | {quilt-4 quilt-5 {WING XL}} | quilt-4 quilt-5 {WING X*} |
| F2 | 1 | quilt-3 | quilt-3 |
| F3 | 3 | {quilt-1 quilt-2 quilt-12} | quilt-1* quilt-2 quilt-4 !quilt-11 |
| Global | 1 | quilt-11 | * |

$mesher getFilterEntityCounts -dict -includeEntities
| Filter | Cnt | Matched Entities | Patterns |
| ------ | --- | ------------------------------ | ----------------------------------- |
| F1 | 3 | {quilt-4 quilt-5 {WING XL}} | quilt-4 quilt-5 {WING X*} |
| F2 | 1 | quilt-3 | quilt-3 |
| F3 | 3 | {quilt-1 quilt-2 quilt-12} | quilt-1* quilt-2 quilt-4 !quilt-11 |
| Global | 1 | quilt-11 | * |

setFilterPriority

$mesher setFilterPriority ?-type filter_type? name_list

This action sets the priority of one or more existing filters.

Parameters

-type filter_typeThis optional parameter specifies the string filter type.  One of < MaximumEdgeSpacing >.
name_listThis parameter is a list of string filter names.  Any filters not in name_list will be prioritized after the entities in name_list.

Returns

This action returns nothing.

See Also

addFilter, getFilterDefinition, getFilterDefinitions

Note

The relative ordering of the re-prioritized filters will be maintained.

Example

Code

# $mesher is a DatabaseMesher mode

proc doSetPriority { mesher names } {
puts "\$mesher setFilterPriority [list $names]:"
if { [catch {$mesher setFilterPriority $names} err] } {
puts " [string trim $err]"
} else {
puts " [$mesher getFilterNames]"
}
}

$mesher addFilter F1 0.1 {quilt-1*}
$mesher addFilter F2 0.2 {quilt-2*}
$mesher addFilter F3 0.3 {quilt-3*}
$mesher addFilter F4 0.4 {quilt-4*}
$mesher addFilter F5 0.5 {quilt-5*}
$mesher addFilter F6 0.6 {quilt-6*}

puts "Starting filter priority:"
puts " [$mesher getFilterNames]"
doSetPriority $mesher {F2 F6 F4}
doSetPriority $mesher F6
doSetPriority $mesher {F6 F5 F4 F3 F2 F1}
puts "\nThese will fail:"
doSetPriority $mesher {F4 F2 F4 F2}
doSetPriority $mesher {XX YY}
doSetPriority $mesher {F4 F2 F4 XX}
doSetPriority $mesher {F2 Global F6 F4}

Output

Starting filter priority:
F1 F2 F3 F4 F5 F6 Global
$mesher setFilterPriority {F2 F6 F4}:
F2 F6 F4 F1 F3 F5 Global
$mesher setFilterPriority F6:
F6 F2 F4 F1 F3 F5 Global
$mesher setFilterPriority {F6 F5 F4 F3 F2 F1}:
F6 F5 F4 F3 F2 F1 Global

These will fail:
$mesher setFilterPriority {F4 F2 F4 F2}:
ERROR: Found duplicate filter names {F4 F2}.
$mesher setFilterPriority {XX YY}:
ERROR: Filters {XX YY} do not exist.
$mesher setFilterPriority {F4 F2 F4 XX}:
ERROR: Filter XX does not exist. Found duplicate filter name F4.
$mesher setFilterPriority {F2 Global F6 F4}:
ERROR: Cannot change the Global filter priority.

setFilterPatterns

$mesher setFilterPatterns ?-type filter_type? < index | name > pattern_list

This action sets the patterns of an existing filters.

Parameters

-type filter_typeThis optional parameter specifies the string filter type.  One of < MaximumEdgeSpacing >.
indexThis parameter is the integer index of the filter in the range [1, number of filters].
nameThis parameter is the string filter name.
patternsThe list of string patterns that will be used to match against database entity names.

Returns

This action returns nothing.

See Also

addFilter, getFilterDefinition, getFilterDefinitions

Example

Code

$mesher addFilter F1 0.1 {quilt-4 quilt-5}

puts "patterns: [dict get [$mesher getFilterDefinition -dict F1] Patterns]"
puts "\$mesher setFilterPatterns F1 {quilt-4 quilt-5 {WING X*}}"
$mesher setFilterPatterns F1 {quilt-4 quilt-5 {WING X*}}
puts "patterns: [dict get [$mesher getFilterDefinition -dict F1] Patterns]"

# Will fail
catch {$mesher setFilterPatterns Global {W*}} err
puts $err

Output

patterns: quilt-4 quilt-5
$mesher setFilterPatterns F1 {quilt-4 quilt-5 {WING X*}}
patterns: quilt-4 quilt-5 {WING X*}
ERROR: Cannot change the Global filter patterns.

setFilterEntities

$mesher setFilterEntities ?-type filter_type? ?-op op_type? < index | name > dbentity_list

This action modifies filter patterns as needed to guarantee that the entities in dbentity_list are captured by the specified filter.

Parameters

-type filter_typeThis optional parameter specifies the string filter type.  One of < MaximumEdgeSpacing >.
-op op_typeThis optional parameter specifies the string operation type.  One of < Set | Remove >.
indexThis parameter is the integer index of the filter in the range [1, number of filters].
nameThis parameter is the string filter name.
dbentity_listThis parameter is a list of pw::DatabaseEntity objects, or a single pw::DatabaseEntity object.

Returns

This action returns nothing.

See Also

addFilter, getFilterDefinition, getFilterDefinitions

Note

Other filters may need to be adjusted to properly fulfill the requested configure operation.  For instance, to add or set entities on filter, those same entities will be removed from other filters as needed so that they no longer capture these entities.

Example

Code

# $mesher is a DatabaseMesher mode
# $dbEnts is a list of database entities

proc toNames { ents } {
set ret [list]
foreach ent $ents {
lappend ret [$ent getName]
}
return $ret
}

proc dumpPatterns { mesher } {
set filterCnts [$mesher getFilterEntityCounts -dict -includeEntities]
set fmt "| %-6.6s | %-37.37s | %-55.55s |"
set hr [string repeat - 80]
puts [format $fmt Filter Patterns "Matched Entities"]
puts [format $fmt $hr $hr $hr]
foreach name [$mesher getFilterNames] {
set defn [$mesher getFilterDefinition -dict $name]
if { [catch {dict get $filterCnts $name Entities} ents] } {
set ents [list]
}
puts [format $fmt $name [dict get $defn Patterns] [toNames $ents]]
}
}

set quilts [list]
set names {quilt-11 quilt-2 quilt-1}
foreach name $names {
lappend quilts [pw::DatabaseEntity getByName $name]
}

$mesher addFilter F1 0.1 {quilt-1*}
$mesher addFilter F2 0.2 {quilt-2*}
$mesher addFilter F3 0.3 {quilt-1* quilt-3*}

puts "All Database Entities:"
puts " [toNames $dbEnts]"
puts ""
dumpPatterns $mesher
puts ""
puts "\$mesher setFilterEntities -op Set F2 [list $names]"
$mesher setFilterEntities -op Set F2 $quilts
dumpPatterns $mesher
puts ""
puts "\$mesher setFilterEntities -op Set F3 [list $names]"
$mesher setFilterEntities -op Set F3 $quilts
dumpPatterns $mesher
puts ""
puts "\$mesher setFilterEntities F1 [list $names]"
$mesher setFilterEntities F1 $quilts
dumpPatterns $mesher
puts ""
puts "\$mesher setFilterEntities -op Remove F1 [list $names]"
$mesher setFilterEntities -op Remove F1 $quilts
dumpPatterns $mesher
puts ""
# Setting entities to the Global filter removes them from all other filters
puts "\$mesher setFilterEntities Global [list $names]"
$mesher setFilterEntities Global $quilts
dumpPatterns $mesher
puts ""
puts "\$mesher setFilterEntities -op Remove Global [list $names]"
catch {$mesher setFilterEntities -op Remove Global $quilts} err
puts " [join [split [string trim $err] "\n"] "\n "]"

Output

All Database Entities:
body_0 quilt-1 quilt-2 quilt-3 quilt-4 quilt-5 quilt-12 {WING XL} quilt-11

| Filter | Patterns | Matched Entities |
| ------ | ------------------------------------- | ------------------------------------------------------- |
| F1 | quilt-1* | quilt-1 quilt-12 quilt-11 |
| F2 | quilt-2* | quilt-2 |
| F3 | quilt-1* quilt-3* | quilt-3 |
| Global | * | quilt-4 quilt-5 {WING XL} |

$mesher setFilterEntities -op Set F2 {quilt-11 quilt-2 quilt-1}
| Filter | Patterns | Matched Entities |
| ------ | ------------------------------------- | ------------------------------------------------------- |
| F1 | quilt-1* !quilt-11 !quilt-1 | quilt-12 |
| F2 | quilt-2* quilt-11 quilt-1 | quilt-1 quilt-2 quilt-11 |
| F3 | quilt-1* quilt-3* | quilt-3 |
| Global | * | quilt-4 quilt-5 {WING XL} |

$mesher setFilterEntities -op Set F3 {quilt-11 quilt-2 quilt-1}
| Filter | Patterns | Matched Entities |
| ------ | ------------------------------------- | ------------------------------------------------------- |
| F1 | quilt-1* !quilt-11 !quilt-1 | quilt-12 |
| F2 | quilt-2* !quilt-2 | |
| F3 | quilt-1* quilt-3* quilt-2 | quilt-1 quilt-2 quilt-3 quilt-11 |
| Global | * | quilt-4 quilt-5 {WING XL} |

$mesher setFilterEntities F1 {quilt-11 quilt-2 quilt-1}
| Filter | Patterns | Matched Entities |
| ------ | ------------------------------------- | ------------------------------------------------------- |
| F1 | quilt-1* quilt-2 | quilt-1 quilt-2 quilt-12 quilt-11 |
| F2 | quilt-2* !quilt-2 | |
| F3 | quilt-1* quilt-3* quilt-2 | quilt-3 |
| Global | * | quilt-4 quilt-5 {WING XL} |

$mesher setFilterEntities -op Remove F1 {quilt-11 quilt-2 quilt-1}
| Filter | Patterns | Matched Entities |
| ------ | ------------------------------------- | ------------------------------------------------------- |
| F1 | quilt-1* !quilt-11 !quilt-1 | quilt-12 |
| F2 | quilt-2* !quilt-2 | |
| F3 | quilt-1* quilt-3* quilt-2 | quilt-1 quilt-2 quilt-3 quilt-11 |
| Global | * | quilt-4 quilt-5 {WING XL} |

$mesher setFilterEntities Global {quilt-11 quilt-2 quilt-1}
| Filter | Patterns | Matched Entities |
| ------ | ------------------------------------- | ------------------------------------------------------- |
| F1 | quilt-1* !quilt-11 !quilt-1 | quilt-12 |
| F2 | quilt-2* !quilt-2 | |
| F3 | quilt-1* quilt-3* !quilt-11 !quilt-1 | quilt-3 |
| Global | * | quilt-1 quilt-2 quilt-4 quilt-5 {WING XL} quilt-11 |

$mesher setFilterEntities -op Remove Global {quilt-11 quilt-2 quilt-1}
ERROR: Cannot remove entities from the Global filter.

setFilterValue

$mesher setFilterValue ?-type filter_type? < index | name > value

This action sets a filter’s value.

Parameters

-type filter_typeThis optional parameter specifies the string filter type.  One of < MaximumEdgeSpacing >.
indexThis parameter is the integer index of the filter in the range [1, number of filters].
nameThis parameter is the string filter name.
valueThe filter’s new value.  The value’s type and range depend on the filter_type.  See Ranges section below.

Returns

This action returns nothing.

See Also

addFilter, getFilterDefinition, getFilterDefinitions

Ranges

MaximumEdgeSpacingvalue is a float in the range [0, infinity).

Example

Code

# $mesher is a DatabaseMesher mode
$mesher addFilter F1 0.1 {quilt-1*}

puts "value: [dict get [$mesher getFilterDefinition -dict F1] Value]"
$mesher setFilterValue F1 0.9
puts "\n\$mesher setFilterValue F1 0.9"
puts "value: [dict get [$mesher getFilterDefinition -dict F1] Value]"

puts "\n\$mesher setFilterValue F1 -1.0"
catch {$mesher setFilterValue F1 -1.0} err
puts " [join [split [string trim $err] "\n"] "\n "]"
puts "value: [dict get [$mesher getFilterDefinition -dict F1] Value]"

puts "\n\$mesher setFilterValue Q1 1.0"
catch {$mesher setFilterValue Q1 1.0} err
puts " [join [split [string trim $err] "\n"] "\n "]"

Output

value: 0.1

$mesher setFilterValue F1 0.9
value: 0.9

$mesher setFilterValue F1 -1.0
ERROR: value outside the range [0,infinity)
ERROR: usage (argument 3): ::pw::DatabaseMesher_1 setFilterValue ?-type filter_type? < index | name > value
value: 0.9

$mesher setFilterValue Q1 1.0
ERROR: Filter 'Q1' does not exist.
ERROR: usage (argument 2): ::pw::DatabaseMesher_1 setFilterValue ?-type filter_type? < index | name > value

setFilterName

$mesher setFilterName ?-type filter_type? < index | name > newName

This action renames a filter.

Parameters

-type filter_typeThis optional parameter specifies the string filter type.  One of < MaximumEdgeSpacing >.
indexThis parameter is the integer index of the filter in the range [1, number of filters].
nameThis parameter is the string filter name.
newNameThe filter’s new name.

Returns

This action returns newName.

See Also

addFilter, getFilterDefinition, getFilterDefinitions

Example

Code

# $mesher is a DatabaseMesher mode
puts "set nm \[\$mesher addFilter {} 0.1\]"
set nm [$mesher addFilter {} 0.1]
puts "\$mesher getFilterDefinition -dict \$nm"
puts " [$mesher getFilterDefinition -dict $nm]"
puts "\$mesher setFilterName \$nm FX"
$mesher setFilterName $nm FX
puts "\$mesher getFilterDefinition -dict \$nm"
catch {$mesher getFilterDefinition -dict $nm} err
puts " [join [split [string trim $err] "\n"] "\n "]"
puts "\$mesher getFilterDefinition -dict FX"
puts " [$mesher getFilterDefinition -dict FX]"

Output

set nm [$mesher addFilter {} 0.1]
$mesher getFilterDefinition -dict $nm
Type MaximumEdgeSpacing Priority 1 Name filter-1 Value 0.1 Patterns {}
$mesher setFilterName $nm FX
$mesher getFilterDefinition -dict $nm
ERROR: Filter 'filter-1' does not exist.
ERROR: usage (argument 3): ::pw::DatabaseMesher_1 getFilterDefinition ?-type filter_type? < index | name >
$mesher getFilterDefinition -dict FX
Type MaximumEdgeSpacing Priority 1 Name FX Value 0.1 Patterns {}
$mesher get/setMergeTolerance tol
This attribute is the tolerance to use when merging connectors.
$mesher get/setJoinDomainAngle angle
This attribute is the turning angle to use when joining domains.
$mesher get/setMinimumSpacingMode mode
This attribute is the preferred method for setting the minimum spacing.
$mesher get/setMinimumEdgeSpacing spacing
This attribute is the minimum edge spacing for the mesh.
$mesher get/setMaximumSpacingMode mode
This attribute is the preferred method for setting the maximum spacing.
$mesher get/setMaximumExtentsSubdivisions subdivisions
This attribute is the maximum number of mesh subdivisions per the extents of the entities being meshed.
$mesher get/setMaximumEdgeSpacing spacing
This attribute is the maximum edge spacing for the mesh.
$mesher get/setCurvatureResolutionAngle angle
This attribute is the curvature angle resolution in degrees.
$mesher get/setMaximumAspectRatio ratio
This attribute specifies the maximum aspect ratio.
$mesher get/setBoundaryGrowthRate rate
This attribute specifies the boundary growth rate.
$mesher get/setDomainAlgorithm < AdvancingFront | QuadDominant >
This attribute determines the algorithm to use when meshing domains.
$mesher get/setRefinementFactor factor
This attribute is the refinement factor used to globally scale the parameters of the mesher in order to increase the refinement.
$mesher get/setMappedSurfaceSubdivisionRatio factor
This attribute is the ratio between the number of subdivisions used to detect domains that can be initialized from structured domains.
$mesher get/setBoundaryProximityInfluence < Orientation | All | None >
This attribute controls how nearby boundaries influence clustering on a surface.
$mesher get/setBoundaryGroupAngle angle
This attribute is the turning angle to use when grouping boundaries.
$mesher get/setBoundaryCurvatureRatio ratio
This attribute is the ratio between the surface and curve curvature along a boundary to use when detecting Curvature boundaries.
$mesher get/setBoundaryCurvatureUseGrowth growth
This attribute controls whether TRex growth should occur along curvature manifold boundaries.
$mesher get/setBoundaryCurvatureSpacingFactor factor
This attribute is the factor used to scale the spacing of curvature manifold boundaries.
$mesher get/setBoundaryHardAngle angle
This attribute is the angle between normals to use when detecting Convex and Concave manifold boundaries.
$mesher get/setBoundaryConvexUseGrowth growth
This attribute controls whether TRex growth should occur along convex manifold boundaries.
$mesher get/setBoundaryConvexSpacingFactor factor
This attribute is the factor used to scale the spacing of convex manifold boundaries.
$mesher get/setBoundaryConcaveUseGrowth growth
This attribute controls whether TRex growth should occur along concave manifold boundaries.
$mesher get/setBoundaryConcaveSpacingFactor factor
This attribute is the factor used to scale the spacing of concave manifold boundaries.
$mesher get/setDomainAreaRatioThreshold threshold
This attribute is the metric threshold for domain area ratio.
$mesher get/setDomainAspectRatioThreshold threshold
This attribute is the metric threshold for domain aspect ratio.
$mesher get/setDomainMaximumAngleThreshold threshold
This attribute is the metric threshold for domain maximum angle.
$mesher get/setKeepExistingDomains value
This attribute controls whether any pre-existing domains constrained to the quilts in the mode are retained or destroyed.
$mesher getExtents
This action gets the extents of the models of the mode.
$mesher getMinimumBoundaryGroup
This action gets the quilt boundary group with the minimum length.
$mesher getMinimumBoundaryGroupLength
This action gets the length of the minimum boundary group.
$mesher getSymmetryLoops ?symmetry?
This action gets a list of symmetry loops, where each loop is a list of quilt boundaries that are lamina and lie on a symmetry plane.
$mesher getLaminaBoundaryGroups classify
This action gets a list of lamina quilt boundary lists of a certain classification.
A boundary is reference to either a database curve or the edge of a database surface.
$mesher getManifoldBoundaryGroups classify
This action gets a list of manifold quilt boundary lists of a certain classification.
$mesher createGridEntities ent_type
This action creates grid entities on the database entities of this mode.
$mesher getRejectedEntities
This action gets a list of database entities that a surface mesh was not able to be constructed on during the createSurfaceMesh action.
$mesher getExistingDomains
This action gets a list of domains that are dependent upon the quilts included in the mode.
$mesher getExistingSources
This action gets a list of sources that are dependent upon the quilts included in the mode.
$mesher getMappingResult ?-details detailVar? domain
This action gets whether or not a created unstructured domain was mapped to a structured domain.
$mesher getFilterTypes
This action returns a list of supported filter type names.
$mesher addFilter ?-type filter_type? ?-priority < index | name >? ?-name name? value ?pattern_list?
This action adds a new, mesher mode filter to a filter queue.
$mesher deleteFilter ?-type filter_type? < index | name >
This action deletes a filter.
$mesher getFilterNames ?-type filter_type? ?-regex? ?pattern?
This action returns a list of filter names defined in the mesher mode filter_type.
$mesher getFilterCount ?-type filter_type?
This action returns the number of filters of the given filter_type defined in the mesher mode.
$mesher getFilterDefinition ?-type filter_type? ?-dict? < index | name >
This action gets the definition of a filter identified by index or name.
$mesher getFilterDefinitions ?-type filter_type? ?-dict?
This action gets a list of all filter definitions of the given filter_type.
$mesher getFilterEntityCounts ?-type filter_type? ?-includeEntities? ?-dict?
This action matches the name of each mode entity against the filter patterns in filter priority order and returns the match count for each filter.
$mesher setFilterPriority ?-type filter_type? name_list
This action sets the priority of one or more existing filters.
$mesher setFilterPatterns ?-type filter_type? < index | name > pattern_list
This action sets the patterns of an existing filters.
$mesher setFilterEntities ?-type filter_type? ?-op op_type? < index | name > dbentity_list
This action modifies filter patterns as needed to guarantee that the entities in dbentity_list are captured by the specified filter.
$mesher setFilterValue ?-type filter_type? < index | name > value
This action sets a filter’s value.
$mesher setFilterName ?-type filter_type? < index | name > newName
This action renames a filter.
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.
A float is a fractional number.
A string is an array of characters.
This attribute is the minimum number of mesh subdivisions per database boundary.
An integer is a whole number.
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.
A vector is a list of float values.
Connector type
Domain type
pw::Connector createOnDatabase ?-merge tolerance? ?-splitConnectors split_angle? ?-joinConnectors join_angle? ?-parametricConnectors mode? ?-reject rejectVar? ?-type type? entity_or_boundary_list
This action creates new connector objects on the given database entities.
pw::DomainStructured createOnDatabase ?-merge tolerance? ?-splitConnectors split_angle? ?-joinConnectors join_angle? ?-parametricConnectors mode? ?-reject rejectVar? entities
This action creates new structured domain objects on the given database entities.
pw::DomainUnstructured createOnDatabase ?-merge tolerance? ?-splitConnectors split_angle? ?-joinConnectors join_con_angle? ?-joinDomains join_dom_angle? ?-parametricConnectors mode? ?-reject rejectVar? entities
This creates new unstructured domain objects on the given database entities.
Base type for all database entities
Base type for all source entities
Structured domain type