OpenLexocad  27.1
Geom::Ax2 Class Reference

#include <Ax2.h>

Public Member Functions

 Ax2 ()=default
 Creates an indefinite coordinate system.
More...
 
 Ax2 (const Geom::Pnt &P, const Geom::Dir &N, const Geom::Dir &Vx)
 
 Ax2 (const Geom::Pnt &P, const Geom::Dir &V)
 
 Ax2 (const Geom::Pnt &aP, const Geom::Dir &aZDir, const Geom::Dir &aYDir, const Geom::Dir &aXDir)
 
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 Ax2 &Other) const
 
const Geom::Ax1axis () 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 isCoplanar (const Ax2 &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)
 
Ax2 mirrored (const Geom::Pnt &P) const
 
void mirror (const Geom::Ax1 &A1)
 
Ax2 mirrored (const Geom::Ax1 &A1) const
 
void mirror (const Ax2 &A2)
 
Ax2 mirrored (const Ax2 &A2) const
 
void rotate (const Geom::Ax1 &A1, const double Ang)
 
Ax2 rotated (const Geom::Ax1 &A1, const double Ang) const
 
void scale (const Geom::Pnt &P, const double S)
 
Ax2 scaled (const Geom::Pnt &P, const double S) const
 
void transform (const Geom::Trsf &T)
 
Ax2 transformed (const Geom::Trsf &T) const
 
void translate (const Geom::Vec &V)
 
Ax2 translated (const Geom::Vec &V) const
 
void translate (const Geom::Pnt &P1, const Geom::Pnt &P2)
 
Ax2 translated (const Geom::Pnt &P1, const Geom::Pnt &P2) const
 
bool isEqual (const Ax2 &Other, const double tolerance) const
 

Detailed Description

Describes a right-handed coordinate system in 3D space.
A coordinate system is defined by:

  • its origin (also referred to as its "Location point"), and
  • three orthogonal unit vectors, termed respectively the
    "X 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.
    The "main Direction" is also the "Z Direction".
    Since an Ax2 coordinate system is right-handed, its
    "main Direction" is always equal to the cross product of
    its "X Direction" and "Y Direction". (To define a
    left-handed coordinate system, use Geom::Ax3.)
    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 two axes", or
  • to define geometric transformations.
    Note: we refer to the "X Axis", "Y Axis" and "Z Axis",
    respectively, as to axes having:
  • the origin of the coordinate system as their origin, and
  • the unit vectors "X Direction", "Y Direction" and "main <br> Direction", respectively, as their unit vectors.
    The "Z Axis" is also the "main Axis".

Constructor & Destructor Documentation

◆ Ax2() [1/4]

Geom::Ax2::Ax2 ( )
default

Creates an indefinite coordinate system.

◆ Ax2() [2/4]

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

Creates an axis placement with an origin P such that:

  • N is the Direction, and
  • the "X Direction" is normal to N, in the plane
    defined by the vectors (N, Vx): "X <br> Direction" = (N ^ Vx) ^ N,
    Exception: raises ConstructionError if N and Vx are parallel (same or opposite orientation).

◆ Ax2() [3/4]

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

Creates - a coordinate system with an origin P, where V
gives the "main Direction" (here, "X Direction" and "Y <br> Direction" are defined automatically).

◆ Ax2() [4/4]

Geom::Ax2::Ax2 ( const Geom::Pnt aP,
const Geom::Dir aZDir,
const Geom::Dir aYDir,
const Geom::Dir aXDir 
)

Member Function Documentation

◆ angle()

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

Computes the angular value, in radians, 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::Ax2::axis ( ) const

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

◆ direction()

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

Returns the main direction of <me>.

◆ isCoplanar() [1/2]

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

◆ isCoplanar() [2/2]

bool Geom::Ax2::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 main direction of <me> and the direction of A1 are normal.
Note: the tolerance criterion for angular equality is given by AngularTolerance.

◆ isEqual()

bool Geom::Ax2::isEqual ( const Ax2 Other,
const double  tolerance 
) const

◆ location()

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

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

◆ mirror() [1/3]

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

Performs a symmetrical transformation of this coordinate
system with respect to:

  • the point P, and assigns the result to this coordinate system.
    Warning
    This transformation is always performed on the origin.
    In case of a reflection with respect to a point:
  • the main direction of the coordinate system is not changed, and
  • the "X Direction" and the "Y Direction" are simply reversed
    In case of a reflection with respect to an axis or a plane:
    • the transformation is applied to the "X Direction"
      and the "Y Direction", then
    • the "main Direction" is recomputed as the cross
      product "X Direction" ^ "Y Direction".
      This maintains the right-handed property of the
      coordinate system.

◆ mirror() [2/3]

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

Performs a symmetrical transformation of this coordinate
system with respect to:

  • the axis A1, and assigns the result to this coordinate systeme.
    Warning
    This transformation is always performed on the origin.
    In case of a reflection with respect to a point:
  • the main direction of the coordinate system is not changed, and
  • the "X Direction" and the "Y Direction" are simply reversed
    In case of a reflection with respect to an axis or a plane:
    • the transformation is applied to the "X Direction"
      and the "Y Direction", then
    • the "main Direction" is recomputed as the cross
      product "X Direction" ^ "Y Direction".
      This maintains the right-handed property of the
      coordinate system.

◆ mirror() [3/3]

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

Performs a symmetrical transformation of this coordinate
system with respect to:

  • the plane defined by the origin, "X Direction" and "Y <br> Direction" of coordinate system A2 and assigns the result to this coordinate systeme.
    Warning
    This transformation is always performed on the origin.
    In case of a reflection with respect to a point:
  • the main direction of the coordinate system is not changed, and
  • the "X Direction" and the "Y Direction" are simply reversed
    In case of a reflection with respect to an axis or a plane:
    • the transformation is applied to the "X Direction"
      and the "Y Direction", then
    • the "main Direction" is recomputed as the cross
      product "X Direction" ^ "Y Direction".
      This maintains the right-handed property of the
      coordinate system.

◆ mirrored() [1/3]

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

Performs a symmetrical transformation of this coordinate
system with respect to:

  • the point P, and creates a new one.
    Warning
    This transformation is always performed on the origin.
    In case of a reflection with respect to a point:
  • the main direction of the coordinate system is not changed, and
  • the "X Direction" and the "Y Direction" are simply reversed
    In case of a reflection with respect to an axis or a plane:
    • the transformation is applied to the "X Direction"
      and the "Y Direction", then
    • the "main Direction" is recomputed as the cross
      product "X Direction" ^ "Y Direction".
      This maintains the right-handed property of the
      coordinate system.

◆ mirrored() [2/3]

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

Performs a symmetrical transformation of this coordinate
system with respect to:

  • the axis A1, and creates a new one.
    Warning
    This transformation is always performed on the origin.
    In case of a reflection with respect to a point:
  • the main direction of the coordinate system is not changed, and
  • the "X Direction" and the "Y Direction" are simply reversed
    In case of a reflection with respect to an axis or a plane:
    • the transformation is applied to the "X Direction"
      and the "Y Direction", then
    • the "main Direction" is recomputed as the cross
      product "X Direction" ^ "Y Direction".
      This maintains the right-handed property of the
      coordinate system.

◆ mirrored() [3/3]

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

Performs a symmetrical transformation of this coordinate
system with respect to:

  • the plane defined by the origin, "X Direction" and "Y <br> Direction" of coordinate system A2 and creates a new one.
    Warning
    This transformation is always performed on the origin.
    In case of a reflection with respect to a point:
  • the main direction of the coordinate system is not changed, and
  • the "X Direction" and the "Y Direction" are simply reversed
    In case of a reflection with respect to an axis or a plane:
    • the transformation is applied to the "X Direction"
      and the "Y Direction", then
    • the "main Direction" is recomputed as the cross
      product "X Direction" ^ "Y Direction".
      This maintains the right-handed property of the
      coordinate system.

◆ rotate()

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

◆ rotated()

Ax2 Geom::Ax2::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::Ax2::scale ( const Geom::Pnt P,
const double  S 
)

◆ scaled()

Ax2 Geom::Ax2::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::Ax2::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.
Exceptions
Standard_ConstructionError if A1 is parallel to the "X <br> Direction" of this coordinate system.

◆ setDirection()

void Geom::Ax2::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)
Exceptions
Standard_ConstructionError if V is parallel to the "X <br> Direction" of this coordinate system.

◆ setLocation()

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

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

◆ setXDirection()

void Geom::Ax2::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).
Exceptions
Standard_ConstructionError if Vx or Vy is parallel to
the "main Direction" of this coordinate system.

◆ setYDirection()

void Geom::Ax2::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).
Exceptions
Standard_ConstructionError if Vx or Vy is parallel to
the "main Direction" of this coordinate system.

◆ transform()

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

◆ transformed()

Ax2 Geom::Ax2::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::Ax2::translate ( const Geom::Vec V)

◆ translate() [2/2]

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

◆ translated() [1/2]

Ax2 Geom::Ax2::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]

Ax2 Geom::Ax2::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::Ax2::xDirection ( ) const

Returns the "XDirection" of <me>.

◆ yDirection()

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

Returns the "YDirection" of <me>.


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