On this page:
3.6.2 Specifying a Location
3.6.3 Specifying a Location on a Curve
3.6.4 Specifying a Direction
3.6.5 Specifying an Axis
3.6.6 Specifying a Plane
3.6.7 Drawing a Location, Direction, or Axis
2022.4+26187-e1209cf7 Apr 14, 2022

3.6 Location, 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.1 Command 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 91:

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 92:

3.6.2 Specifying 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.1 Position (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.2 Last 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.3 Node 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:

draw location vertex 5

3.6.2.4 On a Curve

Various options are available to specify a location on a curve. See the section Specifying a Location On a Curve for details.

3.6.2.5 On a Surface

[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.6 On 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.7 Center

Center Curve <id_list>

Finds the center of an arc - an error is returned if the curve is not an arc.

3.6.2.8 Extrema

Extrema {Curve|Surface|Volume|Body|Group} <range> [Direction] {options} [Direction {options}] [Direction {options}]

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.9 Fire 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.

3.6.2.10 Between

Between {Location <options> Location <options> } | {Location <options> Project {Curve|Surface} <range>} [Stop] [Fraction <val>]

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 location 10 0 0

The following will draw a location at (2.5, 0, 0) - 25% of the distance from (0, 0, 0) to (10, 0, 0):

draw location between location 0 0 0 location 10 0 0 fraction .25

The second item can be an entity:

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.

3.6.2.11 Move

Move [All] { <xval yval zval> | {Dx|X|Dy|Y|Dz|Z} <val> | Direction {options} Distance <val> }

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):

draw location 0 0 0 move 5 0 0 move {10*sind(45)} {10*sind(45)} 0
draw location 0 0 0 move 5 0 0 move direction 1 1 0 distance 10
draw location 0 0 0 move 5 0 0 move direction 1 0 0 rotate about 0 0 1 angle 45 dist 10

3.6.2.12 Swing

Swing [All] [About] Axis {options} Angle <ang>

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.

draw location 2.5 5 5 swing about axis curve 11 angle 30

Figure 93: Swinging a Location

3.6.2.13 Multiple Location Specification

Location {options} Location {options}...

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).

create curve spline location 0 0 0 location 1 2 3 location 4 5 6 location 7 8 9

3.6.2.14 Previewing a Location

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:

Draw Location {options}

3.6.3 Specifying a Location on a Curve

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.1 Center

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.2 Start, 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.

3.6.3.3 Fraction

Fraction <val 0.0 to 1.0> [From Vertex <id> | Start|End] |

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.

3.6.3.4 Distance

Distance <d> [From {Vertex|Curve|Surface} <id> | Start | End ] |

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 94: 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.

3.6.3.6 Extrema

Extrema [Direction] {options} [Direction {options}] [Direction {options}]

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.7 Segment

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 95:

Figure 2 - Five Segments on a Curve

3.6.3.8 Crossing

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.9 Previewing 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.4 Specifying 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.1 Vector (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.2 Last 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.3 Positive 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.4 On 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

Figure 96:

Figure 1 - Tangents to a Curve

3.6.4.5 On Surface Normal

[On] | [Normal] [At] Surface <id> [{close_to|at Location {options}} | CENTER]

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

3.6.4.6 From Location

[From] {Location {options} | Node|Vertex <id>} [Project] {Location {options} | [Entity]
{Node|Vertex|Curve|Surface} <id>}

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.7 Rotate

[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|X|Ay|Y|Az|Z [Angle] <angle>} | { {[About] | Towards} Direction {options} Angle <val> } [Rotate (options)] [Origin (location)]

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.8 Cross

[Cross [With] Direction {options}]

The cross option allows you to find the vector cross product of the direction with another direction.

3.6.4.9 Reverse

[Reverse]

This keyword simply reverses the direction specification.

3.6.4.10 Previewing 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.

Draw Direction {direction_options} [Location (location_options)]

3.6.5 Specifying an Axis

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.1 Last

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.

3.6.5.2 Specify an origin and a vector

{Direction {options} [Origin [Location] {options}] [Length <val>] [Angle <val>]}

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 97: 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.

3.6.5.3 Revolve an axis about an axis

[Axis {options} Revolve [About] Axis {options} Angle <val>]

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 98: Revolving an axis about another axis

3.6.5.4 Previewing 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.

Draw Axis {options}

3.6.6 Specifying a Plane

Some commands require a specified plane (such as sweep curve target) for the command.

3.6.6.1 Location and Normal Vector

{Location|Vertex|Node} <origin> Direction <normal>

The first way to specify a plane is to specify a starting point and a direction vector:

draw plane location 1 2 3 direction 0 1 1
draw plane vertex 1 direction tangent at curve 1

Figure 99: Specifying a plane with a location and surface normal

To see the options for location specification, see Specifying a Location. Direction options can be found at Specifying a Direction.

3.6.6.2 Location and Two Vectors on the Plane

{Location|Vertex|Node} <origin> Direction <vec on plane> Direction <vec on plane>

It is also possible to select an origin point and 2 direction vectors on the plane.

Figure 100: Specifying a plane with a point and 2 in-plane vectors

3.6.6.3 Two Locations and Vector on the Plane

{Location|Vertex|Node} <2 locations> Direction <vector on the plane>

You can also specify 2 locations and 1 direction on the plane to define the plane.

draw plane vertex 1 2 direction 0 1 1

Figure 101: Specifying 2 locations and 1 direction on the plane

3.6.6.4 Three Points on the Plane

{Location|Vertex|Node} <3 locations>

A plane can be defined by three locations, vertices, or nodes. The locations are specified using Location Specification.

draw plane vertex 1 2 3
draw plane vertex 1 2 location 3 4 5

Figure 102: A plane specified by three points

3.6.6.5 Plane defined by a Surface

Surface <id> [At Location <loc>]

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 103: Specifying a Tangent plane to a Surface

3.6.6.6 Plane 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 104: Draw Plane Normal to Curve

3.6.6.7 Plane Defined by a Non-linear curve

Arc Curve <id>

A plane can be defined by a single curve, provided that curve is not linear.

cylinder height 12 radius 3
draw plane arc curve 2

3.6.6.8 Plane Defined by a two linear curves

Linear Curve <id> <id>

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.9 Normal 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.10 Coordinate 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.11 Last 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.

[Offset <val>]

[Move {<xval yval zval>}| {Dx|X|Dy|Y|Dz|Z} <val> | Direction {options} [Distance <val>]]

[[To] Location {options}]

[Spin [About] Axis {options} Angle <ang>]]

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.12 Previewing 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:

Draw Plane (options) [Graphics | {[Intersecting] {Body|Volume} <id_range>] [ [Extended] {Percentage|Absolute} <val>]}] [Color ’color_name’]

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.13 Preview a Cylindrical Plane

The ability to preview a cylindrical plane is possible with the following command:

Draw Cylinder Radius <val> Axis {x|y|z|Vertex <id_1> Vertex <id_2> | <xyz values>} [Center <x_val> <y_val> <z_val>] [[Intersecting] Body <id_range>] [Extended Percentage|Absolute <val>] [Color ’color_name’]

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.7 Drawing 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:

  1. A fraction along the curve from the start of the curve, or optionally, from a specified vertex on the curve.

  2. A distance along the curve from the start of the curve, or optionally, from a specified vertex on the curve.

  3. An xyz position that is moved to the closest point on the given curve.

  4. 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:

Draw Location {options} [color <color_name>][no_flush]

Similar commands for drawing lines and polygons may also be useful.