3.6Location, Direction, Plane and Axis Specification
Many commands require that a location or a direction be specified. Although entering the three floating point numbers required to uniquely define a vector is perfectly acceptable, it may be more convenient to specify the direction or location with respect to existing entities in the model.
For example, the following commands might be used for creating straight curves using location and direction specification described here:
Create Curve [From] Location {options} Direction {options} length <value>
3.6.1Command Panels for Specifying Location, Direction, Plane, and Axis
The command syntax for specifying location, direction, plane, and axis are some of the most powerful, yet complex in the Cubit command language. On those command panels where this information is required popup dialogs are available to assist the user define needed information. The dialogs are each derived from the same base parent, so their behavior is similar.
For example, the command for creating a simple curve (shown above) includes options for specifying a location and direction for the curve. The command panel for this command is shown below. Notice the fields for specifying location and direction. Each includes a button which, when pressed, will launch a dialog that includes all the details for a simple location of direction, or a very complicated location and direction. The dialogs are shown below.
Figure 81
The location, direction, plane, and axis commands often allow additional location, direction, plane, and axis syntax tokens as part of the definition. When this happens the ’child’ dialog’ will spawn a new tab. As the user hits the Apply button, the tokens will be written to the appropriate field on the parent dialog. An example below shows a direction dialog shown as a new tab in the location dialog. The new direction tab is highlighted in yellow.
Figure 82
3.6.2Specifying a Location
Some commands require a specified location or point (such as create curve spline) for the command. A location is basically an x-y-z position in the model. The following options determine a location specification:
3.6.2.1Position (XYZ values)
[Position] <xval yval zval>
The most basic way to specify a location is to just give the xyz values of the location. In this case the following two commands both draw a location at the coordinates (1, 2, 3), as the Position keyword is optional:
draw location position 1 2 3 draw location 1 2 3
3.6.2.2Last Location Used in a Command
Last
The last option recalls the last location used in a command. For example, if the following command is entered after the above position commands a location would be drawn at the position (1, 2, 3).
draw location last
Last locations do not carry over from Cubit session to Cubit session. The last location defaults to (0, 0, 0) if no location has been used during the session.
3.6.2.3Node or Vertex
[At] {Node|Vertex} <id_list>
Referring to a node or vertex simply returns the coordinates of that node or vertex. The command can also handle multiple locations where multiple locations are needed to complete the command string. The following draws a location at the coordinates of Vertex 5:
[On] Surface <id_list> [Close_To | At Location {options} | CENTER]
If a surface is used to specify a location without other options, the geometrical center of the surface is found (the center keyword is optional - the default). Otherwise, you can specify another general location and that location is projected to the surface. For example, the following command will draw the location that is position (5,0,0) projected to surface 1:
draw location on surface 1 location 5 0 0
Any valid location options listed on this page can be used to specify the location that is projected to the surface.
3.6.2.6On a Plane
[On] Plane <options> [Close_To | At Location {options}]
A location can be defined at the closest point on a plane to a location. See Specifying a Plane for plane options.
3.6.2.7Center
Center Curve <id_list>
Finds the center of an arc - an error is returned if the curve is not an arc.
The extrema option returns the location of the maximum value, on the specified entity or group, in the specified direction. For example, the following places a vertex on a surface at the point of maximum y-axis value.
create vertex location extrema surf 1 direction y
3.6.2.9Fire Ray
The fire ray command allows a user to identify a location, or set of locations, on an object by firing a ray at the object and determining the intersections. A ray can be fired at a list of bodies, volumes, surfaces, curves, or vertices. The fire ray command is:
Fire Ray Location {options} Direction {options} At {Body|Volume|Surface|Curve|Vertex} <ids> [Maximum Hits <val>] [Ray Radius <val>]
The location options are described on this page. The direction options are described under Specifying a Direction. The user can specify the maximum number of hits that he wishes to receive back from the command. If this value is omitted, the command will return all intersections found. When firing a ray at a curve, a ray radius must be used. The ray radius is the distance from the curve the ray must be to be considered a "hit." If no ray radius is used, the geometry engine default is used.
The between option finds a location that is between two locations or a location and an entity. An optional fraction can be given to specify the fractional distance from the first location to the second location or entity. For example, the following will draw a location at (5, 0, 0):
draw location between location 0 0 0 vertex 2 draw location between location 0 0 0 surface 1
In the second case, location (0, 0, 0) is projected to surface 1, then the location that is between (0, 0, 0) and the projected location is found.
Of course, any valid location can be used in the command. In the following example a location at the top center of the brick is found:
brick x 10 draw location between location bet vert 3 vert 2 location bet vert 8 vert 5
The first location is between vertices 3 and 2, and the second location is between vertices 8 and 5.
You can "swing" a location about an axis, "rotate" a direction about another direction, "revolve" an axis about another axis and "spin" a plane about an axis. The only reason Cubit needs to use different keywords for each entity type is because the Cubit command language does not support expressions (as in using parentheses). The keyword stop is also used in the location/direction/axis/plane parsing as a partial workaround to this limitation. Using this stop keyword will aid in parsing out extended location specifications. Insert a stop after the first location to let the parser know that where the specifications begin and end.
Any location can be optionally moved either a xyz distance or a certain distance in a given direction. As many moves as desired can be strung together. For example, the following will return a location at (5, 0, 0):
draw location 0 0 0 move 5 0 0
These examples add another move that basically moves the location (5, 0, 0) in a direction 45 degrees up and to the right a distance of 10 (all three commands are equivalent - see sections on directions and rotations):
Any location can be "swung" (rotated) about an axis by a certain angle. (See the section on specifying an axis for the axis syntax). As with moves, multiple swings can be strung together. The following example rotates the location (2.5, 5, 5) thirty degrees about an axis defined by Curve 11. Note that the right-hand rule is used to determine the direction of the swing about the axis.
Multiple location specifications can be used in a single command. For example, the following command uses several locations to create a spline curve at points (0,0,0), (1,2,3), (4,5,6), and (7,8,9).
Sometimes it is advantageous to preview a location before using it in a command. A location can be previewed with the Draw command. All of the options that can be used to specify locations in a command can be used to preview locations as well. See above for a description of these options. The command syntax is:
Some commands require you to specify a location on a curve (i.e., webcutting with a plane normal to a curve). The following are the options for specifying a location (or locations in the case of the segment option) on a curve:
3.6.3.1Center
center
The center option helps in identifying the location at the center of a given arc. Example: create vertex location on curve 3 center
3.6.3.2Start, Midpoint, or End
MIDPOINT | Start | End |
These options simply specify the location that is the midpoint, start or end point of a curve. By default, the midpoint is the understood location unless another location is specified.
The fraction option simply finds the location that is a fractional distance along the curve. By default, the fraction references the start of the curve; however, you can optionally specify which vertex to reference from.
The distance option not only can find a location that is a certain distance along the curve from the start or end of the curve, but can also find a location (or locations if there is more than one solution) on a curve that is a specified distance from another curve or a surface. If the From Curve option is used both curves must lie in the same plane.
draw location on curve 13 distance 7 from curve 2
Figure 84: Location on a Curve a Distance from Another Curve
3.6.3.5{Close_To|At} Location
{{Close_To|At} Location {options} | Position <xval><yval><zval> |{Node|Vertex} <id>} |
These options take a location closest to the location on the curve.
The extrema option finds the maximum value location along a curve in a specified direction. For example:
create vertex location on curve 1 extrema ny
Creates a vertex on curve 1 at the location where the y axis value of the curve is at a minimum.
3.6.3.7Segment
Segment <num_segs>
The segment option finds locations spaced evenly along the curve such as to break the curve into equal length "segments" (of course the curve is not modified). You must specify a minimum of two segments (if two segments were specified a location would be found at the center of the curve). The following example results in 4 locations:
draw location on curve 1 segment 5
create vertex on curve 1 segment 5
Figure 85
Figure 2 - Five Segments on a Curve
3.6.3.8Crossing
Crossing {Curve|Surface} <id_list> [Bounded|Near]
The crossing option finds locations at the intersection of the curve and another curve or surface. By default, the curve(s) and surface are extended to infinity and the intersections are calculated; if the bounded option is specified only intersections that lie on the bounded entities will be returned. The near option is valid only for two linear curves. If near is specified the nearest location between the two linear curves will be returned.
3.6.3.9Previewing a Location on a Curve
A location on a curve can be previewed with the Draw command. All of the options that can be used for specifying a location on a curve can be used to preview a location on a curve. See above for a description of these options. The command syntax is:
Draw Location On Curve <curve id> {options}
3.6.4Specifying a Direction
Some commands require a specified a direction or vector for the command. A direction is basically a xyz vector in the model. The following options determine a direction specification:
3.6.4.1Vector (XYZ values)
[Vector] <xval yval zval>
The most basic way to specify a direction is to just give the vector x-y-z components of the direction. The given vector need not be a unit vector. The following three commands simply draw a direction in the x-direction (1, 0, 0) as the Vector keyword is optional and unit vectors are not required:
draw direction vector 1 0 0 draw direction 1 0 0 draw direction 10 0 0
3.6.4.2Last Direction Used
Last
The last option recalls the last direction used in a command. For example, if the following command is entered after the above vector commands a direction location would be drawn in the x-direction (1, 0, 0).
draw direction last
Last directions do not carry over from Cubit session to Cubit session. The last direction defaults to (1, 0, 0) if no direction has been used during the session.
3.6.4.3Positive or Negative X,Y,Z Direction Vectors
X|Y|Z|Nx|Ny|Nz
The x|y|z|nx|ny|nz options assign the x direction, y direction, z direction, negative x direction, negative y direction and negative z direction respectively.
3.6.4.4On Curve Tangent
[On] | [Tangent] [At] Curve <id> {location on curve options}
The curve option simply finds a tangent vector on a curve. Note that the on, tangent and at keywords are optional, as well as the location on the curve. If no location is specified, the tangent at the start vertex of the curve is found. See the section above, Specifying a Location on a Curve, for details on how to specify where along the curve the tangent vector is found.
draw direction curve 1 draw direction on curve 1 draw direction tangent at curve 1 draw direction tangent at curve 1 distance 3 draw direction tangent at curve 1 fraction .5 draw direction tangent at curve 1 distance 2 reverse
The surface option simply finds a normal vector on a surface. Note that the "on", "normal" and "at" keywords are optional, as well as the location on the surface. If no location is specified, the normal vector at the center of the surface is found. If a location is specified, the location is projected to the surface, then the normal vector is found.
draw direction on surface 1 draw direction on surface 1 location 1 2 0
The from location option finds a direction that is from one location to another or from a location to an entity. If the second specification is an entity, the first location is projected to the entity to find the direction.
draw direction from vertex 1 vertex 2 draw direction from location on curve 1 fraction .5 surface 3
Note that when using an entity for the second specification, the Project and Entity keywords are generally optional. However, it is sometimes necessary to remove ambiguity from the previous location specification. For example, the following will not parse correctly:
draw direction location on curve 1 distance 2 surface 3
In this case, the location on the curve is parsed as a distance 2.0 from surface 3. Instead, the desired behavior is to find the location on curve 1 as a distance of 2.0 along the curve from the start of the curve, and project it to surface 3 to find the direction. The following commands (all equivalent) achieve this behavior:
draw direction location on curve 1 distance 2 project surface 3 draw direction location on curve 1 distance 2 entity surface 3 draw direction location on curve 1 distance 2 project entity surface 3
3.6.4.7Rotate
[Rotate {options}]
The rotate option allows you to rotate the direction about another vector. You can string together as many rotations as necessary. For example:
draw direction 1 0 0 rotate about z 135 rotate about curve 1 angle 50
Options that can be used with rotate are as follows:
Ax, Ay, Az (or X,Y,Z) angles can be entered in any order. The optional specification of another rotate keyword in the options indicated that multiple nested rotations are permitted.
3.6.4.8Cross
[Cross [With] Direction {options}]
The cross option allows you to find the vector cross product of the direction with another direction.
3.6.4.9Reverse
[Reverse]
This keyword simply reverses the direction specification.
3.6.4.10Previewing a Direction
Sometimes it is helpful to preview a direction before using it in a command. A direction may be previewed using the Draw command. The direction options are described above. See Specifying a Location for a list of location options.
Some commands require a specified axis (such as webcut with a cylinder) and it is sometimes advantageous to view an axis before modifying geometry. An axis is simply a vector with a specified origin. The following options determine an axis specification:
3.6.5.1Last
Last
The last option recalls the last axis used in an axis command. The last axis does not carry over from Cubit session to Cubit session.
To specify an axis simply specify a vector (a direction) and an origin (a location). Notice that the command requires the axis direction first because the origin defaults to 0 0 0 when not specified. An example of specifying an axis to draw a location using the swing command is as follows:
draw location 1 0 0 swing about axis direction z ang 45
Figure 87: Swinging a point about the z-axis
The location 1 0 0 was swung 45 degrees about an axis defined by a vector in the z direction and an origin at 0 0 0.
To revolve one axis around another use the revolve keyword. The following example revolves the first axis (defined by the y-axis and origin) around the second axis (defined by the z-axis and origin) by 45 degrees and draws the result.
draw axis direction y revolve axis direction z angle 45
Figure 88: Revolving an axis about another axis
3.6.5.4Previewing an Axis
Sometimes it is helpful to preview an axis before using it in a command. An axis may be previewed using the Draw command. The options for previewing an axis are the same as the ones described above.
The surface option uses and existing surface to define the plane. If it is not a planar surface, the optional location specifier can be used to find the tangent plane of a specific point on the surface.
draw plane surface 1 at location 4 0 0
Figure 93: Specifying a Tangent plane to a Surface
3.6.6.6Plane Normal to a Curve
[Normal To] Curve <id> [loc on curve options]
The Normal to Curve option allows you to define a plane by using an existing curve. The direction of the curve will define the surface normal of the new plane. The optional location argument specifies which point to use on the curve if it is not a straight curve. If no location is specified the plane will originate at the midpoint of the curve. See Specifying a Location on a Curve for more information on location options.
brick x 10 cylinder radius 3 z 12 subtract body 2 from 1 webcut body 1 xplane draw plane normal to curve 30
Figure 94: Draw Plane Normal to Curve
3.6.6.7Plane Defined by a Non-linear curve
Arc Curve <id>
A plane can be defined by a single curve, provided that curve is not linear.
A plane can be defined by a two linear curves, provided that the curves are not co-linear.
brick x 10 draw plane linear curve 2 3
3.6.6.9Normal Vector and Coefficient
Direction <Normal> Coefficient <val>
The direction and coefficient option allows you to specify a plane based on a vector and an offset from the origin. The Coefficient argument specifies how far to offset the plane from the origin
draw plane direction 1 2 3 coefficient 3
3.6.6.10Coordinate Plane
X|Xplane|Yz|Zy|Y|Yplane|Zx|Xz|Z|Zplane|Xy|Yx
A plane can be defined from any coordinate plane or combination thereof. The coordinate planes will pass through the origin unless optional specifiers are included.
draw plane xplane webcut volume 1 plane xz
3.6.6.11Last Location Used
Last
The last option will return the plane most recently used in a command. Last locations do not carry over from Cubit session to Cubit session. The last location defaults to (0, 0, 0) if no location has been used during the session.
The following options apply to all of the plane specification methods described above.
A offset value will offset the plane in the direction of the surface normal.
The move option will displace the plane in the specified directions by the specified distance. The direction options are outlined on Specifying a Direction.
The location option will move the plane to a specified location without rotating it. See Specifying a Location for location options.
The spin option will rotate the plane around an axis. See Specifying an Axis for axis options.
3.6.6.12Previewing a Plane
The ability to preview a plane prior to creating the plane or using it in a command is possible with the following commands:
The options for specifying a plane are described above in the section on Plane Specification. By default, the commands draw the plane just large enough to intersect the bounding box of the entire model with minimum surface area. Optionally, you can give a list of bodies to intersect for this calculation. You can also extend the size of the surface by either a percentage distance or an absolute distance of the minimum area size. The default color is blue, but you can specify a different one. See the Appendix of the Cubit Users Guide for available colors in Cubit.
3.6.6.13Preview a Cylindrical Plane
The ability to preview a cylindrical plane is possible with the following command:
The cylinder is defined by a radius and the cylinder axis. The axis is specified as a line corresponding to a coordinate axis, the normal to a specified surface, two arbitrary points, or an arbitrary point and the origin. The center point through which the cylinder axis passes can also be specified.
By default, the commands draw the cylinder just large enough to just intersect the bounding box of the entire model. Optionally, you can give a list of bodies to intersect for this calculation. You can also extend the length of the cylinder by either a percentage distance or an absolute distance of the cylinder length. The default color is blue, but you can specify a different one. See the Appendix of the Cubit Users Guide for available colors in Cubit.
3.6.7Drawing a Location, Direction, or Axis
Some commands require you to specify a location on a curve (i.e., webcutting with a plane normal to a curve). This location can be previewed with the following options:
A fraction along the curve from the start of the curve, or optionally, from a specified vertex on the curve.
A distance along the curve from the start of the curve, or optionally, from a specified vertex on the curve.
An xyz position that is moved to the closest point on the given curve.
The position of a vertex that is moved to the closest point on the given curve.
Draw Location On Curve <curve id> {Fraction <f> | Distance <d> | Position <xval><yval><zval> | Close_To Vertex <vertex_id>} [[From] Vertex <vertex_id> (optional for ’Fraction’ & ’Distance’)]
Some commands require a specified axis (such as webcut with a cylinder) and it is sometimes advantageous to view an axis before modifying geometry. To draw a preview of an axis use the following command:
Draw Axis {options}
Some commands require a specified location or point (such as create curve spline) and it is sometimes advantages to view a location before modifying or creating geometry. To draw a preview of a location use the following command: