|
Blender V5.0
|
Classes | |
| struct | CornerNormalSpace |
| struct | CornerNormalSpaceArray |
| class | NormalJoinInfo |
| struct | VertCornerInfo |
| struct | EdgeOneCorner |
| struct | EdgeTwoCorners |
| struct | EdgeSharp |
| struct | CornerSpaceGroup |
| struct | MeshToTangentQuadsTris |
| struct | SGLSLMeshToTangent |
| struct | LocalData |
Typedefs | |
| using | EdgeUninitialized = std::monostate |
| using | VertEdgeInfo = std::variant<EdgeUninitialized, EdgeOneCorner, EdgeTwoCorners, EdgeSharp> |
| using | LocalEdgeVectorSet |
Functions | |
| int | face_corner_prev (const IndexRange face, const int corner) |
| int | face_corner_next (const IndexRange face, const int corner) |
| int | face_find_corner_from_vert (const IndexRange face, const Span< int > corner_verts, const int vert) |
| int2 | face_find_adjacent_verts (const IndexRange face, const Span< int > corner_verts, const int vert) |
| int | face_triangles_num (const int face_size) |
| IndexRange | face_triangles_range (OffsetIndices< int > faces, int face_i) |
| int | edge_other_vert (const int2 edge, const int vert) |
| Array< int > | build_corner_to_face_map (OffsetIndices< int > faces) |
| GroupedSpan< int > | build_vert_to_edge_map (Span< int2 > edges, int verts_num, Array< int > &r_offsets, Array< int > &r_indices) |
| void | build_vert_to_face_indices (OffsetIndices< int > faces, Span< int > corner_verts, OffsetIndices< int > offsets, MutableSpan< int > face_indices) |
| GroupedSpan< int > | build_vert_to_face_map (OffsetIndices< int > faces, Span< int > corner_verts, int verts_num, Array< int > &r_offsets, Array< int > &r_indices) |
| Array< int > | build_vert_to_corner_indices (Span< int > corner_verts, OffsetIndices< int > offsets) |
| GroupedSpan< int > | build_vert_to_corner_map (Span< int > corner_verts, int verts_num, Array< int > &r_offsets, Array< int > &r_indices) |
| GroupedSpan< int > | build_edge_to_corner_map (Span< int > corner_edges, int edges_num, Array< int > &r_offsets, Array< int > &r_indices) |
| GroupedSpan< int > | build_edge_to_face_map (OffsetIndices< int > faces, Span< int > corner_edges, int edges_num, Array< int > &r_offsets, Array< int > &r_indices) |
| void | calc_uv_tangent_tris_quads (Span< float3 > vert_positions, OffsetIndices< int > faces, Span< int > corner_verts, Span< float3 > corner_normals, Span< float2 > uv_map, MutableSpan< float4 > results, ReportList *reports) |
| static float3 | face_center_calc_ngon (const Span< float3 > vert_positions, const Span< int > face_verts) |
| static float | mesh_calc_face_volume_centroid_with_reference_center (const Span< float3 > positions, const Span< int > face_verts, const float3 &reference_center, float r_cent[3]) |
| static float | face_area_centroid_calc (const Span< float3 > positions, const Span< int > face_verts, float r_cent[3]) |
| static Array< int > | create_reverse_offsets (const Span< int > indices, const int items_num) |
| static void | sort_small_groups (const OffsetIndices< int > groups, const int grain_size, MutableSpan< int > indices) |
| static Array< int > | reverse_indices_in_groups (const Span< int > group_indices, const OffsetIndices< int > offsets) |
| static void | reverse_group_indices_in_groups (const OffsetIndices< int > groups, const Span< int > group_to_elem, const OffsetIndices< int > offsets, MutableSpan< int > results) |
| static GroupedSpan< int > | gather_groups (const Span< int > group_indices, const int groups_num, Array< int > &r_offsets, Array< int > &r_indices) |
| static void | mix_normals_corner_to_vert (const Span< float3 > vert_positions, const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_face_map, const Span< float3 > corner_normals, MutableSpan< float3 > vert_normals) |
| static void | mix_normals_vert_to_face (const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< float3 > vert_normals, MutableSpan< float3 > face_normals) |
| static void | mix_normals_corner_to_face (const OffsetIndices< int > faces, const Span< float3 > corner_normals, MutableSpan< float3 > face_normals) |
| static CornerNormalSpace | corner_fan_space_define (const float3 &lnor, const float3 &vec_ref, const float3 &vec_other, const Span< float3 > edge_vectors) |
| static float3 | corner_space_custom_data_to_normal (const CornerNormalSpace &lnor_space, const short2 clnor_data) |
| static void | mesh_edges_sharp_tag (const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< int > corner_edges, const Span< int > corner_to_face_map, const Span< float3 > face_normals, const Span< bool > sharp_faces, const Span< bool > sharp_edges, const float split_angle, MutableSpan< int2 > edge_to_corners, MutableSpan< bool > r_sharp_edges) |
| static void | collect_corner_info (const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< int > vert_faces, const int vert, MutableSpan< VertCornerInfo > r_corner_infos) |
| static void | add_corner_to_edge (const Span< int > corner_edges, const Span< bool > sharp_edges, const int local_corner, const int corner, const int other_corner, const bool winding_torwards_vert, VertEdgeInfo &info) |
| static void | calc_local_edge_indices (MutableSpan< VertCornerInfo > corner_infos, LocalEdgeVectorSet &r_other_vert_to_edge) |
| static void | calc_connecting_edge_info (const Span< int > corner_edges, const Span< bool > sharp_edges, const Span< bool > sharp_faces, const Span< VertCornerInfo > corner_infos, MutableSpan< VertEdgeInfo > edge_infos) |
| static void | traverse_fan_local_corners (const Span< VertCornerInfo > corner_infos, const Span< VertEdgeInfo > edge_infos, const int start_local_corner, Vector< int, 16 > &result_fan) |
| static void | calc_edge_directions (const Span< float3 > vert_positions, const Span< int > local_edge_by_vert, const float3 &vert_position, MutableSpan< float3 > edge_dirs) |
| static float3 | accumulate_fan_normal (const Span< VertCornerInfo > corner_infos, const Span< float3 > edge_dirs, const Span< float3 > face_normals, const Span< int > local_corners_in_fan) |
| static BLI_NOINLINE void | handle_fan_result_and_custom_normals (const Span< short2 > custom_normals, const Span< VertCornerInfo > corner_infos, const Span< float3 > edge_dirs, const Span< int > local_corners_in_fan, float3 &fan_normal, CornerNormalSpaceArray *r_fan_spaces, Vector< CornerSpaceGroup, 0 > *r_local_space_groups) |
| static void | mesh_normals_corner_custom_set (const Span< float3 > positions, const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< int > corner_edges, const GroupedSpan< int > vert_to_face_map, const Span< float3 > vert_normals, const Span< float3 > face_normals, const Span< bool > sharp_faces, const bool use_vertices, MutableSpan< float3 > r_custom_corner_normals, MutableSpan< bool > sharp_edges, MutableSpan< short2 > r_clnors_data) |
| static void | mesh_set_custom_normals (Mesh &mesh, MutableSpan< float3 > r_custom_nors, const bool use_vertices) |
| static bke::AttrDomain | normal_domain_to_domain (bke::MeshNormalDomain domain) |
Polygon Data Evaluation | |
| float3 | face_normal_calc (Span< float3 > vert_positions, Span< int > face_verts) |
| void | corner_tris_calc (Span< float3 > vert_positions, OffsetIndices< int > faces, Span< int > corner_verts, MutableSpan< int3 > corner_tris) |
| void | corner_tris_calc_with_normals (Span< float3 > vert_positions, OffsetIndices< int > faces, Span< int > corner_verts, Span< float3 > face_normals, MutableSpan< int3 > corner_tris) |
| void | corner_tris_calc_face_indices (OffsetIndices< int > faces, MutableSpan< int > tri_faces) |
| void | vert_tris_from_corner_tris (Span< int > corner_verts, Span< int3 > corner_tris, MutableSpan< int3 > vert_tris) |
| int3 | corner_tri_get_real_edges (Span< int2 > edges, Span< int > corner_verts, Span< int > corner_edges, const int3 &corner_tri) |
| float3 | face_center_calc (Span< float3 > vert_positions, Span< int > face_verts) |
| float | face_area_calc (Span< float3 > vert_positions, Span< int > face_verts) |
| void | face_angles_calc (Span< float3 > vert_positions, Span< int > face_verts, MutableSpan< float > angles) |
Medium-Level Normals Calculation | |
| void | normals_calc_faces (Span< float3 > vert_positions, OffsetIndices< int > faces, Span< int > corner_verts, MutableSpan< float3 > face_normals) |
| void | normals_calc_verts (Span< float3 > vert_positions, OffsetIndices< int > faces, Span< int > corner_verts, GroupedSpan< int > vert_to_face_map, Span< float3 > face_normals, MutableSpan< float3 > vert_normals) |
Face Corner Normal Calculation | |
| short2 | corner_space_custom_normal_to_data (const CornerNormalSpace &lnor_space, const float3 &custom_lnor) |
| void | normals_calc_corners (Span< float3 > vert_positions, OffsetIndices< int > faces, Span< int > corner_verts, Span< int > corner_edges, GroupedSpan< int > vert_to_face_map, Span< float3 > face_normals, Span< bool > sharp_edges, Span< bool > sharp_faces, Span< short2 > custom_normals, CornerNormalSpaceArray *r_fan_spaces, MutableSpan< float3 > r_corner_normals) |
| void | normals_corner_custom_set (Span< float3 > vert_positions, OffsetIndices< int > faces, Span< int > corner_verts, Span< int > corner_edges, GroupedSpan< int > vert_to_face_map, Span< float3 > vert_normals, Span< float3 > face_normals, Span< bool > sharp_faces, MutableSpan< bool > sharp_edges, MutableSpan< float3 > r_custom_corner_normals, MutableSpan< short2 > r_clnors_data) |
| void | normals_corner_custom_set_from_verts (Span< float3 > vert_positions, OffsetIndices< int > faces, Span< int > corner_verts, Span< int > corner_edges, GroupedSpan< int > vert_to_face_map, Span< float3 > vert_normals, Span< float3 > face_normals, Span< bool > sharp_faces, MutableSpan< bool > sharp_edges, MutableSpan< float3 > r_custom_vert_normals, MutableSpan< short2 > r_clnors_data) |
| void | edges_sharp_from_angle_set (OffsetIndices< int > faces, Span< int > corner_verts, Span< int > corner_edges, Span< float3 > face_normals, Span< int > corner_to_face, Span< bool > sharp_faces, const float split_angle, MutableSpan< bool > sharp_edges) |
| bool | is_corner_fan_normals (const AttributeMetaData &meta_data) |
Mesh Tangent Calculations (All Layers) | |
| Array< Array< float4 > > | calc_uv_tangents (Span< float3 > vert_positions, OffsetIndices< int > faces, Span< int > corner_verts, Span< int3 > corner_tris, Span< int > corner_tri_faces, Span< bool > sharp_faces, Span< float3 > vert_normals, Span< float3 > face_normals, Span< float3 > corner_normals, Span< Span< float2 > > uv_maps) |
| Array< float4 > | calc_orco_tangents (Span< float3 > vert_positions, OffsetIndices< int > faces, Span< int > corner_verts, Span< int3 > corner_tris, Span< int > corner_tri_faces, Span< bool > sharp_faces, Span< float3 > vert_normals, Span< float3 > face_normals, Span< float3 > corner_normals, Span< float3 > vert_orco) |
| static void | calc_face_as_quad_map (const OffsetIndices< int > faces, const Span< int3 > corner_tris, const Span< int > corner_tri_faces, int &num_face_as_quad_map, int *&face_as_quad_map) |
Mesh Normal Calculation (Polygons) | |
| static float3 | normal_calc_ngon (const Span< float3 > vert_positions, const Span< int > face_verts) |
Face Tessellation | |
| BLI_INLINE void | mesh_calc_tessellation_for_face_impl (const Span< int > corner_verts, const Span< float3 > positions, const int face_start, const int face_size, int3 *tri, MemArena **pf_arena_p, const bool face_normal, const float normal_precalc[3]) |
| static void | mesh_calc_tessellation_for_face (const Span< int > corner_verts, const Span< float3 > positions, const int face_start, const int face_size, int3 *tri, MemArena **pf_arena_p) |
| static void | mesh_calc_tessellation_for_face_with_normal (const Span< int > corner_verts, const Span< float3 > positions, const int face_start, const int face_size, int3 *tri, MemArena **pf_arena_p, const float normal_precalc[3]) |
| static void | corner_tris_calc_impl (const Span< float3 > positions, const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< float3 > face_normals, MutableSpan< int3 > corner_tris) |
Variables | |
| constexpr AttributeMetaData | CORNER_FAN_META_DATA {AttrDomain::Corner, AttrType::Int16_2D} |
| using blender::bke::mesh::EdgeUninitialized = std::monostate |
The edge hasn't been handled yet while the edge info is being created.
Definition at line 966 of file mesh_normals.cc.
Use a custom VectorSet type to use int32 instead of int64 for the key indices.
Definition at line 1035 of file mesh_normals.cc.
| using blender::bke::mesh::VertEdgeInfo = std::variant<EdgeUninitialized, EdgeOneCorner, EdgeTwoCorners, EdgeSharp> |
Definition at line 994 of file mesh_normals.cc.
|
static |
The normal for all the corners in the fan is a weighted combination of their face normals.
Definition at line 1160 of file mesh_normals.cc.
References accumulate_fan_normal(), blender::math::dot(), blender::bke::mesh::VertCornerInfo::face, blender::Span< T >::first(), blender::bke::mesh::VertCornerInfo::local_edge_next, blender::bke::mesh::VertCornerInfo::local_edge_prev, blender::math::normalize(), blender::math::safe_acos_approx(), and blender::Span< T >::size().
Referenced by accumulate_fan_normal().
|
static |
Definition at line 996 of file mesh_normals.cc.
References add_corner_to_edge(), and blender::Span< T >::is_empty().
Referenced by add_corner_to_edge(), and calc_connecting_edge_info().
| Array< int > blender::bke::mesh::build_corner_to_face_map | ( | OffsetIndices< int > | faces | ) |
Definition at line 340 of file mesh_mapping.cc.
References build_corner_to_face_map(), blender::offset_indices::build_reverse_map(), and faces.
Referenced by build_corner_to_face_map(), and mesh_normals_corner_custom_set().
| GroupedSpan< int > blender::bke::mesh::build_edge_to_corner_map | ( | Span< int > | corner_edges, |
| int | edges_num, | ||
| Array< int > & | r_offsets, | ||
| Array< int > & | r_indices ) |
Definition at line 405 of file mesh_mapping.cc.
References build_edge_to_corner_map(), and gather_groups().
Referenced by build_edge_to_corner_map(), blender::nodes::node_geo_mesh_topology_corners_of_edge_cc::CornersOfEdgeInput::get_varray_for_context(), and blender::geometry::split_edges().
| GroupedSpan< int > blender::bke::mesh::build_edge_to_face_map | ( | OffsetIndices< int > | faces, |
| Span< int > | corner_edges, | ||
| int | edges_num, | ||
| Array< int > & | r_offsets, | ||
| Array< int > & | r_indices ) |
Definition at line 413 of file mesh_mapping.cc.
References build_edge_to_face_map(), create_reverse_offsets(), faces, blender::Array< T, InlineBufferCapacity, Allocator >::last(), blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize(), and reverse_group_indices_in_groups().
Referenced by BKE_mesh_remap_calc_loops_from_mesh(), build_edge_to_face_map(), blender::nodes::node_geo_blur_attribute_cc::build_face_to_face_by_edge_map(), blender::nodes::node_geo_input_mesh_face_neighbors_cc::construct_neighbor_count_varray(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_edges(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_face_regions(), face_edge_loop_islands_calc(), blender::ed::sculpt_paint::expand::geodesic_falloff_create(), blender::nodes::node_geo_edges_to_face_groups_cc::FaceSetFromBoundariesInput::get_varray_for_context(), blender::ed::sculpt_paint::face_set::init_flood_fill(), mesh_calc_islands_loop_face_uv(), paintface_select_loop(), paintvert_select_less(), and paintvert_select_more().
| Array< int > blender::bke::mesh::build_vert_to_corner_indices | ( | Span< int > | corner_verts, |
| OffsetIndices< int > | offsets ) |
Definition at line 391 of file mesh_mapping.cc.
References build_vert_to_corner_indices(), and reverse_indices_in_groups().
Referenced by build_vert_to_corner_indices().
| GroupedSpan< int > blender::bke::mesh::build_vert_to_corner_map | ( | Span< int > | corner_verts, |
| int | verts_num, | ||
| Array< int > & | r_offsets, | ||
| Array< int > & | r_indices ) |
Definition at line 397 of file mesh_mapping.cc.
References build_vert_to_corner_map(), and gather_groups().
Referenced by build_vert_to_corner_map().
| GroupedSpan< int > blender::bke::mesh::build_vert_to_edge_map | ( | Span< int2 > | edges, |
| int | verts_num, | ||
| Array< int > & | r_offsets, | ||
| Array< int > & | r_indices ) |
Definition at line 347 of file mesh_mapping.cc.
References BLI_SCOPED_DEFER, build_vert_to_edge_map(), blender::Span< T >::cast(), create_reverse_offsets(), blender::Span< T >::index_range(), MEM_calloc_arrayN(), MEM_freeN(), blender::threading::parallel_for(), blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize(), blender::offset_indices::OffsetIndices< T >::size(), and blender::offset_indices::OffsetIndices< T >::total_size().
Referenced by base_skin(), BKE_mesh_remap_calc_edges_from_mesh(), blender::nodes::node_geo_blur_attribute_cc::build_edge_to_edge_by_vert_map(), build_vert_to_edge_map(), blender::nodes::node_geo_extrude_mesh_cc::build_vert_to_edge_map(), blender::nodes::node_geo_blur_attribute_cc::build_vert_to_vert_by_edge_map(), blender::bke::compare_geometry::construct_vert_mapping(), blender::draw::DRW_subdivide_loose_geom(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_vertices(), blender::ed::sculpt_paint::expand::geodesic_falloff_create(), blender::nodes::node_geo_input_shortest_edge_paths_cc::ShortestEdgePathsCostFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_shortest_edge_paths_cc::ShortestEdgePathsNextVertFieldInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_edges_of_vertex_cc::EdgesOfVertInput::get_varray_for_context(), blender::ed::object::modifier_skin_armature_create(), blender::geometry::split_edges(), blender::bke::subdiv::subdiv_to_mesh(), and blender::ed::object::vgroup_smooth_subset().
| void blender::bke::mesh::build_vert_to_face_indices | ( | OffsetIndices< int > | faces, |
| Span< int > | corner_verts, | ||
| OffsetIndices< int > | offsets, | ||
| MutableSpan< int > | face_indices ) |
Definition at line 371 of file mesh_mapping.cc.
References build_vert_to_face_indices(), faces, and reverse_group_indices_in_groups().
Referenced by build_vert_to_face_indices(), and build_vert_to_face_map().
| GroupedSpan< int > blender::bke::mesh::build_vert_to_face_map | ( | OffsetIndices< int > | faces, |
| Span< int > | corner_verts, | ||
| int | verts_num, | ||
| Array< int > & | r_offsets, | ||
| Array< int > & | r_indices ) |
Definition at line 379 of file mesh_mapping.cc.
References build_vert_to_face_indices(), build_vert_to_face_map(), create_reverse_offsets(), faces, blender::Array< T, InlineBufferCapacity, Allocator >::last(), and blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize().
Referenced by build_vert_to_face_map(), and face_edge_loop_islands_calc().
|
static |
Definition at line 1058 of file mesh_normals.cc.
References add_corner_to_edge(), calc_connecting_edge_info(), blender::bke::mesh::VertCornerInfo::corner, blender::bke::mesh::VertCornerInfo::corner_next, blender::bke::mesh::VertCornerInfo::corner_prev, blender::bke::mesh::VertCornerInfo::face, blender::Span< T >::index_range(), blender::Span< T >::is_empty(), blender::bke::mesh::VertCornerInfo::local_edge_next, and blender::bke::mesh::VertCornerInfo::local_edge_prev.
Referenced by calc_connecting_edge_info().
|
static |
The edge directions are used to compute factors for the face normals from each corner. Since they involve a normalization it's worth it to compute them once, especially since we've deduplicated the edge indices and can easily index them with VertCornerInfo.
Definition at line 1149 of file mesh_normals.cc.
References calc_edge_directions(), i, blender::Span< T >::index_range(), and blender::math::normalize().
Referenced by calc_edge_directions().
|
static |
Definition at line 267 of file mesh_tangent.cc.
References faces, MEM_malloc_arrayN(), blender::Span< T >::size(), and size().
Referenced by calc_uv_tangents().
|
static |
Create a local indexing for the edges connected to the vertex (not including loose edges of course). We could look up the edge indices from the VectorSet as necessary later, but it should be better to just use a bit more space in VertCornerInfo to simplify things instead.
Definition at line 1048 of file mesh_normals.cc.
References calc_local_edge_indices(), blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::index_of_or_add(), blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::reserve(), and blender::MutableSpan< T >::size().
Referenced by calc_local_edge_indices().
| Array< float4 > blender::bke::mesh::calc_orco_tangents | ( | Span< float3 > | vert_positions, |
| OffsetIndices< int > | faces, | ||
| Span< int > | corner_verts, | ||
| Span< int3 > | corner_tris, | ||
| Span< int > | corner_tri_faces, | ||
| Span< bool > | sharp_faces, | ||
| Span< float3 > | vert_normals, | ||
| Span< float3 > | face_normals, | ||
| Span< float3 > | corner_normals, | ||
| Span< float3 > | vert_orco ) |
Definition at line 349 of file mesh_tangent.cc.
References calc_face_as_quad_map(), calc_orco_tangents(), blender::bke::mesh::SGLSLMeshToTangent::corner_normals, blender::bke::mesh::SGLSLMeshToTangent::corner_tris, blender::bke::mesh::SGLSLMeshToTangent::corner_verts, blender::bke::mesh::SGLSLMeshToTangent::face_as_quad_map, blender::bke::mesh::SGLSLMeshToTangent::face_normals, blender::bke::mesh::SGLSLMeshToTangent::faces, faces, blender::Span< T >::is_empty(), MEM_SAFE_FREE, blender::bke::mesh::SGLSLMeshToTangent::num_face_as_quad_map, blender::bke::mesh::SGLSLMeshToTangent::orco, blender::bke::mesh::SGLSLMeshToTangent::positions, blender::bke::mesh::SGLSLMeshToTangent::sharp_faces, blender::Span< T >::size(), blender::bke::mesh::SGLSLMeshToTangent::tangents, blender::bke::mesh::SGLSLMeshToTangent::tri_faces, and blender::bke::mesh::SGLSLMeshToTangent::vert_normals.
Referenced by calc_orco_tangents(), and blender::draw::extract_tan_init_common().
| void blender::bke::mesh::calc_uv_tangent_tris_quads | ( | Span< float3 > | vert_positions, |
| OffsetIndices< int > | faces, | ||
| Span< int > | corner_verts, | ||
| Span< float3 > | corner_normals, | ||
| Span< float2 > | uv_map, | ||
| MutableSpan< float4 > | results, | ||
| ReportList * | reports ) |
Compute simplified tangent space normals, i.e. tangent vector + sign of bi-tangent one, which combined with custom normals can be used to recreate the full tangent space.
Definition at line 77 of file mesh_tangent.cc.
References BKE_report(), blender::bke::mesh::MeshToTangentQuadsTris::corner_normals, blender::bke::mesh::MeshToTangentQuadsTris::corner_verts, blender::bke::mesh::MeshToTangentQuadsTris::faces, faces, i, blender::bke::mesh::MeshToTangentQuadsTris::positions, RPT_ERROR, size(), blender::bke::mesh::MeshToTangentQuadsTris::tangents, and blender::bke::mesh::MeshToTangentQuadsTris::uv_map.
| Array< Array< float4 > > blender::bke::mesh::calc_uv_tangents | ( | Span< float3 > | vert_positions, |
| OffsetIndices< int > | faces, | ||
| Span< int > | corner_verts, | ||
| Span< int3 > | corner_tris, | ||
| Span< int > | corner_tri_faces, | ||
| Span< bool > | sharp_faces, | ||
| Span< float3 > | vert_normals, | ||
| Span< float3 > | face_normals, | ||
| Span< float3 > | corner_normals, | ||
| Span< Span< float2 > > | uv_maps ) |
See: BKE_editmesh_uv_tangents_calc (matching logic).
Definition at line 298 of file mesh_tangent.cc.
References calc_face_as_quad_map(), faces, blender::Span< T >::is_empty(), and blender::threading::parallel_for().
Referenced by blender::draw::extract_tan_init_common(), blender::nodes::node_geo_uv_tangent_cc::TangentFieldInput::get_varray_for_context(), and mesh_calc_tri_tessface().
|
static |
Gather data related to all the connected faces / face corners. This makes accessing it simpler later on in the various per-vertex hot loops. It also means we can be sure it will be in CPU caches. Gathering it into a single Vector of an "info" struct rather than multiple vectors is expected to be worth it because there are typically very few connected corners; the overhead of a Vector for each piece of data would be significant.
Definition at line 948 of file mesh_normals.cc.
References collect_corner_info(), face_corner_next(), face_corner_prev(), face_find_corner_from_vert(), faces, i, and blender::Span< T >::index_range().
Referenced by collect_corner_info().
|
static |
Definition at line 593 of file mesh_normals.cc.
References beta(), BLI_assert, corner_fan_space_define(), blender::math::cross(), blender::math::dot(), float, blender::Span< T >::is_empty(), LIKELY, LNOR_SPACE_TRIGO_THRESHOLD, M_PI, blender::math::normalize(), blender::bke::mesh::CornerNormalSpace::ref_alpha, blender::bke::mesh::CornerNormalSpace::ref_beta, blender::math::safe_acos_approx(), UNLIKELY, blender::bke::mesh::CornerNormalSpace::vec_lnor, blender::bke::mesh::CornerNormalSpace::vec_ortho, and blender::bke::mesh::CornerNormalSpace::vec_ref.
Referenced by BKE_lnor_space_define(), corner_fan_space_define(), and handle_fan_result_and_custom_normals().
|
static |
Definition at line 709 of file mesh_normals.cc.
References beta(), corner_space_custom_data_to_normal(), cosf, float, M_PI, madd_v3_v3fl(), mul_v3_v3fl(), blender::bke::mesh::CornerNormalSpace::ref_alpha, blender::bke::mesh::CornerNormalSpace::ref_beta, sinf, unit_short_to_float(), blender::bke::mesh::CornerNormalSpace::vec_lnor, blender::bke::mesh::CornerNormalSpace::vec_ortho, and blender::bke::mesh::CornerNormalSpace::vec_ref.
Referenced by BKE_lnor_space_custom_data_to_normal(), corner_space_custom_data_to_normal(), and handle_fan_result_and_custom_normals().
| short2 blender::bke::mesh::corner_space_custom_normal_to_data | ( | const CornerNormalSpace & | lnor_space, |
| const float3 & | custom_lnor ) |
Definition at line 761 of file mesh_normals.cc.
References beta(), compare_v3v3(), corner_space_custom_normal_to_data(), blender::math::dot(), float, is_zero_v3(), LNOR_SPACE_TRIGO_THRESHOLD, M_PI, blender::math::normalize(), blender::bke::mesh::CornerNormalSpace::ref_alpha, blender::bke::mesh::CornerNormalSpace::ref_beta, blender::math::safe_acos_approx(), unit_float_to_short(), blender::bke::mesh::CornerNormalSpace::vec_lnor, blender::bke::mesh::CornerNormalSpace::vec_ortho, and blender::bke::mesh::CornerNormalSpace::vec_ref.
Referenced by BKE_lnor_space_custom_normal_to_data(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), corner_space_custom_normal_to_data(), and mesh_normals_corner_custom_set().
| int3 blender::bke::mesh::corner_tri_get_real_edges | ( | Span< int2 > | edges, |
| Span< int > | corner_verts, | ||
| Span< int > | corner_edges, | ||
| const int3 & | corner_tri ) |
Return the triangle's three edge indices they are real edges, otherwise -1.
Definition at line 245 of file mesh_tessellate.cc.
References i.
Referenced by mesh_corner_tris_target_project(), and blender::bke::shrinkwrap::shrinkwrap_build_boundary_data().
| void blender::bke::mesh::corner_tris_calc | ( | Span< float3 > | vert_positions, |
| OffsetIndices< int > | faces, | ||
| Span< int > | corner_verts, | ||
| MutableSpan< int3 > | corner_tris ) |
Definition at line 206 of file mesh_tessellate.cc.
References corner_tris_calc(), corner_tris_calc_impl(), and faces.
Referenced by blender::ed::object::bake_targets_populate_pixels_color_attributes(), corner_tris_calc(), blender::render::texturemargin::generate_margin(), heat_bone_weighting(), Freestyle::BlenderFileLoader::insertShapeNode(), mesh_calc_tri_tessface(), mesh_faces_to_scratch(), and RE_bake_pixels_populate().
| void blender::bke::mesh::corner_tris_calc_face_indices | ( | OffsetIndices< int > | faces, |
| MutableSpan< int > | tri_faces ) |
Definition at line 214 of file mesh_tessellate.cc.
References corner_tris_calc_face_indices(), faces, and blender::threading::parallel_for().
Referenced by corner_tris_calc_face_indices(), and blender::render::texturemargin::generate_margin().
|
static |
Definition at line 164 of file mesh_tessellate.cc.
References faces, blender::Span< T >::is_empty(), and blender::threading::parallel_for().
Referenced by corner_tris_calc(), and corner_tris_calc_with_normals().
| void blender::bke::mesh::corner_tris_calc_with_normals | ( | Span< float3 > | vert_positions, |
| OffsetIndices< int > | faces, | ||
| Span< int > | corner_verts, | ||
| Span< float3 > | face_normals, | ||
| MutableSpan< int3 > | corner_tris ) |
A version of corner_tris_calc which takes pre-calculated face normals (used to avoid having to calculate the face normal for NGON tessellation).
Definition at line 226 of file mesh_tessellate.cc.
References BLI_assert, corner_tris_calc_impl(), corner_tris_calc_with_normals(), faces, and blender::Span< T >::is_empty().
Referenced by corner_tris_calc_with_normals(), and mesh_calc_tri_tessface().
|
static |
Definition at line 265 of file mesh_mapping.cc.
References blender::offset_indices::build_reverse_offsets(), and indices.
Referenced by build_edge_to_face_map(), build_vert_to_edge_map(), build_vert_to_face_map(), and gather_groups().
|
inline |
Return the index of the edge's vertex that is not the vert.
Definition at line 370 of file BKE_mesh.hh.
References BLI_assert, and ELEM.
Referenced by BKE_mesh_remap_calc_edges_from_mesh(), build_edge_mats(), build_emats_stack(), blender::nodes::node_geo_blur_attribute_cc::build_vert_to_vert_by_edge_map(), collect_hull_frames(), blender::bke::subdiv::find_loose_edge_interpolation_positions(), MeshFairingContext::other_vertex_index_from_loop(), blender::ed::object::skin_armature_bone_create(), and traverse_fan_local_corners().
| void blender::bke::mesh::edges_sharp_from_angle_set | ( | OffsetIndices< int > | faces, |
| Span< int > | corner_verts, | ||
| Span< int > | corner_edges, | ||
| Span< float3 > | face_normals, | ||
| Span< int > | corner_to_face, | ||
| Span< bool > | sharp_faces, | ||
| const float | split_angle, | ||
| MutableSpan< bool > | sharp_edges ) |
Define sharp edges as needed to mimic "auto-smooth" from angle threshold.
Used when defining an empty custom corner normals data layer, to keep same shading as with auto-smooth!
| sharp_faces | Optional array used to mark specific faces for sharp shading. |
Definition at line 901 of file mesh_normals.cc.
References edges_sharp_from_angle_set(), faces, M_PI, mesh_edges_sharp_tag(), and blender::MutableSpan< T >::size().
Referenced by edges_sharp_from_angle_set(), and blender::bke::mesh_sharp_edges_set_from_angle().
| void blender::bke::mesh::face_angles_calc | ( | Span< float3 > | vert_positions, |
| Span< int > | face_verts, | ||
| MutableSpan< float > | angles ) |
Calculate the angles at each of the faces corners.
Definition at line 206 of file mesh_evaluate.cc.
References angle_normalized_v3v3(), copy_v3_v3(), normalize_v3(), blender::Span< T >::size(), and sub_v3_v3v3().
Referenced by wn_corner_angle(), and wn_face_with_angle().
Calculate the surface area of the face described by the indexed vertices.
Definition at line 72 of file mesh_evaluate.cc.
References area_poly_v3(), area_tri_v3(), blender::Array< T, InlineBufferCapacity, Allocator >::data(), i, blender::Span< T >::index_range(), and blender::Span< T >::size().
Referenced by BKE_mesh_calc_area(), blender::nodes::node_geo_input_mesh_face_area_cc::construct_face_area_varray(), wn_face_area(), and wn_face_with_angle().
|
static |
Definition at line 175 of file mesh_evaluate.cc.
References area_tri_signed_v3(), copy_v3_v3(), face_normal_calc(), i, madd_v3_v3fl(), mid_v3_v3v3v3(), mul_v3_fl(), blender::Span< T >::size(), v2, and zero_v3().
Referenced by BKE_mesh_center_of_surface().
| float3 blender::bke::mesh::face_center_calc | ( | Span< float3 > | vert_positions, |
| Span< int > | face_verts ) |
Calculate the average position of the vertices in the face.
Definition at line 50 of file mesh_evaluate.cc.
References face_center_calc_ngon(), mid_v3_v3v3v3(), mid_v3_v3v3v3v3(), and blender::Span< T >::size().
Referenced by BKE_mesh_foreach_mapped_face_center(), BKE_mesh_remap_calc_faces_from_mesh(), BKE_mesh_remap_calc_loops_from_mesh(), blender::bke::calc_face_centers(), blender::ed::sculpt_paint::face_set::gesture_apply_mesh(), mesh_island_to_astar_graph_edge_process(), and multires_subdivide_create_object_space_linear_grids().
|
static |
Definition at line 39 of file mesh_evaluate.cc.
References float, i, blender::Span< T >::index_range(), blender::Span< T >::size(), and w().
Referenced by face_center_calc().
|
inline |
Find the index of the next corner in the face, looping to the start if necessary. The indices are into the entire corners array, not just the face's corners.
Definition at line 315 of file BKE_mesh.hh.
References blender::IndexRange::last(), and blender::IndexRange::start().
Referenced by blender::bke::adapt_mesh_domain_corner_to_edge_impl(), blender::bke::adapt_mesh_domain_corner_to_edge_impl(), adjacent_vertices_index_from_adjacent_edge(), blender::ed::sculpt_paint::hide::affect_visibility_mesh(), BKE_crazyspace_set_quats_mesh(), BKE_sculpt_mask_layers_ensure(), collect_corner_info(), blender::geometry::corner_on_edge_connected_to_vert(), blender::geometry::edge_from_corner(), blender::draw::edge_from_corners(), blender::draw::extract_lines_paint_mask_subdiv(), face_find_adjacent_verts(), blender::draw::statvis_calc_distort(), and blender::draw::statvis_calc_sharp().
|
inline |
Find the index of the previous corner in the face, looping to the end if necessary. The indices are into the entire corners array, not just the face's corners.
Definition at line 306 of file BKE_mesh.hh.
References blender::IndexRange::size(), and blender::IndexRange::start().
Referenced by blender::bke::adapt_mesh_domain_edge_to_corner_impl(), blender::bke::calc_edges::add_face_edges_to_hash_maps(), adjacent_vertices_index_from_adjacent_edge(), blender::ed::sculpt_paint::hide::affect_visibility_mesh(), BKE_crazyspace_set_quats_mesh(), BKE_sculpt_mask_layers_ensure(), blender::geometry::calc_corner_groups_for_vertex(), collect_corner_info(), face_find_adjacent_verts(), mesh_normals_corner_custom_set(), and blender::draw::statvis_calc_distort().
|
inline |
Return the vertex indices on either side of the given vertex, ordered based on the winding direction of the face. The vertex must be in the face.
Definition at line 338 of file BKE_mesh.hh.
References face_corner_next(), face_corner_prev(), and face_find_corner_from_vert().
Referenced by MeshFairingContext::adjacents_coords_from_loop(), blender::ed::sculpt_paint::append_neighbors_to_vector(), and blender::ed::sculpt_paint::vert_neighbors_get_mesh().
|
inline |
Find the index of the corner in the face that uses the given vertex. The index is into the entire corners array, not just the face's corners.
Definition at line 327 of file BKE_mesh.hh.
References blender::Span< T >::first_index(), and blender::Span< T >::slice().
Referenced by adjacent_vertices_index_from_adjacent_edge(), calculate_average_color(), collect_corner_info(), blender::ed::sculpt_paint::color::color_vert_get(), do_vpaint_brush_blur_loops(), do_vpaint_brush_smear(), and face_find_adjacent_verts().
| float3 blender::bke::mesh::face_normal_calc | ( | Span< float3 > | vert_positions, |
| Span< int > | face_verts ) |
Calculate the up direction for the face, depending on its winding direction.
Definition at line 141 of file mesh_normals.cc.
References BLI_assert, BLI_ASSERT_UNIT_V3, face_normal_calc(), blender::math::is_zero(), normal_calc_ngon(), normal_quad_v3(), blender::math::normal_tri(), blender::Span< T >::size(), and UNLIKELY.
Referenced by BKE_mesh_foreach_mapped_face_center(), blender::geometry::ngon::calc_corner_tris(), face_area_centroid_calc(), face_normal_calc(), blender::io::obj::fixup_invalid_face(), blender::ed::sculpt_paint::face_set::gesture_apply_mesh(), blender::nodes::node_geo_input_mesh_edge_angle_cc::AngleFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_mesh_edge_angle_cc::SignedAngleFieldInput::get_varray_for_context(), mesh_calc_tri_tessface(), blender::bke::mesh_init_origspace(), multires_reshape_apply_base_refit_base_mesh(), blender::bke::pbvh::normals_calc_faces(), and uvprojectModifier_do().
|
inline |
Return the number of triangles needed to tessellate a face with face_size corners.
Definition at line 350 of file BKE_mesh.hh.
References BLI_assert.
Referenced by BKE_mesh_origindex_map_create_corner_tri(), blender::draw::calc_face_tri_starts_mesh(), blender::geometry::ngon::calc_tris_by_ngon(), blender::bke::create_tree_from_tris(), blender::draw::pbvh::create_tri_index_mesh(), face_triangles_range(), and blender::ed::sculpt_paint::trim::generate_geometry().
|
inline |
Return the range of triangles that belong to the given face.
Definition at line 359 of file BKE_mesh.hh.
References face_triangles_num(), faces, blender::IndexRange::size(), and blender::IndexRange::start().
Referenced by blender::draw::calc_adjacency_mesh(), blender::bke::create_tree_from_tris(), blender::draw::pbvh::create_tri_index_mesh(), blender::bke::pbvh::pixels::do_encode_pixels(), blender::draw::extract_edituv_tris_mesh(), blender::nodes::node_geo_input_mesh_edge_angle_cc::find_other_vert_of_edge_triangle(), blender::bke::pbvh::node_raycast_mesh(), and blender::bke::pbvh::pbvh_faces_node_nearest_to_ray().
|
static |
Definition at line 330 of file mesh_mapping.cc.
References blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), create_reverse_offsets(), gather_groups(), and reverse_indices_in_groups().
Referenced by build_edge_to_corner_map(), build_vert_to_corner_map(), and gather_groups().
|
static |
Don't inline this function to simplify the code path without custom normals.
Definition at line 1188 of file mesh_normals.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Vector< T, InlineBufferCapacity, Allocator >::append_unchecked(), BLI_NOINLINE, blender::bke::mesh::VertCornerInfo::corner, corner_fan_space_define(), corner_space_custom_data_to_normal(), blender::Span< T >::first(), handle_fan_result_and_custom_normals(), i, blender::Span< T >::index_range(), blender::Span< T >::is_empty(), blender::Span< T >::last(), blender::bke::mesh::VertCornerInfo::local_edge_next, blender::Vector< T, InlineBufferCapacity, Allocator >::reserve(), and blender::Span< T >::size().
Referenced by handle_fan_result_and_custom_normals().
| bool blender::bke::mesh::is_corner_fan_normals | ( | const AttributeMetaData & | meta_data | ) |
Return true if the type and domain represent the tangent-space custom normals storage.
Definition at line 1717 of file mesh_normals.cc.
References CORNER_FAN_META_DATA, and is_corner_fan_normals().
Referenced by is_corner_fan_normals(), blender::ed::mesh::join_normals(), and blender::geometry::preprocess_meshes().
|
static |
A version of mesh_calc_face_volume_centroid that takes an initial reference center, use this to increase numeric stability as the quality of the result becomes very low quality as the value moves away from 0.0, see: #65986.
Definition at line 145 of file mesh_evaluate.cc.
References copy_v3_v3(), i, blender::Span< T >::size(), sub_v3_v3v3(), volume_tri_tetrahedron_signed_v3_6x(), and zero_v3().
Referenced by BKE_mesh_center_of_volume().
|
static |
Definition at line 130 of file mesh_tessellate.cc.
References mesh_calc_tessellation_for_face_impl().
| BLI_INLINE void blender::bke::mesh::mesh_calc_tessellation_for_face_impl | ( | const Span< int > | corner_verts, |
| const Span< float3 > | positions, | ||
| const int | face_start, | ||
| const int | face_size, | ||
| int3 * | tri, | ||
| MemArena ** | pf_arena_p, | ||
| const bool | face_normal, | ||
| const float | normal_precalc[3] ) |
| face_normal | This will be optimized out as a constant. |
Definition at line 38 of file mesh_tessellate.cc.
References add_newell_cross_v3_v3v3(), axis_dominant_v3_to_m3_negate(), BLI_INLINE, BLI_memarena_alloc(), BLI_memarena_clear(), BLI_memarena_new(), BLI_MEMARENA_STD_BUFSIZE, BLI_polyfill_calc_arena(), float, is_quad_flip_v3_first_third_fast(), mul_v2_m3v3(), normalize_v3(), UNLIKELY, and zero_v3().
Referenced by mesh_calc_tessellation_for_face(), and mesh_calc_tessellation_for_face_with_normal().
|
static |
Definition at line 141 of file mesh_tessellate.cc.
References mesh_calc_tessellation_for_face_impl().
|
static |
Definition at line 834 of file mesh_normals.cc.
References cosf, blender::math::dot(), faces, INDEX_INVALID, INDEX_UNSET, IS_EDGE_SHARP, blender::Span< T >::is_empty(), and mesh_edges_sharp_tag().
Referenced by edges_sharp_from_angle_set(), and mesh_edges_sharp_tag().
|
static |
Compute internal representation of given custom normals (as an array of float[2]). It also makes sure the mesh matches those custom normals, by setting sharp edges flag as needed to get a same custom lnor for all corners sharing the same smooth fan. If use_vertices if true, r_custom_corner_normals is assumed to be per-vertex, not per-corner (this allows to set whole vert's normals at once, useful in some cases). r_custom_corner_normals is expected to have normalized normals, or zero ones, in which case they will be replaced by default corner/vertex normal.
Definition at line 1406 of file mesh_normals.cc.
References build_corner_to_face_map(), copy_v3_v3(), corner_space_custom_normal_to_data(), blender::bke::mesh::CornerNormalSpaceArray::corner_space_indices, blender::bke::mesh::CornerNormalSpaceArray::corners_by_space, blender::bke::mesh::CornerNormalSpaceArray::create_corners_by_space, dot_v3v3(), face_corner_prev(), faces, blender::bits::BitVector< InlineBufferCapacity, Allocator >::fill(), blender::MutableSpan< T >::fill_indices(), G, G_DEBUG, i, blender::Span< T >::index_range(), blender::Span< T >::is_empty(), is_zero_v3(), blender::IndexRange::last(), blender::Span< T >::last(), LNOR_SPACE_TRIGO_THRESHOLD, mesh_normals_corner_custom_set(), mul_v3_fl(), nor, normals_calc_corners(), printf, blender::Span< T >::size(), and blender::bke::mesh::CornerNormalSpaceArray::spaces.
Referenced by mesh_normals_corner_custom_set(), mesh_set_custom_normals(), normals_corner_custom_set(), and normals_corner_custom_set_from_verts().
|
static |
Definition at line 1649 of file mesh_normals.cc.
References blender::bke::Corner, blender::bke::Edge, blender::bke::Face, blender::bke::SpanAttributeWriter< T >::finish(), blender::bke::AttributeAccessor::lookup(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), mesh_normals_corner_custom_set(), mesh_set_custom_normals(), and blender::bke::SpanAttributeWriter< T >::span.
Referenced by mesh_set_custom_normals(), blender::bke::mesh_set_custom_normals(), blender::bke::mesh_set_custom_normals_from_verts(), blender::bke::mesh_set_custom_normals_from_verts_normalized(), and blender::bke::mesh_set_custom_normals_normalized().
|
static |
Definition at line 274 of file mesh_normals.cc.
References faces, mix_normals_corner_to_face(), and blender::threading::parallel_for().
Referenced by mix_normals_corner_to_face().
|
static |
Definition at line 224 of file mesh_normals.cc.
References faces, blender::Span< T >::index_range(), mix_normals_corner_to_vert(), and blender::threading::parallel_for().
Referenced by mix_normals_corner_to_vert().
|
static |
Definition at line 258 of file mesh_normals.cc.
References faces, mix_normals_vert_to_face(), and blender::threading::parallel_for().
Referenced by mix_normals_vert_to_face().
|
static |
Definition at line 121 of file mesh_normals.cc.
References add_newell_cross_v3_v3v3(), i, blender::Span< T >::index_range(), blender::Span< T >::last(), normal_calc_ngon(), normalize_v3(), and UNLIKELY.
Referenced by face_normal_calc(), and normal_calc_ngon().
|
static |
Definition at line 1722 of file mesh_normals.cc.
References BLI_assert_unreachable, blender::bke::Corner, blender::bke::Face, normal_domain_to_domain(), and blender::bke::Point.
Referenced by blender::bke::mesh::NormalJoinInfo::add_no_custom_normals(), and normal_domain_to_domain().
| void blender::bke::mesh::normals_calc_corners | ( | Span< float3 > | vert_positions, |
| OffsetIndices< int > | faces, | ||
| Span< int > | corner_verts, | ||
| Span< int > | corner_edges, | ||
| GroupedSpan< int > | vert_to_face_map, | ||
| Span< float3 > | face_normals, | ||
| Span< bool > | sharp_edges, | ||
| Span< bool > | sharp_faces, | ||
| Span< short2 > | custom_normals, | ||
| CornerNormalSpaceArray * | r_fan_spaces, | ||
| MutableSpan< float3 > | r_corner_normals ) |
Compute custom normals, i.e. vertex normals associated with each face. Used to visualize sharp edges (or non-smooth faces) without actually modifying the geometry (splitting edges).
| sharp_edges | Optional array of sharp edge tags, used to split the evaluated normals on each side of the edge. |
| sharp_faces | Optional array of sharp face tags, used to split the evaluated normals on the face's edges. |
| r_fan_spaces | Optional return data filled with information about the custom normals spaces for each grouped fan of face corners. |
Definition at line 1237 of file mesh_normals.cc.
References BLI_assert, faces, blender::Span< T >::index_range(), blender::Span< T >::is_empty(), normals_calc_corners(), blender::offset_indices::GroupedSpan< T >::offsets, blender::threading::parallel_for(), blender::MutableSpan< T >::size(), blender::Span< T >::size(), and blender::OffsetIndices< T >::total_size().
Referenced by apply_weights_vertex_normal(), BKE_keyblock_mesh_calc_normals(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), mesh_normals_corner_custom_set(), normalEditModifier_do(), and normals_calc_corners().
| void blender::bke::mesh::normals_calc_faces | ( | Span< float3 > | vert_positions, |
| OffsetIndices< int > | faces, | ||
| Span< int > | corner_verts, | ||
| MutableSpan< float3 > | face_normals ) |
Calculate face normals directly into a result array.
Definition at line 178 of file mesh_normals.cc.
References BLI_assert, faces, normals_calc_faces(), blender::threading::parallel_for(), and blender::MutableSpan< T >::size().
Referenced by BKE_keyblock_mesh_calc_normals(), normals_calc_faces(), and blender::bke::pbvh::update_normals_mesh().
| void blender::bke::mesh::normals_calc_verts | ( | Span< float3 > | vert_positions, |
| OffsetIndices< int > | faces, | ||
| Span< int > | corner_verts, | ||
| GroupedSpan< int > | vert_to_face_map, | ||
| Span< float3 > | face_normals, | ||
| MutableSpan< float3 > | vert_normals ) |
Calculate vertex normals directly into the result array.
Definition at line 191 of file mesh_normals.cc.
References faces, blender::Span< T >::index_range(), normals_calc_verts(), and blender::threading::parallel_for().
Referenced by BKE_keyblock_mesh_calc_normals(), normals_calc_verts(), and blender::bke::pbvh::update_normals_mesh().
| void blender::bke::mesh::normals_corner_custom_set | ( | Span< float3 > | vert_positions, |
| OffsetIndices< int > | faces, | ||
| Span< int > | corner_verts, | ||
| Span< int > | corner_edges, | ||
| GroupedSpan< int > | vert_to_face_map, | ||
| Span< float3 > | vert_normals, | ||
| Span< float3 > | face_normals, | ||
| Span< bool > | sharp_faces, | ||
| MutableSpan< bool > | sharp_edges, | ||
| MutableSpan< float3 > | r_custom_corner_normals, | ||
| MutableSpan< short2 > | r_clnors_data ) |
| sharp_faces | Optional array used to mark specific faces for sharp shading. |
Definition at line 1597 of file mesh_normals.cc.
References faces, mesh_normals_corner_custom_set(), and normals_corner_custom_set().
Referenced by apply_weights_vertex_normal(), data_transfer_dtdata_type_postprocess(), normalEditModifier_do_directional(), normalEditModifier_do_radial(), and normals_corner_custom_set().
| void blender::bke::mesh::normals_corner_custom_set_from_verts | ( | Span< float3 > | vert_positions, |
| OffsetIndices< int > | faces, | ||
| Span< int > | corner_verts, | ||
| Span< int > | corner_edges, | ||
| GroupedSpan< int > | vert_to_face_map, | ||
| Span< float3 > | vert_normals, | ||
| Span< float3 > | face_normals, | ||
| Span< bool > | sharp_faces, | ||
| MutableSpan< bool > | sharp_edges, | ||
| MutableSpan< float3 > | r_custom_vert_normals, | ||
| MutableSpan< short2 > | r_clnors_data ) |
| sharp_faces | Optional array used to mark specific faces for sharp shading. |
Definition at line 1623 of file mesh_normals.cc.
References faces, mesh_normals_corner_custom_set(), and normals_corner_custom_set_from_verts().
Referenced by apply_weights_vertex_normal(), and normals_corner_custom_set_from_verts().
|
static |
Definition at line 312 of file mesh_mapping.cc.
References BLI_SCOPED_DEFER, blender::offset_indices::OffsetIndices< T >::index_range(), MEM_calloc_arrayN(), MEM_freeN(), blender::threading::parallel_for(), reverse_group_indices_in_groups(), and blender::offset_indices::OffsetIndices< T >::size().
Referenced by build_edge_to_face_map(), build_vert_to_face_indices(), and reverse_group_indices_in_groups().
|
static |
Definition at line 284 of file mesh_mapping.cc.
References blender::Span< T >::begin(), BLI_assert, BLI_SCOPED_DEFER, blender::Span< T >::end(), blender::Span< T >::index_range(), blender::Span< T >::is_empty(), MEM_calloc_arrayN(), MEM_freeN(), blender::threading::parallel_for(), reverse_indices_in_groups(), blender::offset_indices::OffsetIndices< T >::size(), and blender::Span< T >::size().
Referenced by build_vert_to_corner_indices(), gather_groups(), and reverse_indices_in_groups().
|
static |
Definition at line 272 of file mesh_mapping.cc.
References blender::offset_indices::OffsetIndices< T >::index_range(), indices, and blender::threading::parallel_for().
|
static |
From a starting corner, follow the connected edges to find the other corners "fanning" around the vertex. Crucially, we've removed ambiguity from the process already by marking edges connected to three faces and edges between faces with opposite winding direction sharp.
Definition at line 1095 of file mesh_normals.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_mutable_span(), b, blender::Vector< T, InlineBufferCapacity, Allocator >::begin(), edge_other_vert(), blender::Vector< T, InlineBufferCapacity, Allocator >::end(), and traverse_fan_local_corners().
Referenced by traverse_fan_local_corners().
| void blender::bke::mesh::vert_tris_from_corner_tris | ( | Span< int > | corner_verts, |
| Span< int3 > | corner_tris, | ||
| MutableSpan< int3 > | vert_tris ) |
Convert triangles encoded as face corner indices to triangles encoded as vertex indices.
Definition at line 238 of file mesh_tessellate.cc.
References blender::MutableSpan< T >::cast(), blender::Span< T >::cast(), blender::array_utils::gather(), and vert_tris_from_corner_tris().
Referenced by cloth_from_mesh(), blender::io::hydra::copy_submesh(), deform_verts(), blender::bke::pbvh::pixels::update_geom_primitives(), and vert_tris_from_corner_tris().
|
constexpr |
Definition at line 1715 of file mesh_normals.cc.
Referenced by blender::bke::mesh::NormalJoinInfo::add_mesh(), and is_corner_fan_normals().