Blender V4.3
mesh_sample.cc File Reference
#include "BKE_attribute_math.hh"
#include "BKE_bvhutils.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_sample.hh"
#include "BLI_math_geom.h"
#include "BLI_rand.hh"
#include "BLI_task.hh"

Go to the source code of this file.

Namespaces

namespace  blender
 
namespace  blender::bke
 
namespace  blender::bke::mesh_surface_sample
 

Functions

template<typename T >
static BLI_NOINLINE void blender::bke::mesh_surface_sample::sample_point_attribute (const Span< int > corner_verts, const Span< int3 > corner_tris, const Span< int > tri_indices, const Span< float3 > bary_coords, const VArray< T > &src, const IndexMask &mask, const MutableSpan< T > dst)
 
void blender::bke::mesh_surface_sample::sample_point_normals (Span< int > corner_verts, Span< int3 > corner_tris, Span< int > tri_indices, Span< float3 > bary_coords, Span< float3 > src, IndexMask mask, MutableSpan< float3 > dst)
 
void blender::bke::mesh_surface_sample::sample_point_attribute (Span< int > corner_verts, Span< int3 > corner_tris, Span< int > tri_indices, Span< float3 > bary_coords, const GVArray &src, const IndexMask &mask, GMutableSpan dst)
 
template<typename T , bool check_indices = false>
static BLI_NOINLINE void blender::bke::mesh_surface_sample::sample_corner_attribute (const Span< int3 > corner_tris, const Span< int > tri_indices, const Span< float3 > bary_coords, const VArray< T > &src, const IndexMask &mask, const MutableSpan< T > dst)
 
void blender::bke::mesh_surface_sample::sample_corner_normals (Span< int3 > corner_tris, Span< int > tri_indices, Span< float3 > bary_coords, Span< float3 > src, const IndexMask &mask, MutableSpan< float3 > dst)
 
void blender::bke::mesh_surface_sample::sample_corner_attribute (Span< int3 > corner_tris, Span< int > tri_indices, Span< float3 > bary_coords, const GVArray &src, const IndexMask &mask, GMutableSpan dst)
 
template<typename T >
void blender::bke::mesh_surface_sample::sample_face_attribute (const Span< int > tri_faces, const Span< int > tri_indices, const VArray< T > &src, const IndexMask &mask, const MutableSpan< T > dst)
 
void blender::bke::mesh_surface_sample::sample_face_attribute (Span< int > corner_tri_faces, Span< int > tri_indices, const GVArray &src, const IndexMask &mask, GMutableSpan dst)
 
template<bool check_indices = false>
static void blender::bke::mesh_surface_sample::sample_barycentric_weights (const Span< float3 > vert_positions, const Span< int > corner_verts, const Span< int3 > corner_tris, const Span< int > tri_indices, const Span< float3 > sample_positions, const IndexMask &mask, MutableSpan< float3 > bary_coords)
 
template<bool check_indices = false>
static void blender::bke::mesh_surface_sample::sample_nearest_weights (const Span< float3 > vert_positions, const Span< int > corner_verts, const Span< int3 > corner_tris, const Span< int > tri_indices, const Span< float3 > sample_positions, const IndexMask &mask, MutableSpan< float3 > bary_coords)
 
int blender::bke::mesh_surface_sample::sample_surface_points_spherical (RandomNumberGenerator &rng, const Mesh &mesh, Span< int > tris_to_sample, const float3 &sample_pos, float sample_radius, float approximate_density, Vector< float3 > &r_bary_coords, Vector< int > &r_tri_indices, Vector< float3 > &r_positions)
 
int blender::bke::mesh_surface_sample::sample_surface_points_projected (RandomNumberGenerator &rng, const Mesh &mesh, BVHTreeFromMesh &mesh_bvhtree, const float2 &sample_pos_re, const float sample_radius_re, const FunctionRef< void(const float2 &pos_re, float3 &r_start, float3 &r_end)> region_position_to_ray, const bool front_face_only, const int tries_num, const int max_points, Vector< float3 > &r_bary_coords, Vector< int > &r_tri_indices, Vector< float3 > &r_positions)
 
float3 blender::bke::mesh_surface_sample::compute_bary_coord_in_triangle (Span< float3 > vert_positions, Span< int > corner_verts, const int3 &corner_tri, const float3 &position)