pw::QuiltAssembler

The quilt assembly mode type

Derives From

pw::Object pw::Mode

Notes

This mode is used to group and assemble quilts.  The various parameters are saved in the application project file.

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

set mode [pw::Application begin QuiltAssembler $models]
Summary
pw::QuiltAssemblerThe quilt assembly mode type
Instance Attributes
BoundaryCurvatureRatioThis attribute is the ratio between the surface and curve curvature along a boundary to use when detecting Curvature boundaries.
BoundaryHardAngleThis attribute is the angle between normals to use when detecting Convex and Concave manifold boundaries.
Instance Actions
getGroupCountThis function returns the number of quilt groups.
getGroupThis function returns a list of the quilts in the specified group.
getGroupNameThis function returns the name of the specified group.
setGroupNameThis function is used to specify the name of the resulting quilt when the group is assembled when the mode is ended.
lockGroupThis function sets the lock status of a group to either locked or unlocked.
isGroupLockedThis function returns the lock status of a group.
getQuiltGroupThis function returns the identifier number of the group containing the quilt.
createGroupThis function creates new groups from the specified quilts.
getBoundaryClassificationThis function returns the classification for the specified boundary.
getBoundaryStateThis function returns the setting for the specified boundary.
setBoundaryStateThis function sets the state of the specified boundary to be blocking or open.
toggleBoundaryStateThis function flips the state of the specified boundary to be blocking or open, whichever is the opposite of its previous state.
resetBoundaryStateThis function clears any user-specified setting for the boundary, resetting it back to its default setting.
isBoundaryLockedThis function queries whether a boundary is locked.

Instance Attributes

BoundaryCurvatureRatio

$quilter 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.

BoundaryHardAngle

$quilter 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.

Instance Actions

getGroupCount

$quilter getGroupCount

This function returns the number of quilt groups.

Parameters

This action has no parameters.

Returns

This action returns the number of quilt groups as an integer value.

See Also

getGroup

Example

Code

# $quilter is a QuiltAssembler mode
puts [$quilt getGroupCount]

Output

36

getGroup

$quilter getGroup $group_index

This function returns a list of the quilts in the specified group.

Parameters

group_indexThis parameter is the number of the quilt group to query.  Thenumber should be an integer value between 1 and the number of quilt groups.

Returns

This action returns a list of pw::Quilt objects representing the quilts in the group.

See Also

getGroupCount, getQuiltGroup

Note

The group numbers are subject to change after any modification to groups, such as changing a boundary state or forming a new group.

Example

Code

# $quilter is a QuiltAssembler mode
puts "Group 5:"
foreach quilt [$quilt getGroup 5] {
  puts "  [$quilt getName]"
}

Output

Group 5:
  quilt-4
  quilt-7
  quilt-15

getGroupName

$quilter getGroupName $group_index

This function returns the name of the specified group.  The name will be assigned to the resulting assembled quilt when the mode is ended.  By default, the name will be the name of the oldest quilt in the group.  A different name can be assigned with setGroupName if the group is locked.

Parameters

group_indexThis parameter is the number of the quilt group to query.  The number should be an integer value between 1 and the number of quilt groups.

Returns

This action returns a string representing the group name.

See Also

setGroupName, lockGroup, isGroupLocked, getGroupCount

Note

The group numbers are subject to change after any modification to groups, such as changing a boundary state or forming a new group.

Example

Code

# $quilter is a QuiltAssembler mode
puts [$quilter getGroupName 5]

Output

quilt-4

setGroupName

$quilter setGroupName $group_index $name

This function is used to specify the name of the resulting quilt when the group is assembled when the mode is ended.  Note that only locked groups can be assigned a name since only locked groups will be assembled when the task ends.

Parameters

group_indexThis parameter is the number of the quilt group to rename.  The number should be an integer value between 1 and the number of quilt groups.
nameThis string parameter is the name to assign to the group.  It must be a name that is unique to all other quilts outside the group and all other named entities.  If it is not unique, it will be appended with an integer suffix so as to make it unique.

Returns

This action returns the actual name that was store with the group.

See Also

getGroupName, lockGroup, isGroupLocked, getGroupCount

Note

The group may share a name with a member quilt but cannot share a name with a quilt outside of the group (even if the other quilt’s group is renamed).

Example

Code

# $quilter is a QuiltAssembler mode
set actualName [$quilter setName 5 "Group Five"]

Output

Group Five

lockGroup

$quilter lockGroup $group_index $lock_status

This function sets the lock status of a group to either locked or unlocked.  Only locked groups will be assembled into single quilts when the mode ends.  Quilts in unlocked groups will not be modified.

Parameters

group_indexThis parameter is the number of the quilt group to lock or unlock.  The number should be an integer value between 1 and the number of quilt groups.
lock_statusThe boolean value controls whether the group will be locked (value is true) or unlocked (value is false).

Returns

This action has no return value.

See Also

getGroupCount, isGroupLocked

Note

Unlocking a group will reset its name to the default name (the name of the oldest quilt in the group).

Example

Code

# $quilter is a QuiltAssembler mode
puts "Lock status: [$quilter isGroupLocked 5]"
$quilter lockGroup 5 true
puts "Lock status: [$quilter isGroupLocked 5]"

Output

Lock status: 0
Lock status: 1

isGroupLocked

$quilter isGroupLocked $group_index

This function returns the lock status of a group.

Parameters

group_indexThis parameter is the number of the quilt group to query.  The number should be an integer value between 1 and the number of quilt groups.

Returns

This action returns a boolean value, with a true value indicating the group is locked and a false value indicating the the group is unlocked.

See Also

getGroupCount, lockGroup

Example

Code

# $quilter is a QuiltAssembler mode
puts "Lock status: [$quilter isGroupLocked 5]"
$quilter lockGroup 5 true
puts "Lock status: [$quilter isGroupLocked 5]"

Output

Lock status: 0
Lock status: 1

getQuiltGroup

$quilter getQuiltGroup $quilt

This function returns the identifier number of the group containing the quilt.

Parameters

quiltThis argument is should be a pw::Quilt object belonging to one of the models in the mode.

Returns

This action returns an integer value representing the group number containing the quilt.

See Also

getGroupCount, getGroup

Example

Code

# $quilter is a QuiltAssembler mode
set quilt(7) [pw::Database getByName "quilt-7"]
puts "quilt-7 belongs to group [$quilter getQuiltGroup $quilt(7)]"

Output

quilt-7 belongs to group 5

createGroup

$quilter createGroup $quilts

This function creates new groups from the specified quilts.  A single group will be formed for each set of topologically adjacent quilts.

Parameters

quiltsThis should be a list of the pw::Quilt objects to form one or more groups.  The quilts should belong to the model or models specified in the mode.

Returns

This action has no return value.

See Also

getGroupCount, getQuiltGroup, getGroup

Note

If all of the specified quilts are adjacent, a single group will be formed.  All boundaries on the perimeter of the group will be changed to blocking.  All shared boundaries within the group will be set to open.  This function may change group numbering.

Example

Code

# $quilter is a QuiltAssembler mode
set quilt(4) [pw::Database getByName "quilt-4"]
set quilt(7) [pw::Database getByName "quilt-7"]
set quilt(12) [pw::Database getByName "quilt-12"]
set quilt(15) [pw::Database getByName "quilt-15"]
$quilter createGroup [list $quilt(4) $quilt(7) $quilt(12) $quilt(15)]
set groupId [$quilter getQuiltGroup $quilt(4)]
puts "Group $groupId:"
foreach quilt [$quilt getGroup $groupId] {
  puts "  [$quilt getName]"
}

Output

Group 8:
  quilt-4
  quilt-7
  quilt-12
  quilt-15

getBoundaryClassification

$quilter getBoundaryClassification boundary

This function returns the classification for the specified boundary.

Parameters

boundaryThe argument specifies the boundary to query as a quilt-index pair.  The argument should be a list of two elements.  The first element should be a pw::Quilt argument that is a member of one of the models specified in the mode, and the second argument should be an integer argument indicating the quilt’s boundary number.

Returns

This action returns a string value indicating whether the boundary indicating how the boundary was classified.  The possible classifications are: Unspecified (no classification), Curvature, Convex, Concave, GeometricTrim

See Also

getBoundaryState

Example

Code

# $quilter is a QuiltAssembler mode
set quilt(4) [pw::Database getByName "quilt-4"]
set numBnds [$quilt(4) getBoundaryCount]
for {set n 1} {$n <= $numBnds} {incr n} {
  set class [$quilter getBoundaryState [list $quilt(4) $n]]
  puts "[$quilt(4) getName] boundary $n is classified as $class"
}

Output

quilt-4 boundary 1 is classified as Unspecified
quilt-4 boundary 2 is classified as Curvature
quilt-4 boundary 3 is classified as Unspecified
quilt-4 boundary 4 is classified as GeometricTrim

getBoundaryState

$quilter getBoundaryState ? -default | -user ? boundary

This function returns the setting for the specified boundary.  By default, it returns the current blocking or open status.  The routine can also return the default setting (ignoring any user overrides) or the user specified setting.

Parameters

