Blender V5.3
BLI_math_geom.hh File Reference
#include <optional>
#include "BLI_math_geom_c.hh"
#include "BLI_math_matrix_types.hh"
#include "BLI_math_vector.hh"
#include "BLI_span.hh"

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::math

Functions

Normals & Area
template<typename T>
VecBase< T, 3 > blender::math::normal_quad (const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3, const VecBase< T, 3 > &v4)
template<typename T>
T blender::math::area_tri (const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3)
template<typename T>
T blender::math::cotangent_tri_weight (const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3)
Planes
template<typename T>
VecBase< T, 4 > blender::math::plane_from_point_normal (const VecBase< T, 3 > &co, const VecBase< T, 3 > &no)
template<typename T>
T blender::math::plane_point_side (const VecBase< T, 4 > &plane, const VecBase< T, 3 > &co)
Distance & Closest Points
template<typename T, int Size>
VecBase< T, Size > blender::math::closest_to_line_segment (const VecBase< T, Size > &p, const VecBase< T, Size > &l1, const VecBase< T, Size > &l2)
template<typename T, int Size>
T blender::math::dist_squared_to_line_segment (const VecBase< T, Size > &p, const VecBase< T, Size > &l1, const VecBase< T, Size > &l2)
template<typename T>
VecBase< T, 3 > blender::math::closest_to_plane_normalized (const VecBase< T, 4 > &plane, const VecBase< T, 3 > &pt)
template<typename T>
VecBase< T, 3 > blender::math::closest_to_plane (const VecBase< T, 4 > &plane, const VecBase< T, 3 > &pt)
template<typename T>
T blender::math::dist_squared_to_plane (const VecBase< T, 3 > &p, const VecBase< T, 4 > &plane)
Projection Factors
template<typename T, int Size>
T blender::math::line_point_factor (const VecBase< T, Size > &p, const VecBase< T, Size > &l1, const VecBase< T, Size > &l2)
Matrix Utilities
float3x3 blender::math::axis_dominant_to_m3 (const float3 &normal)
Intersection
int blender::math::isect_line_line (const float3 &v1, const float3 &v2, const float3 &v3, const float3 &v4, float3 &r_i1, float3 &r_i2)
std::optional< float3 > blender::math::isect_line_plane (const float3 &l1, const float3 &l2, const float3 &plane_co, const float3 &plane_no)
template<typename T>
int blender::math::isect_point_tri (const VecBase< T, 2 > &pt, const VecBase< T, 2 > &v1, const VecBase< T, 2 > &v2, const VecBase< T, 2 > &v3)
template<typename T>
int blender::math::isect_point_quad (const VecBase< T, 2 > &p, const VecBase< T, 2 > &v1, const VecBase< T, 2 > &v2, const VecBase< T, 2 > &v3, const VecBase< T, 2 > &v4)
bool blender::math::isect_point_poly (const float2 &pt, Span< float2 > verts)
Barycentric Coordinates
float3 blender::math::barycentric_weights (const float2 &v1, const float2 &v2, const float2 &v3, const float2 &co)
Polygon Utilities
constexpr int blender::math::poly_to_tri_count (const int poly_count, const int corner_count)
float blender::math::area_poly (Span< float2 > verts)
void blender::math::interp_weights_poly (MutableSpan< float > r_weights, Span< float2 > verts, const float2 &co)
Interpolation
template<typename T>
VecBase< T, 3 > blender::math::interp_bilinear_quad (const VecBase< T, 3 > &v0, const VecBase< T, 3 > &v1, const VecBase< T, 3 > &v2, const VecBase< T, 3 > &v3, const T u, const T v)
Mapping
float2 blender::math::map_to_sphere (const float3 &co)