Archicad 28 C++ API
Loading...
Searching...
No Matches
Geometry

Provides functions for geometry related operations. More...

Classes

class  Geometry::GJKResult< VectorType >
 
struct  API_PrimHatchBorder
 Hatch border for primitive elements. More...
 
struct  API_PrimElemRef
 Primitive element reference. More...
 
struct  API_Prim_Head
 Header information for primitive elements. More...
 
struct  API_PrimHotspot
 A primitive hotspot. More...
 
struct  API_PrimPoint
 A primitive point. More...
 
struct  API_PrimLine
 A primitive line. More...
 
struct  API_PrimArc
 A primitive arc. More...
 
struct  API_PrimPLine
 A primitive polyline. More...
 
struct  API_PrimTri
 A primitive triangle. More...
 
struct  API_PrimPoly
 A primitive polygon. More...
 
struct  API_PrimPict
 A picture inside a placed drawing. More...
 

Functions

template<typename VectorType >
VectorType Geometry::GJKGetAveragePoint (const GS::Array< VectorType > &vertices)
 
template<typename VectorType >
VectorType Geometry::GJKGetFurthestPoint (const GS::Array< VectorType > &vertices, const VectorType &d)
 
template<typename VectorType >
VectorType Geometry::GJKGetSupport (const GS::Array< VectorType > &vertices1, const GS::Array< VectorType > &vertices2, const VectorType &d)
 
template<typename Coordinate >
bool Geometry::GJKDoSimplex (GS::Array< Vector2< Coordinate > > &simplex, Vector2< Coordinate > &direction)
 
template<typename Coordinate >
bool Geometry::GJKDoSimplex (GS::Array< Vector3< Coordinate > > &simplex, Vector3< Coordinate > &direction)
 
template<typename SupportFunction , typename VectorType >
GJKResult< VectorType > Geometry::GJKCollisionDetection (SupportFunction supportFunction, VectorType direction)
 
template<typename VectorType >
GJKResult< VectorType > Geometry::GJKCollisionDetection (const GS::Array< VectorType > &vertices1, const GS::Array< VectorType > &vertices2)
 

Detailed Description

Provides functions for geometry related operations.

Function Documentation

◆ GJKCollisionDetection() [1/2]

template<typename VectorType >
GJKResult< VectorType > Geometry::GJKCollisionDetection ( const GS::Array< VectorType > &  vertices1,
const GS::Array< VectorType > &  vertices2 
)

Specific implementation of the specialized GJK algorithm for two shapes defined by vertices.

Parameters
vertices1The array of vertices of the first shape.
vertices2The array of vertices of the second shape.
Returns
true if the zero point is included in the Minkowski difference, i.e. collision is detected, false otherwise.

◆ GJKCollisionDetection() [2/2]

template<typename SupportFunction , typename VectorType >
GJKResult< VectorType > Geometry::GJKCollisionDetection ( SupportFunction  supportFunction,
VectorType  direction 
)

Generic implementation of the specialized GJK algorithm for collision detection.

Parameters
supportFunctionThe support function callback to get the Minkowski difference point for a specific direction.
directionThe initial direction for algorithm startup.
Returns
true if the zero point is included in the Minkowski difference, i.e. collision is detected, false otherwise.

◆ GJKDoSimplex() [1/2]

template<typename Coordinate >
bool Geometry::GJKDoSimplex ( GS::Array< Vector2< Coordinate > > &  simplex,
Vector2< Coordinate > &  direction 
)

Zero-point check for the current simplex in the Minkowski space.

Specific implementation for the 2D case.

Parameters
simplexThe current simplex. The function updates it based on the zero-point direction.
directionThe current direction. The function updates it based on the zero-point direction.
Returns
true if the zero point is included in the Minkowski sum, i.e. collision is detected, false otherwise.

◆ GJKDoSimplex() [2/2]

template<typename Coordinate >
bool Geometry::GJKDoSimplex ( GS::Array< Vector3< Coordinate > > &  simplex,
Vector3< Coordinate > &  direction 
)

Zero-point check for the current simplex in the Minkowski space.

Specific implementation for the 3D case.

Parameters
simplexThe current simplex. The function updates it based on the zero-point direction.
directionThe current direction. The function updates it based on the zero-point direction.
Returns
true if the zero point is included in the Minkowski sum, i.e. collision is detected, false otherwise.

◆ GJKGetAveragePoint()

template<typename VectorType >
VectorType Geometry::GJKGetAveragePoint ( const GS::Array< VectorType > &  vertices)

This is to compute the average center (roughly).

It might be different from the Center of Gravity, especially for bodies with nonuniform density, but this is ok as the initial direction of simplex search in GJK.

Parameters
verticesThe array of vertices.
Returns
The average center point.

◆ GJKGetFurthestPoint()

template<typename VectorType >
VectorType Geometry::GJKGetFurthestPoint ( const GS::Array< VectorType > &  vertices,
const VectorType &  d 
)

Get the furthest vertex point along a certain direction.

Parameters
verticesThe array of vertices.
dThe direction vector.
Returns
The furthest vertex point.

◆ GJKGetSupport()

template<typename VectorType >
VectorType Geometry::GJKGetSupport ( const GS::Array< VectorType > &  vertices1,
const GS::Array< VectorType > &  vertices2,
const VectorType &  d 
)

Minkowski sum support function for GJK.

Parameters
vertices1The array of vertices of the first shape.
vertices2The array of vertices of the second shape.
dThe direction vector.
Returns
The Minkowski sum support point along the specified direction.