OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
Loading...
Searching...
No Matches
occtl::Transform Struct Reference

3-by-4 affine transform value type. Mirrors occtl_transform_t. More...

#include <geom.hpp>

Public Member Functions

 Transform (const occtl_transform_t &theC) noexcept
 Wraps an existing C value type (zero-cost).
 
const occtl_transform_tc_type () const noexcept
 Borrows-it view of the underlying C value type.
 
Point3 apply (const Point3 &theP) const noexcept
 Applies the full affine transform to a point (includes translation).
 
Vector3 apply (const Vector3 &theV) const noexcept
 Applies only the linear (3×3) part to a vector. No translation.
 
Direction3 apply (const Direction3 &theD) const
 Applies the linear part to a unit direction and re-normalises the result.
 
Transform compose (const Transform &theSecond) const noexcept
 Composition: returns "apply *this first, then @c theSecond". Equivalent to the matrix product theSecond * *this.
 
Transform inverted () const
 Returns the inverse transform.
 

Static Public Member Functions

static Transform identity () noexcept
 Returns the identity transform.
 
static Transform translation (const Vector3 &theV) noexcept
 Returns a pure-translation transform.
 
static Transform rotation (const Axis1Placement &theAxis, const double theAngle)
 Returns a rotation transform around theAxis by theAngle radians.
 
static Transform scale (const Point3 &theCenter, const double theFactor)
 Returns a uniform-scale transform centred on theCenter.
 
static Transform from_axis2 (const Axis2Placement &theFrame)
 Returns the world→frame transform for the given coordinate frame.
 
static Transform from_axis3 (const Axis3Placement &theFrame)
 Returns the transform whose linear columns are the explicit axes.
 

Detailed Description

3-by-4 affine transform value type. Mirrors occtl_transform_t.

Composition convention: see compose.

Member Function Documentation

◆ apply()

Direction3 occtl::Transform::apply ( const Direction3 theD) const
inline

Applies the linear part to a unit direction and re-normalises the result.

Exceptions
Errorwith code OCCTL_GEOMETRY_INVALID when the transform collapses the direction to zero.

◆ from_axis2()

static Transform occtl::Transform::from_axis2 ( const Axis2Placement theFrame)
inlinestatic

Returns the world→frame transform for the given coordinate frame.

Exceptions
Errorwith code OCCTL_GEOMETRY_INVALID when the frame is degenerate.

◆ from_axis3()

static Transform occtl::Transform::from_axis3 ( const Axis3Placement theFrame)
inlinestatic

Returns the transform whose linear columns are the explicit axes.

Exceptions
Errorwith code OCCTL_GEOMETRY_INVALID when the three axes are linearly dependent.

◆ inverted()

Transform occtl::Transform::inverted ( ) const
inline

Returns the inverse transform.

Exceptions
Errorwith code OCCTL_GEOMETRY_INVALID when *this is singular.

◆ rotation()

static Transform occtl::Transform::rotation ( const Axis1Placement theAxis,
const double  theAngle 
)
inlinestatic

Returns a rotation transform around theAxis by theAngle radians.

Exceptions
Errorwith code OCCTL_GEOMETRY_INVALID when the axis direction is zero.

◆ scale()

static Transform occtl::Transform::scale ( const Point3 theCenter,
const double  theFactor 
)
inlinestatic

Returns a uniform-scale transform centred on theCenter.

Exceptions
Errorwith code OCCTL_GEOMETRY_INVALID when theFactor is zero.

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