-defaultIf present, this argument indicates that the routine should return the blocking state ignoring any user-specified state change.
-userIf present, this argument indicates that only the effect of the user state changes should be queried, ignoring the default value.  If the user has specified the boundary as blocking, a true value will be returned.  If the user has specified the boundary as open, or if the user has not overridden the default state, a false value will be returned.
boundaryThe argument specifies the boundary to query as a quilt-index pair.  The argument should be a list of two elements.  The first element should be a pw::Quilt argument that is a member of one of the models specified in the mode, and the second argument should be an integer argument indicating the quilt’s boundary number.

Returns

This action returns a string value indicating whether the boundary is blocking (the return value is “Blocking”) or open (the return value is “Open”).

See Also

setBoundaryState, toggleBoundaryState, resetBoundaryState

Example

Code

# $quilter is a QuiltAssembler mode
set quilt(4) [pw::Database getByName "quilt-4"]
set numBnds [$quilt(4) getBoundaryCount]
for {set n 1} {$n <= $numBnds} {incr n} {
  set state [$quilter getBoundaryState [list $quilt(4) $n]]
  puts "[$quilt(4) getName] boundary $n is $state"
}
set n 3
$quilter setBoundaryState [list $quilt(4) $n] Blocking
set state [$quilter getBoundaryState [list $quilt(4) $n]]
puts "[$quilt(4) getName] boundary $n is now $state"
set state [$quilter getBoundaryState [list $quilt(4) $n]]
puts "[$quilt(4) getName] boundary $n default state is $state"

Output

quilt-4 boundary 1 is Blocking
quilt-4 boundary 2 is Blocking
quilt-4 boundary 3 is Open
quilt-4 boundary 4 is Blocking
quilt-4 boundary 3 is now Blocking
quilt-4 boundary 3 default state is Open

setBoundaryState

$quilter setBoundaryState boundary < Open | Blocking >

This function sets the state of the specified boundary to be blocking or open.  Quilt groups will be formed across open boundaries and not be formed across blocking boundaries.

Parameters

boundaryThe argument specifies the boundary to change as a quilt-index pair.  The argument should be a list of two elements.  The first element should be a pw::Quilt argument that is a member of one of the models specified in the mode, and the second argument should be an integer argument indicating the quilt’s boundary number.
stateThis should be either Open or Blocking.  Quilt groups will be formed across open boundaries and not be formed across blocking boundaries.

Returns

This action has no return value.

See Also

getBoundaryState, toggleBoundaryState, resetBoundaryState

Note

This function may change group numbering.  Even if the new state matches the default state, the state will be saved as a user-specified setting.  This has no impact other than when querying the state via getBoundaryState with the -user flag.

Example

Code

# $quilter is a QuiltAssembler mode
set quilt(4) [pw::Database getByName "quilt-4"]
set n 3
$quilter setBoundaryState [list $quilt(4) $n] Blocking
set state [$quilter getBoundaryState [list $quilt(4) $n]]
puts "[$quilt(4) getName] boundary $n is $state"
$quilter setBoundaryState [list $quilt(4) $n] Open
set state [$quilter getBoundaryState [list $quilt(4) $n]]
puts "[$quilt(4) getName] boundary $n is $state"

Output

quilt-4 boundary 3 is Blocking
quilt-4 boundary 3 is Open

toggleBoundaryState

$quilter toggleBoundaryState boundary_list

This function flips the state of the specified boundary to be blocking or open, whichever is the opposite of its previous state.  Quilt groups will be formed across open boundaries and not be formed across blocking boundaries.

Parameters

boundary_listThe argument specifies a list of boundaries to change as a list of quilt-index pairs.  Each quilt-index pair in the list should have a pw::Quilt argument as the first element and the boundary index as an integer as the second element.

Returns

This action has no return value.

See Also

getBoundaryState, toggleBoundaryState, resetBoundaryState

Note

This function may change group numbering.  If the new state after toggling the state matches the default state, the user state will be cleared.  This has no impact other than when querying the state via getBoundaryState with the -user flag.

Example

Code

# $quilter is a QuiltAssembler mode
set quilt(4) [pw::Database getByName "quilt-4"]
$quilter setBoundaryState [list $quilt(4) 3] Blocking
$quilter setBoundaryState [list $quilt(4) 4] Open
set state [$quilter getBoundaryState [list $quilt(4) 3]]
puts "[$quilt(4) getName] boundary 3 is $state"
set state [$quilter getBoundaryState [list $quilt(4) 4]]
puts "[$quilt(4) getName] boundary 4 is $state"
# Toggle the boundaries
$quilter toggleBoundaryState [list [list $quilt(4) 3]

[list $quilt(4) 4]]

set state [$quilter getBoundaryState [list $quilt(4) 3]]
puts "[$quilt(4) getName] boundary 3 is now $state"
set state [$quilter getBoundaryState [list $quilt(4) 4]]
puts "[$quilt(4) getName] boundary 4 is now $state"

