OpenLexocad  27.1
Geom::Ax3 Class Reference

#include <Ax3.h>

Public Member Functions

 Ax3 ()
 Creates an indefinite coordinate system.
More...
 
 Ax3 (const Geom::Ax2 &A)
 
 Ax3 (const Geom::Pnt &P, const Geom::Dir &N, const Geom::Dir &Vx)
 
 Ax3 (const Geom::Pnt &P, const Geom::Dir &V)
 
void xReverse ()
 Reverses the X direction of <me>.
More...
 
void yReverse ()
 Reverses the Y direction of <me>.
More...
 
void zReverse ()
 Reverses the Z direction of <me>.
More...
 
void setAxis (const Geom::Ax1 &A1)
 
void setDirection (const Geom::Dir &V)
 
void setLocation (const Geom::Pnt &P)
 Changes the "Location" point (origin) of <me>.
More...
 
void setXDirection (const Geom::Dir &Vx)
 
void setYDirection (const Geom::Dir &Vy)
 
double angle (const Ax3 &Other) const
 
const Geom::Ax1axis () const
 
Geom::Ax2 axis2 () const
 
const Geom::Dirdirection () const
 Returns the main direction of <me>.
More...
 
const Geom::Pntlocation () const
 Returns the "Location" point (origin) of <me>.
More...
 
const Geom::DirxDirection () const
 Returns the "XDirection" of <me>.
More...
 
const Geom::DiryDirection () const
 Returns the "YDirection" of <me>.
More...
 
bool direct () const
 
bool isCoplanar (const Ax3 &Other, const double LinearTolerance, const double AngularTolerance) const
 
bool isCoplanar (const Geom::Ax1 &A1, const double LinearTolerance, const double AngularTolerance) const
 
void mirror (const Geom::Pnt &P)
 
Ax3 mirrored (const Geom::Pnt &P) const
 
void mirror (const Geom::Ax1 &A1)
 
Ax3 mirrored (const Geom::Ax1 &A1) const
 
void mirror (const Geom::Ax2 &A2)
 
Ax3 mirrored (const Geom::Ax2 &A2) const
 
void rotate (const Geom::Ax1 &A1, const double Ang)
 
Ax3 rotated (const Geom::Ax1 &A1, const double Ang) const
 
void scale (const Geom::Pnt &P, const double S)
 
Ax3 scaled (const Geom::Pnt &P, const double S) const
 
void transform (const Geom::Trsf &T)
 
Ax3 transformed (const Geom::Trsf &T) const
 
void translate (const Geom::Vec &V)
 
Ax3 translated (const Geom::Vec &V) const
 
void translate (const Geom::Pnt &P1, const Geom::Pnt &P2)
 
Ax3 translated (const Geom::Pnt &P1, const Geom::Pnt &P2) const
 

Detailed Description

Describes a coordinate system in 3D space. Unlike a
Geom::Ax2 coordinate system, a Ax3 can be
right-handed ("direct sense) or left-handed ("indirect sense").
A coordinate system is defined by:

  • its origin (also referred to as its "Location point"), and
  • three orthogonal unit vectors, termed the "X <br> Direction", the "Y Direction" and the "Direction" (also
    referred to as the "main Direction").
    The "Direction" of the coordinate system is called its
    "main Direction" because whenever this unit vector is
    modified, the "X Direction" and the "Y Direction" are
    recomputed. However, when we modify either the "X <br> Direction" or the "Y Direction", "Direction" is not modified.
    "Direction" is also the "Z Direction".
    The "main Direction" is always parallel to the cross
    product of its "X Direction" and "Y Direction".
    If the coordinate system is right-handed, it satisfies the equation:
    "main Direction" = "X Direction" ^ "Y Direction"
    and if it is left-handed, it satisfies the equation:
    "main Direction" = -"X Direction" ^ "Y Direction"
    A coordinate system is used:
  • to describe geometric entities, in particular to position
    them. The local coordinate system of a geometric
    entity serves the same purpose as the STEP function
    "axis placement three axes", or
  • to define geometric transformations.
    Note:
  • We refer to the "X Axis", "Y Axis" and "Z Axis",
    respectively, as the axes having:
  • the origin of the coordinate system as their origin, and
  • the unit vectors "X Direction", "Y Direction" and
    "main Direction", respectively, as their unit vectors.
  • The "Z Axis" is also the "main Axis".
  • Geom::Ax2 is used to define a coordinate system that must be always right-handed.

Constructor & Destructor Documentation

◆ Ax3() [1/4]

Geom::Ax3::Ax3 ( )

Creates an indefinite coordinate system.

◆ Ax3() [2/4]

Geom::Ax3::Ax3 ( const Geom::Ax2 A)

Creates a coordinate system from a right-handed
coordinate system.

◆ Ax3() [3/4]

Geom::Ax3::Ax3 ( const Geom::Pnt P,
const Geom::Dir N,
const Geom::Dir Vx 
)

Creates a right handed axis placement with the
"Location" point P and two directions, N gives the
"Direction" and Vx gives the "XDirection".
Raises ConstructionError if N and Vx are parallel (same or opposite orientation).

◆ Ax3() [4/4]

Geom::Ax3::Ax3 ( const Geom::Pnt P,
const Geom::Dir V 
)

Creates an axis placement with the "Location" point


and the normal direction <V>.

Member Function Documentation

◆ angle()

double Geom::Ax3::angle ( const Ax3 Other) const

Computes the angular value between the main direction of
<me> and the main direction of <Other>. Returns the angle
between 0 and PI in radians.

◆ axis()

const Geom::Ax1& Geom::Ax3::axis ( ) const

Returns the main axis of <me>. It is the "Location" point
and the main "Direction".

◆ axis2()

Geom::Ax2 Geom::Ax3::axis2 ( ) const

Computes a right-handed coordinate system with the
same "X Direction" and "Y Direction" as those of this
coordinate system, then recomputes the "main Direction".
If this coordinate system is right-handed, the result
returned is the same coordinate system. If this
coordinate system is left-handed, the result is reversed.

◆ direct()

bool Geom::Ax3::direct ( ) const

Returns True if the coordinate system is right-handed. i.e.
XDirection().Crossed(YDirection()).Dot(Direction()) > 0

◆ direction()

const Geom::Dir& Geom::Ax3::direction ( ) const

Returns the main direction of <me>.

◆ isCoplanar() [1/2]

bool Geom::Ax3::isCoplanar ( const Ax3 Other,
const double  LinearTolerance,
const double  AngularTolerance 
) const

Returns True if
. the distance between the "Location" point of <me> and
<Other> is lower or equal to LinearTolerance and
. the distance between the "Location" point of <Other> and
<me> is lower or equal to LinearTolerance and
. the main direction of <me> and the main direction of
<Other> are parallel (same or opposite orientation).

◆ isCoplanar() [2/2]

bool Geom::Ax3::isCoplanar ( const Geom::Ax1 A1,
const double  LinearTolerance,
const double  AngularTolerance 
) const

Returns True if
. the distance between <me> and the "Location" point of A1
is lower of equal to LinearTolerance and
. the distance between A1 and the "Location" point of <me>
is lower or equal to LinearTolerance and
. the main direction of <me> and the direction of A1 are normal.

◆ location()

const Geom::Pnt& Geom::Ax3::location ( ) const

Returns the "Location" point (origin) of <me>.

◆ mirror() [1/3]

void Geom::Ax3::mirror ( const Geom::Pnt P)

◆ mirror() [2/3]

void Geom::Ax3::mirror ( const Geom::Ax1 A1)

◆ mirror() [3/3]

void Geom::Ax3::mirror ( const Geom::Ax2 A2)

◆ mirrored() [1/3]

Ax3 Geom::Ax3::mirrored ( const Geom::Pnt P) const

Performs the symmetrical transformation of an axis
placement with respect to the point P which is the
center of the symmetry.
Warnings :
The main direction of the axis placement is not changed.
The "XDirection" and the "YDirection" are reversed.
So the axis placement stay right handed.

◆ mirrored() [2/3]

Ax3 Geom::Ax3::mirrored ( const Geom::Ax1 A1) const

Performs the symmetrical transformation of an axis
placement with respect to an axis placement which
is the axis of the symmetry.
The transformation is performed on the "Location"
point, on the "XDirection" and "YDirection".
The resulting main "Direction" is the cross product between
the "XDirection" and the "YDirection" after transformation.

◆ mirrored() [3/3]

Ax3 Geom::Ax3::mirrored ( const Geom::Ax2 A2) const

Performs the symmetrical transformation of an axis
placement with respect to a plane.
The axis placement <A2> locates the plane of the symmetry :
(Location, XDirection, YDirection).
The transformation is performed on the "Location"
point, on the "XDirection" and "YDirection".
The resulting main "Direction" is the cross product between
the "XDirection" and the "YDirection" after transformation.

◆ rotate()

void Geom::Ax3::rotate ( const Geom::Ax1 A1,
const double  Ang 
)

◆ rotated()

Ax3 Geom::Ax3::rotated ( const Geom::Ax1 A1,
const double  Ang 
) const

Rotates an axis placement. <A1> is the axis of the
rotation . Ang is the angular value of the rotation
in radians.

◆ scale()

void Geom::Ax3::scale ( const Geom::Pnt P,
const double  S 
)

◆ scaled()

Ax3 Geom::Ax3::scaled ( const Geom::Pnt P,
const double  S 
) const

Applies a scaling transformation on the axis placement.
The "Location" point of the axisplacement is modified.
Warnings :
If the scale <S> is negative :
. the main direction of the axis placement is not changed.
. The "XDirection" and the "YDirection" are reversed.
So the axis placement stay right handed.

◆ setAxis()

void Geom::Ax3::setAxis ( const Geom::Ax1 A1)

Assigns the origin and "main Direction" of the axis A1 to
this coordinate system, then recomputes its "X Direction" and "Y Direction".
Note:

  • The new "X Direction" is computed as follows:
    new "X Direction" = V1 ^(previous "X Direction" ^ V)
    where V is the "Direction" of A1.
  • The orientation of this coordinate system
    (right-handed or left-handed) is not modified.
    Raises ConstructionError if the "Direction" of <A1> and the "XDirection" of <me>
    are parallel (same or opposite orientation) because it is
    impossible to calculate the new "XDirection" and the new
    "YDirection".

◆ setDirection()

void Geom::Ax3::setDirection ( const Geom::Dir V)

Changes the main direction of this coordinate system,
then recomputes its "X Direction" and "Y Direction".
Note:

  • The new "X Direction" is computed as follows:
    new "X Direction" = V ^ (previous "X Direction" ^ V).
  • The orientation of this coordinate system (left- or right-handed) is not modified.
    Raises ConstructionError if <V< and the previous "XDirection" are parallel
    because it is impossible to calculate the new "XDirection"
    and the new "YDirection".

◆ setLocation()

void Geom::Ax3::setLocation ( const Geom::Pnt P)

Changes the "Location" point (origin) of <me>.

◆ setXDirection()

void Geom::Ax3::setXDirection ( const Geom::Dir Vx)

Changes the "Xdirection" of <me>. The main direction
"Direction" is not modified, the "Ydirection" is modified.
If <Vx> is not normal to the main direction then <XDirection>
is computed as follows XDirection = Direction ^ (Vx ^ Direction).
Raises ConstructionError if <Vx> is parallel (same or opposite
orientation) to the main direction of <me>

◆ setYDirection()

void Geom::Ax3::setYDirection ( const Geom::Dir Vy)

Changes the "Ydirection" of <me>. The main direction is not
modified but the "Xdirection" is changed.
If <Vy> is not normal to the main direction then "YDirection"
is computed as follows
YDirection = Direction ^ (<Vy> ^ Direction).
Raises ConstructionError if <Vy> is parallel to the main direction of <me>

◆ transform()

void Geom::Ax3::transform ( const Geom::Trsf T)

◆ transformed()

Ax3 Geom::Ax3::transformed ( const Geom::Trsf T) const

Transforms an axis placement with a Trsf.
The "Location" point, the "XDirection" and the
"YDirection" are transformed with T. The resulting
main "Direction" of <me> is the cross product between
the "XDirection" and the "YDirection" after transformation.

◆ translate() [1/2]

void Geom::Ax3::translate ( const Geom::Vec V)

◆ translate() [2/2]

void Geom::Ax3::translate ( const Geom::Pnt P1,
const Geom::Pnt P2 
)

◆ translated() [1/2]

Ax3 Geom::Ax3::translated ( const Geom::Vec V) const

Translates an axis plaxement in the direction of the vector
<V>. The magnitude of the translation is the vector's magnitude.

◆ translated() [2/2]

Ax3 Geom::Ax3::translated ( const Geom::Pnt P1,
const Geom::Pnt P2 
) const

Translates an axis placement from the point <P1> to the
point <P2>.

◆ xDirection()

const Geom::Dir& Geom::Ax3::xDirection ( ) const

Returns the "XDirection" of <me>.

◆ xReverse()

void Geom::Ax3::xReverse ( )

Reverses the X direction of <me>.

◆ yDirection()

const Geom::Dir& Geom::Ax3::yDirection ( ) const

Returns the "YDirection" of <me>.

◆ yReverse()

void Geom::Ax3::yReverse ( )

Reverses the Y direction of <me>.

◆ zReverse()

void Geom::Ax3::zReverse ( )

Reverses the Z direction of <me>.


The documentation for this class was generated from the following file: