Enmesh
Loading...
Searching...
No Matches
Enmesh::Triangle Struct Reference

A struct representing a triangle in the mesh. More...

#include <triangle.h>

Public Member Functions

bool containsEdge (size_t v1, size_t v2) const
 Check if the circum circle of the triangle contains a specific edge defined by two vertex indices.
bool containsPoint (const std::vector< Point > &vertices, const Point &point)
 Check if the circum circle of the triangle contains a specific point.
bool operator== (const Triangle &other) const
 Overload the == operator to compare two triangles based on their vertex indices.

Public Attributes

std::array< size_t, 3 > v
 Indices of the vertices that form the triangle.
bool isBad = false
 Flag used in Delaunay triangulation to mark triangles that need to be removed.

Static Public Attributes

static constexpr size_t elementType = 2
 Gmsh element type for triangles.
static constexpr size_t numVertices = 3
 Number of vertices in a triangle.

Detailed Description

A struct representing a triangle in the mesh.

Member Function Documentation

◆ containsEdge()

bool Enmesh::Triangle::containsEdge ( size_t v1,
size_t v2 ) const

Check if the circum circle of the triangle contains a specific edge defined by two vertex indices.

Parameters
v1index of the first vertex of the edge
v2index of the second vertex of the edge

◆ containsPoint()

bool Enmesh::Triangle::containsPoint ( const std::vector< Point > & vertices,
const Point & point )

Check if the circum circle of the triangle contains a specific point.

Parameters
verticesThe list of vertices in the mesh
pointThe point to check
Returns
true if point is inside the circum circle, false otherwise

◆ operator==()

bool Enmesh::Triangle::operator== ( const Triangle & other) const
inline

Overload the == operator to compare two triangles based on their vertex indices.

Parameters
otherThe triangle to compare with
Returns
true if the triangles have the same vertex indices (regardless of order), false otherwise

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