The quilt assembly mode type
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]
pw:: | The quilt assembly mode type |
Instance Attributes | |
BoundaryCurvatureRatio | This attribute is the ratio between the surface and curve curvature along a boundary to use when detecting Curvature boundaries. |
BoundaryHardAngle | This attribute is the angle between normals to use when detecting Convex and Concave manifold boundaries. |
Instance Actions | |
getGroupCount | This function returns the number of quilt groups. |
getGroup | This function returns a list of the quilts in the specified group. |
getGroupName | This function returns the name of the specified group. |
setGroupName | This function is used to specify the name of the resulting quilt when the group is assembled when the mode is ended. |
lockGroup | This function sets the lock status of a group to either locked or unlocked. |
isGroupLocked | This function returns the lock status of a group. |
getQuiltGroup | This function returns the identifier number of the group containing the quilt. |
createGroup | This function creates new groups from the specified quilts. |
getBoundaryClassification | This function returns the classification for the specified boundary. |
getBoundaryState | This function returns the setting for the specified boundary. |
setBoundaryState | This function sets the state of the specified boundary to be blocking or open. |
toggleBoundaryState | This function flips the state of the specified boundary to be blocking or open, whichever is the opposite of its previous state. |
resetBoundaryState | This function clears any user-specified setting for the boundary, resetting it back to its default setting. |
isBoundaryLocked | This function queries whether a boundary is locked. |
$quilter get/setBoundaryCurvatureRatio ratio
This attribute is the ratio between the surface and curve curvature along a boundary to use when detecting Curvature boundaries.
This attribute is a float with the range [0, infinity), where 0 means no Curvature boundaries will be detected.
The default for this attribute is 2.5.
$quilter get/setBoundaryHardAngle angle
This attribute is the angle between normals to use when detecting Convex and Concave manifold boundaries.
This attribute is a float with the range [0, 180), where 0 means no Convex and Concave boundaries will be detected.
The default for this attribute is 45.
$quilter getGroup $group_index
This function returns a list of the quilts in the specified group.
group_index | This parameter is the number of the quilt group to query. Thenumber should be an integer value between 1 and the number of quilt groups. |
This action returns a list of pw::Quilt objects representing the quilts in the group.
The group numbers are subject to change after any modification to groups, such as changing a boundary state or forming a new group.
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
$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.
group_index | This 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. |
This action returns a string representing the group name.
setGroupName, lockGroup, isGroupLocked, getGroupCount
The group numbers are subject to change after any modification to groups, such as changing a boundary state or forming a new group.
Code
# $quilter is a QuiltAssembler mode puts [$quilter getGroupName 5]
Output
quilt-4
$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.
group_index | This 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. |
name | This 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. |
This action returns the actual name that was store with the group.
getGroupName, lockGroup, isGroupLocked, getGroupCount
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).
Code
# $quilter is a QuiltAssembler mode set actualName [$quilter setName 5 "Group Five"]
Output
Group Five
$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.
group_index | This 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_status | The boolean value controls whether the group will be locked (value is true) or unlocked (value is false). |
This action has no return value.
Unlocking a group will reset its name to the default name (the name of the oldest quilt in the group).
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
$quilter isGroupLocked $group_index
This function returns the lock status of a group.
group_index | This 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. |
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.
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
$quilter getQuiltGroup $quilt
This function returns the identifier number of the group containing the quilt.
quilt | This argument is should be a pw::Quilt object belonging to one of the models in the mode. |
This action returns an integer value representing the group number containing the quilt.
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
$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.
quilts | This 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. |
This action has no return value.
getGroupCount, getQuiltGroup, getGroup
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.
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
$quilter getBoundaryClassification boundary
This function returns the classification for the specified boundary.
boundary | The 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. |
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
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
$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.
-default | If present, this argument indicates that the routine should return the blocking state ignoring any user-specified state change. |
-user | If 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. |
boundary | The 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. |
This action returns a string value indicating whether the boundary is blocking (the return value is “Blocking”) or open (the return value is “Open”).
setBoundaryState, toggleBoundaryState, resetBoundaryState
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
$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.
boundary | The 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. |
state | This should be either Open or Blocking. Quilt groups will be formed across open boundaries and not be formed across blocking boundaries. |
This action has no return value.
getBoundaryState, toggleBoundaryState, resetBoundaryState
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.
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
$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.
boundary_list | The 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. |
This action has no return value.
getBoundaryState, toggleBoundaryState, resetBoundaryState
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.
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
This function clears any user-specified setting for the boundary, resetting it back to its default setting.
boundary | The 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. |
This action has no return value.
getBoundaryState, setBoundaryState, toggleBoundaryState
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
$quilter isBoundaryLocked $boundary
This function queries whether a boundary is locked.
boundary | The 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. |
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.
setBoundaryState, toggleBoundaryState, resetBoundaryState
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
This attribute is the ratio between the surface and curve curvature along a boundary to use when detecting Curvature boundaries.
$quilter get/setBoundaryCurvatureRatio ratio
This attribute is the angle between normals to use when detecting Convex and Concave manifold boundaries.
$quilter get/setBoundaryHardAngle angle
This function returns the number of quilt groups.
$quilter getGroupCount
This function returns a list of the quilts in the specified group.
$quilter getGroup $group_index
This function returns the name of the specified group.
$quilter getGroupName $group_index
This function is used to specify the name of the resulting quilt when the group is assembled when the mode is ended.
$quilter setGroupName $group_index $name
This function sets the lock status of a group to either locked or unlocked.
$quilter lockGroup $group_index $lock_status
This function returns the lock status of a group.
$quilter isGroupLocked $group_index
This function returns the identifier number of the group containing the quilt.
$quilter getQuiltGroup $quilt
This function creates new groups from the specified quilts.
$quilter createGroup $quilts
This function returns the classification for the specified boundary.
$quilter getBoundaryClassification boundary
This function returns the setting for the specified boundary.
$quilter getBoundaryState ? -default | -user ? boundary
This function sets the state of the specified boundary to be blocking or open.
$quilter setBoundaryState boundary < Open | Blocking >
This function flips the state of the specified boundary to be blocking or open, whichever is the opposite of its previous state.
$quilter toggleBoundaryState boundary_list
This function queries whether a boundary is locked.
$quilter isBoundaryLocked $boundary
This action begins a mode in the application.
pw::Application begin ?-mode_specific_flags? mode ?entities?