Glyph2

Glyph2 is the scripting language for Pointwise.  It is an extension to the tcl programming language that allows access to the commands and entities of the Pointwise application.

Summary
Glyph2 is the scripting language for Pointwise.
A string is an array of characters.
An integer is a whole number.
A float is a fractional number.
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.
A color is represented as a 32-bit hex value, 0x00RRBBGG.
A vector is a list of float values.
A point is a position either in model space or database parameter space.
A plane is a list of four float values representing the geometric plane coefficients A, B, C and D.
A boundary is reference to either a database curve or the edge of a database surface.
An index is a list of integer values.
A coord is a position in grid space.
A register is the usage of a lower level entity in a higher level entity.
A framework_path is a reference to a specific framework.
A framework_entity is a reference to an entity in a pw::Framework.
A type is the class name of a Glyph2 object.

Primitives

string

A string is an array of characters.  They are represented as tcl strings.

integer

An integer is a whole number.  They are represented as tcl integers.

float

A float is a fractional number.  They are represented as tcl floating point numbers, which follows the ANSI-compliant C compiler specification, which includes representing floating point numbers in scientific format (e.g.  1.23e+4)

boolean

A boolean is represented as a 0 or 1, with 0 being false and 1 being true.  Commands that return a boolean will always return the value as a 0 or 1.  Commands that take a boolean as a parameter will accept the following representations:

  • integer, 0 is false and anything else is true
  • the strings true and false
  • the strings yes and no

color

A color is represented as a 32-bit hex value, 0x00RRBBGG.  Commands that return a color will always return the color in the 32-bit hex value form.  Commands that take a color as a parameter will accept the following representations:

  • 32-bit hex value, 0x00RRBBGG
  • html hex form, #RRGGBB
  • list of three values [0.0,1.0], a normalized real value for each color component

Examples

The following color values are equivalent.

  • 0x00FF7F3F
  • #FF7F3F
  • [1.0 0.5 0.25]

vector

A vector is a list of float values.  These are typically lists of three values for representing xyz coordinates, or two values for representing uv coordinates.

point

A point is a position either in model space or database parameter space.  If the point is referring to model space it will be in the form of an xyz vector.  If the point is referring to parameter space it will be in the form of a uv vector followed by a pw::DatabaseEntity object that is parametric or a face index and a pw::Quilt or pw::Shell.  Examples of these three different possibilities are as follows:

  • [list 1.0 2.0 3.0]
  • [list 0.1 0.2 $surf]
  • [list 0.3 0.4 5 $shell]

plane

A plane is a list of four float values representing the geometric plane coefficients A, B, C and D.  You can use pwu::Plane to construct a plane.  The following plane definitions are equivalent:

  • {1 0 0 0} ;# explicit plane definition
  • pwu::Plane set {1 0 0 0} ;# set with coefficients list
  • pwu::Plane set 1 0 0 0 ;# set with coefficient values
  • pwu::Plane set {1 0 0} {0 0 0} ;# set with normal and origin
  • pwu::Plane set {0 0 0} {0 10 0} {0 0 10} ;# set with three points

boundary

A boundary is reference to either a database curve or the edge of a database surface.  When referring to a database curve, it will be simply the pw::Curve.  If the boundary is the edge of a parametric surface, it will be a list comprised of the pw::Surface, either U or V to indicate the constant parameter, and the constant value of the parameter.  If the boundary is a trimmed curve, it will be a list comprised of the pw::Curve followed by the minimum parameter value and the maximum parameter value.  If the boundary is the edge of a shell, trim surface or quilt, it will be a list of the pw::Shell object, pw::SurfaceTrim object, or pw::Quilt object and the boundary index.  Examples of the different types are as follows:

  • [list $curve]
  • [list $surf U 1.0]
  • [list $curve 0.2 0.8]
  • [list $shell 2]
  • [list $tsurf 3]
  • [list $quilt 5]

index

An index is a list of integer values.  These are typically lists of three values for representing ijk coordinates, or two values for representing ij coordinates.

coord

A coord is a position in grid space.  The coord is specified as a list with the last element being a pw::GridEntity object.  The first elements of the list can be 1, 2, or 3 integers specifying the i, ij, or ijk of the coord.  Any missing j or k values are considered to be 1, and if the grid entity does not have j or k computational space, those values are ignored.  Examples of the three different possibilities are as follows:

  • [list 1 $con]
  • [list 5 10 $dom]
  • [list 10 15 20 $blk]

register

A register is the usage of a lower level entity in a higher level entity.

For the usage of a connector in a domain, it is represented as a list with two or three elements, the first being a pw::Domain object, the second a pw::Connector object, and the (optional) third is the orientation of the connector in the domain’s edge represented by the string Same or Opposite.  The orientation is optional when the connector is used only once in the domain.  If the orientation is not specified and the connector is used more than once in the domain, Same is assumed.

For the usage of a domain in a block, it is represented as a list with two or three elements, the first being a pw::Block object, the second a pw::Domain object, and the (optional) third is the orientation of the domain in the block’s face represented by the string Same or Opposite.  The orientation is optional when the domain is used only once in the block.  If the orientation is not specified and the domain is used more than once in the block, Same is assumed.

Examples of the different possibilities are as follows

  • [list $dom $con]
  • [list $dom $con Opposite]
  • [list $blk $dom]
  • [list $blk $dom Same]

framework_path

A framework_path is a reference to a specific framework.  It can be represented either as an ordered sequence (list) of pw::Framework objects or an ordered sequence (list) of framework names.

Examples

  • [list $fw1 $fw2 $fw3] where $fw1, $fw2 and $fw3 are pw::Framework objects and $fw1 is the root framework and $fw2 is a child framework of $fw1, and $fw3 is a child framework of $fw2
  • [list root A B] or {root A B} where root is the name of the root pw::Framework, A is the name of a child of root, and B is the name of a child of A.

framework_entity

A framework_entity is a reference to an entity in a pw::Framework.  Framework entities can be represented in any of the following ways:

Further, commands that accept lists of framework_entity may accept any of the above, or a list of any combination of the above.  For example:

type

A type is the class name of a Glyph2 object.  The type of an object is the string shown at the top of its relevant page in this manual, and always starts with the namespace qualifier “pw::”.  Valid types are any that derive from pw::Object, which includes all general, entity, mode, segment and support types.  For full type inheritance, see the Derives From section at the top of any page in this manual.

A float is a fractional number.
An integer is a whole number.
Framework type
A vector is a list of float values.
Base type for all database entities
Database quilt type
Database shell type
Utility functions for planes, which are represented as a list of four real values (the A, B, C and D coeffecients).
Database curve type
Database surface type
Database trim surface type
Domain type
Connector type
Block type
Entity type
A framework_path is a reference to a specific framework.
A framework_entity is a reference to an entity in a pw::Framework.
A string is an array of characters.
Base type for all glyph types