Output

quilt-4 boundary 3 is Blocking
quilt-4 boundary 4 is Open
quilt-4 boundary 3 is now Open
quilt-4 boundary 4 is now Blocking

resetBoundaryState

This function clears any user-specified setting for the boundary, resetting it back to its default setting.

Parameters

boundaryThe argument specifies the boundary to change as a quilt-index pair.  The argument should be a list of two elements.  The first element should be a pw::Quilt argument that is a member of one of the models specified in the mode, and the second argument should be an integer argument indicating the quilt’s boundary number.

Returns

This action has no return value.

See Also

getBoundaryState, setBoundaryState, toggleBoundaryState

Example

Code

# $quilter is a QuiltAssembler mode
set quilt(4) [pw::Database getByName "quilt-4"]
$quilter setBoundaryState [list $quilt(4) 3] Blocking
$quilter setBoundaryState [list $quilt(4) 4] Open
set state [$quilter getBoundaryState [list $quilt(4) 3]]
puts "[$quilt(4) getName] boundary 3 is $state"
set state [$quilter getBoundaryState [list $quilt(4) 4]]
puts "[$quilt(4) getName] boundary 4 is $state"
# Toggle the boundaries
$quilter toggleBoundaryState [list [list $quilt(4) 3]

[list $quilt(4) 4]]

set state [$quilter getBoundaryState [list $quilt(4) 3]]
puts "[$quilt(4) getName] boundary 3 is now $state"
set state [$quilter getBoundaryState [list $quilt(4) 4]]
puts "[$quilt(4) getName] boundary 4 is now $state"

Output

quilt-4 boundary 3 is Blocking
quilt-4 boundary 4 is Open
quilt-4 boundary 3 is now Open
quilt-4 boundary 4 is now Blocking

isBoundaryLocked

$quilter isBoundaryLocked $boundary

This function queries whether a boundary is locked.

Parameters

boundaryThe argument specifies the boundary to query as a quilt-index pair.  The argument should be a list of two elements.  The first element should be a pw::Quilt argument that is a member of one of the models specified in the mode, and the second argument should be an integer argument indicating the quilt’s boundary number.

Returns

This action returns a boolean value, with a true value indicating the group is locked and a false value indicating the the group is unlocked.

See Also

setBoundaryState, toggleBoundaryState, resetBoundaryState

Example

Code

# $quilter is a QuiltAssembler mode
set quilt(4) [pw::Database getByName "quilt-4"]
set numBnds [$quilt(4) getBoundaryCount]
set value(0) "Unlocked"
set value(1) "Locked"
for {set n 1} {$n <= $numBnds} {incr n} {
  set locked [$quilter isBoundaryLocked [list $quilt(4) $n]]
  puts "[$quilt(4) getName] boundary $n is $value($locked)"
}

Output

quilt-4 boundary 1 is Unlocked
quilt-4 boundary 2 is Unlocked
quilt-4 boundary 3 is Locked
quilt-4 boundary 4 is Unlocked
$quilter get/setBoundaryCurvatureRatio ratio
This attribute is the ratio between the surface and curve curvature along a boundary to use when detecting Curvature boundaries.
$quilter get/setBoundaryHardAngle angle
This attribute is the angle between normals to use when detecting Convex and Concave manifold boundaries.
$quilter getGroupCount
This function returns the number of quilt groups.
$quilter getGroup $group_index
This function returns a list of the quilts in the specified group.
$quilter getGroupName $group_index
This function returns the name of the specified group.
$quilter setGroupName $group_index $name
This function is used to specify the name of the resulting quilt when the group is assembled when the mode is ended.
$quilter lockGroup $group_index $lock_status
This function sets the lock status of a group to either locked or unlocked.
$quilter isGroupLocked $group_index
This function returns the lock status of a group.
$quilter getQuiltGroup $quilt
This function returns the identifier number of the group containing the quilt.
$quilter createGroup $quilts
This function creates new groups from the specified quilts.
$quilter getBoundaryClassification boundary
This function returns the classification for the specified boundary.
$quilter getBoundaryState ? -default | -user ? boundary
This function returns the setting for the specified boundary.
$quilter setBoundaryState boundary < Open | Blocking >
This function sets the state of the specified boundary to be blocking or open.
$quilter toggleBoundaryState boundary_list
This function flips the state of the specified boundary to be blocking or open, whichever is the opposite of its previous state.
$quilter isBoundaryLocked $boundary
This function queries whether a boundary is locked.
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.
An integer is a whole number.
Database quilt type
A string is an array of characters.
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.
This function clears any user-specified setting for the boundary, resetting it back to its default setting.
Close