Blender V5.3
blender::geometry Namespace Reference

Namespaces

namespace  boolean
namespace  construct
namespace  curve_constraints
namespace  debug
namespace  geom
namespace  ngon
namespace  profile
namespace  quad
namespace  tests
namespace  uv

Classes

struct  AddCurvesOnMeshInputs
struct  AddCurvesOnMeshOutputs
struct  AllCurvesInfo
struct  AllGreasePencilsInfo
struct  AllInstancesInfo
struct  AllMeshesInfo
struct  AllPointCloudsInfo
struct  AttrFallbackData
struct  AttributeDomainAndType
struct  AttributeFallbacksArray
struct  AttributesForInterpolation
struct  AttributesForResample
struct  BevelAttributeOutputs
struct  BevelParameters
struct  BevelState
struct  BevVert
struct  BoundVert
struct  ConeAttributeOutputs
struct  ConeConfig
struct  ConvertCurvesOptions
struct  CuboidConfig
struct  CurveFromEdgesOutput
struct  CurvesElementStartIndices
class  CurvesGeometry
struct  EdgeHalf
struct  EvalDataBuffer
class  ExtendableMesh
struct  FaceHash
struct  FacesEquality
struct  GatherOffsets
struct  GatherTasks
struct  GatherTasksInfo
class  GeometryComponent
struct  GeometrySet
struct  GeometryWithPaths
struct  GeoUVPinIndex
struct  GreasePencilRealizeInfo
struct  GSpanAttributeWriter
struct  InstanceContext
class  InstanceReference
class  Instances
struct  LocalData
struct  LocalRowData
struct  MergePropagationMap
struct  MeshElementStartIndices
struct  MeshRealizeInfo
struct  MeshToVolumeResolution
struct  NeighborCurve
struct  NewVert
class  Occupancy
struct  OrderedAttributes
class  OverlapMerger
struct  PAbfSystem
class  PackIsland
class  ParamHandle
struct  ParamSlimOptions
struct  PChart
struct  PChartOrigBounds
struct  PEdge
struct  PFace
struct  PHash
struct  PointCloudRealizeInfo
struct  Profile
struct  ProfileSpacing
struct  PropagationAttribute
struct  PVert
struct  RealizeCurveInfo
struct  RealizeCurveTask
struct  RealizeEditDataTask
struct  RealizeGreasePencilTask
struct  RealizeInstancesOptions
struct  RealizeInstancesResult
struct  RealizeMeshTask
struct  RealizePointCloudTask
struct  RemovedFacesAndCorners
struct  ResampleCurvesOutputAttributeIDs
class  ReverseUVSampler
struct  Row
struct  SpanAttributeWriter
struct  TaskAttrInfo
struct  TransformGeometryErrors
struct  TriKey
struct  TriWithRange
class  UVAABBIsland
struct  UVFace
class  UVMinimumEnclosingSquareFinder
class  UVPackIsland_Params
class  UVPhi
struct  VariedDepthOptions
struct  VertLooseEdges
struct  VMesh
struct  WeldFace
struct  WeldMesh
struct  WeldVertexCluster

Typedefs

using ParamKey = uintptr_t
using NeighborCurves = Vector<NeighborCurve, max_neighbors>
using UVVertBucket = Set<int>
using UVVertMap = Map<int, Vector<UVVertBucket>>
using CornerGroup = Vector<int>
using PHashKey = uintptr_t

Enumerations

enum class  FitMethod { Refit , Split }
enum class  BevelAffect { Vertices = 0 , Edges = 1 }
enum class  BevelMiterType { Sharp = 0 , Patch = 1 , Arc = 2 }
enum class  ConeFillType { None = 0 , NGon = 1 , Triangles = 2 }
enum class  TriangulateNGonMode { Beauty = 0 , EarClip = 1 }
enum class  TriangulateQuadMode {
  Beauty = 0 , Fixed = 1 , Alternate = 2 , ShortEdge = 3 ,
  LongEdge = 4
}
enum class  PointRasterizeType { Scalar = 0 , Vector = 1 }
enum class  KernelType { NearestPoint = 0 , Linear = 1 , Quadratic = 2 , Cubic = 3 }
enum  PHandleState { PHANDLE_STATE_ALLOCATED , PHANDLE_STATE_CONSTRUCTED , PHANDLE_STATE_LSCM , PHANDLE_STATE_STRETCH }
enum  Flag { OnStack = 1 , Inserted = 2 }
enum class  FKind { Orig = 0 , Edge = 1 , Vert = 2 , Profile = 3 }
enum class  AngleKind { Smaller = -1 , Straight = 0 , Larger = 1 }
enum class  MeshKind {
  None = 0 , Poly , Adj , TriFan ,
  Cutoff
}
enum class  VMeshMethod { Adj , Cutoff }
enum class  NewFaceKind : uint8_t { Other = 0 , VertexFace = 1 , EdgeFace = 2 }
enum class  NewEdgeKind : uint8_t { Other = 0 , OuterEdge = 1 , MidEdge = 2 }
enum  PVertFlag {
  PVERT_PIN = 1 , PVERT_SELECT = 2 , PVERT_INTERIOR = 4 , PVERT_COLLAPSE = 8 ,
  PVERT_SPLIT = 16
}
enum  PEdgeFlag {
  PEDGE_SEAM = 1 , PEDGE_VERTEX_SPLIT = 2 , PEDGE_PIN = 4 , PEDGE_SELECT = 8 ,
  PEDGE_DONE = 16 , PEDGE_FILLED = 32 , PEDGE_COLLAPSE = 64 , PEDGE_COLLAPSE_EDGE = 128 ,
  PEDGE_COLLAPSE_PAIR = 256
}
enum  PFaceFlag { PFACE_CONNECTED = 1 , PFACE_FILLED = 2 , PFACE_COLLAPSE = 4 , PFACE_DONE = 8 }
enum class  AttrDomain
enum class  AttrDomain
enum class  AttrDomain

Functions

AddCurvesOnMeshOutputs add_curves_on_mesh (bke::CurvesGeometry &curves, const AddCurvesOnMeshInputs &inputs)
float3 compute_surface_point_normal (const int3 &tri, const float3 &bary_coord, Span< float3 > corner_normals)
bke::CurvesGeometry remove_points_and_split (const bke::CurvesGeometry &curves, const IndexMask &mask)
bke::CurvesGeometry grease_pencil_remove_points_and_split (const bke::CurvesGeometry &curves, const IndexMask &mask)
bke::CurvesGeometry extend_curves (bke::CurvesGeometry &src_curves, const IndexMask &selection, const VArray< float > &start_lengths, const VArray< float > &end_lengths, float overshoot_fac, bool follow_curvature, float point_density, float segment_influence, float max_angle, bool invert_curvature, GeometryNodeCurveSampleMode sample_mode, const bke::AttributeFilter &attribute_filter)
Array< Mesh * > extract_mesh_vertices (const Mesh &mesh, const IndexMask &mask, const bke::AttributeFilter &attribute_filter)
Array< Mesh * > extract_mesh_edges (const Mesh &mesh, const IndexMask &mask, const bke::AttributeFilter &attribute_filter)
Array< Mesh * > extract_mesh_faces (const Mesh &mesh, const IndexMask &mask, const bke::AttributeFilter &attribute_filter)
Array< PointCloud * > extract_pointcloud_points (const PointCloud &pointcloud, const IndexMask &mask, const bke::AttributeFilter &attribute_filter)
Array< Curves * > extract_curves_points (const Curves &curves, const IndexMask &mask, const bke::AttributeFilter &attribute_filter)
Array< Curves * > extract_curves (const Curves &curves, const IndexMask &mask, const bke::AttributeFilter &attribute_filter)
Array< bke::Instances * > extract_instances (const bke::Instances &instances, const IndexMask &mask, const bke::AttributeFilter &attribute_filter)
Array< GreasePencil * > extract_greasepencil_layers (const GreasePencil &grease_pencil, const IndexMask &mask, const bke::AttributeFilter &attribute_filter)
Array< GreasePencil * > extract_greasepencil_layer_points (const GreasePencil &grease_pencil, int layer_i, const IndexMask &mask, const bke::AttributeFilter &attribute_filter)
Array< GreasePencil * > extract_greasepencil_layer_curves (const GreasePencil &grease_pencil, int layer_i, const IndexMask &mask, const bke::AttributeFilter &attribute_filter)
bke::CurvesGeometry fillet_curves_poly (const bke::CurvesGeometry &src_curves, const IndexMask &curve_selection, const VArray< float > &radius, const VArray< int > &counts, bool limit_radius, const bke::AttributeFilter &attribute_filter)
bke::CurvesGeometry fillet_curves_bezier (const bke::CurvesGeometry &src_curves, const IndexMask &curve_selection, const VArray< float > &radius, bool limit_radius, const bke::AttributeFilter &attribute_filter)
bke::CurvesGeometry fit_poly_to_bezier_curves (const bke::CurvesGeometry &src_curves, const IndexMask &curve_selection, const VArray< float > &thresholds, const VArray< bool > &corners, FitMethod method, const bke::AttributeFilter &attribute_filter)
void foreach_real_geometry (bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
void sample_curve_padded (const Span< float3 > positions, bool cyclic, MutableSpan< int > r_indices, MutableSpan< float > r_factors)
void sample_curve_padded (const bke::CurvesGeometry &curves, int curve_index, bool cyclic, bool reverse, MutableSpan< int > r_indices, MutableSpan< float > r_factors)
void interpolate_curves (const bke::CurvesGeometry &from_curves, const bke::CurvesGeometry &to_curves, Span< int > from_curve_indices, Span< int > to_curve_indices, const IndexMask &dst_curve_mask, Span< bool > dst_curve_flip_direction, float mix_factor, bke::CurvesGeometry &dst_curves, IndexMaskMemory &memory)
void interpolate_curves_with_samples (const bke::CurvesGeometry &from_curves, const bke::CurvesGeometry &to_curves, Span< int > from_curve_indices, Span< int > to_curve_indices, Span< int > from_sample_indices, Span< int > to_sample_indices, Span< float > from_sample_factors, Span< float > to_sample_factors, const IndexMask &dst_curve_mask, float mix_factor, bke::CurvesGeometry &dst_curves, IndexMaskMemory &memory)
bke::GeometrySet join_geometries (Span< bke::GeometrySet > geometries, const bke::AttributeFilter &attribute_filter, const std::optional< Span< bke::GeometryComponent::Type > > &component_types_to_join=std::nullopt, bool allow_merging_instance_references=true)
bke::CurvesGeometry curves_merge_endpoints (const bke::CurvesGeometry &src_curves, Span< int > connect_to_curve, Span< bool > flip_direction, const bke::AttributeFilter &attribute_filter)
GreasePencil * merge_layers (const GreasePencil &src_grease_pencil, GroupedSpan< int > layers_to_merge, const bke::AttributeFilter &attribute_filter)
GreasePencil * merge_layers_by_name (const GreasePencil &src_grease_pencil, const VArray< bool > &selection, const bke::AttributeFilter &attribute_filter)
std::optional< Mesh * > mesh_bevel (const Mesh &src_mesh, const IndexMask &selection, const BevelParameters &params, const bke::AttributeFilter &attribute_filter)
std::optional< Mesh * > mesh_copy_selection (const Mesh &src_mesh, const VArray< bool > &selection, bke::AttrDomain selection_domain, const bke::AttributeFilter &attribute_filter={})
std::optional< Mesh * > mesh_copy_selection_keep_verts (const Mesh &src_mesh, const VArray< bool > &selection, bke::AttrDomain selection_domain, const bke::AttributeFilter &attribute_filter={})
std::optional< Mesh * > mesh_copy_selection_keep_edges (const Mesh &mesh, const VArray< bool > &selection, bke::AttrDomain selection_domain, const bke::AttributeFilter &attribute_filter={})
std::optional< Mesh * > mesh_merge_verts (const Mesh &mesh, const IndexMask &selection, Span< int > merge_ids, const bke::AttributeFilter &attribute_filter)
Mesh * create_cuboid_mesh (const float3 &size, int verts_x, int verts_y, int verts_z, std::optional< StringRef > uv_id)
Mesh * create_cuboid_mesh (const float3 &size, int verts_x, int verts_y, int verts_z)
Mesh * create_cylinder_or_cone_mesh (float radius_top, float radius_bottom, float depth, int circle_segments, int side_segments, int fill_segments, ConeFillType fill_type, ConeAttributeOutputs &attribute_outputs)
Mesh * create_grid_mesh (int verts_x, int verts_y, float size_x, float size_y, std::optional< StringRef > uv_map_id)
Mesh * create_line_mesh (float3 start, float3 delta, int count)
Bounds< float3 > calculate_bounds_radial_primitive (float radius_top, float radius_bottom, int segments, float height)
Mesh * create_uv_sphere_mesh (float radius, int segments, int rings, std::optional< StringRef > uv_map_id)
IndexMask vert_selection_from_edge (Span< int2 > edges, const IndexMask &edge_mask, int verts_num, IndexMaskMemory &memory)
IndexMask vert_selection_from_face (OffsetIndices< int > faces, const IndexMask &face_mask, Span< int > corner_verts, int verts_num, IndexMaskMemory &memory)
IndexMask edge_selection_from_face (OffsetIndices< int > faces, const IndexMask &face_mask, Span< int > corner_edges, int edges_num, IndexMaskMemory &memory)
IndexMask edge_selection_from_vert (Span< int2 > edges, Span< bool > vert_selection, IndexMaskMemory &memory)
IndexMask face_selection_from_vert (OffsetIndices< int > faces, Span< int > corner_verts, Span< bool > vert_selection, IndexMaskMemory &memory)
IndexMask face_selection_from_edge (OffsetIndices< int > faces, Span< int > corner_edges, Span< bool > edge_mask, IndexMaskMemory &memory)
void split_edges (Mesh &mesh, const IndexMask &selected_edges, const bke::AttributeFilter &attribute_filter={})
bke::CurvesGeometry mesh_edges_to_curves_convert (const Mesh &mesh, const IndexMask &selection, const bke::AttributeFilter &attribute_filter)
bke::CurvesGeometry create_curve_from_vert_indices (const bke::AttributeAccessor &mesh_attributes, Span< int > vert_indices, Span< int > curve_offsets, IndexRange cyclic_curves, const bke::AttributeFilter &attribute_filter)
bke::CurvesGeometry mesh_faces_to_curves_convert (const Mesh &mesh, const IndexMask &selection, const bke::AttributeFilter &attribute_filter)
std::optional< Mesh * > mesh_triangulate (const Mesh &src_mesh, const IndexMask &selection, TriangulateNGonMode ngon_mode, TriangulateQuadMode quad_mode, const bke::AttributeFilter &attribute_filter)
void mix_geometries (bke::GeometrySet &a, const bke::GeometrySet &b, float factor)
void mix_bundles (nodes::Bundle &a, const nodes::Bundle &b, float factor)
void mix_socket_values (bke::SocketValueVariant &a, const bke::SocketValueVariant &b, const float factor)
PointCloud * point_merge_by_distance (const PointCloud &src_points, const float merge_distance, const IndexMask &selection, const bke::AttributeFilter &attribute_filter)
PointCloud * merge_points (const PointCloud &src_points, const IndexMask &selection, Span< int > merge_ids, const bke::AttributeFilter &attribute_filter)
const CPPType & points_rasterize_attribute_type (const PointRasterizeType rasterize_type)
const CPPType & points_rasterize_grid_type (const PointRasterizeType rasterize_type)
bool use_debug_randomization ()
void debug_randomize_vert_order (Mesh *mesh)
void debug_randomize_edge_order (Mesh *mesh)
void debug_randomize_face_order (Mesh *mesh)
void debug_randomize_mesh_order (Mesh *mesh)
void debug_randomize_point_order (PointCloud *pointcloud)
void debug_randomize_curve_order (bke::CurvesGeometry *curves)
void debug_randomize_instance_order (bke::Instances *instances)
const MultiValueMap< bke::GeometryComponent::Type, bke::AttrDomain > & components_supported_reordering ()
Mesh * reorder_mesh (const Mesh &src_mesh, Span< int > old_by_new_map, bke::AttrDomain domain, const bke::AttributeFilter &attribute_filter)
PointCloud * reorder_points (const PointCloud &src_pointcloud, Span< int > old_by_new_map, const bke::AttributeFilter &attribute_filter)
bke::CurvesGeometry reorder_curves_geometry (const bke::CurvesGeometry &src_curves, Span< int > old_by_new_map, const bke::AttributeFilter &attribute_filter)
Curves * reorder_curves (const Curves &src_curves, Span< int > old_by_new_map, const bke::AttributeFilter &attribute_filter)
bke::Instances * reorder_instaces (const bke::Instances &src_instances, Span< int > old_by_new_map, const bke::AttributeFilter &attribute_filter)
bke::GeometryComponentPtr reordered_component (const bke::GeometryComponent &src_component, Span< int > old_by_new_map, bke::AttrDomain domain, const bke::AttributeFilter &attribute_filter)
std::optional< Array< int > > sort_indices_by_weights (int domain_size, const IndexMask &mask, const VArray< int > &group_id, const VArray< float > &weight)
CurvesGeometry resample_to_count (const CurvesGeometry &src_curves, const IndexMask &selection, const VArray< int > &counts, const ResampleCurvesOutputAttributeIDs &output_ids={})
CurvesGeometry resample_to_count (const CurvesGeometry &src_curves, const fn::FieldContext &field_context, const fn::Field< bool > &selection_field, const fn::Field< int > &count_field, const ResampleCurvesOutputAttributeIDs &output_ids={})
CurvesGeometry resample_to_length (const CurvesGeometry &src_curves, const IndexMask &selection, const VArray< float > &sample_lengths, const ResampleCurvesOutputAttributeIDs &output_ids={}, bool keep_last_segment=false)
CurvesGeometry resample_to_length (const CurvesGeometry &src_curves, const fn::FieldContext &field_context, const fn::Field< bool > &selection_field, const fn::Field< float > &segment_length_field, const ResampleCurvesOutputAttributeIDs &output_ids={}, bool keep_last_segment=false)
CurvesGeometry resample_to_evaluated (const CurvesGeometry &src_curves, const IndexMask &selection, const ResampleCurvesOutputAttributeIDs &output_ids={})
CurvesGeometry resample_to_evaluated (const CurvesGeometry &src_curves, const fn::FieldContext &field_context, const fn::Field< bool > &selection_field, const ResampleCurvesOutputAttributeIDs &output_ids={})
void separate_geometry (bke::GeometrySet &geometry_set, bke::AttrDomain domain, GeometryNodeDeleteGeometryMode mode, const fn::Field< bool > &selection_field, const bke::AttributeFilter &attribute_filter, bool &r_is_error)
bke::CurvesGeometry convert_curves (const bke::CurvesGeometry &src_curves, const IndexMask &selection, CurveType dst_type, const bke::AttributeFilter &attribute_filter, const ConvertCurvesOptions &options={})
IndexMask simplify_curve_attribute (const Span< float3 > positions, const IndexMask &curves_selection, const OffsetIndices< int > points_by_curve, const VArray< bool > &cyclic, float epsilon, GSpan attribute_data, IndexMaskMemory &memory)
void curve_simplify (const Span< float3 > positions, const bool cyclic, const float epsilon, const GSpan attribute_data, MutableSpan< bool > points_to_delete)
void gaussian_blur_1D (const GSpan src, int iterations, const VArray< float > &influence_by_point, const bool smooth_ends, const bool keep_shape, const bool is_cyclic, GMutableSpan dst)
void smooth_curve_attribute (const IndexMask &curves_to_smooth, const OffsetIndices< int > points_by_curve, const VArray< bool > &point_selection, const VArray< bool > &cyclic, int iterations, float influence, bool smooth_ends, bool keep_shape, GMutableSpan attribute_data)
void smooth_curve_attribute (const IndexMask &curves_to_smooth, const OffsetIndices< int > points_by_curve, const VArray< bool > &point_selection, const VArray< bool > &cyclic, int iterations, const VArray< float > &influence_by_point, bool smooth_ends, bool keep_shape, GMutableSpan attribute_data)
void smooth_curve_positions (bke::CurvesGeometry &curves, const IndexMask &curves_to_smooth, const VArray< bool > &point_selection, int iterations, const VArray< float > &influence_by_point, bool smooth_ends, bool keep_shape)
void smooth_curve_positions (bke::CurvesGeometry &curves, const IndexMask &curves_to_smooth, const VArray< bool > &point_selection, int iterations, float influence, bool smooth_ends, bool keep_shape)
bke::CurvesGeometry subdivide_curves (const bke::CurvesGeometry &src_curves, const IndexMask &selection, const VArray< int > &cuts, const bke::AttributeFilter &attribute_filter={})
void transform_mesh (Mesh &mesh, float3 translation, math::Quaternion rotation, float3 scale)
std::optional< TransformGeometryErrors > transform_geometry (bke::GeometrySet &geometry, const float4x4 &transform)
void translate_geometry (bke::GeometrySet &geometry, const float3 translation)
float pack_islands (Span< PackIsland * > islands, const UVPackIsland_Params &params)
void mul_v2_m2_add_v2v2 (float r[2], const float mat[2][2], const float a[2], const float b[2])
static void calc_straight_curve_positions (const float3 &a, const float3 &b, MutableSpan< float3 > dst)
static void find_curve_neighbors (const Span< float3 > root_positions, const KDTreeNew< float3 > &old_roots_kdtree, Vector< int > &offset_data, Vector< int > &index_data, Vector< float > &weight_data)
static void calc_position_without_interpolation (CurvesGeometry &curves, const int old_curves_num, const Span< float3 > root_positions_cu, const Span< float > new_lengths_cu, const Span< float3 > new_normals_su, const float4x4 &surface_to_curves_normal_mat)
static void calc_position_with_interpolation (CurvesGeometry &curves, const Span< float3 > root_positions_cu, const OffsetIndices< int > neighbor_offsets, const Span< int > neighbor_indices, const Span< float > neighbor_weights, const int old_curves_num, const Span< float > new_lengths_cu, const Span< float3 > new_normals_su, const bke::CurvesSurfaceTransforms &transforms, const Span< int3 > corner_tris, const ReverseUVSampler &reverse_uv_sampler, const Span< float3 > corner_normals_su)
static void calc_radius_without_interpolation (CurvesGeometry &curves, const IndexRange new_points_range, const float radius)
static void calc_radius_with_interpolation (CurvesGeometry &curves, const int old_curves_num, const float radius, const Span< float > new_lengths_cu, const OffsetIndices< int > neighbor_offsets, const Span< int > neighbor_indices, const Span< float > neighbor_weights)
static void extend_curve_straight (const float used_percent_length, const float new_size, const Span< int > start_points, const Span< int > end_points, const int curve, const IndexRange new_curve, const Span< float > use_start_lengths, const Span< float > use_end_lengths, MutableSpan< float3 > positions)
static void extend_curve_curved (const float used_percent_length, const Span< int > start_points, const Span< int > end_points, const OffsetIndices< int > points_by_curve, const int curve, const IndexRange new_curve, const Span< float > use_start_lengths, const Span< float > use_end_lengths, const float max_angle, const float segment_influence, const bool invert_curvature, MutableSpan< float3 > positions)
static void duplicate_fillet_point_data (const OffsetIndices< int > src_points_by_curve, const OffsetIndices< int > dst_points_by_curve, const IndexMask &curve_selection, const Span< int > all_point_offsets, const GSpan src, GMutableSpan dst)
static void calculate_result_offsets (const OffsetIndices< int > src_points_by_curve, const IndexMask &selection, const IndexMask &unselected, const VArray< float > &radii, const VArray< int > &counts, const Span< bool > cyclic, MutableSpan< int > dst_curve_offsets, MutableSpan< int > dst_point_offsets)
static void calculate_directions (const Span< float3 > positions, MutableSpan< float3 > directions)
static void calculate_angles (const Span< float3 > directions, MutableSpan< float > angles)
static void zero_degenerate_radii (const Span< float3 > directions, const Span< float > angles, MutableSpan< float > radii)
static float limit_radius (const float3 &position_prev, const float3 &position, const float3 &position_next, const float angle_prev, const float angle, const float angle_next, const float radius_prev, const float radius, const float radius_next)
static void limit_radii (const Span< float3 > positions, const Span< float > angles, const Span< float > radii, const bool cyclic, MutableSpan< float > radii_clamped)
static void calculate_fillet_positions (const Span< float3 > src_positions, const Span< float > angles, const Span< float > radii, const Span< float3 > directions, const OffsetIndices< int > dst_offsets, MutableSpan< float3 > dst)
static HandleType fillet_handle_type (const float3 &position, const float3 &handle, const float3 &other_handle)
static void calculate_bezier_handles_bezier_mode (const Span< float3 > src_handles_l, const Span< float3 > src_handles_r, const Span< int8_t > src_types_l, const Span< int8_t > src_types_r, const Span< float > angles, const Span< float > radii, const Span< float3 > directions, const OffsetIndices< int > dst_offsets, const Span< float3 > dst_positions, MutableSpan< float3 > dst_handles_l, MutableSpan< float3 > dst_handles_r, MutableSpan< int8_t > dst_types_l, MutableSpan< int8_t > dst_types_r)
static void calculate_bezier_handles_poly_mode (const Span< float3 > src_handles_l, const Span< float3 > src_handles_r, const Span< int8_t > src_types_l, const Span< int8_t > src_types_r, const OffsetIndices< int > dst_offsets, const Span< float3 > dst_positions, MutableSpan< float3 > dst_handles_l, MutableSpan< float3 > dst_handles_r, MutableSpan< int8_t > dst_types_l, MutableSpan< int8_t > dst_types_r)
static bke::CurvesGeometry fillet_curves (const bke::CurvesGeometry &src_curves, const IndexMask &curve_selection, const VArray< float > &radius_input, const VArray< int > &counts, const bool limit_radius, const bool use_bezier_mode, const bke::AttributeFilter &attribute_filter)
static void extract_real_geometries_recursive (bke::GeometrySet &geometry, Vector< int > &path, Map< bke::GeometrySet, Vector< Vector< int > > > &r_real_geometries)
static void reinsert_modified_geometry_recursive (bke::GeometrySet &geometry, const bke::GeometrySet &geometry_to_insert, const Span< int > path)
static Array< float > build_point_to_sample_map (const Span< float3 > positions, const bool cyclic, const int samples_num)
static void assign_samples_to_segments (const int num_dst_points, const Span< float3 > src_positions, const bool cyclic, MutableSpan< int > dst_sample_offsets)
static void reverse_samples (const int points_num, MutableSpan< int > r_indices, MutableSpan< float > r_factors)
static bool interpolate_attribute_to_curves (const StringRef name, const std::array< int, CURVE_TYPES_NUM > &type_counts)
static bool interpolate_attribute_to_poly_curve (const StringRef name)
static AttributesForInterpolation retrieve_attribute_spans (const Span< StringRef > names, const CurvesGeometry &src_from_curves, const CurvesGeometry &src_to_curves, const bke::AttrDomain domain, CurvesGeometry &dst_curves)
static AttributesForInterpolation gather_point_attributes_to_interpolate (const CurvesGeometry &from_curves, const CurvesGeometry &to_curves, CurvesGeometry &dst_curves)
static AttributesForInterpolation gather_curve_attributes_to_interpolate (const CurvesGeometry &from_curves, const CurvesGeometry &to_curves, CurvesGeometry &dst_curves)
static void sample_curve_attribute (const bke::CurvesGeometry &src_curves, const Span< int > src_curve_indices, const OffsetIndices< int > dst_points_by_curve, const GSpan src_data, const IndexMask &dst_curve_mask, const Span< int > dst_sample_indices, const Span< float > dst_sample_factors, GMutableSpan dst_data)
static float4 calculate_catmull_rom_basis_derivative (const float parameter)
static int4 get_catmull_rom_indices (const int src_index, const int src_index_last, const bool cyclic)
static void sample_poly_curve_positions_handles (const bool cyclic, const Span< float3 > src_pos, const Span< int > dst_indices, const Span< float > dst_factors, const IndexRange dst_points, const int8_t dst_type, MutableSpan< float3 > dst_pos, MutableSpan< float3 > dst_left, MutableSpan< float3 > dst_right, MutableSpan< int8_t > dst_types_left, MutableSpan< int8_t > dst_types_right)
static void sample_catmull_rom_curve_positions_handles (const bool cyclic, const IndexRange src_points, const Span< float3 > src_pos, const Span< int > dst_indices, const Span< float > dst_factors, const IndexRange dst_points, const int8_t dst_type, MutableSpan< float3 > dst_pos, MutableSpan< float3 > dst_left, MutableSpan< float3 > dst_right, MutableSpan< int8_t > dst_types_left, MutableSpan< int8_t > dst_types_right)
static void sample_bezier_curve_positions_handles (const bool cyclic, const IndexRange src_points, const Span< float3 > src_pos, const Span< float3 > src_handle_left, const Span< float3 > src_handle_right, const Span< int8_t > src_types_left, const Span< int8_t > src_types_right, const Span< int > dst_indices, const Span< float > dst_factors, const IndexRange dst_points, MutableSpan< float3 > dst_pos, MutableSpan< float3 > dst_left, MutableSpan< float3 > dst_right, MutableSpan< int8_t > dst_types_left, MutableSpan< int8_t > dst_types_right)
static void sample_curve_positions_and_handles (const bke::CurvesGeometry &src_curves, const Span< int > src_curve_indices, const OffsetIndices< int > dst_points_by_curve, const VArray< int8_t > dst_types, const IndexMask &dst_curve_mask, const Span< int > dst_sample_indices, const Span< float > dst_sample_factors, MutableSpan< float3 > dst_positions, MutableSpan< float3 > dst_handles_left, MutableSpan< float3 > dst_handles_right, MutableSpan< int8_t > dst_handle_types_left, MutableSpan< int8_t > dst_handle_types_right)
template<typename T>
static void mix_arrays (const Span< T > from, const Span< T > to, const float mix_factor, const MutableSpan< T > dst)
static void mix_arrays (const GSpan src_from, const GSpan src_to, const Span< float > mix_factors, const IndexMask &selection, const GMutableSpan dst)
static void mix_arrays (const GSpan src_from, const GSpan src_to, const Span< float > mix_factors, const IndexMask &group_selection, const OffsetIndices< int > groups, const GMutableSpan dst)
static int8_t mix_handle_type (const int8_t from_type, const int8_t to_type)
static void mix_handle_type_arrays (const Span< int8_t > src_from, const Span< int8_t > src_to, const IndexMask &group_selection, const OffsetIndices< int > groups, const MutableSpan< int8_t > dst)
static void mix_curve_type (const Span< int > from_curve_indices, const Span< int > to_curve_indices, const VArray< int8_t > &from_types, const VArray< int8_t > &to_types, const IndexMask &dst_curve_mask, MutableSpan< int8_t > dst_curve_types)
static void sample_curve_uniform (const bke::CurvesGeometry &curves, const int curve_index, const bool cyclic, const bool reverse, MutableSpan< int > r_segment_indices, MutableSpan< float > r_factors)
static GeometrySet::GatheredAttributes get_final_attribute_info (const Span< const GeometryComponent * > components, const Span< StringRef > ignored_attributes)
static void fill_new_attribute (const Span< const GeometryComponent * > src_components, const StringRef name, const bke::AttrType data_type, const bke::AttrDomain domain, GMutableSpan dst_span)
static bool try_join_single_value_attribute (const Span< const GeometryComponent * > src_components, const StringRef name, const bke::AttrDomain domain, const bke::AttrType data_type, bke::MutableAttributeAccessor dst_attributes)
static void join_attributes (const Span< const GeometryComponent * > src_components, GeometryComponent &result, const Span< StringRef > ignored_attributes)
static void join_instances (const Span< const GeometryComponent * > src_components, const bool allow_merging_instance_references, GeometrySet &result)
static void join_volumes (const Span< const GeometryComponent * >, GeometrySet &)
static void join_component_type (const bke::GeometryComponent::Type component_type, const Span< GeometrySet > src_geometry_sets, const bke::AttributeFilter &attribute_filter, const bool allow_merging_instance_references, GeometrySet &result)
GeometrySet join_geometries (const Span< GeometrySet > geometries, const bke::AttributeFilter &attribute_filter, const std::optional< Span< GeometryComponent::Type > > &component_types_to_join, const bool allow_merging_instance_references)
template<typename Fn>
static void foreach_connected_curve (const Span< int > connect_to_curve, MutableSpan< uint8_t > flags, const int start, Fn fn)
static Vector< int > toposort_connected_curves (const Span< int > connect_to_curve)
static void reverse_order (GMutableSpan span)
static void reorder_and_flip_attributes_group_to_group (const bke::AttributeAccessor src_attributes, const bke::AttrDomain domain, const OffsetIndices< int > src_offsets, const OffsetIndices< int > dst_offsets, const Span< int > old_by_new_map, const Span< bool > flip_direction, bke::MutableAttributeAccessor dst_attributes)
static bke::CurvesGeometry reorder_and_flip_curves (const bke::CurvesGeometry &src_curves, const Span< int > old_by_new_map, const Span< bool > flip_direction)
static void find_connected_ranges (const bke::CurvesGeometry &src_curves, const Span< int > old_by_new_map, Span< int > connect_to_curve, Span< bool > cyclic, Vector< int > &r_joined_curve_offsets, Vector< bool > &r_joined_cyclic)
static bke::CurvesGeometry join_curves_ranges (const bke::CurvesGeometry &src_curves, const OffsetIndices< int > old_curves_by_new)
static bke::CurvesGeometry join_curves (const GreasePencil &src_grease_pencil, const Span< const bke::CurvesGeometry * > all_src_curves, const Span< float4x4 > transforms_to_apply, const bke::AttributeFilter &attribute_filter)
static void remap_verts (const OffsetIndices< int > src_faces, const OffsetIndices< int > dst_faces, const int src_verts_num, const IndexMask &vert_mask, const IndexMask &edge_mask, const IndexMask &face_mask, const Span< int2 > src_edges, const Span< int > src_corner_verts, MutableSpan< int2 > dst_edges, MutableSpan< int > dst_corner_verts)
static void remap_edges (const OffsetIndices< int > src_faces, const OffsetIndices< int > dst_faces, const int src_edges_num, const IndexMask &edge_mask, const IndexMask &face_mask, const Span< int > src_corner_edges, MutableSpan< int > dst_corner_edges)
static void copy_loose_vert_hint (const Mesh &src, Mesh &dst)
static void copy_loose_edge_hint (const Mesh &src, Mesh &dst)
static void copy_overlapping_hint (const Mesh &src, Mesh &dst)
static void gather_vert_attributes (const Mesh &mesh_src, const bke::AttributeFilter &attribute_filter, const IndexMask &vert_mask, Mesh &mesh_dst)
template<typename Fn>
static void foreach_weld_face_corner (const WeldFace &weld_face, const Span< int > corner_next, const Fn &fn)
static void calculate_positions (const CuboidConfig &config, MutableSpan< float3 > positions)
static void define_quad (MutableSpan< int > corner_verts, const int corner, const int vert_1, const int vert_2, const int vert_3, const int vert_4)
static void calculate_corner_verts (const CuboidConfig &config, MutableSpan< int > corner_verts)
static void calculate_uvs (const CuboidConfig &config, Mesh *mesh, const StringRef uv_id)
static void calculate_cone_verts (const ConeConfig &config, MutableSpan< float3 > positions)
static void calculate_cone_edges (const ConeConfig &config, MutableSpan< int2 > edges)
static void calculate_cone_faces (const ConeConfig &config, MutableSpan< int > corner_verts, MutableSpan< int > corner_edges, MutableSpan< int > face_sizes)
static void calculate_selection_outputs (const ConeConfig &config, const ConeAttributeOutputs &attribute_outputs, bke::MutableAttributeAccessor attributes)
static void calculate_cone_uvs (const ConeConfig &config, Mesh *mesh, const StringRef uv_map_id)
static Mesh * create_vertex_mesh ()
static Bounds< float3 > calculate_bounds_cylinder (const ConeConfig &config)
static void calculate_uvs (Mesh *mesh, const Span< float3 > positions, const Span< int > corner_verts, const float size_x, const float size_y, const StringRef uv_map_id)
static int sphere_vert_total (const int segments, const int rings)
static int sphere_edge_total (const int segments, const int rings)
static int sphere_corner_total (const int segments, const int rings)
static int sphere_face_total (const int segments, const int rings)
static BLI_NOINLINE void calculate_sphere_vertex_data (MutableSpan< float3 > positions, MutableSpan< float3 > vert_normals, const float radius, const int segments, const int rings)
static BLI_NOINLINE void calculate_sphere_edge_indices (MutableSpan< int2 > edges, const int segments, const int rings)
static BLI_NOINLINE void calculate_sphere_faces (MutableSpan< int > face_offsets, const int segments)
static BLI_NOINLINE void calculate_sphere_corners (MutableSpan< int > corner_verts, MutableSpan< int > corner_edges, const int segments, const int rings)
static BLI_NOINLINE void calculate_sphere_uvs (Mesh *mesh, const float segments, const float rings, const StringRef uv_map_id)
static Bounds< float3 > calculate_bounds_uv_sphere (const float radius, const int segments, const int rings)
static IndexMask mapped_corner_selection_from_face (const OffsetIndices< int > faces, const IndexMask &face_mask, const Span< int > corner_verts_or_edges, const int verts_or_edges_num, IndexMaskMemory &memory)
static IndexMask face_selection_from_mapped_corner (const OffsetIndices< int > faces, const Span< int > corner_verts_or_edges, const Span< bool > vert_or_edge_selection, IndexMaskMemory &memory)
static void propagate_vert_attributes (Mesh &mesh, const Span< int > new_to_old_verts_map)
static void propagate_edge_attributes (Mesh &mesh, const Span< int > new_to_old_edge_map)
static int corner_on_edge_connected_to_vert (const Span< int > corner_verts, const int corner, const IndexRange face, const int vert)
static Vector< CornerGroup > calc_corner_groups_for_vertex (const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< int > corner_edges, const GroupedSpan< int > edge_to_corner_map, const Span< int > corner_to_face_map, const BitSpan split_edges, const Span< int > connected_corners, const int vert)
static BLI_NOINLINE Array< Vector< CornerGroup > > calc_all_corner_groups (const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< int > corner_edges, const GroupedSpan< int > vert_to_corner_map, const GroupedSpan< int > edge_to_corner_map, const Span< int > corner_to_face_map, const BitSpan split_edges, const IndexMask &affected_verts)
static VertLooseEdges calc_vert_loose_edges (const GroupedSpan< int > vert_to_edge_map, const BitSpan loose_edges, const BitSpan split_edges, const int vert)
static OffsetIndices< int > calc_vert_ranges_per_old_vert (const IndexMask &affected_verts, const Span< Vector< CornerGroup > > corner_groups, const GroupedSpan< int > vert_to_edge_map, const BitSpan loose_edges, const BitSpan split_edges, Array< int > &offset_data)
static void update_corner_verts (const int orig_verts_num, const Span< Vector< CornerGroup > > corner_groups, const OffsetIndices< int > new_verts_by_affected_vert, MutableSpan< int > new_corner_verts)
static OrderedEdge edge_from_corner (const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< int > corner_to_face_map, const int corner)
static Array< int2 > calc_new_edges (const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > edge_to_corner_map, const Span< int > corner_to_face_map, const IndexMask &selected_edges, MutableSpan< int2 > edges, MutableSpan< int > corner_edges, MutableSpan< int > r_new_edge_offsets)
static void update_unselected_edges (const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > edge_to_corner_map, const Span< int > corner_to_face_map, const IndexMask &unselected_edges, MutableSpan< int2 > edges)
static void swap_edge_vert (int2 &edge, const int old_vert, const int new_vert)
static void reassign_loose_edge_verts (const int orig_verts_num, const IndexMask &affected_verts, const GroupedSpan< int > vert_to_edge_map, const BitSpan loose_edges, const BitSpan split_edges, const Span< Vector< CornerGroup > > corner_groups, const OffsetIndices< int > new_verts_by_affected_vert, MutableSpan< int2 > edges)
static Array< int > offsets_to_map (const IndexMask &mask, const OffsetIndices< int > offsets)
static auto filter_builtin_attributes (const bke::AttributeAccessor &mesh_attributes, const bke::AttributeAccessor &curves_attributes, Set< StringRef > &storage, const bke::AttributeFilter &attribute_filter)
static BLI_NOINLINE CurveFromEdgesOutput edges_to_curve_point_indices (const int verts_num, const Span< int2 > edges)
static BLI_NOINLINE bke::CurvesGeometry edges_to_curves_convert (const Mesh &mesh, const Span< int2 > edges, const bke::AttributeFilter &attribute_filter)
static bke::CurvesGeometry create_curves_for_faces (const Mesh &mesh, const OffsetIndices< int > faces, const IndexMask &selection)
static Span< int > create_point_to_vert_map (const Mesh &mesh, const OffsetIndices< int > faces, const OffsetIndices< int > points_by_curve, const IndexMask &selection, Array< int > &map_data)
static void gather (const Span< int > src, const Span< int16_t > indices, MutableSpan< int > dst)
static Span< int > gather_or_reference (const Span< int > src, const Span< int16_t > indices, Vector< int > &dst)
static Span< int > gather_or_reference (const Span< int > src, const IndexMaskSegment mask, Vector< int > &dst)
static Span< float3 > face_normals_if_worthwhile (const Mesh &src_mesh, const int selection_size)
static void copy_loose_vert_hint (const Mesh &src, Mesh &dst)
static OffsetIndices< int > gather_selected_offsets (const OffsetIndices< int > src_offsets, const IndexMaskSegment selection, MutableSpan< int > dst_offsets)
static int3 tri_to_ordered (const int3 tri)
static Span< int3 > tri_to_ordered_tri (MutableSpan< int3 > tris)
static IndexMask face_tris_mask (const OffsetIndices< int > src_faces, const IndexMask &mask, IndexMaskMemory &memory)
static IndexMask tris_in_set (const IndexMask &tri_mask, const OffsetIndices< int > faces, const Span< int > corner_verts, const VectorSet< TriKey, 4, DefaultProbingStrategy, FaceHash, FacesEquality, SimpleVectorSetSlot< TriKey, int > > &unique_tris, IndexMaskMemory &memory)
static void face_keys_to_face_indices (const Span< TriKey > faces, MutableSpan< int > indices)
static void quad_indices_of_tris (const IndexMask &quads, MutableSpan< int > indices)
static void ngon_indices_of_tris (const IndexMask &ngons, const OffsetIndices< int > tris_by_ngon, MutableSpan< int > indices)
static bool sharing_info_equal (const ImplicitSharingInfo *a, const ImplicitSharingInfo *b)
template<typename T>
void mix_with_indices (MutableSpan< T > a, const VArray< T > &b, const Span< int > index_map, const float factor)
static void mix_with_indices (GMutableSpan a, const GVArray &b, const Span< int > index_map, const float factor)
template<typename T>
static void mix (MutableSpan< T > a, const VArray< T > &b, const float factor)
static void mix (GMutableSpan a, const GVArray &b, const float factor)
static void mix_attributes (bke::MutableAttributeAccessor attributes_a, const bke::AttributeAccessor b_attributes, const Span< int > index_map, const bke::AttrDomain mix_domain, const float factor, const Set< std::string > &names_to_skip={})
static Array< int > create_id_index_map (const bke::AttributeAccessor attributes_a, const bke::AttributeAccessor b_attributes, const bke::AttrDomain id_domain)
static void mix_socket_values_same_type (bke::SocketValueVariant &a, const bke::SocketValueVariant &b, const float factor)
static void mix_bundle_items (nodes::BundleItemValue &a, const nodes::BundleItemValue &b, const float factor)
static Array< int > get_permutation (const int length, const int seed)
static Array< int > invert_permutation (const Span< int > permutation)
static int seed_from_mesh (const Mesh &mesh)
static int seed_from_pointcloud (const PointCloud &pointcloud)
static int seed_from_curves (const bke::CurvesGeometry &curves)
static int seed_from_instances (const bke::Instances &instances)
static void reorder_customdata (CustomData &data, const Span< int > new_by_old_map)
static void reorder_attribute_domain (bke::AttributeStorage &data, const bke::AttrDomain domain, const Span< int > new_by_old_map)
static Array< int > make_new_offset_indices (const OffsetIndices< int > old_offsets, const Span< int > old_by_new_map)
static void reorder_customdata_groups (CustomData &data, const OffsetIndices< int > old_offsets, const OffsetIndices< int > new_offsets, const Span< int > new_by_old_map)
static void reorder_attribute_groups (bke::AttributeStorage &storage, const bke::AttrDomain domain, const OffsetIndices< int > old_offsets, const OffsetIndices< int > new_offsets, const Span< int > new_by_old_map)
static bool valid_int_num (const int64_t num)
static int64_t get_final_points_num (const GatherTasks &tasks)
static bool skip_transform (const float4x4 &transform)
static void threaded_copy (const GVArray &src, GMutableSpan dst)
static void threaded_fill (const GPointer value, GMutableSpan dst)
static void copy_generic_attributes_to_result (const Span< std::optional< GVArray > > src_attributes, const AttributeFallbacksArray &attribute_fallbacks, const OrderedAttributes &ordered_attributes, const FunctionRef< IndexRange(bke::AttrDomain)> &range_fn, MutableSpan< GSpanAttributeWriter > dst_attribute_writers)
static void create_result_ids (const RealizeInstancesOptions &options, const VArray< int > &stored_ids, const int task_id, MutableSpan< int > dst_ids)
static VectorSet< int > gather_all_fill_ids (const VArray< int > &fill_ids)
static bool try_join_single_value_attribute (const int tasks_num, const OrderedAttributes &ordered_attributes, const FunctionRef< TaskAttrInfo(int)> get_task_attributes, const int attr_index, bke::MutableAttributeAccessor dst_attributes)
static void reorder_attributes_group_to_group (const bke::AttributeAccessor src_attributes, const bke::AttrDomain domain, const OffsetIndices< int > src_offsets, const OffsetIndices< int > dst_offsets, const Span< int > old_by_new_map, const bke::AttributeFilter &attribute_filter, bke::MutableAttributeAccessor dst_attributes)
static Array< int > invert_permutation (const Span< int > permutation)
static void copy_and_reorder_mesh_verts (const Mesh &src_mesh, const Span< int > old_by_new_map, const bke::AttributeFilter &attribute_filter, Mesh &dst_mesh)
static void copy_and_reorder_mesh_edges (const Mesh &src_mesh, const Span< int > old_by_new_map, const bke::AttributeFilter &attribute_filter, Mesh &dst_mesh)
static void copy_and_reorder_mesh_faces (const Mesh &src_mesh, const Span< int > old_by_new_map, const bke::AttributeFilter &attribute_filter, Mesh &dst_mesh)
static void copy_and_reorder_mesh (const Mesh &src_mesh, const Span< int > old_by_new_map, const bke::AttrDomain domain, const bke::AttributeFilter &attribute_filter, Mesh &dst_mesh)
static void copy_and_reorder_points (const PointCloud &src_pointcloud, const Span< int > old_by_new_map, const bke::AttributeFilter &attribute_filter, PointCloud &dst_pointcloud)
static void copy_and_reorder_curves (const bke::CurvesGeometry &src_curves, const Span< int > old_by_new_map, const bke::AttributeFilter &attribute_filter, bke::CurvesGeometry &dst_curves)
static void copy_and_reorder_instaces (const bke::Instances &src_instances, const Span< int > old_by_new_map, const bke::AttributeFilter &attribute_filter, bke::Instances &dst_instances)
template<typename T, typename Func>
static void parallel_transform (MutableSpan< T > values, const int64_t grain_size, const Func &func)
static void grouped_sort (const OffsetIndices< int > offsets, const Span< float > weights, MutableSpan< int > indices)
static void find_points_by_group_index (const Span< int > indices, MutableSpan< int > r_offsets, MutableSpan< int > r_indices)
static int identifiers_to_indices (MutableSpan< int > r_identifiers_to_indices)
static fn::Field< int > get_count_input_max_one (const fn::Field< int > &count_field)
static int get_count_from_length (const float curve_length, const float sample_length, const bool keep_last_segment)
static fn::Field< int > get_count_input_from_length (const fn::Field< float > &length_field, const bool keep_last_segment)
static bool interpolate_attribute_to_curves (const StringRef name, const std::array< int, CURVE_TYPES_NUM > &type_counts)
static bool interpolate_attribute_to_poly_curve (const StringRef name)
static void retrieve_attribute_spans (const Span< StringRef > names, const CurvesGeometry &src_curves, CurvesGeometry &dst_curves, Vector< GVArraySpan > &src_arrays, Vector< GMutableSpan > &dst_arrays, Vector< bke::GSpanAttributeWriter > &dst_writers)
static void gather_point_attributes_to_interpolate (const CurvesGeometry &src_curves, CurvesGeometry &dst_curves, AttributesForResample &result, const ResampleCurvesOutputAttributeIDs &output_ids)
static void copy_or_defaults_for_unselected_curves (const CurvesGeometry &src_curves, const IndexMask &unselected_curves, const AttributesForResample &attributes, CurvesGeometry &dst_curves)
static void normalize_span (MutableSpan< float3 > data)
static void normalize_curve_point_data (const IndexMaskSegment curve_selection, const OffsetIndices< int > points_by_curve, MutableSpan< float3 > data)
static void resample_to_uniform (const CurvesGeometry &src_curves, const IndexMask &selection, const ResampleCurvesOutputAttributeIDs &output_ids, CurvesGeometry &dst_curves)
static CurvesGeometry resample_to_uniform (const CurvesGeometry &src_curves, const fn::FieldContext &field_context, const fn::Field< bool > &selection_field, const fn::Field< int > &count_field, const ResampleCurvesOutputAttributeIDs &output_ids)
static int2 uv_to_cell (const float2 &uv, const int resolution)
static Bounds< int2 > tri_to_cell_bounds (const int3 &tri, const int resolution, const Span< float2 > uv_map)
static void sort_tris_into_rows (const Span< float2 > uv_map, const Span< int3 > corner_tris, const int resolution, threading::EnumerableThreadSpecific< LocalData > &data_per_thread)
static void finish_rows (const Span< int > all_ys, const Span< const LocalData * > local_data_vec, const Bounds< int > y_bounds, ReverseUVSampler::LookupGrid &lookup_grid)
static Span< int > lookup_tris_in_cell (const int2 cell, const ReverseUVSampler::LookupGrid &lookup_grid)
static std::optional< bke::CurvesGeometry > separate_curves_selection (const bke::CurvesGeometry &src_curves, const fn::FieldContext &field_context, const fn::Field< bool > &selection_field, const AttrDomain domain, const bke::AttributeFilter &attribute_filter)
static std::optional< PointCloud * > separate_pointcloud_selection (const PointCloud &src_pointcloud, const fn::Field< bool > &selection_field, const bke::AttributeFilter &attribute_filter)
static void delete_selected_instances (bke::GeometrySet &geometry_set, const fn::Field< bool > &selection_field, const bke::AttributeFilter &attribute_filter)
static std::optional< Mesh * > separate_mesh_selection (const Mesh &mesh, const fn::Field< bool > &selection_field, const AttrDomain selection_domain, const GeometryNodeDeleteGeometryMode mode, const bke::AttributeFilter &attribute_filter)
static std::optional< GreasePencil * > separate_grease_pencil_layer_selection (const GreasePencil &src_grease_pencil, const fn::Field< bool > &selection_field, const bke::AttributeFilter &attribute_filter)
static bool is_nurbs_to_bezier_one_to_one (const KnotsMode knots_mode)
template<typename T>
static void scale_input_assign (const Span< T > src, const int scale, const int offset, MutableSpan< T > dst)
static void bezier_positions_to_nurbs (const Span< float3 > src_positions, const Span< float3 > src_handles_l, const Span< float3 > src_handles_r, MutableSpan< float3 > dst_positions)
static void catmull_rom_to_bezier_handles (const Span< float3 > src_positions, const bool cyclic, MutableSpan< float3 > dst_handles_l, MutableSpan< float3 > dst_handles_r)
static void catmull_rom_to_nurbs_positions (const Span< float3 > src_positions, const bool cyclic, MutableSpan< float3 > dst_positions)
static Vector< float3 > create_nurbs_to_bezier_handles (const Span< float3 > nurbs_positions, const KnotsMode knots_mode)
static void create_nurbs_to_bezier_positions (const Span< float3 > nurbs_positions, const Span< float3 > handle_positions, const KnotsMode knots_mode, MutableSpan< float3 > bezier_positions)
static int to_bezier_size (const CurveType src_type, const bool cyclic, const KnotsMode knots_mode, const int src_size)
static int to_nurbs_size (const CurveType src_type, const int src_size)
static bke::CurvesGeometry convert_curves_to_bezier (const bke::CurvesGeometry &src_curves, const IndexMask &selection, const bke::AttributeFilter &attribute_filter)
static bke::CurvesGeometry convert_curves_to_nurbs (const bke::CurvesGeometry &src_curves, const IndexMask &selection, const bke::AttributeFilter &attribute_filter)
static bke::CurvesGeometry convert_curves_trivial (const bke::CurvesGeometry &src_curves, const IndexMask &selection, const CurveType dst_type)
static bke::CurvesGeometry convert_curves_to_catmull_rom_or_poly (const bke::CurvesGeometry &src_curves, const IndexMask &selection, const CurveType dst_type, const bke::AttributeFilter &attribute_filter, const ConvertCurvesOptions &options)
static bke::CurvesGeometry convert_bezier_or_catmull_rom_to_poly_before_conversion_to_nurbs (const bke::CurvesGeometry &src_curves, const IndexMask &selection, const ConvertCurvesOptions &options)
template<typename T>
float perpendicular_distance (const Span< float3 > positions, const Span< T > attribute_data, const int64_t first_index, const int64_t last_index, const int64_t index)
template<typename T>
static void ramer_douglas_peucker (const IndexRange range, const Span< float3 > positions, const float epsilon, const Span< T > attribute_data, MutableSpan< bool > points_to_delete)
template<typename T>
static void curve_simplify (const Span< float3 > positions, const bool cyclic, const float epsilon, const Span< T > attribute_data, MutableSpan< bool > points_to_delete)
template<typename T>
static void gaussian_blur_1D (const Span< T > src, const int iterations, const VArray< float > &influence_by_point, const bool smooth_ends, const bool keep_shape, const bool is_cyclic, MutableSpan< T > dst)
static void calculate_result_offsets (const bke::CurvesGeometry &src_curves, const IndexMask &selection, const IndexMask &unselected, const VArray< int > &cuts, const Span< bool > cyclic, MutableSpan< int > dst_curve_offsets, MutableSpan< int > dst_point_offsets)
template<typename T>
static void linear_interpolation (const T &a, const T &b, MutableSpan< T > dst)
template<typename T>
static void subdivide_attribute_linear (const OffsetIndices< int > src_points_by_curve, const OffsetIndices< int > dst_points_by_curve, const IndexMask &selection, const Span< int > all_point_offsets, const Span< T > src, MutableSpan< T > dst)
static void subdivide_attribute_linear (const OffsetIndices< int > src_points_by_curve, const OffsetIndices< int > dst_points_by_curve, const IndexMask &selection, const Span< int > all_point_offsets, const GSpan src, GMutableSpan dst)
static void subdivide_attribute_catmull_rom (const OffsetIndices< int > src_points_by_curve, const OffsetIndices< int > dst_points_by_curve, const IndexMask &selection, const Span< int > all_point_offsets, const Span< bool > cyclic, const GSpan src, GMutableSpan dst)
static HandleType aligned_or_free_handle_type (const HandleType type)
static void subdivide_bezier_segment (const float3 &position_prev, const float3 &handle_prev, const float3 &handle_next, const float3 &position_next, const HandleType type_prev, const HandleType type_next, const IndexRange segment_points, const int dst_next_segment_start, MutableSpan< float3 > dst_positions, MutableSpan< float3 > dst_handles_l, MutableSpan< float3 > dst_handles_r, MutableSpan< int8_t > dst_types_l, MutableSpan< int8_t > dst_types_r)
static void subdivide_bezier_positions (const Span< float3 > src_positions, const Span< int8_t > src_types_l, const Span< int8_t > src_types_r, const Span< float3 > src_handles_l, const Span< float3 > src_handles_r, const OffsetIndices< int > evaluated_offsets, const bool cyclic, MutableSpan< float3 > dst_positions, MutableSpan< int8_t > dst_types_l, MutableSpan< int8_t > dst_types_r, MutableSpan< float3 > dst_handles_l, MutableSpan< float3 > dst_handles_r)
static void translate_positions (MutableSpan< float3 > positions, const float3 &translation)
static void translate_pointcloud (PointCloud &pointcloud, const float3 translation)
static void transform_pointcloud (PointCloud &pointcloud, const float4x4 &transform)
static void translate_greasepencil (GreasePencil &grease_pencil, const float3 translation)
static void transform_greasepencil (GreasePencil &grease_pencil, const float4x4 &transform)
static void translate_instances (bke::Instances &instances, const float3 translation)
static void transform_instances (bke::Instances &instances, const float4x4 &transform)
static void transform_volume (Volume &volume, const float4x4 &transform, TransformGeometryErrors &r_errors)
static void translate_volume (Volume &volume, const float3 translation)
static void transform_curve_edit_hints (bke::CurvesEditHints &edit_hints, const float4x4 &transform)
static void transform_grease_pencil_edit_hints (bke::GreasePencilEditHints &edit_hints, const float4x4 &transform)
static void transform_gizmo_edit_hints (bke::GizmoEditHints &edit_hints, const float4x4 &transform)
static void translate_curve_edit_hints (bke::CurvesEditHints &edit_hints, const float3 &translation)
static void translate_gizmos_edit_hints (bke::GizmoEditHints &edit_hints, const float3 &translation)
static float dist_signed_squared_to_edge (const float2 probe, const float2 uva, const float2 uvb)
static float get_aspect_scaled_extent (const rctf &extent, const UVPackIsland_Params &params)
static float get_aspect_scaled_area (const rctf &extent, const UVPackIsland_Params &params)
static bool is_larger (const rctf &a, const rctf &b, const UVPackIsland_Params &params)
static bool can_rotate (const Span< PackIsland * > islands, const UVPackIsland_Params &params)
static float2 sincos_rotate_90 (const float2 &sincos)
static float2 sincos_wrap (const float2 &sincos)
static float2 sincos_plusminus_90 (const float2 &sincos)
static void transformation_from_sincos (const float2 &sincos, const float aspect_y, float r_matrix[2][2])
static void inverse_transformation_from_sincos (const float2 &sincos, const float aspect_y, float r_matrix[2][2])
static void pack_islands_alpaca_turbo (const int64_t exclude_index, const rctf &exclude, const Span< std::unique_ptr< UVAABBIsland > > islands, const float target_aspect_y, MutableSpan< UVPhi > r_phis, rctf *r_extent)
static void update_hole_rotate (float2 &hole, float2 &hole_diagonal, bool &hole_rotate, const float u0, const float v0, const float u1, const float v1)
static void pack_islands_alpaca_rotate (const int64_t exclude_index, const rctf &exclude, const Span< std::unique_ptr< UVAABBIsland > > islands, const float target_aspect_y, MutableSpan< UVPhi > r_phis, rctf *r_extent)
static void pack_islands_fast (const int64_t exclude_index, const rctf &exclude, const Span< std::unique_ptr< UVAABBIsland > > aabbs, const bool rotate, const float target_aspect_y, MutableSpan< UVPhi > r_phis, rctf *r_extent)
static void pack_gobel (const Span< std::unique_ptr< UVAABBIsland > > aabbs, const float scale, const int m, MutableSpan< UVPhi > r_phis)
static bool pack_islands_optimal_pack_table (const int table_count, const float max_extent, const float *optimal, const char *, int64_t island_count, const float large_uv, const Span< std::unique_ptr< UVAABBIsland > > aabbs, const UVPackIsland_Params &params, MutableSpan< UVPhi > r_phis, rctf *r_extent)
static void pack_islands_optimal_pack (const Span< std::unique_ptr< UVAABBIsland > > aabbs, const UVPackIsland_Params &params, MutableSpan< UVPhi > r_phis, rctf *r_extent)
static void pack_island_box_pack_2d (const Span< std::unique_ptr< UVAABBIsland > > aabbs, const UVPackIsland_Params &params, MutableSpan< UVPhi > r_phis, rctf *r_extent)
static float signed_distance_fat_triangle (const float2 probe, const float2 uv0, const float2 uv1, const float2 uv2)
static UVPhi find_best_fit_for_island (const PackIsland *island, const int scan_line, const Occupancy &occupancy, const float scale, const int angle_90_multiple, const float margin, const float target_aspect_y)
static float guess_initial_scale (const Span< PackIsland * > islands, const float scale, const float margin)
static bool rotate_inside_square (const Span< std::unique_ptr< UVAABBIsland > > island_indices, const Span< PackIsland * > islands, const UVPackIsland_Params &params, const float scale, const float margin, MutableSpan< UVPhi > r_phis, rctf *r_extent)
static int64_t pack_island_xatlas (const Span< std::unique_ptr< UVAABBIsland > > island_indices, const Span< PackIsland * > islands, const float scale, const float margin, const UVPackIsland_Params &params, MutableSpan< UVPhi > r_phis, rctf *r_extent)
static float pack_islands_scale_margin (const Span< PackIsland * > islands, const float scale, const float margin, const UVPackIsland_Params &params, MutableSpan< UVPhi > r_phis)
static float pack_islands_margin_fraction (const Span< PackIsland * > islands, const float margin_fraction, const bool rescale_margin, const UVPackIsland_Params &params)
static float calc_margin_from_aabb_length_sum (const Span< PackIsland * > island_vector, const UVPackIsland_Params &params)
static bool can_rotate_with_method (const PackIsland &island, const UVPackIsland_Params &params, const eUVPackIsland_RotationMethod rotate_method)
static float p_chart_minimum_area_angle (PChart *chart)
static PHash * phash_new (PHashLink **list, int sizehint)
static void phash_safe_delete (PHash **pph)
static int phash_size (PHash *ph)
static void phash_insert (PHash *ph, PHashLink *link)
static PHashLink * phash_lookup (PHash *ph, PHashKey key)
static PHashLink * phash_next (PHash *ph, PHashKey key, PHashLink *link)
static void fix_large_angle (const float v_fix[3], const float v1[3], const float v2[3], double *r_fix, double *r_a1, double *r_a2)
static void p_triangle_angles (const float v1[3], const float v2[3], const float v3[3], double *r_a1, double *r_a2, double *r_a3)
static void p_face_angles (PFace *f, double *r_a1, double *r_a2, double *r_a3)
static float p_vec_cos (const float v1[3], const float v2[3], const float v3[3])
static void p_triangle_cos (const float v1[3], const float v2[3], const float v3[3], float *r_cos1, float *r_cos2, float *r_cos3)
static void UNUSED_FUNCTION p_face_cos (PFace *f, float *r_cos1, float *r_cos2, float *r_cos3)
static float p_face_area (PFace *f)
static float p_area_signed (const float v1[2], const float v2[2], const float v3[2])
static float p_face_uv_area_signed (PFace *f)
static float p_edge_length (PEdge *e)
static float p_edge_length_squared (PEdge *e)
static float p_edge_uv_length (PEdge *e)
static void p_chart_uv_bbox (PChart *chart, float minv[2], float maxv[2])
static float p_chart_uv_area (PChart *chart)
static void p_chart_uv_scale (PChart *chart, const float scale)
static void uv_parametrizer_scale_x (ParamHandle *phandle, const float scale_x)
static void p_chart_uv_rotate (PChart *chart, float angle)
static void p_chart_uv_translate (PChart *chart, const float trans[2])
static void p_chart_uv_transform (PChart *chart, const float mat[2][2])
static void p_chart_uv_to_array (PChart *chart, MutableSpan< float2 > points)
static bool p_intersect_line_2d_dir (const float v1[2], const float dir1[2], const float v2[2], const float dir2[2], float r_isect[2])
static PEdge * p_wheel_edge_next (PEdge *e)
static const PEdge * p_wheel_edge_next (const PEdge *e)
static PEdge * p_wheel_edge_prev (PEdge *e)
static PEdge * p_boundary_edge_next (PEdge *e)
static PEdge * p_boundary_edge_prev (PEdge *e)
static bool p_vert_interior (PVert *v)
static void p_face_flip (PFace *f)
static void p_vert_load_pin_select_uvs (ParamHandle *handle, PVert *v)
static void p_flush_uvs (ParamHandle *handle, PChart *chart)
static void p_face_backup_uvs (PFace *f)
static void p_face_restore_uvs (PFace *f)
static PVert * p_vert_add (ParamHandle *handle, PHashKey key, const float co[3], const float weight, PEdge *e)
static PVert * p_vert_lookup (ParamHandle *handle, PHashKey key, const float co[3], const float weight, PEdge *e)
static PVert * p_vert_copy (ParamHandle *handle, PVert *v)
static PEdge * p_edge_lookup (ParamHandle *handle, const PHashKey *vkeys)
static int p_face_exists (ParamHandle *handle, const ParamKey *pvkeys, int i1, int i2, int i3)
static bool p_edge_implicit_seam (PEdge *e, PEdge *ep)
static bool p_edge_has_pair (ParamHandle *handle, PEdge *e, bool topology_from_uvs, PEdge **r_pair)
static bool p_edge_connect_pair (ParamHandle *handle, PEdge *e, bool topology_from_uvs, PEdge ***stack)
static int p_connect_pairs (ParamHandle *handle, bool topology_from_uvs)
static void p_split_vert (ParamHandle *handle, PChart *chart, PEdge *e)
static PChart ** p_split_charts (ParamHandle *handle, PChart *chart, int ncharts)
static PFace * p_face_add (ParamHandle *handle)
static PFace * p_face_add_construct (ParamHandle *handle, ParamKey key, const ParamKey *vkeys, const float **co, float **uv, const float *weight, int i1, int i2, int i3, const bool *pin, const bool *select)
static PFace * p_face_add_fill (ParamHandle *handle, PChart *chart, PVert *v1, PVert *v2, PVert *v3)
static void p_chart_boundaries (PChart *chart, PEdge **r_outer)
static void p_polygon_calc_tris (ParamHandle *handle, const float **co, uint(**r_tris)[3], uint nverts)
static void p_chart_fill_boundary (ParamHandle *handle, PChart *chart, MutableSpan< PEdge * > border_edges, const float **co)
static void p_chart_fill_boundaries (ParamHandle *handle, PChart *chart, const PEdge *outer)
static void p_vert_fix_edge_pointer (PVert *v)
static void p_collapsing_verts (PEdge *edge, PEdge *pair, PVert **r_newv, PVert **r_keepv)
static void p_collapse_edge (PEdge *edge, PEdge *pair)
static bool p_collapse_allowed_topologic (PEdge *edge, PEdge *pair)
static void p_collapse_cost_vertex (PVert *vert, float *r_mincost, PEdge **r_mine, const std::function< float(PEdge *, PEdge *)> &collapse_cost_fn, const std::function< float(PEdge *, PEdge *)> &collapse_allowed_fn)
static void p_chart_post_collapse_flush (PChart *chart, PEdge *collapsed)
static void p_chart_simplify_compute (PChart *chart, std::function< float(PEdge *, PEdge *)> collapse_cost_fn, std::function< float(PEdge *, PEdge *)> collapse_allowed_fn)
static void p_abf_setup_system (PAbfSystem *sys)
static void p_abf_compute_sines (PAbfSystem *sys)
static float p_abf_compute_sin_product (PAbfSystem *sys, PVert *v, int aid)
static float p_abf_compute_grad_alpha (PAbfSystem *sys, PFace *f, PEdge *e)
static float p_abf_compute_gradient (PAbfSystem *sys, PChart *chart)
static void p_abf_adjust_alpha (PAbfSystem *sys, const int id, const float dlambda1, const float pre)
static bool p_abf_matrix_invert (PAbfSystem *sys, PChart *chart)
static bool p_chart_abf_solve (PChart *chart)
static void p_chart_pin_positions (PChart *chart, PVert **pin1, PVert **pin2)
static bool p_chart_symmetry_pins (PChart *chart, PEdge *outer, PVert **pin1, PVert **pin2)
static void p_chart_extrema_verts (PChart *chart, PVert **pin1, PVert **pin2)
static void p_chart_orig_bounds_init (PChart *chart)
static void p_chart_lscm_begin (PChart *chart, bool live, bool abf, const bool use_original_bounds)
static bool p_chart_lscm_solve (ParamHandle *handle, PChart *chart)
static void p_chart_lscm_transform_single_pin (PChart *chart)
static void p_chart_lscm_end (PChart *chart)
static void p_stretch_pin_boundary (PChart *chart)
static float p_face_stretch (PFace *f)
static float p_stretch_compute_vertex (PVert *v)
static void p_chart_stretch_minimize (PChart *chart, RNG *rng)
static int p_compare_geometric_uv (const void *a, const void *b)
static bool p_chart_convex_hull (PChart *chart, PVert ***r_verts, int *r_nverts, int *r_right)
static float p_rectangle_area (float *p1, float *dir, float *p2, float *p3, float *p4)
static void p_chart_rotate_minimum_area (PChart *chart)
static void p_chart_rotate_fit_aabb (PChart *chart)
static GeoUVPinIndex * new_geo_uv_pinindex (ParamHandle *handle, const float uv[2])
static void p_add_ngon (ParamHandle *handle, const ParamKey key, const int nverts, const ParamKey *vkeys, const float **co, float **uv, const float *weight, const bool *pin, const bool *select)
Merge Map Creation
std::optional< Mesh * > mesh_merge_by_distance_all (const Mesh &mesh, const IndexMask &selection, float merge_distance, const bke::AttributeFilter &attribute_filter=bke::AttributeFilter::default_filter())
std::optional< Mesh * > mesh_merge_by_distance_connected (const Mesh &mesh, Span< bool > selection, float merge_distance, bool only_loose_edges, const bke::AttributeFilter &attribute_filter=bke::AttributeFilter::default_filter())
Mesh * mesh_merge_verts (const Mesh &mesh, Span< int > vert_src_to_target, int removed_verts_num, bool do_mix_data)
Realize Instances
RealizeInstancesResult realize_instances (bke::GeometrySet geometry_set, const RealizeInstancesOptions &options)
RealizeInstancesResult realize_instances (bke::GeometrySet geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option)
static void remove_id_attribute_from_instances (bke::GeometrySet &geometry_set)
static void propagate_instances_to_keep (const bke::GeometrySet &geometry_set, const IndexMask &selection, bke::GeometrySet &new_geometry_set, const bke::AttributeFilter &attribute_filter)
Public API
bke::CurvesGeometry trim_curves (const bke::CurvesGeometry &src_curves, const IndexMask &selection, const VArray< float > &starts, const VArray< float > &ends, GeometryNodeCurveSampleMode mode, const bke::AttributeFilter &attribute_filter)
Chart Construction:

Faces and seams may only be added between #ParamHandle::ParamHandle() and #geometry::uv_parametrizer_construct_end.

The pointers to co and uv are stored, rather than being copied. Vertices are implicitly created.

In #geometry::uv_parametrizer_construct_end the mesh will be split up according to the seams. The resulting charts must be manifold, connected and open (at least one boundary loop). The output will be written to the uv pointers.

void uv_parametrizer_aspect_ratio (ParamHandle *handle, float aspect_y)
void uv_prepare_pin_index (ParamHandle *handle, const int bmvertindex, const float uv[2])
ParamKey uv_find_pin_index (ParamHandle *handle, const int bmvertindex, const float uv[2])
void uv_parametrizer_face_add (ParamHandle *handle, const ParamKey key, const int nverts, const ParamKey *vkeys, const float **co, float **uv, const float *weight, const bool *pin, const bool *select)
void uv_parametrizer_edge_set_seam (ParamHandle *phandle, const ParamKey *vkeys)
void uv_parametrizer_construct_end (ParamHandle *phandle, bool fill_holes, bool topology_from_uvs, int *r_count_failed=nullptr)
SLIM:
  • begin: data is gathered into matrices and transferred to SLIM.
  • solve: compute cheap initialization (if necessary) and refine iteratively.
  • end: clean up.
void uv_parametrizer_slim_solve (ParamHandle *phandle, const ParamSlimOptions *slim_options, bool use_original_bounds, int *count_changed, int *count_failed)
void uv_parametrizer_slim_live_begin (ParamHandle *phandle, const ParamSlimOptions *slim_options)
void uv_parametrizer_slim_live_solve_iteration (ParamHandle *phandle)
void uv_parametrizer_slim_live_end (ParamHandle *phandle)
void uv_parametrizer_slim_stretch_iteration (ParamHandle *phandle, float blend)
bool uv_parametrizer_is_slim (const ParamHandle *phandle)
Least Squares Conformal Maps:

Charts with less than two pinned vertices are assigned two pins. LSCM is divided to three steps:

  1. Begin: compute matrix and its factorization (expensive).
  2. Solve using pinned coordinates (cheap).
  3. End: clean up.

UV coordinates are allowed to change within begin/end, for quick re-solving.

void uv_parametrizer_lscm_begin (ParamHandle *handle, bool live, bool abf, bool use_original_bounds)
void uv_parametrizer_lscm_solve (ParamHandle *handle, int *count_changed, int *count_failed)
void uv_parametrizer_lscm_end (ParamHandle *handle)
Stretch
void uv_parametrizer_stretch_begin (ParamHandle *handle)
void uv_parametrizer_stretch_blend (ParamHandle *handle, float blend)
void uv_parametrizer_stretch_iter (ParamHandle *handle)
void uv_parametrizer_stretch_end (ParamHandle *handle)
Packing
void uv_parametrizer_pack (ParamHandle *handle, const UVPackIsland_Params &params)
Original Bounds
void uv_parametrizer_original_bounds (ParamHandle *phandle)
Average area for all charts
void uv_parametrizer_average (ParamHandle *handle, bool ignore_pinned, bool scale_uv, bool shear)
Flushing
void uv_parametrizer_flush (ParamHandle *handle)
void uv_parametrizer_flush_restore (ParamHandle *handle)
Vert API
static Array< bool > find_affected_verts (const Span< int > vert_src_to_target)
Edge API
static IndexMask find_collapsed_and_weld_edges (const Span< int2 > edges, const Span< int > vert_src_to_target, const Span< bool > vert_affected, IndexMaskMemory &memory, MutableSpan< int > r_edge_src_to_target, int *r_collapsed_edges_num)
static int find_duplicate_edges (const Span< int2 > edges, const Span< int > vert_src_to_target, const IndexMask &weld_edges, const int verts_num, MutableSpan< int > r_edge_src_to_target)
Poly and Loop API
static void weld_face_corner_ctx_alloc (const OffsetIndices< int > faces, const Span< int > corner_verts, WeldMesh *r_weld_mesh)
static void weld_face_split_recursive (int face_size, const Span< int > corner_verts, WeldFace *r_wp, WeldMesh *r_weld_mesh, RemovedFacesAndCorners &r_removed)
static int collapse_weld_face (const Span< int > corner_edges, const Span< int > edge_src_to_target, WeldFace &weld_face, MutableSpan< int > corner_next, RemovedFacesAndCorners &r_removed)
static void weld_face_corner_ctx_setup_collapsed_and_split (const Span< int > corner_verts, const Span< int > corner_edges, const int remaining_edge_ctx_num, WeldMesh *r_weld_mesh)
static void weld_face_find_doubles (const Span< int > corner_verts, WeldMesh *r_weld_mesh)
Mesh API
static void weld_mesh_context_create (const Mesh &mesh, const Span< int > vert_src_to_target, const Span< bool > vert_affected, const int removed_verts_num, WeldMesh *r_weld_mesh)
Merging
static IndexMask merge_survivors (const Span< int > src_to_target, IndexMaskMemory &memory)
static MergePropagationMap merge_propagation_map (const Span< int > src_to_target, const IndexMask &survivors, const Span< int > src_to_dst, const bool do_mix_data, IndexMaskMemory &memory)
static Array< int > merge_src_to_dst_map (const Span< int > src_to_target, const IndexMask &survivors)
Mesh Vertex Merging
static void copy_and_mix_attributes (const bke::AttributeAccessor src_attributes, const bke::AttrDomain domain, const bke::AttributeFilter &attribute_filter, const MergePropagationMap &map, bke::MutableAttributeAccessor dst_attributes)
static void mix_vertex_groups (const Mesh &mesh_src, const MergePropagationMap &map, Mesh &mesh_dst)
static Set< StringRef > get_vertex_group_names (const Mesh &mesh)
static Mesh * create_merged_mesh (const Mesh &mesh, const Span< int > vert_src_to_target, const int removed_vertex_count, const bool do_mix_data, const bke::AttributeFilter &attribute_filter)
Gather Realize Tasks
static void gather_realize_tasks_recursive (GatherTasksInfo &gather_info, const int current_depth, const int target_depth, const bke::GeometrySet &geometry_set, const float4x4 &base_transform, const InstanceContext &base_instance_context)
static Vector< AttrFallbackData > prepare_attribute_fallbacks (GatherTasksInfo &gather_info, const Instances &instances, const OrderedAttributes &ordered_attributes)
static void foreach_geometry_in_reference (const InstanceReference &reference, const float4x4 &base_transform, const uint32_t id, FunctionRef< void(const bke::GeometrySet &geometry_set, const float4x4 &transform, uint32_t id)> fn)
static void gather_realize_tasks_for_instances (GatherTasksInfo &gather_info, const int current_depth, const int target_depth, const Instances &instances, const float4x4 &base_transform, const InstanceContext &base_instance_context)
static void gather_attribute_propagation_components (const bke::GeometrySet &geometry, const bke::GeometryComponent::Type component_type, const RealizeInstancesOptions &options, const int current_depth, const std::optional< int > max_depth, Set< bke::GeometryComponentPtr > &r_components)
static void gather_attribute_propagation_components_with_custom_depths (const bke::GeometrySet &geometry, const bke::GeometryComponent::Type component_type, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option, Set< bke::GeometryComponentPtr > &r_components)
static bke::GeometrySet::GatheredAttributes gather_attributes_to_propagate (const bke::GeometrySet &geometry, const bke::GeometryComponent::Type component_type, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option)
Instance
static OrderedAttributes gather_generic_instance_attributes_to_propagate (const bke::GeometrySet &in_geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option)
static void execute_instances_tasks (const Span< bke::GeometryComponentPtr > src_components, const Span< float4x4 > src_base_transforms, const OrderedAttributes &all_instances_attributes, const Span< geometry::AttributeFallbacksArray > attribute_fallback, bke::GeometrySet &r_realized_geometry)
Point Cloud
static OrderedAttributes gather_generic_pointcloud_attributes_to_propagate (const bke::GeometrySet &in_geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option, bool &r_create_radii, bool &r_create_id)
static void gather_pointclouds_to_realize (const bke::GeometrySet &geometry_set, VectorSet< const PointCloud * > &r_pointclouds)
static AllPointCloudsInfo preprocess_pointclouds (const bke::GeometrySet &geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option)
static void execute_realize_pointcloud_task (const RealizeInstancesOptions &options, const RealizePointCloudTask &task, const OrderedAttributes &ordered_attributes, MutableSpan< GSpanAttributeWriter > dst_attribute_writers, MutableSpan< float > all_dst_radii, MutableSpan< int > all_dst_ids, MutableSpan< float3 > all_dst_positions)
static void add_instance_attributes_to_single_geometry (const OrderedAttributes &ordered_attributes, const AttributeFallbacksArray &attribute_fallbacks, bke::MutableAttributeAccessor attributes)
static void execute_realize_pointcloud_tasks (const RealizeInstancesOptions &options, const GatherOffsets &offsets, const AllPointCloudsInfo &all_pointclouds_info, const Span< RealizePointCloudTask > tasks, const OrderedAttributes &ordered_attributes, RealizeInstancesResult &r_result)
Mesh
static OrderedAttributes gather_generic_mesh_attributes_to_propagate (const bke::GeometrySet &in_geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option, bool &r_create_id, bool &r_create_material_index)
static void gather_meshes_to_realize (const bke::GeometrySet &geometry_set, VectorSet< const Mesh * > &r_meshes)
static AllMeshesInfo preprocess_meshes (const bke::GeometrySet &geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option)
static void execute_realize_mesh_task (const RealizeInstancesOptions &options, const RealizeMeshTask &task, const OrderedAttributes &ordered_attributes, MutableSpan< GSpanAttributeWriter > dst_attribute_writers, MutableSpan< float3 > all_dst_positions, MutableSpan< int2 > all_dst_edges, MutableSpan< int > all_dst_face_offsets, MutableSpan< int > all_dst_corner_verts, MutableSpan< int > all_dst_corner_edges, MutableSpan< int > all_dst_vert_ids, GSpanAttributeWriter &all_dst_custom_normals, MutableSpan< int > all_dst_origindex_vert, MutableSpan< int > all_dst_origindex_edge, MutableSpan< int > all_dst_origindex_face)
static void copy_vertex_group_name (ListBaseT< bDeformGroup > *dst_deform_group, const OrderedAttributes &ordered_attributes, const bDeformGroup &src_deform_group)
static void copy_vertex_group_names (Mesh &dst_mesh, const OrderedAttributes &ordered_attributes, const Span< const Mesh * > src_meshes)
static int get_mapped_material_index (const MeshRealizeInfo &info, const int index)
static std::optional< int > calc_material_index_max_hint (const Span< MeshRealizeInfo > infos)
static std::optional< int > calc_single_value_material_index (const AllMeshesInfo &all_meshes_info)
static void join_mesh_material_indices (const AllMeshesInfo &all_meshes_info, const Span< RealizeMeshTask > tasks, Mesh &dst_mesh)
static void execute_realize_mesh_tasks (const RealizeInstancesOptions &options, const GatherOffsets &offsets, const AllMeshesInfo &all_meshes_info, const Span< RealizeMeshTask > tasks, const OrderedAttributes &ordered_attributes, const VectorSet< Material * > &ordered_materials, RealizeInstancesResult &r_result)
Curves
static OrderedAttributes gather_generic_curve_attributes_to_propagate (const bke::GeometrySet &in_geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option, bool &r_create_id, bool &r_create_fill_id)
static void gather_curves_to_realize (const bke::GeometrySet &geometry_set, VectorSet< const Curves * > &r_curves)
static AllCurvesInfo preprocess_curves (const bke::GeometrySet &geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option)
static void initialize_curves_builtin_attribute_defaults (const AllCurvesInfo &all_curves_info, InstanceContext &attribute_fallbacks)
static void execute_realize_curve_task (const RealizeInstancesOptions &options, const AllCurvesInfo &all_curves_info, const RealizeCurveTask &task, const OrderedAttributes &ordered_attributes, bke::CurvesGeometry &dst_curves, MutableSpan< GSpanAttributeWriter > dst_attribute_writers, MutableSpan< int > all_dst_ids, MutableSpan< int > all_dst_fill_ids, MutableSpan< float3 > all_handle_left, MutableSpan< float3 > all_handle_right, MutableSpan< float > all_radii, MutableSpan< float3 > all_custom_normals)
static void copy_vertex_group_names (CurvesGeometry &dst_curve, const OrderedAttributes &ordered_attributes, const Span< const Curves * > src_curves)
static void execute_realize_curve_tasks (const RealizeInstancesOptions &options, const GatherOffsets &offsets, const AllCurvesInfo &all_curves_info, const Span< RealizeCurveTask > tasks, const OrderedAttributes &ordered_attributes, RealizeInstancesResult &r_result)
Grease Pencil
static OrderedAttributes gather_generic_grease_pencil_attributes_to_propagate (const bke::GeometrySet &in_geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_options)
static void gather_grease_pencils_to_realize (const bke::GeometrySet &geometry_set, VectorSet< const GreasePencil * > &r_grease_pencils)
static AllGreasePencilsInfo preprocess_grease_pencils (const bke::GeometrySet &geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_options)
static void execute_realize_grease_pencil_task (const RealizeGreasePencilTask &task, const OrderedAttributes &ordered_attributes, GreasePencil &dst_grease_pencil, MutableSpan< GSpanAttributeWriter > dst_attribute_writers)
static void transform_grease_pencil_layers (Span< bke::greasepencil::Layer * > layers, const float4x4 &transform)
static void execute_realize_grease_pencil_tasks (const AllGreasePencilsInfo &all_grease_pencils_info, const GatherOffsets &offsets, const Span< RealizeGreasePencilTask > tasks, const OrderedAttributes &ordered_attributes, RealizeInstancesResult &r_result)
Edit Data
static void execute_realize_edit_data_tasks (const Span< RealizeEditDataTask > tasks, bke::GeometrySet &r_realized_geometry)
Lookup Curve Points
static bke::curves::CurvePoint lookup_point_uniform_spacing (const Span< float > lengths, const float sample_length, const bool cyclic, const int resolution, const int num_curve_points)
static bke::curves::CurvePoint lookup_point_polygonal (const Span< float > lengths, const float sample_length, const bool cyclic, const int evaluated_size)
static bke::curves::CurvePoint lookup_point_bezier (const Span< int > bezier_offsets, const Span< float > lengths, const float sample_length, const bool cyclic, const int num_curve_points)
static bke::curves::CurvePoint lookup_point_bezier (const bke::CurvesGeometry &src_curves, const OffsetIndices< int > evaluated_points_by_curve, const int64_t curve_index, const Span< float > accumulated_lengths, const float sample_length, const bool cyclic, const int resolution, const int num_curve_points)
static bke::curves::CurvePoint lookup_curve_point (const bke::CurvesGeometry &src_curves, const OffsetIndices< int > evaluated_points_by_curve, const CurveType curve_type, const int64_t curve_index, const Span< float > accumulated_lengths, const float sample_length, const bool cyclic, const int resolution, const int num_curve_points)
Utility Functions
static void fill_bezier_data (bke::CurvesGeometry &dst_curves, const IndexMask &selection)
static void fill_nurbs_data (bke::CurvesGeometry &dst_curves, const IndexMask &selection)
template<typename T>
static int64_t copy_point_data_between_endpoints (const Span< T > src_data, MutableSpan< T > dst_data, const bke::curves::IndexRangeCyclic src_range, int64_t dst_index)
Sampling Utilities
template<typename T>
static T interpolate_catmull_rom (const Span< T > src_data, const bke::curves::CurvePoint insertion_point, const bool src_cyclic)
static bke::curves::bezier::Insertion knot_insert_bezier (const Span< float3 > positions, const Span< float3 > handles_left, const Span< float3 > handles_right, const bke::curves::CurvePoint insertion_point)
Sample Curve Interval (Trim)
template<typename T, bool include_start_point = true>
static void sample_interval_linear (const Span< T > src_data, MutableSpan< T > dst_data, bke::curves::IndexRangeCyclic src_range, const IndexRange dst_range, const bke::curves::CurvePoint start_point, const bke::curves::CurvePoint end_point)
template<typename T>
static void sample_interval_catmull_rom (const Span< T > src_data, MutableSpan< T > dst_data, bke::curves::IndexRangeCyclic src_range, const IndexRange dst_range, const bke::curves::CurvePoint start_point, const bke::curves::CurvePoint end_point, const bool src_cyclic)
template<bool include_start_point = true>
static void sample_interval_bezier (const Span< float3 > src_positions, const Span< float3 > src_handles_l, const Span< float3 > src_handles_r, const Span< int8_t > src_types_l, const Span< int8_t > src_types_r, MutableSpan< float3 > dst_positions, MutableSpan< float3 > dst_handles_l, MutableSpan< float3 > dst_handles_r, MutableSpan< int8_t > dst_types_l, MutableSpan< int8_t > dst_types_r, bke::curves::IndexRangeCyclic src_range, const IndexRange dst_range, const bke::curves::CurvePoint start_point, const bke::curves::CurvePoint end_point)
Trim Curves
static void trim_attribute_linear (const bke::CurvesGeometry &src_curves, bke::CurvesGeometry &dst_curves, const IndexMask &selection, const Span< bke::curves::CurvePoint > start_points, const Span< bke::curves::CurvePoint > end_points, const Span< bke::curves::IndexRangeCyclic > src_ranges, MutableSpan< bke::AttributeTransferData > transfer_attributes)
static void trim_polygonal_curves (const bke::CurvesGeometry &src_curves, bke::CurvesGeometry &dst_curves, const IndexMask &selection, const Span< bke::curves::CurvePoint > start_points, const Span< bke::curves::CurvePoint > end_points, const Span< bke::curves::IndexRangeCyclic > src_ranges, MutableSpan< bke::AttributeTransferData > transfer_attributes)
static void trim_catmull_rom_curves (const bke::CurvesGeometry &src_curves, bke::CurvesGeometry &dst_curves, const IndexMask &selection, const Span< bke::curves::CurvePoint > start_points, const Span< bke::curves::CurvePoint > end_points, const Span< bke::curves::IndexRangeCyclic > src_ranges, MutableSpan< bke::AttributeTransferData > transfer_attributes)
static void trim_bezier_curves (const bke::CurvesGeometry &src_curves, bke::CurvesGeometry &dst_curves, const IndexMask &selection, const Span< bke::curves::CurvePoint > start_points, const Span< bke::curves::CurvePoint > end_points, const Span< bke::curves::IndexRangeCyclic > src_ranges, MutableSpan< bke::AttributeTransferData > transfer_attributes)
static void trim_evaluated_curves (const bke::CurvesGeometry &src_curves, bke::CurvesGeometry &dst_curves, const IndexMask &selection, const Span< bke::curves::CurvePoint > start_points, const Span< bke::curves::CurvePoint > end_points, const Span< bke::curves::IndexRangeCyclic > src_ranges, MutableSpan< bke::AttributeTransferData > transfer_attributes)
Compute trim parameters
static float trim_sample_length (const Span< float > accumulated_lengths, const float sample_length, const GeometryNodeCurveSampleMode mode)
static void compute_curve_trim_parameters (const bke::CurvesGeometry &curves, const IndexMask &selection, const VArray< float > &starts, const VArray< float > &ends, const GeometryNodeCurveSampleMode mode, MutableSpan< int > dst_curve_size, MutableSpan< bke::curves::CurvePoint > start_points, MutableSpan< bke::curves::CurvePoint > end_points, MutableSpan< bke::curves::IndexRangeCyclic > src_ranges)
Implement <tt>pack_islands</tt>
static bool overlap_aabb (const float2 &pivot_a, const float2 &half_diagonal_a, const float2 &pivot_b, const float2 &half_diagonal_b)
static void finalize_geometry (const Span< PackIsland * > islands, const UVPackIsland_Params &params)
float pack_islands (const Span< PackIsland * > islands, const UVPackIsland_Params &params)

Variables

static constexpr int max_neighbors = 5
static constexpr int P_NGON_STACK_NUM = 32
static int PHashSizes []

Degenerate Geometry Fixing

static const float CORR_ZERO_AREA_EPS = 1.0e-10f
static void p_chart_flush_collapsed_uvs (PChart *chart)
static bool p_collapse_doubles_allowed (PEdge *edge, PEdge *pair, float threshold_squared)
static float p_collapse_doubles_cost (PEdge *edge, PEdge *pair)
static void UNUSED_FUNCTION p_chart_collapse_doubles (PChart *chart, const float threshold)
static bool p_validate_corrected_coords_point (const PEdge *corr_e, const float corr_co1[3], const float corr_co2[3], const float min_area, const float min_angle_cos)
static bool p_validate_corrected_coords (const PEdge *corr_e, const float corr_co[3], float min_area, float min_angle_cos)
static bool p_edge_matrix (float R[3][3], const float edge_dir[3])
static bool p_edge_matrix (float R[3][3], const PEdge *e)
static bool p_chart_correct_degenerate_triangle_point (PFace *f, float min_area, float min_angle_cos)
static bool p_chart_correct_degenerate_triangles2 (PChart *chart, float min_area, float min_angle)
static bool p_validate_triangle_angles (const PVert *vert1, const PVert *vert2, const PVert *vert3, const float min_angle_cos)
static bool UNUSED_FUNCTION_NO_SLIM p_chart_correct_degenerate_triangles (PChart *chart, const float min_area, const float min_angle)

Detailed Description

The code below uses a suffix naming convention to indicate the coordinate space: cu: Local space of the curves object that is being edited. su: Local space of the surface object.

Typedef Documentation

◆ CornerGroup

Definition at line 150 of file mesh_split_edges.cc.

◆ NeighborCurves

◆ ParamKey

Definition at line 33 of file GEO_uv_parametrizer.hh.

◆ PHashKey

Definition at line 52 of file uv_parametrizer.cc.

◆ UVVertBucket

Definition at line 76 of file mesh_bevel.cc.

◆ UVVertMap

Definition at line 77 of file mesh_bevel.cc.

Enumeration Type Documentation

◆ AngleKind

enum class blender::geometry::AngleKind
strong
Enumerator
Smaller 
Straight 
Larger 

Definition at line 56 of file mesh_bevel.cc.

◆ AttrDomain [1/3]

enum class blender::bke::AttrDomain : int8_t
strong

Definition at line 40 of file BKE_attribute_enums.hh.

◆ AttrDomain [2/3]

enum class blender::bke::AttrDomain : int8_t
strong

Definition at line 40 of file BKE_attribute_enums.hh.

◆ AttrDomain [3/3]

enum class blender::bke::AttrDomain : int8_t
strong

Definition at line 40 of file BKE_attribute_enums.hh.

◆ BevelAffect

enum class blender::geometry::BevelAffect
strong
Warning
Each of following enum values are saved in files. Currently, they also need to be in sync with values in bmesh_opdefines.h and DNA_modifier_types.h.
Enumerator
Vertices 
Edges 

Definition at line 28 of file GEO_mesh_bevel.hh.

◆ BevelMiterType

Enumerator
Sharp 
Patch 
Arc 

Definition at line 35 of file GEO_mesh_bevel.hh.

◆ ConeFillType

Enumerator
None 
NGon 
Triangles 

Definition at line 27 of file GEO_mesh_primitive_cylinder_cone.hh.

◆ FitMethod

enum class blender::geometry::FitMethod
strong
Enumerator
Refit 

Iteratively removes knots/control points with the least error starting with a dense curve.

Split 

Uses a least squares solver to recursively find the control points.

Definition at line 15 of file GEO_fit_curves.hh.

◆ FKind

enum class blender::geometry::FKind
strong
Enumerator
Orig 
Edge 
Vert 
Profile 

Definition at line 49 of file mesh_bevel.cc.

◆ Flag

Enumerator
OnStack 
Inserted 

Definition at line 19 of file merge_curves.cc.

◆ KernelType

enum class blender::geometry::KernelType
strong

Kernel functions for weighting point influence on surrounding voxels.

Enumerator
NearestPoint 

Only the nearest voxel is affected.

Linear 

Linear falloff over 1 voxel.

Quadratic 

Quadratic falloff over 1.5 voxels with a continuous derivative.

Cubic 

Cubic falloff over 2 voxels with a continuous and smooth derivative.

Definition at line 36 of file GEO_points_to_volume.hh.

◆ MeshKind

enum class blender::geometry::MeshKind
strong
Enumerator
None 
Poly 
Adj 
TriFan 
Cutoff 

Definition at line 79 of file mesh_bevel.cc.

◆ NewEdgeKind

Identifies the role of a newly created edge for the BevelAttributeOutputs fields.

Enumerator
Other 
OuterEdge 

Outermost edge of a bevel strip - adjacent to the surviving original geometry.

MidEdge 

Mid-ring edge of a bevel strip (at k = nseg / 2, only when nseg >= 2).

Definition at line 198 of file mesh_bevel.cc.

◆ NewFaceKind

Identifies the role of a newly created face for the BevelAttributeOutputs fields.

Enumerator
Other 
VertexFace 

Face that fills the VMesh cap around a beveled vertex.

EdgeFace 

Face (quad) that fills a bevel strip along a beveled edge.

Definition at line 189 of file mesh_bevel.cc.

◆ PEdgeFlag

Enumerator
PEDGE_SEAM 
PEDGE_VERTEX_SPLIT 
PEDGE_PIN 
PEDGE_SELECT 
PEDGE_DONE 
PEDGE_FILLED 
PEDGE_COLLAPSE 
PEDGE_COLLAPSE_EDGE 
PEDGE_COLLAPSE_PAIR 

Definition at line 127 of file uv_parametrizer.cc.

◆ PFaceFlag

Enumerator
PFACE_CONNECTED 
PFACE_FILLED 
PFACE_COLLAPSE 
PFACE_DONE 

Definition at line 142 of file uv_parametrizer.cc.

◆ PHandleState

Enumerator
PHANDLE_STATE_ALLOCATED 
PHANDLE_STATE_CONSTRUCTED 
PHANDLE_STATE_LSCM 
PHANDLE_STATE_STRETCH 

Definition at line 36 of file GEO_uv_parametrizer.hh.

◆ PointRasterizeType

Supported rasterization types.

Enumerator
Scalar 

Rasterize a float attribute into a float grid.

Vector 

Rasterize a vector attribute into a vector grid.

Definition at line 28 of file GEO_points_to_volume.hh.

◆ PVertFlag

Enumerator
PVERT_PIN 
PVERT_SELECT 
PVERT_INTERIOR 
PVERT_COLLAPSE 
PVERT_SPLIT 

Definition at line 119 of file uv_parametrizer.cc.

◆ TriangulateNGonMode

Warning
Values are saved in files.
Enumerator
Beauty 

Add a "beauty" pass on top of the standard ear-clipping algorithm.

EarClip 

Definition at line 24 of file GEO_mesh_triangulate.hh.

◆ TriangulateQuadMode

Warning
Values are saved in files.
Enumerator
Beauty 

Complex method to determine the best looking edge.

Fixed 

Create a new edge from the first corner to the last.

Alternate 

Create a new edge from the second corner to the third.

ShortEdge 

Create a new edge along the shortest diagonal.

LongEdge 

Create a new edge along the longest diagonal.

Definition at line 31 of file GEO_mesh_triangulate.hh.

◆ VMeshMethod

enum class blender::geometry::VMeshMethod
strong
Enumerator
Adj 
Cutoff 

Definition at line 87 of file mesh_bevel.cc.

Function Documentation

◆ add_curves_on_mesh()

AddCurvesOnMeshOutputs blender::geometry::add_curves_on_mesh ( bke::CurvesGeometry & curves,
const AddCurvesOnMeshInputs & inputs )

Generate new curves on a mesh surface with the given inputs. Existing curves stay intact.

Definition at line 326 of file add_curves_on_mesh.cc.

References add_curves_on_mesh(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), blender::bke::attribute_filter_from_skip_ref(), blender::BLI_assert(), calc_position_with_interpolation(), calc_position_without_interpolation(), calc_radius_with_interpolation(), calc_radius_without_interpolation(), blender::MutableSpan< T >::copy_from(), blender::offset_indices::copy_group_sizes(), blender::geometry::AddCurvesOnMeshInputs::corner_normals_su, blender::bke::Curve, blender::CURVE_TYPE_CATMULL_ROM, blender::Default, blender::math::distance(), blender::IndexRange::drop_back(), blender::geometry::AddCurvesOnMeshInputs::fallback_curve_length, blender::geometry::AddCurvesOnMeshInputs::fallback_curve_radius, blender::geometry::AddCurvesOnMeshInputs::fallback_point_count, blender::Array< T, InlineBufferCapacity, Allocator >::fill(), blender::bke::fill_attribute_range_default(), find_curve_neighbors(), blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), blender::geometry::AddCurvesOnMeshInputs::interpolate_length, blender::geometry::AddCurvesOnMeshInputs::interpolate_point_count, blender::geometry::AddCurvesOnMeshInputs::interpolate_radius, blender::geometry::AddCurvesOnMeshInputs::interpolate_resolution, blender::geometry::AddCurvesOnMeshInputs::interpolate_shape, length(), blender::bke::MutableAttributeAccessor::lookup_for_write_span(), blender::bke::attribute_math::mix3(), blender::bke::attribute_math::mix_groups(), blender::geometry::AddCurvesOnMeshOutputs::new_curves_range, blender::geometry::AddCurvesOnMeshOutputs::new_points_range, blender::geometry::ReverseUVSampler::Ok, blender::geometry::AddCurvesOnMeshInputs::old_roots_kdtree, blender::threading::parallel_for(), blender::bke::Point, PRF_scope, blender::result, blender::geometry::AddCurvesOnMeshInputs::reverse_uv_sampler, blender::geometry::ReverseUVSampler::sample(), blender::bke::mesh_surface_sample::sample_corner_normals(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::geometry::AddCurvesOnMeshInputs::surface, blender::geometry::AddCurvesOnMeshInputs::surface_corner_tris, blender::bke::CurvesSurfaceTransforms::surface_to_curves, blender::bke::CurvesSurfaceTransforms::surface_to_curves_normal, blender::MutableSpan< T >::take_back(), blender::MutableSpan< T >::take_front(), blender::math::transform_point(), blender::geometry::AddCurvesOnMeshInputs::transforms, blender::geometry::AddCurvesOnMeshOutputs::uv_error, and blender::geometry::AddCurvesOnMeshInputs::uvs.

Referenced by add_curves_on_mesh(), and blender::ed::sculpt_paint::AddOperationExecutor::execute().

◆ add_instance_attributes_to_single_geometry()

◆ aligned_or_free_handle_type()

◆ assign_samples_to_segments()

void blender::geometry::assign_samples_to_segments ( const int num_dst_points,
const Span< float3 > src_positions,
const bool cyclic,
MutableSpan< int > dst_sample_offsets )
static

◆ bezier_positions_to_nurbs()

void blender::geometry::bezier_positions_to_nurbs ( const Span< float3 > src_positions,
const Span< float3 > src_handles_l,
const Span< float3 > src_handles_r,
MutableSpan< float3 > dst_positions )
static

◆ build_point_to_sample_map()

◆ calc_all_corner_groups()

BLI_NOINLINE Array< Vector< CornerGroup > > blender::geometry::calc_all_corner_groups ( const OffsetIndices< int > faces,
const Span< int > corner_verts,
const Span< int > corner_edges,
const GroupedSpan< int > vert_to_corner_map,
const GroupedSpan< int > edge_to_corner_map,
const Span< int > corner_to_face_map,
const BitSpan split_edges,
const IndexMask & affected_verts )
static

◆ calc_corner_groups_for_vertex()

Vector< CornerGroup > blender::geometry::calc_corner_groups_for_vertex ( const OffsetIndices< int > faces,
const Span< int > corner_verts,
const Span< int > corner_edges,
const GroupedSpan< int > edge_to_corner_map,
const Span< int > corner_to_face_map,
const BitSpan split_edges,
const Span< int > connected_corners,
const int vert )
static

Collect groups of corners connected by edges bordered by boundary edges or split edges. We store corner indices instead of edge indices because later on in the algorithm we only relink the corner_vert array to each group's new vertex.

The corners are not ordered in winding order, since we only need to group connected faces into each group.

Definition at line 160 of file mesh_split_edges.cc.

References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), calc_corner_groups_for_vertex(), corner_on_edge_connected_to_vert(), blender::bke::mesh::face_corner_prev(), blender::Span< T >::first_index(), blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), blender::Span< T >::size(), and split_edges().

Referenced by calc_all_corner_groups(), and calc_corner_groups_for_vertex().

◆ calc_margin_from_aabb_length_sum()

float blender::geometry::calc_margin_from_aabb_length_sum ( const Span< PackIsland * > island_vector,
const UVPackIsland_Params & params )
static

◆ calc_material_index_max_hint()

std::optional< int > blender::geometry::calc_material_index_max_hint ( const Span< MeshRealizeInfo > infos)
static

If the max material index can be easily fetched from the inputs from the inputs without much work, return the common maximum.

Definition at line 1873 of file realize_instances.cc.

References calc_material_index_max_hint(), get_mapped_material_index(), and max.

Referenced by calc_material_index_max_hint(), and join_mesh_material_indices().

◆ calc_new_edges()

Array< int2 > blender::geometry::calc_new_edges ( const OffsetIndices< int > faces,
const Span< int > corner_verts,
const GroupedSpan< int > edge_to_corner_map,
const Span< int > corner_to_face_map,
const IndexMask & selected_edges,
MutableSpan< int2 > edges,
MutableSpan< int > corner_edges,
MutableSpan< int > r_new_edge_offsets )
static

◆ calc_position_with_interpolation()

void blender::geometry::calc_position_with_interpolation ( CurvesGeometry & curves,
const Span< float3 > root_positions_cu,
const OffsetIndices< int > neighbor_offsets,
const Span< int > neighbor_indices,
const Span< float > neighbor_weights,
const int old_curves_num,
const Span< float > new_lengths_cu,
const Span< float3 > new_normals_su,
const bke::CurvesSurfaceTransforms & transforms,
const Span< int3 > corner_tris,
const ReverseUVSampler & reverse_uv_sampler,
const Span< float3 > corner_normals_su )
static

◆ calc_position_without_interpolation()

void blender::geometry::calc_position_without_interpolation ( CurvesGeometry & curves,
const int old_curves_num,
const Span< float3 > root_positions_cu,
const Span< float > new_lengths_cu,
const Span< float3 > new_normals_su,
const float4x4 & surface_to_curves_normal_mat )
static

◆ calc_radius_with_interpolation()

◆ calc_radius_without_interpolation()

void blender::geometry::calc_radius_without_interpolation ( CurvesGeometry & curves,
const IndexRange new_points_range,
const float radius )
static

◆ calc_single_value_material_index()

◆ calc_straight_curve_positions()

◆ calc_vert_loose_edges()

VertLooseEdges blender::geometry::calc_vert_loose_edges ( const GroupedSpan< int > vert_to_edge_map,
const BitSpan loose_edges,
const BitSpan split_edges,
const int vert )
static

◆ calc_vert_ranges_per_old_vert()

OffsetIndices< int > blender::geometry::calc_vert_ranges_per_old_vert ( const IndexMask & affected_verts,
const Span< Vector< CornerGroup > > corner_groups,
const GroupedSpan< int > vert_to_edge_map,
const BitSpan loose_edges,
const BitSpan split_edges,
Array< int > & offset_data )
static

Every affected vertex maps to potentially multiple output vertices. Create a mapping from affected vertex index to the group of output vertex indices (indices are within those groups, not indices in arrays of all vertices). For every original vertex, reuse the original vertex for the first of:

  1. The last face corner group
  2. The last selected loose edge
  3. The group of non-selected loose edges Using this order prioritizes the simplicity of the no-loose-edge case, which we assume is more common.

Definition at line 278 of file mesh_split_edges.cc.

References calc_vert_ranges_per_old_vert(), blender::index_mask::IndexMask::index_range(), blender::threading::parallel_for(), blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize(), blender::index_mask::IndexMask::size(), and split_edges().

Referenced by calc_vert_ranges_per_old_vert(), and split_edges().

◆ calculate_angles()

◆ calculate_bezier_handles_bezier_mode()

void blender::geometry::calculate_bezier_handles_bezier_mode ( const Span< float3 > src_handles_l,
const Span< float3 > src_handles_r,
const Span< int8_t > src_types_l,
const Span< int8_t > src_types_r,
const Span< float > angles,
const Span< float > radii,
const Span< float3 > directions,
const OffsetIndices< int > dst_offsets,
const Span< float3 > dst_positions,
MutableSpan< float3 > dst_handles_l,
MutableSpan< float3 > dst_handles_r,
MutableSpan< int8_t > dst_types_l,
MutableSpan< int8_t > dst_types_r )
static

Set handles for the "Bezier" mode where we rely on setting the inner handles to approximate a circular arc. The outer (previous and next) handles outside the result fillet segment are set to vector handles.

Definition at line 320 of file fillet_curves.cc.

References calculate_bezier_handles_bezier_mode(), blender::Span< T >::index_range(), blender::IndexRange::last(), and blender::threading::parallel_for().

Referenced by calculate_bezier_handles_bezier_mode(), and fillet_curves().

◆ calculate_bezier_handles_poly_mode()

void blender::geometry::calculate_bezier_handles_poly_mode ( const Span< float3 > src_handles_l,
const Span< float3 > src_handles_r,
const Span< int8_t > src_types_l,
const Span< int8_t > src_types_r,
const OffsetIndices< int > dst_offsets,
const Span< float3 > dst_positions,
MutableSpan< float3 > dst_handles_l,
MutableSpan< float3 > dst_handles_r,
MutableSpan< int8_t > dst_types_l,
MutableSpan< int8_t > dst_types_r )
static

In the poly fillet mode, all the inner handles are set to vector handles, along with the "outer" (previous and next) handles at each fillet.

Definition at line 387 of file fillet_curves.cc.

References calculate_bezier_handles_poly_mode(), blender::Span< T >::index_range(), blender::IndexRange::last(), and blender::threading::parallel_for().

Referenced by calculate_bezier_handles_poly_mode(), and fillet_curves().

◆ calculate_bounds_cylinder()

◆ calculate_bounds_radial_primitive()

Bounds< float3 > blender::geometry::calculate_bounds_radial_primitive ( float radius_top,
float radius_bottom,
int segments,
float height )

Calculates the bounds of a radial primitive. The algorithm assumes X-axis symmetry of primitives.

Definition at line 20 of file mesh_primitive_uv_sphere.cc.

References calculate_bounds_radial_primitive(), and delta_phi().

Referenced by blender::nodes::node_geo_mesh_primitive_circle_cc::calculate_bounds_circle(), calculate_bounds_cylinder(), calculate_bounds_radial_primitive(), and calculate_bounds_uv_sphere().

◆ calculate_bounds_uv_sphere()

Bounds< float3 > blender::geometry::calculate_bounds_uv_sphere ( const float radius,
const int segments,
const int rings )
static

◆ calculate_catmull_rom_basis_derivative()

float4 blender::geometry::calculate_catmull_rom_basis_derivative ( const float parameter)
static

◆ calculate_cone_edges()

◆ calculate_cone_faces()

◆ calculate_cone_uvs()

void blender::geometry::calculate_cone_uvs ( const ConeConfig & config,
Mesh * mesh,
const StringRef uv_map_id )
static

If the top is the cone tip or has a fill, it is unwrapped into a circle in the lower left quadrant of the UV. Likewise, if the bottom is the cone tip or has a fill, it is unwrapped into a circle in the lower right quadrant of the UV. If the mesh is a truncated cone or a cylinder, the side faces are unwrapped into a rectangle that fills the top half of the UV (or the entire UV, if there are no fills).

Definition at line 530 of file mesh_primitive_cylinder_cone.cc.

References angle(), blender::geometry::ConeConfig::bottom_has_center_vert, blender::geometry::ConeConfig::bottom_is_point, calculate_cone_uvs(), blender::geometry::ConeConfig::circle_segments, blender::bke::Corner, blender::geometry::ConeConfig::fill_segments, blender::geometry::ConeConfig::fill_type, blender::bke::SpanAttributeWriter< T >::finish(), float, blender::IndexRange::IndexRange(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), NGon, None, blender::geometry::ConeConfig::side_segments, blender::bke::SpanAttributeWriter< T >::span, blender::geometry::ConeConfig::top_has_center_vert, and blender::geometry::ConeConfig::top_is_point.

Referenced by calculate_cone_uvs(), and create_cylinder_or_cone_mesh().

◆ calculate_cone_verts()

◆ calculate_corner_verts()

◆ calculate_directions()

◆ calculate_fillet_positions()

void blender::geometry::calculate_fillet_positions ( const Span< float3 > src_positions,
const Span< float > angles,
const Span< float > radii,
const Span< float3 > directions,
const OffsetIndices< int > dst_offsets,
MutableSpan< float3 > dst )
static

◆ calculate_positions()

◆ calculate_result_offsets() [1/2]

◆ calculate_result_offsets() [2/2]

◆ calculate_selection_outputs()

◆ calculate_sphere_corners()

BLI_NOINLINE void blender::geometry::calculate_sphere_corners ( MutableSpan< int > corner_verts,
MutableSpan< int > corner_edges,
const int segments,
const int rings )
static

◆ calculate_sphere_edge_indices()

BLI_NOINLINE void blender::geometry::calculate_sphere_edge_indices ( MutableSpan< int2 > edges,
const int segments,
const int rings )
static

◆ calculate_sphere_faces()

◆ calculate_sphere_uvs()

◆ calculate_sphere_vertex_data()

BLI_NOINLINE void blender::geometry::calculate_sphere_vertex_data ( MutableSpan< float3 > positions,
MutableSpan< float3 > vert_normals,
const float radius,
const int segments,
const int rings )
static

Also calculate vertex normals here, since the calculation is trivial, and it allows avoiding the calculation later, if it's necessary. The vertex normals are just the normalized positions.

Definition at line 67 of file mesh_primitive_uv_sphere.cc.

References BLI_NOINLINE, calculate_sphere_vertex_data(), delta_phi(), blender::MutableSpan< T >::first(), blender::IndexRange::IndexRange(), blender::MutableSpan< T >::last(), sin_theta(), blender::x, y, and z().

Referenced by calculate_sphere_vertex_data(), and create_uv_sphere_mesh().

◆ calculate_uvs() [1/2]

◆ calculate_uvs() [2/2]

void blender::geometry::calculate_uvs ( Mesh * mesh,
const Span< float3 > positions,
const Span< int > corner_verts,
const float size_x,
const float size_y,
const StringRef uv_map_id )
static

◆ can_rotate()

bool blender::geometry::can_rotate ( const Span< PackIsland * > islands,
const UVPackIsland_Params & params )
static

Definition at line 191 of file uv_pack.cc.

References can_rotate().

Referenced by can_rotate(), and pack_islands_scale_margin().

◆ can_rotate_with_method()

◆ catmull_rom_to_bezier_handles()

◆ catmull_rom_to_nurbs_positions()

void blender::geometry::catmull_rom_to_nurbs_positions ( const Span< float3 > src_positions,
const bool cyclic,
MutableSpan< float3 > dst_positions )
static

◆ collapse_weld_face()

int blender::geometry::collapse_weld_face ( const Span< int > corner_edges,
const Span< int > edge_src_to_target,
WeldFace & weld_face,
MutableSpan< int > corner_next,
RemovedFacesAndCorners & r_removed )
static

◆ components_supported_reordering()

◆ compute_curve_trim_parameters()

◆ compute_surface_point_normal()

◆ convert_bezier_or_catmull_rom_to_poly_before_conversion_to_nurbs()

bke::CurvesGeometry blender::geometry::convert_bezier_or_catmull_rom_to_poly_before_conversion_to_nurbs ( const bke::CurvesGeometry & src_curves,
const IndexMask & selection,
const ConvertCurvesOptions & options )
static

Converts some curves to poly curves before they are converted to nurbs. This is useful because it discards the bezier/catmull-rom shape which is sometimes the desired behavior.

Definition at line 765 of file set_curve_type.cc.

References convert_bezier_or_catmull_rom_to_poly_before_conversion_to_nurbs(), convert_curves_trivial(), blender::CURVE_TYPE_BEZIER, blender::CURVE_TYPE_CATMULL_ROM, blender::CURVE_TYPE_POLY, blender::bke::CurvesGeometry::curve_types(), blender::IndexMask::from_predicate(), and options.

Referenced by convert_bezier_or_catmull_rom_to_poly_before_conversion_to_nurbs(), and convert_curves().

◆ convert_curves()

◆ convert_curves_to_bezier()

bke::CurvesGeometry blender::geometry::convert_curves_to_bezier ( const bke::CurvesGeometry & src_curves,
const IndexMask & selection,
const bke::AttributeFilter & attribute_filter )
static

Definition at line 219 of file set_curve_type.cc.

References blender::offset_indices::accumulate_counts_to_offsets(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), attribute, blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), blender::BEZIER_HANDLE_ALIGN, blender::BEZIER_HANDLE_VECTOR, blender::BKE_defgroup_copy_list(), blender::bke::CurvesGeometry::calculate_bezier_auto_handles(), catmull_rom_to_bezier_handles(), blender::index_mask::IndexMask::complement(), convert_curves_to_bezier(), blender::bke::curves::nurbs::copy_custom_knots(), blender::offset_indices::copy_group_sizes(), blender::array_utils::copy_group_to_group(), blender::bke::curves::copy_only_curve_domain(), create_nurbs_to_bezier_handles(), create_nurbs_to_bezier_positions(), blender::bke::curves::curve_to_point_selection(), blender::CURVE_TYPE_BEZIER, blender::bke::CurvesGeometry::curve_type_counts(), blender::CURVE_TYPE_NURBS, blender::bke::CurvesGeometry::curve_types(), blender::bke::CurvesGeometry::curves_num(), blender::bke::CurvesGeometry::curves_range(), blender::bke::CurvesGeometry::cyclic(), blender::IndexRange::drop_back(), blender::IndexRange::drop_front(), blender::Vector< T, InlineBufferCapacity, Allocator >::extend(), blender::bke::CurvesGeometry::fill_curve_types(), blender::bke::curves::fill_points(), blender::IndexRange::first(), blender::MutableSpan< T >::first(), blender::bke::curves::foreach_curve_by_type(), blender::index_mask::IndexMask::foreach_index(), blender::bke::attribute_math::gather(), blender::exec_mode::grain_size(), blender::bke::CurvesGeometry::handle_positions_left(), blender::bke::CurvesGeometry::handle_positions_left_for_write(), blender::bke::CurvesGeometry::handle_positions_right(), blender::bke::CurvesGeometry::handle_positions_right_for_write(), blender::bke::CurvesGeometry::handle_types_left(), blender::bke::CurvesGeometry::handle_types_left_for_write(), blender::bke::CurvesGeometry::handle_types_right(), blender::bke::CurvesGeometry::handle_types_right_for_write(), blender::bke::CurvesGeometry::has_curve_with_type(), blender::MutableSpan< T >::index_range(), is_nurbs_to_bezier_one_to_one(), blender::IndexRange::last(), blender::MutableSpan< T >::last(), blender::index_mask::IndexMask::min_array_size(), blender::NURBS_KNOT_MODE_ENDPOINT, blender::NURBS_KNOT_MODE_NORMAL, blender::bke::CurvesGeometry::nurbs_knots_modes(), blender::bke::CurvesGeometry::offsets_for_write(), blender::bke::Point, blender::bke::CurvesGeometry::points_by_curve(), position, blender::bke::CurvesGeometry::positions(), blender::bke::CurvesGeometry::positions_for_write(), blender::bke::CurvesGeometry::resize(), blender::bke::retrieve_attributes_for_transfer(), scale_input_assign(), blender::IndexRange::size(), blender::MutableSpan< T >::slice(), blender::Span< T >::slice(), to_bezier_size(), and blender::CurvesGeometry::vertex_group_names.

Referenced by convert_curves(), and convert_curves_to_bezier().

◆ convert_curves_to_catmull_rom_or_poly()

bke::CurvesGeometry blender::geometry::convert_curves_to_catmull_rom_or_poly ( const bke::CurvesGeometry & src_curves,
const IndexMask & selection,
const CurveType dst_type,
const bke::AttributeFilter & attribute_filter,
const ConvertCurvesOptions & options )
static

Definition at line 638 of file set_curve_type.cc.

References blender::offset_indices::accumulate_counts_to_offsets(), attribute, blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), blender::BKE_defgroup_copy_list(), blender::index_mask::IndexMask::complement(), convert_curves_to_catmull_rom_or_poly(), convert_curves_trivial(), blender::bke::curves::nurbs::copy_custom_knots(), blender::offset_indices::copy_group_sizes(), blender::array_utils::copy_group_to_group(), blender::bke::curves::copy_only_curve_domain(), blender::CURVE_TYPE_BEZIER, blender::CURVE_TYPE_CATMULL_ROM, blender::bke::CurvesGeometry::curve_type_counts(), blender::bke::CurvesGeometry::curve_types(), blender::bke::CurvesGeometry::curves_num(), blender::bke::CurvesGeometry::curves_range(), blender::bke::CurvesGeometry::cyclic(), blender::CPPType::fill_assign_n(), blender::bke::CurvesGeometry::fill_curve_types(), blender::bke::curves::foreach_curve_by_type(), blender::index_mask::IndexMask::foreach_index(), blender::exec_mode::grain_size(), blender::bke::CurvesGeometry::handle_positions_left(), blender::bke::CurvesGeometry::handle_positions_right(), blender::bke::CurvesGeometry::has_curve_with_type(), blender::IndexRange::index_range(), blender::MutableSpan< T >::last(), blender::bke::CurvesGeometry::offsets_for_write(), options, blender::bke::Point, blender::bke::CurvesGeometry::points_by_curve(), blender::bke::CurvesGeometry::positions(), blender::bke::CurvesGeometry::positions_for_write(), blender::bke::CurvesGeometry::resize(), blender::bke::retrieve_attributes_for_transfer(), blender::IndexRange::size(), blender::IndexRange::start(), and blender::CurvesGeometry::vertex_group_names.

Referenced by convert_curves(), and convert_curves_to_catmull_rom_or_poly().

◆ convert_curves_to_nurbs()

bke::CurvesGeometry blender::geometry::convert_curves_to_nurbs ( const bke::CurvesGeometry & src_curves,
const IndexMask & selection,
const bke::AttributeFilter & attribute_filter )
static

Definition at line 439 of file set_curve_type.cc.

References blender::offset_indices::accumulate_counts_to_offsets(), blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), attribute, blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), bezier_positions_to_nurbs(), blender::BKE_defgroup_copy_list(), catmull_rom_to_nurbs_positions(), blender::index_mask::IndexMask::complement(), blender::bke::AttributeAccessor::contains(), convert_curves_to_nurbs(), blender::bke::curves::nurbs::copy_custom_knots(), blender::offset_indices::copy_group_sizes(), blender::array_utils::copy_group_to_group(), blender::bke::curves::copy_only_curve_domain(), blender::bke::curves::curve_to_point_selection(), blender::bke::CurvesGeometry::curve_type_counts(), blender::CURVE_TYPE_NURBS, blender::bke::CurvesGeometry::curve_types(), blender::bke::CurvesGeometry::curves_num(), blender::bke::CurvesGeometry::curves_range(), blender::bke::CurvesGeometry::cyclic(), blender::bke::CurvesGeometry::fill_curve_types(), blender::bke::curves::fill_points(), blender::bke::curves::foreach_curve_by_type(), blender::index_mask::IndexMask::foreach_index(), blender::index_mask::IndexMask::foreach_index_optimized(), blender::index_mask::IndexMask::foreach_segment(), blender::bke::attribute_math::gather(), blender::VArrayCommon< T >::get_internal_single(), blender::exec_mode::grain_size(), blender::bke::CurvesGeometry::handle_positions_left(), blender::bke::CurvesGeometry::handle_positions_right(), blender::IndexRange::index_range(), blender::IndexMask::IndexMask(), blender::VArrayCommon< T >::is_single(), blender::MutableSpan< T >::last(), blender::index_mask::masked_fill(), blender::index_mask::IndexMask::min_array_size(), blender::NURBS_KNOT_MODE_BEZIER, blender::NURBS_KNOT_MODE_ENDPOINT, blender::NURBS_KNOT_MODE_NORMAL, blender::bke::CurvesGeometry::nurbs_knots_modes_for_write(), blender::bke::CurvesGeometry::nurbs_orders_for_write(), blender::bke::CurvesGeometry::nurbs_weights(), blender::bke::CurvesGeometry::nurbs_weights_for_write(), blender::bke::CurvesGeometry::offsets_for_write(), blender::bke::Point, blender::bke::CurvesGeometry::points_by_curve(), blender::bke::CurvesGeometry::positions(), blender::bke::CurvesGeometry::positions_for_write(), blender::bke::CurvesGeometry::resize(), blender::bke::retrieve_attributes_for_transfer(), blender::MutableSpan< T >::slice(), blender::Span< T >::slice(), to_nurbs_size(), and blender::CurvesGeometry::vertex_group_names.

Referenced by convert_curves(), and convert_curves_to_nurbs().

◆ convert_curves_trivial()

◆ copy_and_mix_attributes()

void blender::geometry::copy_and_mix_attributes ( const bke::AttributeAccessor src_attributes,
const bke::AttrDomain domain,
const bke::AttributeFilter & attribute_filter,
const MergePropagationMap & map,
bke::MutableAttributeAccessor dst_attributes )
static

Copy attributes from a source element for every result element, and mix the values for result elements created from multiple source elements. When nothing is mixed and the result domain is unchanged, attribute arrays are shared with the source.

Definition at line 880 of file mesh_merge_verts.cc.

References blender::bke::MutableAttributeAccessor::add(), blender::bke::AttributeFilter::allow_skip(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), blender::GVArrayCommon::common_info(), copy_and_mix_attributes(), blender::CommonVArrayInfo::data, blender::offset_indices::GroupedSpan< T >::data, blender::bke::AttributeIter::data_type, blender::bke::AttributeIter::domain, blender::geometry::MergePropagationMap::dst_to_src, blender::bke::GSpanAttributeWriter::finish(), blender::bke::AttributeAccessor::foreach_attribute(), blender::bke::attribute_math::gather(), blender::bke::gather_attributes(), blender::bke::AttributeIter::get(), blender::bke::subdiv::init(), blender::index_mask::IndexMask::is_empty(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), blender::bke::attribute_math::mix_groups(), blender::geometry::MergePropagationMap::mixed, blender::geometry::MergePropagationMap::mixed_groups(), blender::bke::AttributeIter::name, blender::offset_indices::GroupedSpan< T >::offsets, blender::CommonVArrayInfo::Single, blender::bke::GSpanAttributeWriter::span, blender::bke::String, blender::CommonVArrayInfo::type, and blender::GVArrayCommon::type().

Referenced by copy_and_mix_attributes(), and create_merged_mesh().

◆ copy_and_reorder_curves()

◆ copy_and_reorder_instaces()

◆ copy_and_reorder_mesh()

void blender::geometry::copy_and_reorder_mesh ( const Mesh & src_mesh,
const Span< int > old_by_new_map,
const bke::AttrDomain domain,
const bke::AttributeFilter & attribute_filter,
Mesh & dst_mesh )
static

◆ copy_and_reorder_mesh_edges()

◆ copy_and_reorder_mesh_faces()

◆ copy_and_reorder_mesh_verts()

◆ copy_and_reorder_points()

void blender::geometry::copy_and_reorder_points ( const PointCloud & src_pointcloud,
const Span< int > old_by_new_map,
const bke::AttributeFilter & attribute_filter,
PointCloud & dst_pointcloud )
static

◆ copy_generic_attributes_to_result()

void blender::geometry::copy_generic_attributes_to_result ( const Span< std::optional< GVArray > > src_attributes,
const AttributeFallbacksArray & attribute_fallbacks,
const OrderedAttributes & ordered_attributes,
const FunctionRef< IndexRange(bke::AttrDomain)> & range_fn,
MutableSpan< GSpanAttributeWriter > dst_attribute_writers )
static

◆ copy_loose_edge_hint()

void blender::geometry::copy_loose_edge_hint ( const Mesh & src,
Mesh & dst )
static

◆ copy_loose_vert_hint() [1/2]

void blender::geometry::copy_loose_vert_hint ( const Mesh & src,
Mesh & dst )
static

◆ copy_loose_vert_hint() [2/2]

void blender::geometry::copy_loose_vert_hint ( const Mesh & src,
Mesh & dst )
static

◆ copy_or_defaults_for_unselected_curves()

◆ copy_overlapping_hint()

void blender::geometry::copy_overlapping_hint ( const Mesh & src,
Mesh & dst )
static

◆ copy_point_data_between_endpoints()

◆ copy_vertex_group_name()

◆ copy_vertex_group_names() [1/2]

void blender::geometry::copy_vertex_group_names ( CurvesGeometry & dst_curve,
const OrderedAttributes & ordered_attributes,
const Span< const Curves * > src_curves )
static

◆ copy_vertex_group_names() [2/2]

◆ corner_on_edge_connected_to_vert()

int blender::geometry::corner_on_edge_connected_to_vert ( const Span< int > corner_verts,
const int corner,
const IndexRange face,
const int vert )
static

Used for fanning around the corners connected to a vertex.

Depending on the winding direction of neighboring faces, traveling from a corner across an edge to a different face can give a corner that uses a different vertex than the original. To find the face's corner that uses the original vertex, we may have to use the next corner instead.

Definition at line 137 of file mesh_split_edges.cc.

References blender::BLI_assert(), corner_on_edge_connected_to_vert(), and blender::bke::mesh::face_corner_next().

Referenced by calc_corner_groups_for_vertex(), and corner_on_edge_connected_to_vert().

◆ create_cuboid_mesh() [1/2]

Mesh * blender::geometry::create_cuboid_mesh ( const float3 & size,
int verts_x,
int verts_y,
int verts_z )

Definition at line 402 of file mesh_primitive_cuboid.cc.

References create_cuboid_mesh().

◆ create_cuboid_mesh() [2/2]

◆ create_curve_from_vert_indices()

BLI_NOINLINE bke::CurvesGeometry blender::geometry::create_curve_from_vert_indices ( const bke::AttributeAccessor & mesh_attributes,
Span< int > vert_indices,
Span< int > curve_offsets,
IndexRange cyclic_curves,
const bke::AttributeFilter & attribute_filter )

◆ create_curves_for_faces()

◆ create_cylinder_or_cone_mesh()

◆ create_grid_mesh()

◆ create_id_index_map()

◆ create_line_mesh()

◆ create_merged_mesh()

Mesh * blender::geometry::create_merged_mesh ( const Mesh & mesh,
const Span< int > vert_src_to_target,
const int removed_vertex_count,
const bool do_mix_data,
const bke::AttributeFilter & attribute_filter )
static

◆ create_nurbs_to_bezier_handles()

◆ create_nurbs_to_bezier_positions()

void blender::geometry::create_nurbs_to_bezier_positions ( const Span< float3 > nurbs_positions,
const Span< float3 > handle_positions,
const KnotsMode knots_mode,
MutableSpan< float3 > bezier_positions )
static

◆ create_point_to_vert_map()

◆ create_result_ids()

◆ create_uv_sphere_mesh()

◆ create_vertex_mesh()

Mesh * blender::geometry::create_vertex_mesh ( )
static

◆ curve_simplify() [1/2]

void blender::geometry::curve_simplify ( const Span< float3 > positions,
const bool cyclic,
const float epsilon,
const GSpan attribute_data,
MutableSpan< bool > points_to_delete )

Same as above, but only for a single curve. All spans are expected to be the size of the curve.

Definition at line 124 of file simplify_curves.cc.

References curve_simplify(), float, T, blender::CPPType::to_static_type(), blender::GSpan::type(), and blender::GSpan::typed().

Referenced by curve_simplify(), curve_simplify(), simplify_curve_attribute(), and blender::ed::sculpt_paint::greasepencil::simplify_stroke().

◆ curve_simplify() [2/2]

template<typename T>
void blender::geometry::curve_simplify ( const Span< float3 > positions,
const bool cyclic,
const float epsilon,
const Span< T > attribute_data,
MutableSpan< bool > points_to_delete )
static

◆ curves_merge_endpoints()

bke::CurvesGeometry blender::geometry::curves_merge_endpoints ( const bke::CurvesGeometry & src_curves,
Span< int > connect_to_curve,
Span< bool > flip_direction,
const bke::AttributeFilter & attribute_filter )

◆ debug_randomize_curve_order()

◆ debug_randomize_edge_order()

◆ debug_randomize_face_order()

◆ debug_randomize_instance_order()

◆ debug_randomize_mesh_order()

◆ debug_randomize_point_order()

◆ debug_randomize_vert_order()

◆ define_quad()

void blender::geometry::define_quad ( MutableSpan< int > corner_verts,
const int corner,
const int vert_1,
const int vert_2,
const int vert_3,
const int vert_4 )
static

Definition at line 110 of file mesh_primitive_cuboid.cc.

References define_quad().

Referenced by calculate_corner_verts(), and define_quad().

◆ delete_selected_instances()

◆ dist_signed_squared_to_edge()

float blender::geometry::dist_signed_squared_to_edge ( const float2 probe,
const float2 uva,
const float2 uvb )
static

Compute signed distance squared to a line passing through uva and uvb.

Definition at line 72 of file uv_pack.cc.

References dist_signed_squared_to_edge(), and blender::math::length_squared().

Referenced by blender::geometry::PackIsland::add_triangle(), dist_signed_squared_to_edge(), and signed_distance_fat_triangle().

◆ duplicate_fillet_point_data()

void blender::geometry::duplicate_fillet_point_data ( const OffsetIndices< int > src_points_by_curve,
const OffsetIndices< int > dst_points_by_curve,
const IndexMask & curve_selection,
const Span< int > all_point_offsets,
const GSpan src,
GMutableSpan dst )
static

◆ edge_from_corner()

OrderedEdge blender::geometry::edge_from_corner ( const OffsetIndices< int > faces,
const Span< int > corner_verts,
const Span< int > corner_to_face_map,
const int corner )
static

◆ edge_selection_from_face()

IndexMask blender::geometry::edge_selection_from_face ( OffsetIndices< int > faces,
const IndexMask & face_mask,
Span< int > corner_edges,
int edges_num,
IndexMaskMemory & memory )

An edge is selected if it is used by a selected face.

Definition at line 58 of file mesh_selection.cc.

References edge_selection_from_face(), and mapped_corner_selection_from_face().

Referenced by blender::ed::transform::calc_target_elems(), edge_selection_from_face(), and mesh_copy_selection_keep_verts().

◆ edge_selection_from_vert()

IndexMask blender::geometry::edge_selection_from_vert ( Span< int2 > edges,
Span< bool > vert_selection,
IndexMaskMemory & memory )

An edge is selected if both of its vertices are selected.

Definition at line 67 of file mesh_selection.cc.

References blender::Default, edge_selection_from_vert(), blender::IndexMask::from_predicate(), blender::Span< T >::index_range(), and PRF_scope.

Referenced by edge_selection_from_vert().

◆ edges_to_curve_point_indices()

◆ edges_to_curves_convert()

BLI_NOINLINE bke::CurvesGeometry blender::geometry::edges_to_curves_convert ( const Mesh & mesh,
const Span< int2 > edges,
const bke::AttributeFilter & attribute_filter )
static

◆ execute_instances_tasks()

void blender::geometry::execute_instances_tasks ( const Span< bke::GeometryComponentPtr > src_components,
const Span< float4x4 > src_base_transforms,
const OrderedAttributes & all_instances_attributes,
const Span< geometry::AttributeFallbacksArray > attribute_fallback,
bke::GeometrySet & r_realized_geometry )
static

◆ execute_realize_curve_task()

void blender::geometry::execute_realize_curve_task ( const RealizeInstancesOptions & options,
const AllCurvesInfo & all_curves_info,
const RealizeCurveTask & task,
const OrderedAttributes & ordered_attributes,
bke::CurvesGeometry & dst_curves,
MutableSpan< GSpanAttributeWriter > dst_attribute_writers,
MutableSpan< int > all_dst_ids,
MutableSpan< int > all_dst_fill_ids,
MutableSpan< float3 > all_handle_left,
MutableSpan< float3 > all_handle_right,
MutableSpan< float > all_radii,
MutableSpan< float3 > all_custom_normals )
static

◆ execute_realize_curve_tasks()

void blender::geometry::execute_realize_curve_tasks ( const RealizeInstancesOptions & options,
const GatherOffsets & offsets,
const AllCurvesInfo & all_curves_info,
const Span< RealizeCurveTask > tasks,
const OrderedAttributes & ordered_attributes,
RealizeInstancesResult & r_result )
static

Definition at line 2469 of file realize_instances.cc.

References add_instance_attributes_to_single_geometry(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::geometry::RealizeCurveTask::attribute_fallbacks, blender::bke::CurvesGeometry::attributes_for_write(), blender::BKE_curves_copy_for_eval(), copy_vertex_group_names(), blender::geometry::AllCurvesInfo::create_fill_id_attribute, blender::geometry::AllCurvesInfo::create_id_attribute, blender::bke::Curve, blender::geometry::RealizeCurveTask::curve_info, blender::geometry::RealizeCurveInfo::curves, blender::bke::curves_copy_parameters(), blender::bke::curves_new_nomain(), blender::geometry::GatherOffsets::curves_offsets, blender::Default, blender::geometry::RealizeInstancesResult::errors, execute_realize_curve_tasks(), blender::Span< T >::first(), blender::geometry::RealizeInstancesResult::geometry, blender::geometry::OrderedAttributes::index_range(), blender::Span< T >::is_empty(), blender::geometry::OrderedAttributes::kinds, blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), blender::geometry::OrderedAttributes::names, blender::bke::CurvesGeometry::nurbs_custom_knots_resize(), blender::bke::CurvesGeometry::offsets_for_write(), options, blender::geometry::AllCurvesInfo::order, blender::bke::Point, PRF_scope, blender::bke::GeometrySet::replace_curves(), RPT_, blender::Span< T >::size(), skip_transform(), blender::geometry::RealizeCurveTask::transform, try_join_single_value_attribute(), and valid_int_num().

Referenced by execute_realize_curve_tasks(), and realize_instances().

◆ execute_realize_edit_data_tasks()

void blender::geometry::execute_realize_edit_data_tasks ( const Span< RealizeEditDataTask > tasks,
bke::GeometrySet & r_realized_geometry )
static

◆ execute_realize_grease_pencil_task()

◆ execute_realize_grease_pencil_tasks()

void blender::geometry::execute_realize_grease_pencil_tasks ( const AllGreasePencilsInfo & all_grease_pencils_info,
const GatherOffsets & offsets,
const Span< RealizeGreasePencilTask > tasks,
const OrderedAttributes & ordered_attributes,
RealizeInstancesResult & r_result )
static

◆ execute_realize_mesh_task()

void blender::geometry::execute_realize_mesh_task ( const RealizeInstancesOptions & options,
const RealizeMeshTask & task,
const OrderedAttributes & ordered_attributes,
MutableSpan< GSpanAttributeWriter > dst_attribute_writers,
MutableSpan< float3 > all_dst_positions,
MutableSpan< int2 > all_dst_edges,
MutableSpan< int > all_dst_face_offsets,
MutableSpan< int > all_dst_corner_verts,
MutableSpan< int > all_dst_corner_edges,
MutableSpan< int > all_dst_vert_ids,
GSpanAttributeWriter & all_dst_custom_normals,
MutableSpan< int > all_dst_origindex_vert,
MutableSpan< int > all_dst_origindex_edge,
MutableSpan< int > all_dst_origindex_face )
static

◆ execute_realize_mesh_tasks()

void blender::geometry::execute_realize_mesh_tasks ( const RealizeInstancesOptions & options,
const GatherOffsets & offsets,
const AllMeshesInfo & all_meshes_info,
const Span< RealizeMeshTask > tasks,
const OrderedAttributes & ordered_attributes,
const VectorSet< Material * > & ordered_materials,
RealizeInstancesResult & r_result )
static

Prepare original index layers for Edit Mode / CrazySpace mapping.

Definition at line 1986 of file realize_instances.cc.

References add_instance_attributes_to_single_geometry(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::geometry::RealizeMeshTask::attribute_fallbacks, blender::BKE_id_material_eval_assign(), blender::BKE_mesh_copy_for_eval(), blender::BKE_mesh_copy_parameters_for_eval(), blender::BKE_mesh_new_nomain(), blender::BLI_assert(), blender::CD_ORIGINDEX, blender::CD_SET_DEFAULT, copy_vertex_group_names(), blender::bke::Corner, blender::bke::mesh::NormalJoinInfo::CornerFan, blender::geometry::AllMeshesInfo::create_id_attribute, blender::geometry::AllMeshesInfo::create_origindex_edge_attribute, blender::geometry::AllMeshesInfo::create_origindex_face_attribute, blender::geometry::AllMeshesInfo::create_origindex_vert_attribute, blender::geometry::AllMeshesInfo::custom_normal_info, blender::CustomData_add_layer(), blender::data, blender::Default, blender::Mesh::edge_data, blender::geometry::RealizeInstancesResult::errors, execute_realize_mesh_tasks(), blender::Mesh::face_data, blender::Mesh::faces_num, blender::Span< T >::first(), blender::bke::Float3, blender::bke::mesh::NormalJoinInfo::Free, blender::geometry::RealizeInstancesResult::geometry, blender::Mesh::id, blender::geometry::OrderedAttributes::index_range(), blender::bke::Int16_2D, blender::Span< T >::is_empty(), blender::math::is_negative(), blender::geometry::OrderedAttributes::kinds, blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), blender::geometry::MeshRealizeInfo::mesh, blender::bke::mesh_flip_faces(), blender::geometry::RealizeMeshTask::mesh_info, blender::geometry::GatherOffsets::mesh_offsets, blender::bke::mesh_transform(), blender::geometry::OrderedAttributes::names, blender::bke::mesh::NormalJoinInfo::None, options, blender::geometry::AllMeshesInfo::order, blender::bke::Point, PRF_scope, blender::bke::GeometrySet::replace_mesh(), blender::bke::mesh::NormalJoinInfo::result_domain, blender::bke::mesh::NormalJoinInfo::result_type, RPT_, blender::Span< T >::size(), blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), skip_transform(), blender::geometry::RealizeMeshTask::transform, try_join_single_value_attribute(), valid_int_num(), blender::Mesh::vert_data, blender::Mesh::vertex_group_active_index, and blender::Mesh::vertex_group_names.

Referenced by execute_realize_mesh_tasks(), and realize_instances().

◆ execute_realize_pointcloud_task()

◆ execute_realize_pointcloud_tasks()

void blender::geometry::execute_realize_pointcloud_tasks ( const RealizeInstancesOptions & options,
const GatherOffsets & offsets,
const AllPointCloudsInfo & all_pointclouds_info,
const Span< RealizePointCloudTask > tasks,
const OrderedAttributes & ordered_attributes,
RealizeInstancesResult & r_result )
static

◆ extend_curve_curved()

void blender::geometry::extend_curve_curved ( const float used_percent_length,
const Span< int > start_points,
const Span< int > end_points,
const OffsetIndices< int > points_by_curve,
const int curve,
const IndexRange new_curve,
const Span< float > use_start_lengths,
const Span< float > use_end_lengths,
const float max_angle,
const float segment_influence,
const bool invert_curvature,
MutableSpan< float3 > positions )
static

◆ extend_curve_straight()

void blender::geometry::extend_curve_straight ( const float used_percent_length,
const float new_size,
const Span< int > start_points,
const Span< int > end_points,
const int curve,
const IndexRange new_curve,
const Span< float > use_start_lengths,
const Span< float > use_end_lengths,
MutableSpan< float3 > positions )
static

◆ extend_curves()

bke::CurvesGeometry blender::geometry::extend_curves ( bke::CurvesGeometry & src_curves,
const IndexMask & selection,
const VArray< float > & start_lengths,
const VArray< float > & end_lengths,
float overshoot_fac,
bool follow_curvature,
float point_density,
float segment_influence,
float max_angle,
bool invert_curvature,
GeometryNodeCurveSampleMode sample_mode,
const bke::AttributeFilter & attribute_filter )

◆ extract_curves()

◆ extract_curves_points()

◆ extract_greasepencil_layer_curves()

◆ extract_greasepencil_layer_points()

◆ extract_greasepencil_layers()

◆ extract_instances()

◆ extract_mesh_edges()

◆ extract_mesh_faces()

◆ extract_mesh_vertices()

◆ extract_pointcloud_points()

◆ extract_real_geometries_recursive()

◆ face_keys_to_face_indices()

void blender::geometry::face_keys_to_face_indices ( const Span< TriKey > faces,
MutableSpan< int > indices )
static

◆ face_normals_if_worthwhile()

Span< float3 > blender::geometry::face_normals_if_worthwhile ( const Mesh & src_mesh,
const int selection_size )
static

If a significant number of Ngons are selected (> 25% of the faces), then use the face normals cache, in case the cache is persistent (or already calculated).

Definition at line 63 of file mesh_triangulate.cc.

References blender::bke::MeshRuntime::face_normals_cache, face_normals_if_worthwhile(), blender::Mesh::faces_num, and blender::Mesh::runtime.

Referenced by face_normals_if_worthwhile(), and mesh_triangulate().

◆ face_selection_from_edge()

IndexMask blender::geometry::face_selection_from_edge ( OffsetIndices< int > faces,
Span< int > corner_edges,
Span< bool > edge_mask,
IndexMaskMemory & memory )

A face is selected if all of its edges are selected.

Definition at line 99 of file mesh_selection.cc.

References face_selection_from_edge(), and face_selection_from_mapped_corner().

Referenced by face_selection_from_edge(), and mesh_copy_selection_keep_edges().

◆ face_selection_from_mapped_corner()

IndexMask blender::geometry::face_selection_from_mapped_corner ( const OffsetIndices< int > faces,
const Span< int > corner_verts_or_edges,
const Span< bool > vert_or_edge_selection,
IndexMaskMemory & memory )
static

◆ face_selection_from_vert()

IndexMask blender::geometry::face_selection_from_vert ( OffsetIndices< int > faces,
Span< int > corner_verts,
Span< bool > vert_selection,
IndexMaskMemory & memory )

A face is selected if all of its vertices are selected.

Definition at line 91 of file mesh_selection.cc.

References face_selection_from_mapped_corner(), and face_selection_from_vert().

Referenced by face_selection_from_vert(), and mesh_copy_selection_keep_edges().

◆ face_tris_mask()

◆ fill_bezier_data()

◆ fill_new_attribute()

void blender::geometry::fill_new_attribute ( const Span< const GeometryComponent * > src_components,
const StringRef name,
const bke::AttrType data_type,
const bke::AttrDomain domain,
GMutableSpan dst_span )
static

◆ fill_nurbs_data()

◆ fillet_curves()

bke::CurvesGeometry blender::geometry::fillet_curves ( const bke::CurvesGeometry & src_curves,
const IndexMask & curve_selection,
const VArray< float > & radius_input,
const VArray< int > & counts,
const bool limit_radius,
const bool use_bezier_mode,
const bke::AttributeFilter & attribute_filter )
static

Definition at line 436 of file fillet_curves.cc.

References blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), attribute, blender::bke::attribute_filter_with_skip_ref(), blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), calculate_angles(), blender::bke::CurvesGeometry::calculate_bezier_auto_handles(), calculate_bezier_handles_bezier_mode(), calculate_bezier_handles_poly_mode(), calculate_directions(), calculate_fillet_positions(), calculate_result_offsets(), blender::index_mask::IndexMask::complement(), blender::bke::copy_attributes_group_to_group(), blender::bke::curves::copy_only_curve_domain(), blender::CURVE_TYPE_BEZIER, blender::bke::CurvesGeometry::curves_num(), blender::bke::CurvesGeometry::curves_range(), blender::bke::CurvesGeometry::cyclic(), duplicate_fillet_point_data(), fillet_curves(), blender::index_mask::IndexMask::foreach_segment(), blender::exec_mode::grain_size(), blender::bke::CurvesGeometry::handle_positions_left(), blender::bke::CurvesGeometry::handle_positions_left_for_write(), blender::bke::CurvesGeometry::handle_positions_right(), blender::bke::CurvesGeometry::handle_positions_right_for_write(), blender::bke::CurvesGeometry::handle_types_left(), blender::bke::CurvesGeometry::handle_types_left_for_write(), blender::bke::CurvesGeometry::handle_types_right(), blender::bke::CurvesGeometry::handle_types_right_for_write(), blender::bke::CurvesGeometry::has_curve_with_type(), blender::bke::CurvesGeometry::is_empty(), limit_radii(), limit_radius(), blender::VArrayCommon< T >::materialize_compressed(), blender::bke::CurvesGeometry::nurbs_has_custom_knots(), blender::NURBS_KNOT_MODE_NORMAL, blender::bke::CurvesGeometry::offsets(), blender::bke::CurvesGeometry::offsets_for_write(), blender::bke::curves::per_curve_point_offsets_range(), blender::bke::Point, blender::bke::CurvesGeometry::points_by_curve(), blender::bke::CurvesGeometry::points_num(), blender::bke::CurvesGeometry::positions(), blender::bke::CurvesGeometry::positions_for_write(), blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize(), blender::bke::CurvesGeometry::resize(), blender::bke::retrieve_attributes_for_transfer(), blender::IndexRange::size(), blender::blender::Span< T >::slice(), blender::MutableSpan< T >::slice(), blender::Span< T >::slice(), blender::bke::curves::nurbs::update_custom_knot_modes(), and zero_degenerate_radii().

Referenced by fillet_curves(), fillet_curves_bezier(), and fillet_curves_poly().

◆ fillet_curves_bezier()

bke::CurvesGeometry blender::geometry::fillet_curves_bezier ( const bke::CurvesGeometry & src_curves,
const IndexMask & curve_selection,
const VArray< float > & radius,
bool limit_radius,
const bke::AttributeFilter & attribute_filter )

◆ fillet_curves_poly()

bke::CurvesGeometry blender::geometry::fillet_curves_poly ( const bke::CurvesGeometry & src_curves,
const IndexMask & curve_selection,
const VArray< float > & radius,
const VArray< int > & counts,
bool limit_radius,
const bke::AttributeFilter & attribute_filter )

◆ fillet_handle_type()

HandleType blender::geometry::fillet_handle_type ( const float3 & position,
const float3 & handle,
const float3 & other_handle )
static

Return the type for handle. Keep it aligned if recalculating it from other_handle preserves its position. Otherwise, use a free handle to preserve the circular arc constructed by the fillet.

Definition at line 283 of file fillet_curves.cc.

References blender::BEZIER_HANDLE_ALIGN, blender::BEZIER_HANDLE_FREE, blender::math::dot(), fillet_handle_type(), FLT_EPSILON, blender::math::is_zero(), blender::math::length(), length(), blender::math::normalize(), and position.

Referenced by fillet_handle_type().

◆ filter_builtin_attributes()

◆ finalize_geometry()

void blender::geometry::finalize_geometry ( const Span< PackIsland * > islands,
const UVPackIsland_Params & params )
static

◆ find_affected_verts()

Array< bool > blender::geometry::find_affected_verts ( const Span< int > vert_src_to_target)
static

Find the vertices affected by the merge: the vertices that merge into another vertex, and the vertices they merge into. The topology collapsing code can skip work for everything else.

Definition at line 198 of file mesh_merge_verts.cc.

References find_affected_verts(), blender::Span< T >::index_range(), blender::threading::parallel_for(), and blender::Span< T >::size().

Referenced by create_merged_mesh(), and find_affected_verts().

◆ find_best_fit_for_island()

UVPhi blender::geometry::find_best_fit_for_island ( const PackIsland * island,
const int scan_line,
const Occupancy & occupancy,
const float scale,
const int angle_90_multiple,
const float margin,
const float target_aspect_y )
static

◆ find_collapsed_and_weld_edges()

IndexMask blender::geometry::find_collapsed_and_weld_edges ( const Span< int2 > edges,
const Span< int > vert_src_to_target,
const Span< bool > vert_affected,
IndexMaskMemory & memory,
MutableSpan< int > r_edge_src_to_target,
int * r_collapsed_edges_num )
static

Find edges that collapse because both of their vertices merge into the same vertex, and the other edges affected by the merge (the "weld edges").

Parameters
r_edge_src_to_targetFilled with ELEM_COLLAPSED for collapsed edges, and the edge index itself for all other edges.
Returns
The weld edges.

Definition at line 229 of file mesh_merge_verts.cc.

References ELEM_COLLAPSED, blender::array_utils::fill_index_range(), find_collapsed_and_weld_edges(), blender::IndexMask::from_difference(), blender::IndexMask::from_predicate(), blender::exec_mode::grain_size(), blender::Span< T >::index_range(), and blender::index_mask::masked_fill().

Referenced by find_collapsed_and_weld_edges(), and weld_mesh_context_create().

◆ find_connected_ranges()

◆ find_curve_neighbors()

◆ find_duplicate_edges()

int blender::geometry::find_duplicate_edges ( const Span< int2 > edges,
const Span< int > vert_src_to_target,
const IndexMask & weld_edges,
const int verts_num,
MutableSpan< int > r_edge_src_to_target )
static

Find weld edges that connect the same two vertices after merging. The edge with the lowest index in each group of duplicates is kept, and the others are mapped to it in r_edge_src_to_target.

Returns
The number of duplicate edges.

Definition at line 264 of file mesh_merge_verts.cc.

References blender::offset_indices::build_groups_from_indices(), find_duplicate_edges(), blender::index_mask::IndexMask::foreach_index(), blender::exec_mode::grain_size(), blender::offset_indices::OffsetIndices< T >::index_range(), blender::index_mask::IndexMask::is_empty(), blender::threading::parallel_reduce(), blender::index_mask::IndexMask::size(), blender::OrderedEdge::v_high, and blender::OrderedEdge::v_low.

Referenced by find_duplicate_edges(), and weld_mesh_context_create().

◆ find_points_by_group_index()

void blender::geometry::find_points_by_group_index ( const Span< int > indices,
MutableSpan< int > r_offsets,
MutableSpan< int > r_indices )
static

◆ finish_rows()

void blender::geometry::finish_rows ( const Span< int > all_ys,
const Span< const LocalData * > local_data_vec,
const Bounds< int > y_bounds,
ReverseUVSampler::LookupGrid & lookup_grid )
static

Consolidates the data that has been gather for each row so that it is each to look up which triangles are in each cell.

Definition at line 122 of file reverse_uv_sampler.cc.

References finish_rows(), blender::Span< T >::index_range(), and blender::threading::parallel_for().

Referenced by finish_rows(), and blender::geometry::ReverseUVSampler::ReverseUVSampler().

◆ fit_poly_to_bezier_curves()

bke::CurvesGeometry blender::geometry::fit_poly_to_bezier_curves ( const bke::CurvesGeometry & src_curves,
const IndexMask & curve_selection,
const VArray< float > & thresholds,
const VArray< bool > & corners,
FitMethod method,
const bke::AttributeFilter & attribute_filter )

Fit the selected curves to Bézier curves.

Parameters
src_curvesThe input curves.
curve_selectionA selection of curves to fit. The selected curves will be replaced by the fitted bézier curves and the unselected curves are copied to the output geometry.
thresholdsA error threshold (fit distance) for each input curve. The fitted curve should be within this distance.
cornersBoolean value for each input point. When this is true, the point is treated as a corner in the curve fitting. The resulting bézier curve will include this point and the handles will be "free", resulting in a sharp corner.
methodThe fitting algorithm to use. See FitMethod.

Definition at line 25 of file fit_curves.cc.

References blender::offset_indices::accumulate_counts_to_offsets(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::BEZIER_HANDLE_ALIGN, blender::BEZIER_HANDLE_FREE, blender::BKE_defgroup_copy_list(), blender::BLI_assert(), blender::Span< T >::cast(), blender::index_mask::IndexMask::complement(), blender::MutableSpan< T >::copy_from(), blender::offset_indices::copy_group_sizes(), blender::array_utils::copy_group_to_group(), blender::bke::curves::copy_only_curve_domain(), blender::CURVE_TYPE_BEZIER, blender::CURVE_TYPE_POLY, blender::bke::CurvesGeometry::curve_types_for_write(), blender::bke::CurvesGeometry::curves_num(), blender::bke::CurvesGeometry::curves_range(), blender::bke::CurvesGeometry::cyclic(), blender::Vector< T, InlineBufferCapacity, Allocator >::data(), blender::MutableSpan< T >::fill(), blender::array_utils::fill_index_range(), blender::MutableSpan< T >::fill_indices(), blender::IndexRange::first(), fit_poly_to_bezier_curves(), FLT_MAX, blender::index_mask::IndexMask::foreach_index(), blender::IndexRange::from_begin_end(), blender::exec_mode::grain_size(), blender::bke::CurvesGeometry::handle_positions_left(), blender::bke::CurvesGeometry::handle_positions_left_for_write(), blender::bke::CurvesGeometry::handle_positions_right(), blender::bke::CurvesGeometry::handle_positions_right_for_write(), blender::bke::CurvesGeometry::handle_types_left(), blender::bke::CurvesGeometry::handle_types_left_for_write(), blender::bke::CurvesGeometry::handle_types_right(), blender::bke::CurvesGeometry::handle_types_right_for_write(), blender::IndexRange::index_range(), blender::blender::Span< T >::is_empty(), blender::index_mask::IndexMask::is_empty(), blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), blender::IndexRange::last(), blender::MutableSpan< T >::MutableSpan(), blender::nullptr, blender::bke::CurvesGeometry::offsets(), blender::bke::CurvesGeometry::offsets_for_write(), blender::threading::parallel_for(), blender::bke::CurvesGeometry::points_num(), blender::bke::CurvesGeometry::positions(), blender::bke::CurvesGeometry::positions_for_write(), Refit, blender::bke::CurvesGeometry::resize(), blender::index_mask::IndexMask::size(), blender::IndexRange::size(), blender::Span< T >::size(), blender::VArrayCommon< T >::size(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::MutableSpan< T >::slice(), blender::Span< T >::slice(), Split, blender::IndexRange::start(), and blender::CurvesGeometry::vertex_group_names.

Referenced by blender::ed::sculpt_paint::greasepencil::convert_stroke_type(), blender::ed::greasepencil::fit_poly_curves(), and fit_poly_to_bezier_curves().

◆ fix_large_angle()

void blender::geometry::fix_large_angle ( const float v_fix[3],
const float v1[3],
const float v2[3],
double * r_fix,
double * r_a1,
double * r_a2 )
static

Definition at line 308 of file uv_parametrizer.cc.

References DEG2RAD, fix_large_angle(), blender::len_v3v3(), and blender::v2.

Referenced by fix_large_angle(), and p_triangle_angles().

◆ foreach_connected_curve()

◆ foreach_geometry_in_reference()

void blender::geometry::foreach_geometry_in_reference ( const InstanceReference & reference,
const float4x4 & base_transform,
const uint32_t id,
FunctionRef< void(const bke::GeometrySet &geometry_set, const float4x4 &transform, uint32_t id)> fn )
static

Calls fn for every geometry in the given InstanceReference. Also passes on the transformation that is applied to every instance.

Definition at line 669 of file realize_instances.cc.

References foreach_geometry_in_reference(), and blender::bke::InstanceReference::to_geometry_set().

Referenced by foreach_geometry_in_reference(), and gather_realize_tasks_for_instances().

◆ foreach_real_geometry()

void blender::geometry::foreach_real_geometry ( bke::GeometrySet & geometry,
FunctionRef< void(bke::GeometrySet &geometry_set)> fn )

Modify every real geometry separately, including those from instances. The input to the callback never contains instances. Newly generated instances will be merged with the previously existing ones.

Definition at line 74 of file foreach_geometry.cc.

References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::clear(), extract_real_geometries_recursive(), foreach_real_geometry(), blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::items(), and blender::threading::parallel_for().

Referenced by foreach_real_geometry(), blender::nodes::LazyFunctionForReduceForeachGeometryElement::handle_generation_items_group(), blender::nodes::node_geo_viewer_cc::log_viewer_attribute(), blender::nodes::node_geo_attribute_capture_cc::node_geo_exec(), blender::nodes::node_geo_bevel_cc::node_geo_exec(), blender::nodes::node_geo_bounding_box_cc::node_geo_exec(), blender::nodes::node_geo_convex_hull_cc::node_geo_exec(), blender::nodes::node_geo_curve_fill_cc::node_geo_exec(), blender::nodes::node_geo_curve_fillet_cc::node_geo_exec(), blender::nodes::node_geo_curve_resample_cc::node_geo_exec(), blender::nodes::node_geo_curve_reverse_cc::node_geo_exec(), blender::nodes::node_geo_curve_set_handle_type_cc::node_geo_exec(), blender::nodes::node_geo_curve_spline_type_cc::node_geo_exec(), blender::nodes::node_geo_curve_subdivide_cc::node_geo_exec(), blender::nodes::node_geo_curve_to_mesh_cc::node_geo_exec(), blender::nodes::node_geo_curve_to_points_cc::node_geo_exec(), blender::nodes::node_geo_curve_trim_cc::node_geo_exec(), blender::nodes::node_geo_delete_geometry_cc::node_geo_exec(), blender::nodes::node_geo_distribute_points_in_volume_cc::node_geo_exec(), blender::nodes::node_geo_distribute_points_on_faces_cc::node_geo_exec(), blender::nodes::node_geo_dual_mesh_cc::node_geo_exec(), blender::nodes::node_geo_duplicate_elements_cc::node_geo_exec(), blender::nodes::node_geo_edge_paths_to_curves_cc::node_geo_exec(), blender::nodes::node_geo_edge_split_cc::node_geo_exec(), blender::nodes::node_geo_extrude_mesh_cc::node_geo_exec(), blender::nodes::node_geo_flip_faces_cc::node_geo_exec(), blender::nodes::node_geo_grease_pencil_set_depth_mode::node_geo_exec(), blender::nodes::node_geo_instance_on_points_cc::node_geo_exec(), blender::nodes::node_geo_material_replace_cc::node_geo_exec(), blender::nodes::node_geo_merge_by_distance_cc::node_geo_exec(), blender::nodes::node_geo_merge_layers_cc::node_geo_exec(), blender::nodes::node_geo_merge_points_cc::node_geo_exec(), blender::nodes::node_geo_mesh_subdivide_cc::node_geo_exec(), blender::nodes::node_geo_mesh_to_curve_cc::node_geo_exec(), blender::nodes::node_geo_mesh_to_points_cc::node_geo_exec(), blender::nodes::node_geo_mesh_to_volume_cc::node_geo_exec(), blender::nodes::node_geo_points_to_curves_cc::node_geo_exec(), blender::nodes::node_geo_points_to_vertices_cc::node_geo_exec(), blender::nodes::node_geo_points_to_volume_cc::node_geo_exec(), blender::nodes::node_geo_points_type_cc::node_geo_exec(), blender::nodes::node_geo_rename_attribute_cc::node_geo_exec(), blender::nodes::node_geo_scale_elements_cc::node_geo_exec(), blender::nodes::node_geo_separate_geometry_cc::node_geo_exec(), blender::nodes::node_geo_set_curve_handles_cc::node_geo_exec(), blender::nodes::node_geo_set_curve_normal_cc::node_geo_exec(), blender::nodes::node_geo_set_curve_radius_cc::node_geo_exec(), blender::nodes::node_geo_set_curve_tilt_cc::node_geo_exec(), blender::nodes::node_geo_set_grease_pencil_softness_cc::node_geo_exec(), blender::nodes::node_geo_set_material_cc::node_geo_exec(), blender::nodes::node_geo_set_material_index_cc::node_geo_exec(), blender::nodes::node_geo_set_mesh_normal_cc::node_geo_exec(), blender::nodes::node_geo_set_nurbs_order_cc::node_geo_exec(), blender::nodes::node_geo_set_nurbs_weight_cc::node_geo_exec(), blender::nodes::node_geo_set_point_radius_cc::node_geo_exec(), blender::nodes::node_geo_set_shade_smooth_cc::node_geo_exec(), blender::nodes::node_geo_set_spline_cyclic_cc::node_geo_exec(), blender::nodes::node_geo_set_spline_resolution_cc::node_geo_exec(), blender::nodes::node_geo_sort_elements_cc::node_geo_exec(), blender::nodes::node_geo_store_named_attribute_cc::node_geo_exec(), blender::nodes::node_geo_subdivision_surface_cc::node_geo_exec(), blender::nodes::node_geo_tool_set_face_set_cc::node_geo_exec(), blender::nodes::node_geo_tool_set_selection_cc::node_geo_exec(), blender::nodes::node_geo_triangulate_cc::node_geo_exec(), blender::nodes::node_geo_volume_to_mesh_cc::node_geo_exec(), blender::nodes::node_geo_set_grease_pencil_color_cc::set_grease_pencil_color(), and blender::nodes::store_output_attributes().

◆ foreach_weld_face_corner()

template<typename Fn>
void blender::geometry::foreach_weld_face_corner ( const WeldFace & weld_face,
const Span< int > corner_next,
const Fn & fn )
static

◆ gather()

void blender::geometry::gather ( const Span< int > src,
const Span< int16_t > indices,
MutableSpan< int > dst )
static

Definition at line 33 of file mesh_triangulate.cc.

References gather(), and blender::Span< T >::index_range().

Referenced by gather(), and gather_or_reference().

◆ gather_all_fill_ids()

◆ gather_attribute_propagation_components()

◆ gather_attribute_propagation_components_with_custom_depths()

◆ gather_attributes_to_propagate()

bke::GeometrySet::GatheredAttributes blender::geometry::gather_attributes_to_propagate ( const bke::GeometrySet & geometry,
const bke::GeometryComponent::Type component_type,
const RealizeInstancesOptions & options,
const VariedDepthOptions & varied_depth_option )
static

◆ gather_curve_attributes_to_interpolate()

◆ gather_curves_to_realize()

◆ gather_generic_curve_attributes_to_propagate()

◆ gather_generic_grease_pencil_attributes_to_propagate()

◆ gather_generic_instance_attributes_to_propagate()

◆ gather_generic_mesh_attributes_to_propagate()

◆ gather_generic_pointcloud_attributes_to_propagate()

◆ gather_grease_pencils_to_realize()

◆ gather_meshes_to_realize()

◆ gather_or_reference() [1/2]

Span< int > blender::geometry::gather_or_reference ( const Span< int > src,
const IndexMaskSegment mask,
Vector< int > & dst )
static

Definition at line 52 of file mesh_triangulate.cc.

References blender::Span< T >::drop_front(), and gather_or_reference().

◆ gather_or_reference() [2/2]

◆ gather_point_attributes_to_interpolate() [1/2]

◆ gather_point_attributes_to_interpolate() [2/2]

void blender::geometry::gather_point_attributes_to_interpolate ( const CurvesGeometry & src_curves,
CurvesGeometry & dst_curves,
AttributesForResample & result,
const ResampleCurvesOutputAttributeIDs & output_ids )
static

◆ gather_pointclouds_to_realize()

◆ gather_realize_tasks_for_instances()

void blender::geometry::gather_realize_tasks_for_instances ( GatherTasksInfo & gather_info,
const int current_depth,
const int target_depth,
const Instances & instances,
const float4x4 & base_transform,
const InstanceContext & base_instance_context )
static

Definition at line 681 of file realize_instances.cc.

References blender::geometry::AttributeFallbacksArray::array, blender::bke::Instances::attributes(), blender::geometry::AllCurvesInfo::attributes, blender::geometry::AllGreasePencilsInfo::attributes, blender::geometry::AllMeshesInfo::attributes, blender::geometry::AllPointCloudsInfo::attributes, blender::geometry::GatherTasksInfo::create_id_attribute_on_any_component, blender::geometry::GatherTasksInfo::curves, blender::geometry::InstanceContext::curves, blender::geometry::GatherTasksInfo::depths, blender::bke::GAttributeReader::domain, foreach_geometry_in_reference(), blender::index_mask::IndexMask::foreach_index(), gather_realize_tasks_for_instances(), gather_realize_tasks_recursive(), blender::geometry::GatherTasksInfo::grease_pencils, blender::geometry::InstanceContext::grease_pencils, blender::noise::hash(), blender::geometry::InstanceContext::id, blender::bke::Instance, instance_id, blender::geometry::InstanceContext::instances, blender::geometry::GatherTasksInfo::instances_attriubutes, blender::bke::Instances::instances_num(), blender::CPPType::is(), blender::VArrayCommon< T >::is_empty(), blender::bke::AttributeAccessor::lookup(), blender::geometry::GatherTasksInfo::meshes, blender::geometry::InstanceContext::meshes, blender::geometry::GatherTasksInfo::pointclouds, blender::geometry::InstanceContext::pointclouds, prepare_attribute_fallbacks(), blender::bke::Instances::reference_handles(), blender::bke::Instances::references(), blender::geometry::GatherTasksInfo::selection, blender::bke::Instances::transforms(), blender::GVArrayCommon::type(), blender::GVArray::typed(), and blender::bke::GAttributeReader::varray.

Referenced by gather_realize_tasks_for_instances(), and gather_realize_tasks_recursive().

◆ gather_realize_tasks_recursive()

void blender::geometry::gather_realize_tasks_recursive ( GatherTasksInfo & gather_info,
const int current_depth,
const int target_depth,
const bke::GeometrySet & geometry_set,
const float4x4 & base_transform,
const InstanceContext & base_instance_context )
static

Gather tasks for all geometries in the #geometry_set.

Definition at line 775 of file realize_instances.cc.

References blender::blender::ImplicitSharingInfo::add_user(), blender::geometry::AllInstancesInfo::attribute_fallback, blender::bke::GeometrySet::bundle(), blender::geometry::GatherTasks::bundles, blender::bke::GeometryComponent::Curve, blender::geometry::GatherTasks::curve_tasks, blender::geometry::GatherTasksInfo::curves, blender::geometry::InstanceContext::curves, blender::geometry::GatherOffsets::curves_offsets, blender::bke::GeometryComponent::Edit, blender::geometry::GatherTasks::edit_data_tasks, blender::geometry::GatherTasks::first_volume, gather_realize_tasks_for_instances(), gather_realize_tasks_recursive(), blender::bke::GeometrySet::get_components(), blender::geometry::GatherOffsets::grease_pencil_layer_offset, blender::geometry::GatherTasks::grease_pencil_tasks, blender::geometry::GatherTasksInfo::grease_pencils, blender::geometry::InstanceContext::grease_pencils, blender::bke::GeometryComponent::GreasePencil, blender::bke::GeometrySet::has_bundle(), blender::geometry::InstanceContext::id, blender::geometry::RealizeCurveInfo::index_by_fill_id, blender::bke::GeometryComponent::Instance, blender::geometry::GatherTasksInfo::instances, blender::geometry::InstanceContext::instances, blender::geometry::AllInstancesInfo::instances_components_to_merge, blender::geometry::AllInstancesInfo::instances_components_transforms, blender::bke::Instances::instances_num(), blender::bke::GeometryComponent::Mesh, blender::geometry::GatherOffsets::mesh_offsets, blender::geometry::GatherTasks::mesh_tasks, blender::geometry::GatherTasksInfo::meshes, blender::geometry::InstanceContext::meshes, blender::geometry::AllCurvesInfo::order, blender::geometry::AllGreasePencilsInfo::order, blender::geometry::AllMeshesInfo::order, blender::geometry::AllPointCloudsInfo::order, blender::bke::GeometryComponent::PointCloud, blender::geometry::GatherOffsets::pointcloud_offset, blender::geometry::GatherTasks::pointcloud_tasks, blender::geometry::GatherTasksInfo::pointclouds, blender::geometry::InstanceContext::pointclouds, blender::geometry::GatherTasksInfo::r_offsets, blender::geometry::GatherTasksInfo::r_tasks, blender::geometry::AllCurvesInfo::realize_info, blender::geometry::AllGreasePencilsInfo::realize_info, blender::geometry::AllMeshesInfo::realize_info, blender::geometry::AllPointCloudsInfo::realize_info, blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), blender::PointCloud::totpoint, and blender::bke::GeometryComponent::Volume.

Referenced by gather_realize_tasks_for_instances(), gather_realize_tasks_recursive(), and realize_instances().

◆ gather_selected_offsets()

OffsetIndices< int > blender::geometry::gather_selected_offsets ( const OffsetIndices< int > src_offsets,
const IndexMaskSegment selection,
MutableSpan< int > dst_offsets )
static

◆ gather_vert_attributes()

◆ gaussian_blur_1D() [1/2]

void blender::geometry::gaussian_blur_1D ( const GSpan src,
int iterations,
const VArray< float > & influence_by_point,
const bool smooth_ends,
const bool keep_shape,
const bool is_cyclic,
GMutableSpan dst )

1D Gaussian-like smoothing function.

Parameters
iterationsNumber of times to repeat the smoothing.
influence_by_pointInfluence factor for each point.
smooth_endsSmooth the first and last value.
keep_shapeChanges the gaussian kernel to avoid severe deformations.
is_cyclicPropagate smoothing across the ends of the input as if they were connected.

Definition at line 154 of file smooth_curves.cc.

References gaussian_blur_1D(), T, blender::bke::attribute_math::to_static_type(), and blender::GSpan::type().

Referenced by blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::active_smoothing(), gaussian_blur_1D(), gaussian_blur_1D(), smooth_curve_attribute(), and smooth_curve_positions().

◆ gaussian_blur_1D() [2/2]

template<typename T>
void blender::geometry::gaussian_blur_1D ( const Span< T > src,
const int iterations,
const VArray< float > & influence_by_point,
const bool smooth_ends,
const bool keep_shape,
const bool is_cyclic,
MutableSpan< T > dst )
static

1D Gaussian-like smoothing function.

NOTE: This is the algorithm used by #BKE_gpencil_stroke_smooth_point (legacy), but generalized and written in C++.

This function uses a binomial kernel, which is the discrete version of gaussian blur. The weight for a value at the relative index is: w = nCr(n, j + n/2) / 2^n = (n/1 * (n-1)/2 * ... * (n-j-n/2)/(j+n/2)) / 2^n. All weights together sum up to 1. This is equivalent to doing multiple iterations of averaging neighbors, where: n = iterations * 2 and -n/2 <= j <= n/2.

Now the problem is that nCr(n, j + n/2) is very hard to compute for n > 500, since even double precision isn't sufficient. A very good robust approximation for n > 20 is: nCr(n, j + n/2) / 2^n = sqrt(2/(pi*n)) * exp(-2*j*j/n).

keep_shape is a new option to stop the points from severely deforming. It uses different partially negative weights. w = 2 * (nCr(n, j + n/2) / 2^n) - (nCr(3*n, j + n) / 2^(3*n)) ~ 2 * sqrt(2/(pi*n)) * exp(-2*j*j/n) - sqrt(2/(pi*3*n)) * exp(-2*j*j/(3*n)) All weights still sum up to 1. Note that these weights only work because the averaging is done in relative coordinates.

Definition at line 25 of file smooth_curves.cc.

References blender::BLI_assert(), ELEM, exp, gaussian_blur_1D(), blender::MutableSpan< T >::index_range(), blender::Span< T >::is_empty(), M_SQRT3, blender::threading::parallel_for(), blender::MutableSpan< T >::size(), blender::Span< T >::size(), and w().

◆ get_aspect_scaled_area()

float blender::geometry::get_aspect_scaled_area ( const rctf & extent,
const UVPackIsland_Params & params )
static
Returns
the area of extent, factoring in the target aspect ratio.

Definition at line 102 of file uv_pack.cc.

References blender::BLI_rctf_size_x(), blender::BLI_rctf_size_y(), get_aspect_scaled_area(), and blender::geometry::UVPackIsland_Params::target_aspect_y.

Referenced by get_aspect_scaled_area(), and is_larger().

◆ get_aspect_scaled_extent()

float blender::geometry::get_aspect_scaled_extent ( const rctf & extent,
const UVPackIsland_Params & params )
static

◆ get_catmull_rom_indices()

int4 blender::geometry::get_catmull_rom_indices ( const int src_index,
const int src_index_last,
const bool cyclic )
static

◆ get_count_from_length()

int blender::geometry::get_count_from_length ( const float curve_length,
const float sample_length,
const bool keep_last_segment )
static

◆ get_count_input_from_length()

fn::Field< int > blender::geometry::get_count_input_from_length ( const fn::Field< float > & length_field,
const bool keep_last_segment )
static

◆ get_count_input_max_one()

fn::Field< int > blender::geometry::get_count_input_max_one ( const fn::Field< int > & count_field)
static

◆ get_final_attribute_info()

◆ get_final_points_num()

◆ get_mapped_material_index()

◆ get_permutation()

◆ get_vertex_group_names()

◆ grease_pencil_remove_points_and_split()

bke::CurvesGeometry blender::geometry::grease_pencil_remove_points_and_split ( const bke::CurvesGeometry & curves,
const IndexMask & mask )

Same as above, but will also handle splitting Grease Pencil fills.

Definition at line 125 of file curves_remove_and_split.cc.

References blender::Vector< T, InlineBufferCapacity, Allocator >::append_n_times(), blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), blender::bke::CurvesGeometry::attributes_for_write(), blender::array_utils::fill_index_range(), blender::array_utils::find_all_ranges(), blender::Array< T, InlineBufferCapacity, Allocator >::first(), blender::Vector< T, InlineBufferCapacity, Allocator >::first(), blender::IndexMask::from_predicate(), blender::bke::greasepencil::gather_next_available_fill_ids(), grease_pencil_remove_points_and_split(), blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), blender::Vector< T, InlineBufferCapacity, Allocator >::last(), blender::bke::MutableAttributeAccessor::lookup_for_write_span(), remove_points_and_split(), blender::IndexRange::size(), and blender::Vector< T, InlineBufferCapacity, Allocator >::size().

Referenced by blender::ed::greasepencil::grease_pencil_copy_strokes_exec(), blender::ed::greasepencil::grease_pencil_delete_exec(), grease_pencil_remove_points_and_split(), blender::ed::greasepencil::grease_pencil_separate_selected(), blender::ed::sculpt_paint::remove_points_and_split_from_drawings(), and blender::ed::sculpt_paint::greasepencil::remove_points_with_low_opacity().

◆ grouped_sort()

void blender::geometry::grouped_sort ( const OffsetIndices< int > offsets,
const Span< float > weights,
MutableSpan< int > indices )
static

◆ guess_initial_scale()

float blender::geometry::guess_initial_scale ( const Span< PackIsland * > islands,
const float scale,
const float margin )
static

◆ identifiers_to_indices()

◆ initialize_curves_builtin_attribute_defaults()

◆ interpolate_attribute_to_curves() [1/2]

bool blender::geometry::interpolate_attribute_to_curves ( const StringRef name,
const std::array< int, CURVE_TYPES_NUM > & type_counts )
static

Return true if the attribute should be copied/interpolated to the result curves. Don't output attributes that correspond to curve types that have no curves in the result.

Definition at line 238 of file interpolate_curves.cc.

References blender::bke::attribute_name_is_anonymous(), blender::CURVE_TYPE_NURBS, ELEM, and interpolate_attribute_to_curves().

Referenced by gather_point_attributes_to_interpolate(), gather_point_attributes_to_interpolate(), and interpolate_attribute_to_curves().

◆ interpolate_attribute_to_curves() [2/2]

bool blender::geometry::interpolate_attribute_to_curves ( const StringRef name,
const std::array< int, CURVE_TYPES_NUM > & type_counts )
static

Return true if the attribute should be copied/interpolated to the result curves. Don't output attributes that correspond to curve types that have no curves in the result.

Definition at line 72 of file resample_curves.cc.

References blender::bke::attribute_name_is_anonymous(), blender::CURVE_TYPE_BEZIER, blender::CURVE_TYPE_NURBS, ELEM, and interpolate_attribute_to_curves().

◆ interpolate_attribute_to_poly_curve() [1/2]

bool blender::geometry::interpolate_attribute_to_poly_curve ( const StringRef name)
static

◆ interpolate_attribute_to_poly_curve() [2/2]

bool blender::geometry::interpolate_attribute_to_poly_curve ( const StringRef name)
static

Return true if the attribute should be copied to poly curves.

Definition at line 90 of file resample_curves.cc.

References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), and interpolate_attribute_to_poly_curve().

◆ interpolate_catmull_rom()

◆ interpolate_curves()

void blender::geometry::interpolate_curves ( const bke::CurvesGeometry & from_curves,
const bke::CurvesGeometry & to_curves,
Span< int > from_curve_indices,
Span< int > to_curve_indices,
const IndexMask & dst_curve_mask,
Span< bool > dst_curve_flip_direction,
float mix_factor,
bke::CurvesGeometry & dst_curves,
IndexMaskMemory & memory )

◆ interpolate_curves_with_samples()

void blender::geometry::interpolate_curves_with_samples ( const bke::CurvesGeometry & from_curves,
const bke::CurvesGeometry & to_curves,
Span< int > from_curve_indices,
Span< int > to_curve_indices,
Span< int > from_sample_indices,
Span< int > to_sample_indices,
Span< float > from_sample_factors,
Span< float > to_sample_factors,
const IndexMask & dst_curve_mask,
float mix_factor,
bke::CurvesGeometry & dst_curves,
IndexMaskMemory & memory )

Definition at line 1010 of file interpolate_curves.cc.

References blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), attribute, blender::BLI_assert(), blender::bke::CurvesGeometry::calculate_bezier_auto_handles(), blender::array_utils::copy(), blender::bke::cpp_type_to_attribute_type(), blender::bke::CurvesGeometry::curve_types(), blender::bke::CurvesGeometry::curve_types_for_write(), blender::bke::CurvesGeometry::curves_num(), blender::geometry::AttributesForInterpolation::dst, ELEM, blender::bke::CurvesGeometry::ensure_can_interpolate_to_evaluated(), blender::bke::Float, blender::bke::Float2, blender::bke::Float3, blender::bke::Float4, blender::index_mask::IndexMask::foreach_index(), blender::IndexMask::from_bools(), blender::GVArray::from_span(), gather_curve_attributes_to_interpolate(), gather_point_attributes_to_interpolate(), blender::exec_mode::grain_size(), blender::bke::CurvesGeometry::handle_positions_left_for_write(), blender::bke::CurvesGeometry::handle_positions_right_for_write(), blender::bke::CurvesGeometry::handle_types_left_for_write(), blender::bke::CurvesGeometry::handle_types_right_for_write(), interpolate_curves_with_samples(), blender::bke::CurvesGeometry::is_empty(), blender::GSpan::is_empty(), mix_arrays(), mix_curve_type(), mix_handle_type_arrays(), blender::bke::CurvesGeometry::points_by_curve(), blender::bke::CurvesGeometry::points_num(), blender::bke::CurvesGeometry::positions_for_write(), sample_curve_attribute(), sample_curve_positions_and_handles(), blender::GMutableSpan::size(), blender::index_mask::IndexMask::size(), blender::MutableSpan< T >::size(), blender::Span< T >::size(), blender::geometry::AttributesForInterpolation::src_from, blender::geometry::AttributesForInterpolation::src_to, blender::bke::CurvesGeometry::tag_topology_changed(), blender::GMutableSpan::type(), and blender::bke::CurvesGeometry::update_curve_types().

Referenced by blender::ed::sculpt_paint::greasepencil::interpolate_between_curves(), interpolate_curves(), and interpolate_curves_with_samples().

◆ inverse_transformation_from_sincos()

void blender::geometry::inverse_transformation_from_sincos ( const float2 & sincos,
const float aspect_y,
float r_matrix[2][2] )
static

Equivalent to #PackIsland::build_inverse_transformation.

Definition at line 251 of file uv_pack.cc.

References inverse_transformation_from_sincos(), and sincos().

Referenced by inverse_transformation_from_sincos(), and blender::geometry::PackIsland::place_().

◆ invert_permutation() [1/2]

◆ invert_permutation() [2/2]

Array< int > blender::geometry::invert_permutation ( const Span< int > permutation)
static

◆ is_larger()

bool blender::geometry::is_larger ( const rctf & a,
const rctf & b,
const UVPackIsland_Params & params )
static
Returns
true if b is a preferred layout over a, given the packing parameters supplied.

Definition at line 112 of file uv_pack.cc.

References b, blender::compare_ff_relative(), FLT_EPSILON, get_aspect_scaled_area(), get_aspect_scaled_extent(), and is_larger().

Referenced by is_larger(), pack_island_box_pack_2d(), pack_island_xatlas(), pack_islands_optimal_pack(), and pack_islands_optimal_pack_table().

◆ is_nurbs_to_bezier_one_to_one()

bool blender::geometry::is_nurbs_to_bezier_one_to_one ( const KnotsMode knots_mode)
static

This function answers the question about possible conversion method for NURBS-to-Bezier. In general for 3rd degree NURBS curves there is one-to-one relation with 3rd degree Bezier curves that can be exploit for conversion - Bezier handles sit on NURBS hull segments and in the middle between those handles are Bezier anchor points.

Definition at line 28 of file set_curve_type.cc.

References ELEM, is_nurbs_to_bezier_one_to_one(), blender::NURBS_KNOT_MODE_ENDPOINT, and blender::NURBS_KNOT_MODE_NORMAL.

Referenced by convert_curves_to_bezier(), create_nurbs_to_bezier_handles(), create_nurbs_to_bezier_positions(), is_nurbs_to_bezier_one_to_one(), and to_bezier_size().

◆ join_attributes()

◆ join_component_type()

◆ join_curves()

◆ join_curves_ranges()

◆ join_geometries() [1/2]

GeometrySet blender::geometry::join_geometries ( const Span< GeometrySet > geometries,
const bke::AttributeFilter & attribute_filter,
const std::optional< Span< GeometryComponent::Type > > & component_types_to_join,
const bool allow_merging_instance_references )

◆ join_geometries() [2/2]

bke::GeometrySet blender::geometry::join_geometries ( Span< bke::GeometrySet > geometries,
const bke::AttributeFilter & attribute_filter,
const std::optional< Span< bke::GeometryComponent::Type > > & component_types_to_join = std::nullopt,
bool allow_merging_instance_references = true )
Parameters
allow_merging_instance_referencesIf true, instance references from multiple instances components may be merged when they are the same. This is typically good because it reduces the amount of processing for later nodes. However, this may be undesirable in some cases if the instance references are modified afterwards and the calling code assumes that the instances references are just concatenated.

References join_geometries().

Referenced by blender::ed::sculpt_paint::greasepencil::add_strokes_to_drawing(), blender::ed::curves::append_primitive_curve(), blender::ed::sculpt_paint::trim::apply_join_operation(), blender::ed::object::convert_grease_pencil_component_to_curves(), blender::ed::object::convert_grease_pencil_to_mesh(), blender::nodes::node_geo_curve_fill_cc::curve_fill_calculate(), blender::ed::sculpt_paint::grease_pencil_apply_fill(), blender::ed::greasepencil::grease_pencil_join_fills_exec(), blender::ed::greasepencil::grease_pencil_move_to_layer_exec(), blender::ed::greasepencil::grease_pencil_outline_exec(), blender::nodes::node_geo_curve_to_mesh_cc::grease_pencil_to_mesh(), blender::nodes::LazyFunctionForReduceForeachGeometryElement::handle_generation_items_group(), blender::ed::greasepencil::join_curves(), join_curves(), join_geometries(), join_geometries(), blender::nodes::node_geo_curve_to_points_cc::layer_pointclouds_to_instances(), blender::make_prim_finish_sculpt(), blender::MOD_lineart_gpencil_generate_v3(), blender::modify_drawing(), blender::nodes::node_geo_boolean_cc::node_geo_exec(), blender::nodes::node_geo_instance_on_points_cc::node_geo_exec(), blender::nodes::node_geo_join_geometry_cc::node_geo_exec(), blender::ed::greasepencil::paste_all_strokes_from_clipboard(), and reinsert_modified_geometry_recursive().

◆ join_instances()

◆ join_mesh_material_indices()

◆ join_volumes()

void blender::geometry::join_volumes ( const Span< const GeometryComponent * > ,
GeometrySet &  )
static

Definition at line 187 of file join_geometries.cc.

References join_volumes().

Referenced by join_component_type(), and join_volumes().

◆ knot_insert_bezier()

◆ limit_radii()

◆ limit_radius()

float blender::geometry::limit_radius ( const float3 & position_prev,
const float3 & position,
const float3 & position_next,
const float angle_prev,
const float angle,
const float angle_next,
const float radius_prev,
const float radius,
const float radius_next )
static

Find the portion of the previous and next segments used by the current and next point fillets. If more than the total length of the segment would be used, scale the current point's radius just enough to make the two points meet in the middle.

Definition at line 133 of file fillet_curves.cc.

References angle(), blender::math::distance(), limit_radius(), position, and blender::math::safe_divide().

Referenced by fillet_curves(), fillet_curves_bezier(), fillet_curves_poly(), limit_radii(), and limit_radius().

◆ linear_interpolation()

◆ lookup_curve_point()

bke::curves::CurvePoint blender::geometry::lookup_curve_point ( const bke::CurvesGeometry & src_curves,
const OffsetIndices< int > evaluated_points_by_curve,
const CurveType curve_type,
const int64_t curve_index,
const Span< float > accumulated_lengths,
const float sample_length,
const bool cyclic,
const int resolution,
const int num_curve_points )
static

◆ lookup_point_bezier() [1/2]

bke::curves::CurvePoint blender::geometry::lookup_point_bezier ( const bke::CurvesGeometry & src_curves,
const OffsetIndices< int > evaluated_points_by_curve,
const int64_t curve_index,
const Span< float > accumulated_lengths,
const float sample_length,
const bool cyclic,
const int resolution,
const int num_curve_points )
static

◆ lookup_point_bezier() [2/2]

bke::curves::CurvePoint blender::geometry::lookup_point_bezier ( const Span< int > bezier_offsets,
const Span< float > lengths,
const float sample_length,
const bool cyclic,
const int num_curve_points )
static

◆ lookup_point_polygonal()

bke::curves::CurvePoint blender::geometry::lookup_point_polygonal ( const Span< float > lengths,
const float sample_length,
const bool cyclic,
const int evaluated_size )
static

Find the point on the 'evaluated' polygonal curve.

Definition at line 65 of file trim_curves.cc.

References blender::Span< T >::last(), lookup_point_polygonal(), and blender::length_parameterize::sample_at_length().

Referenced by lookup_curve_point(), and lookup_point_polygonal().

◆ lookup_point_uniform_spacing()

bke::curves::CurvePoint blender::geometry::lookup_point_uniform_spacing ( const Span< float > lengths,
const float sample_length,
const bool cyclic,
const int resolution,
const int num_curve_points )
static

Find the point on the curve defined by the distance along the curve. Assumes curve resolution is constant for all curve segments and evaluated curve points are uniformly spaced between the segment endpoints in relation to the curve parameter.

Parameters
lengthsAccumulated length for the evaluated curve.
sample_lengthDistance along the curve to determine the #CurvePoint for.
cyclicIf curve is cyclic.
resolutionCurve resolution (number of evaluated points per segment).
num_curve_pointsTotal number of control points in the curve.
Returns
Point on the piecewise segment matching the given distance.

Definition at line 36 of file trim_curves.cc.

References blender::BLI_assert(), blender::Span< T >::last(), lookup_point_uniform_spacing(), blender::length_parameterize::sample_at_length(), and blender::Span< T >::size().

Referenced by lookup_curve_point(), lookup_point_bezier(), and lookup_point_uniform_spacing().

◆ lookup_tris_in_cell()

◆ make_new_offset_indices()

◆ mapped_corner_selection_from_face()

IndexMask blender::geometry::mapped_corner_selection_from_face ( const OffsetIndices< int > faces,
const IndexMask & face_mask,
const Span< int > corner_verts_or_edges,
const int verts_or_edges_num,
IndexMaskMemory & memory )
static

◆ merge_layers()

GreasePencil * blender::geometry::merge_layers ( const GreasePencil & src_grease_pencil,
GroupedSpan< int > layers_to_merge,
const bke::AttributeFilter & attribute_filter )

◆ merge_layers_by_name()

◆ merge_points()

PointCloud * blender::geometry::merge_points ( const PointCloud & src_points,
const IndexMask & selection,
Span< int > merge_ids,
const bke::AttributeFilter & attribute_filter )

◆ merge_propagation_map()

MergePropagationMap blender::geometry::merge_propagation_map ( const Span< int > src_to_target,
const IndexMask & survivors,
const Span< int > src_to_dst,
const bool do_mix_data,
IndexMaskMemory & memory )
static
Parameters
src_to_targetThe target element each element merges into. Elements that are removed entirely (collapsed edges) have negative values.
survivorsThe elements kept in the result (see merge_survivors).
do_mix_dataBuild groups for mixing attribute values from all of an element's source elements. Otherwise just the value of the target element is used.

Definition at line 790 of file mesh_merge_verts.cc.

References blender::offset_indices::accumulate_counts_to_offsets(), blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::offset_indices::build_groups_from_indices(), blender::MutableSpan< T >::copy_from(), blender::Default, blender::MutableSpan< T >::drop_front(), blender::geometry::MergePropagationMap::dst_to_src, blender::MutableSpan< T >::first(), blender::index_mask::IndexMask::foreach_index(), blender::index_mask::IndexMask::foreach_index_optimized(), blender::IndexMask::from_predicate(), blender::array_utils::gather(), blender::exec_mode::grain_size(), blender::Span< T >::index_range(), blender::index_mask::IndexMask::is_empty(), merge_propagation_map(), blender::geometry::MergePropagationMap::mixed, blender::geometry::MergePropagationMap::mixed_indices, blender::geometry::MergePropagationMap::mixed_offsets, PRF_scope, blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize(), blender::index_mask::IndexMask::size(), blender::offset_indices::GroupedSpan< T >::size(), and blender::index_mask::IndexMask::to_indices().

Referenced by create_merged_mesh(), and merge_propagation_map().

◆ merge_src_to_dst_map()

Array< int > blender::geometry::merge_src_to_dst_map ( const Span< int > src_to_target,
const IndexMask & survivors )
static

Build a map from each source element to the element it becomes in the result. Values for elements removed entirely (collapsed edges) are left uninitialized.

Definition at line 851 of file mesh_merge_verts.cc.

References blender::index_mask::build_reverse_map(), blender::Default, blender::Span< T >::index_range(), merge_src_to_dst_map(), blender::threading::parallel_for(), PRF_scope, and blender::Span< T >::size().

Referenced by create_merged_mesh(), and merge_src_to_dst_map().

◆ merge_survivors()

IndexMask blender::geometry::merge_survivors ( const Span< int > src_to_target,
IndexMaskMemory & memory )
static

The elements that are kept in the result. In other words, the merge targets and also the "out of context" elements.

Definition at line 762 of file mesh_merge_verts.cc.

References blender::IndexMask::from_predicate(), blender::Span< T >::index_range(), and merge_survivors().

Referenced by create_merged_mesh(), and merge_survivors().

◆ mesh_bevel()

◆ mesh_copy_selection()

◆ mesh_copy_selection_keep_edges()

◆ mesh_copy_selection_keep_verts()

◆ mesh_edges_to_curves_convert()

bke::CurvesGeometry blender::geometry::mesh_edges_to_curves_convert ( const Mesh & mesh,
const IndexMask & selection,
const bke::AttributeFilter & attribute_filter )

Convert the mesh into one or many poly curves. Since curves cannot have branches, intersections of more than three edges will become breaks in curves. Attributes that are not built-in on meshes and not curves are transferred to the result curve.

Definition at line 239 of file mesh_to_curve_convert.cc.

References blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Default, edges_to_curves_convert(), blender::array_utils::gather(), mesh_edges_to_curves_convert(), PRF_scope, blender::index_mask::IndexMask::size(), and blender::Span< T >::size().

Referenced by mesh_edges_to_curves_convert(), and blender::nodes::node_geo_mesh_to_curve_cc::node_geo_exec().

◆ mesh_faces_to_curves_convert()

◆ mesh_merge_by_distance_all()

std::optional< Mesh * > blender::geometry::mesh_merge_by_distance_all ( const Mesh & mesh,
const IndexMask & selection,
float merge_distance,
const bke::AttributeFilter & attribute_filter = bke::AttributeFilter::default_filter() )

Merge selected vertices into other selected vertices within the merge_distance. The merged indices favor speed over accuracy, since the results will depend on the order of the vertices.

Returns
#std::nullopt if the mesh should not be changed (no vertices are merged), in order to avoid copying the input. Otherwise returns the new mesh with merged geometry.

Definition at line 1285 of file mesh_merge_verts.cc.

References blender::kdtree::calc_duplicates(), blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), mesh_merge_by_distance_all(), OUT_OF_CONTEXT, and blender::threading::parallel_for().

Referenced by blender::calculate_weld(), blender::io::ply::convert_ply_to_mesh(), mesh_merge_by_distance_all(), and blender::nodes::node_geo_merge_by_distance_cc::mesh_merge_by_distance_all().

◆ mesh_merge_by_distance_connected()

std::optional< Mesh * > blender::geometry::mesh_merge_by_distance_connected ( const Mesh & mesh,
Span< bool > selection,
float merge_distance,
bool only_loose_edges,
const bke::AttributeFilter & attribute_filter = bke::AttributeFilter::default_filter() )

◆ mesh_merge_verts() [1/2]

std::optional< Mesh * > blender::geometry::mesh_merge_verts ( const Mesh & mesh,
const IndexMask & selection,
Span< int > merge_ids,
const bke::AttributeFilter & attribute_filter )

Merge selected vertices that share the same ID. Each group of vertices merges into the vertex with the lowest index.

Returns
#std::nullopt if the mesh should not be changed (no vertices are merged), in order to avoid copying the input. Otherwise returns the new mesh with merged geometry.

Definition at line 1413 of file mesh_merge_verts.cc.

References blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), create_merged_mesh(), blender::array_utils::fill_index_range(), blender::index_mask::IndexMask::foreach_index_optimized(), blender::exec_mode::grain_size(), blender::array_utils::group_ids_to_indices(), mesh_merge_verts(), and blender::index_mask::IndexMask::size().

◆ mesh_merge_verts() [2/2]

Mesh * blender::geometry::mesh_merge_verts ( const Mesh & mesh,
Span< int > vert_src_to_target,
int removed_verts_num,
bool do_mix_data )

Merge vertices into target vertices targets.

Parameters
vert_src_to_targetMaps each vertex to the vertex it merges into. Vertices that don't merge into another vertex point at themselves. The array is aligned with mesh.verts_num.
Warning
vert_src_to_target must not contain any chained mapping (v1 -> v2 -> v3 etc.), this is not supported and will likely generate corrupted geometry. In other words, vert_src_to_target[vert_src_to_target[vert]] must always equal vert_src_to_target[vert].
Parameters
removed_verts_numThe number of vertices that merge into a different vertex, in other words the number of vertices removed by the merge (not the size of the array).
do_mix_dataIf true, each group of merged vertices (the sources with the same target, plus the target vertex) will have their custom data interpolated into the resulting vertex. If false, only the custom data of the target vertex will remain.

Definition at line 1398 of file mesh_merge_verts.cc.

References blender::BLI_assert(), create_merged_mesh(), blender::bke::AttributeFilter::default_filter(), mesh_merge_verts(), and blender::Span< T >::size().

Referenced by blender::arrayModifier_doArray(), mesh_merge_verts(), mesh_merge_verts(), blender::mesh_remove_doubles_on_axis(), blender::mirror_apply_on_axis(), and blender::nodes::node_geo_merge_points_cc::node_geo_exec().

◆ mesh_triangulate()

std::optional< Mesh * > blender::geometry::mesh_triangulate ( const Mesh & src_mesh,
const IndexMask & selection,
TriangulateNGonMode ngon_mode,
TriangulateQuadMode quad_mode,
const bke::AttributeFilter & attribute_filter )
Returns
#std::nullopt if the mesh is not changed (when every selected face is already a triangle).

Definition at line 499 of file mesh_triangulate.cc.

References blender::bke::MutableAttributeAccessor::add(), blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), attribute, blender::bke::attribute_filter_with_skip_ref(), blender::Mesh::attribute_storage, blender::BKE_mesh_copy_parameters_for_eval(), blender::BLI_assert(), blender::bke::MeshRuntime::bounds_cache, blender::geometry::ngon::calc_corner_tris(), blender::geometry::quad::calc_corner_tris(), blender::geometry::ngon::calc_tris_by_ngon(), blender::Span< T >::cast(), blender::CD_CONSTRUCT, blender::CD_MASK_MESH, blender::CD_ORIGINDEX, copy_loose_vert_hint(), blender::bke::Corner, blender::CustomData_add_layer(), blender::CustomData_get_layer(), blender::CustomData_has_layer(), blender::CustomData_merge(), blender::bke::Edge, blender::Mesh::edge_data, blender::Mesh::edges_num, ELEM, blender::CustomData_MeshMasks::emask, blender::index_mask::evaluate_expression(), blender::bke::Face, blender::Mesh::face_data, face_keys_to_face_indices(), face_normals_if_worthwhile(), face_tris_mask(), blender::Mesh::faces_num, blender::offset_indices::fill_constant_group_size(), blender::IndexMask::from_difference(), blender::IndexMask::from_predicate(), blender::array_utils::gather(), blender::bke::attribute_math::gather(), blender::array_utils::gather_group_to_group(), blender::bke::attribute_math::gather_group_to_group(), blender::offset_indices::gather_selected_offsets(), blender::offset_indices::OffsetIndices< T >::index_range(), blender::Span< T >::index_range(), blender::index_mask::IndexMask::is_empty(), blender::bke::mesh_calc_edges(), blender::bke::mesh_is_valid(), blender::bke::mesh_new_no_attributes(), mesh_triangulate(), ngon_indices_of_tris(), blender::bke::Point, quad_indices_of_tris(), blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize(), blender::bke::retrieve_attributes_for_transfer(), blender::Mesh::runtime, blender::index_mask::IndexMask::size(), blender::IndexRange::size(), blender::offset_indices::OffsetIndices< T >::size(), blender::MutableSpan< T >::slice(), blender::offset_indices::OffsetIndices< T >::slice(), blender::index_mask::ExprBuilder::subtract(), blender::IndexRange::take_back(), blender::MutableSpan< T >::take_back(), blender::IndexRange::take_front(), blender::MutableSpan< T >::take_front(), blender::offset_indices::OffsetIndices< T >::total_size(), tri_to_ordered_tri(), tris_in_set(), blender::Mesh::vert_data, blender::Mesh::verts_num, and blender::CustomData_MeshMasks::vmask.

Referenced by mesh_triangulate(), and blender::nodes::node_geo_triangulate_cc::node_geo_exec().

◆ mix() [1/2]

void blender::geometry::mix ( GMutableSpan a,
const GVArray & b,
const float factor )
static

◆ mix() [2/2]

template<typename T>
void blender::geometry::mix ( MutableSpan< T > a,
const VArray< T > & b,
const float factor )
static

◆ mix_arrays() [1/3]

void blender::geometry::mix_arrays ( const GSpan src_from,
const GSpan src_to,
const Span< float > mix_factors,
const IndexMask & group_selection,
const OffsetIndices< int > groups,
const GMutableSpan dst )
static

◆ mix_arrays() [2/3]

void blender::geometry::mix_arrays ( const GSpan src_from,
const GSpan src_to,
const Span< float > mix_factors,
const IndexMask & selection,
const GMutableSpan dst )
static

◆ mix_arrays() [3/3]

template<typename T>
void blender::geometry::mix_arrays ( const Span< T > from,
const Span< T > to,
const float mix_factor,
const MutableSpan< T > dst )
static

◆ mix_attributes()

void blender::geometry::mix_attributes ( bke::MutableAttributeAccessor attributes_a,
const bke::AttributeAccessor b_attributes,
const Span< int > index_map,
const bke::AttrDomain mix_domain,
const float factor,
const Set< std::string > & names_to_skip = {} )
static

Definition at line 81 of file mix_geometries.cc.

References mix_attributes().

Referenced by mix_attributes(), and mix_geometries().

◆ mix_bundle_items()

void blender::geometry::mix_bundle_items ( nodes::BundleItemValue & a,
const nodes::BundleItemValue & b,
const float factor )
static

◆ mix_bundles()

void blender::geometry::mix_bundles ( nodes::Bundle & a,
const nodes::Bundle & b,
float factor )

◆ mix_curve_type()

void blender::geometry::mix_curve_type ( const Span< int > from_curve_indices,
const Span< int > to_curve_indices,
const VArray< int8_t > & from_types,
const VArray< int8_t > & to_types,
const IndexMask & dst_curve_mask,
MutableSpan< int8_t > dst_curve_types )
static

◆ mix_geometries()

◆ mix_handle_type()

int8_t blender::geometry::mix_handle_type ( const int8_t from_type,
const int8_t to_type )
static

◆ mix_handle_type_arrays()

void blender::geometry::mix_handle_type_arrays ( const Span< int8_t > src_from,
const Span< int8_t > src_to,
const IndexMask & group_selection,
const OffsetIndices< int > groups,
const MutableSpan< int8_t > dst )
static

◆ mix_socket_values()

void blender::geometry::mix_socket_values ( bke::SocketValueVariant & a,
const bke::SocketValueVariant & b,
const float factor )

◆ mix_socket_values_same_type()

◆ mix_vertex_groups()

◆ mix_with_indices() [1/2]

void blender::geometry::mix_with_indices ( GMutableSpan a,
const GVArray & b,
const Span< int > index_map,
const float factor )
static

◆ mix_with_indices() [2/2]

template<typename T>
void blender::geometry::mix_with_indices ( MutableSpan< T > a,
const VArray< T > & b,
const Span< int > index_map,
const float factor )

◆ mul_v2_m2_add_v2v2()

void blender::geometry::mul_v2_m2_add_v2v2 ( float r[2],
const float mat[2][2],
const float a[2],
const float b[2] )

Compute r = mat * (a + b) with high precision.

Definition at line 46 of file uv_pack.cc.

References b, float, mul_v2_m2_add_v2v2(), blender::x, and y.

Referenced by blender::island_uv_transform(), mul_v2_m2_add_v2v2(), pack_islands(), and uv_parametrizer_pack().

◆ new_geo_uv_pinindex()

◆ ngon_indices_of_tris()

◆ normalize_curve_point_data()

void blender::geometry::normalize_curve_point_data ( const IndexMaskSegment curve_selection,
const OffsetIndices< int > points_by_curve,
MutableSpan< float3 > data )
static

◆ normalize_span()

void blender::geometry::normalize_span ( MutableSpan< float3 > data)
static

◆ offsets_to_map()

Array< int > blender::geometry::offsets_to_map ( const IndexMask & mask,
const OffsetIndices< int > offsets )
static

Transform the OffsetIndices storage of new elements per source element into a more standard index map which can be used with existing utilities to copy attributes.

Definition at line 531 of file mesh_split_edges.cc.

References blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::exec_mode::grain_size(), offsets_to_map(), and blender::offset_indices::OffsetIndices< T >::total_size().

Referenced by offsets_to_map(), and split_edges().

◆ overlap_aabb()

bool blender::geometry::overlap_aabb ( const float2 & pivot_a,
const float2 & half_diagonal_a,
const float2 & pivot_b,
const float2 & half_diagonal_b )
static

Definition at line 2170 of file uv_pack.cc.

References overlap_aabb().

Referenced by blender::geometry::OverlapMerger::overlap(), and overlap_aabb().

◆ p_abf_adjust_alpha()

void blender::geometry::p_abf_adjust_alpha ( PAbfSystem * sys,
const int id,
const float dlambda1,
const float pre )
static

◆ p_abf_compute_grad_alpha()

◆ p_abf_compute_gradient()

◆ p_abf_compute_sin_product()

◆ p_abf_compute_sines()

◆ p_abf_matrix_invert()

◆ p_abf_setup_system()

◆ p_add_ngon()

void blender::geometry::p_add_ngon ( ParamHandle * handle,
const ParamKey key,
const int nverts,
const ParamKey * vkeys,
const float ** co,
float ** uv,
const float * weight,
const bool * pin,
const bool * select )
static

◆ p_area_signed()

float blender::geometry::p_area_signed ( const float v1[2],
const float v2[2],
const float v3[2] )
static

Definition at line 414 of file uv_parametrizer.cc.

References p_area_signed(), and blender::v2.

Referenced by p_area_signed(), and p_chart_convex_hull().

◆ p_boundary_edge_next()

PEdge * blender::geometry::p_boundary_edge_next ( PEdge * e)
static

◆ p_boundary_edge_prev()

PEdge * blender::geometry::p_boundary_edge_prev ( PEdge * e)
static

◆ p_chart_abf_solve()

◆ p_chart_boundaries()

◆ p_chart_collapse_doubles()

void UNUSED_FUNCTION blender::geometry::p_chart_collapse_doubles ( PChart * chart,
const float threshold )
static

◆ p_chart_convex_hull()

bool blender::geometry::p_chart_convex_hull ( PChart * chart,
PVert *** r_verts,
int * r_nverts,
int * r_right )
static

◆ p_chart_correct_degenerate_triangle_point()

◆ p_chart_correct_degenerate_triangles()

◆ p_chart_correct_degenerate_triangles2()

◆ p_chart_extrema_verts()

void blender::geometry::p_chart_extrema_verts ( PChart * chart,
PVert ** pin1,
PVert ** pin2 )
static

◆ p_chart_fill_boundaries()

◆ p_chart_fill_boundary()

◆ p_chart_flush_collapsed_uvs()

◆ p_chart_lscm_begin()

◆ p_chart_lscm_end()

◆ p_chart_lscm_solve()

◆ p_chart_lscm_transform_single_pin()

◆ p_chart_minimum_area_angle()

◆ p_chart_orig_bounds_init()

void blender::geometry::p_chart_orig_bounds_init ( PChart * chart)
static

◆ p_chart_pin_positions()

◆ p_chart_post_collapse_flush()

◆ p_chart_rotate_fit_aabb()

◆ p_chart_rotate_minimum_area()

void blender::geometry::p_chart_rotate_minimum_area ( PChart * chart)
static

◆ p_chart_simplify_compute()

◆ p_chart_stretch_minimize()

◆ p_chart_symmetry_pins()

◆ p_chart_uv_area()

◆ p_chart_uv_bbox()

void blender::geometry::p_chart_uv_bbox ( PChart * chart,
float minv[2],
float maxv[2] )
static

◆ p_chart_uv_rotate()

void blender::geometry::p_chart_uv_rotate ( PChart * chart,
float angle )
static

◆ p_chart_uv_scale()

void blender::geometry::p_chart_uv_scale ( PChart * chart,
const float scale )
static

◆ p_chart_uv_to_array()

void blender::geometry::p_chart_uv_to_array ( PChart * chart,
MutableSpan< float2 > points )
static

◆ p_chart_uv_transform()

void blender::geometry::p_chart_uv_transform ( PChart * chart,
const float mat[2][2] )
static

◆ p_chart_uv_translate()

void blender::geometry::p_chart_uv_translate ( PChart * chart,
const float trans[2] )
static

◆ p_collapse_allowed_topologic()

bool blender::geometry::p_collapse_allowed_topologic ( PEdge * edge,
PEdge * pair )
static

◆ p_collapse_cost_vertex()

void blender::geometry::p_collapse_cost_vertex ( PVert * vert,
float * r_mincost,
PEdge ** r_mine,
const std::function< float(PEdge *, PEdge *)> & collapse_cost_fn,
const std::function< float(PEdge *, PEdge *)> & collapse_allowed_fn )
static

◆ p_collapse_doubles_allowed()

bool blender::geometry::p_collapse_doubles_allowed ( PEdge * edge,
PEdge * pair,
float threshold_squared )
static

◆ p_collapse_doubles_cost()

float blender::geometry::p_collapse_doubles_cost ( PEdge * edge,
PEdge * pair )
static

◆ p_collapse_edge()

◆ p_collapsing_verts()

◆ p_compare_geometric_uv()

int blender::geometry::p_compare_geometric_uv ( const void * a,
const void * b )
static

◆ p_connect_pairs()

◆ p_edge_connect_pair()

bool blender::geometry::p_edge_connect_pair ( ParamHandle * handle,
PEdge * e,
bool topology_from_uvs,
PEdge *** stack )
static

◆ p_edge_has_pair()

◆ p_edge_implicit_seam()

◆ p_edge_length()

float blender::geometry::p_edge_length ( PEdge * e)
static

◆ p_edge_length_squared()

float blender::geometry::p_edge_length_squared ( PEdge * e)
static

◆ p_edge_lookup()

PEdge * blender::geometry::p_edge_lookup ( ParamHandle * handle,
const PHashKey * vkeys )
static

◆ p_edge_matrix() [1/2]

bool blender::geometry::p_edge_matrix ( float R[3][3],
const float edge_dir[3] )
static

◆ p_edge_matrix() [2/2]

bool blender::geometry::p_edge_matrix ( float R[3][3],
const PEdge * e )
static

◆ p_edge_uv_length()

float blender::geometry::p_edge_uv_length ( PEdge * e)
static

◆ p_face_add()

◆ p_face_add_construct()

◆ p_face_add_fill()

◆ p_face_angles()

void blender::geometry::p_face_angles ( PFace * f,
double * r_a1,
double * r_a2,
double * r_a3 )
static

◆ p_face_area()

◆ p_face_backup_uvs()

◆ p_face_cos()

void UNUSED_FUNCTION blender::geometry::p_face_cos ( PFace * f,
float * r_cos1,
float * r_cos2,
float * r_cos3 )
static

◆ p_face_exists()

int blender::geometry::p_face_exists ( ParamHandle * handle,
const ParamKey * pvkeys,
int i1,
int i2,
int i3 )
static

◆ p_face_flip()

◆ p_face_restore_uvs()

◆ p_face_stretch()

◆ p_face_uv_area_signed()

◆ p_flush_uvs()

◆ p_intersect_line_2d_dir()

bool blender::geometry::p_intersect_line_2d_dir ( const float v1[2],
const float dir1[2],
const float v2[2],
const float dir2[2],
float r_isect[2] )
static

Definition at line 534 of file uv_parametrizer.cc.

References p_intersect_line_2d_dir(), and blender::v2.

Referenced by p_intersect_line_2d_dir(), and p_rectangle_area().

◆ p_polygon_calc_tris()

◆ p_rectangle_area()

float blender::geometry::p_rectangle_area ( float * p1,
float * dir,
float * p2,
float * p3,
float * p4 )
static

◆ p_split_charts()

◆ p_split_vert()

◆ p_stretch_compute_vertex()

float blender::geometry::p_stretch_compute_vertex ( PVert * v)
static

◆ p_stretch_pin_boundary()

void blender::geometry::p_stretch_pin_boundary ( PChart * chart)
static

◆ p_triangle_angles()

void blender::geometry::p_triangle_angles ( const float v1[3],
const float v2[3],
const float v3[3],
double * r_a1,
double * r_a2,
double * r_a3 )
static

◆ p_triangle_cos()

void blender::geometry::p_triangle_cos ( const float v1[3],
const float v2[3],
const float v3[3],
float * r_cos1,
float * r_cos2,
float * r_cos3 )
static

◆ p_validate_corrected_coords()

bool blender::geometry::p_validate_corrected_coords ( const PEdge * corr_e,
const float corr_co[3],
float min_area,
float min_angle_cos )
static

◆ p_validate_corrected_coords_point()

bool blender::geometry::p_validate_corrected_coords_point ( const PEdge * corr_e,
const float corr_co1[3],
const float corr_co2[3],
const float min_area,
const float min_angle_cos )
static

◆ p_validate_triangle_angles()

bool blender::geometry::p_validate_triangle_angles ( const PVert * vert1,
const PVert * vert2,
const PVert * vert3,
const float min_angle_cos )
static

◆ p_vec_cos()

float blender::geometry::p_vec_cos ( const float v1[3],
const float v2[3],
const float v3[3] )
static

◆ p_vert_add()

◆ p_vert_copy()

◆ p_vert_fix_edge_pointer()

void blender::geometry::p_vert_fix_edge_pointer ( PVert * v)
static

◆ p_vert_interior()

bool blender::geometry::p_vert_interior ( PVert * v)
static

◆ p_vert_load_pin_select_uvs()

◆ p_vert_lookup()

PVert * blender::geometry::p_vert_lookup ( ParamHandle * handle,
PHashKey key,
const float co[3],
const float weight,
PEdge * e )
static

◆ p_wheel_edge_next() [1/2]

const PEdge * blender::geometry::p_wheel_edge_next ( const PEdge * e)
static

Definition at line 562 of file uv_parametrizer.cc.

References blender::e, and p_wheel_edge_next().

◆ p_wheel_edge_next() [2/2]

◆ p_wheel_edge_prev()

PEdge * blender::geometry::p_wheel_edge_prev ( PEdge * e)
static

◆ pack_gobel()

void blender::geometry::pack_gobel ( const Span< std::unique_ptr< UVAABBIsland > > aabbs,
const float scale,
const int m,
MutableSpan< UVPhi > r_phis )
static

◆ pack_island_box_pack_2d()

◆ pack_island_xatlas()

int64_t blender::geometry::pack_island_xatlas ( const Span< std::unique_ptr< UVAABBIsland > > island_indices,
const Span< PackIsland * > islands,
const float scale,
const float margin,
const UVPackIsland_Params & params,
MutableSpan< UVPhi > r_phis,
rctf * r_extent )
static

Pack irregular islands using the xatlas strategy, and optional D4 transforms.

Loosely based on the 'xatlas' code by Jonathan Young from https://github.com/jpcy/xatlas

A brute force packer (BF-Packer) with accelerators:

  • Uses a Bitmap Occupancy class.
  • Uses a "Witness Pixel" and a "Triangle Hint".
  • Write with margin * 2, read with margin == 0.
  • Lazy resetting of BF search.

Performance of "xatlas" would normally be O(n^4) (or worse!), however, in our implementation, bitmap_radix is a constant, which reduces the time complexity to O(n^3). => if n can ever be large, bitmap_radix will need to vary accordingly.

Definition at line 1642 of file uv_pack.cc.

References blender::geometry::PackIsland::can_rotate_(), blender::geometry::PackIsland::can_scale_(), blender::geometry::PackIsland::can_translate_(), blender::geometry::UVPackIsland_Params::do_update, blender::ED_UVPACK_SHAPE_AABB, find_best_fit_for_island(), blender::G, blender::geometry::PackIsland::get_diagonal_support(), guess_initial_scale(), is_larger(), blender::geometry::UVPhi::is_valid(), blender::geometry::UVPackIsland_Params::isCancelled(), pack_island_xatlas(), blender::geometry::PackIsland::pivot_, blender::geometry::UVPackIsland_Params::progress, rotate_inside_square(), blender::geometry::UVPhi::rotation, scale(), blender::geometry::UVPackIsland_Params::shape_method, blender::MutableSpan< T >::size(), blender::sqrt(), sqrtf, blender::geometry::UVPackIsland_Params::stop, blender::sub_v2_v2(), blender::geometry::UVPackIsland_Params::target_aspect_y, blender::geometry::UVPhi::translation, blender::geometry::UVPackIsland_Params::udim_base_offset, blender::rctf::xmax, and blender::rctf::ymax.

Referenced by pack_island_xatlas().

◆ pack_islands() [1/2]

◆ pack_islands() [2/2]

◆ pack_islands_alpaca_rotate()

void blender::geometry::pack_islands_alpaca_rotate ( const int64_t exclude_index,
const rctf & exclude,
const Span< std::unique_ptr< UVAABBIsland > > islands,
const float target_aspect_y,
MutableSpan< UVPhi > r_phis,
rctf * r_extent )
static

Pack AABB islands using the "Alpaca" strategy, with rotation.

Same as pack_islands_alpaca_turbo, with support for rotation in 90 degree increments.

Also adds the concept of a "Hole", which is unused space that can be filled. Tracking the "Hole" has a slight performance cost, while improving packing efficiency.

Definition at line 594 of file uv_pack.cc.

References blender::geometry::UVAABBIsland::aspect_y, DEG2RADF, blender::geometry::UVAABBIsland::index, blender::max_ff(), pack_islands_alpaca_rotate(), blender::geometry::UVPhi::rotation, blender::geometry::UVPhi::translation, update_hole_rotate(), blender::geometry::UVAABBIsland::uv_diagonal, blender::rctf::xmax, and blender::rctf::ymax.

Referenced by pack_islands_alpaca_rotate(), and pack_islands_fast().

◆ pack_islands_alpaca_turbo()

void blender::geometry::pack_islands_alpaca_turbo ( const int64_t exclude_index,
const rctf & exclude,
const Span< std::unique_ptr< UVAABBIsland > > islands,
const float target_aspect_y,
MutableSpan< UVPhi > r_phis,
rctf * r_extent )
static

Pack AABB islands using the "Alpaca" strategy, with no rotation.

Each box is packed into an "L" shaped region, gradually filling up space. "Alpaca" is a pun, as it's pronounced the same as "L-Packer" in English.

In theory, alpaca_turbo should be the fastest non-trivial packer, hence the "turbo" suffix.

Technically, the algorithm here is only O(n), In practice, to get reasonable results, the input must be pre-sorted, which costs an additional O(nlogn) time complexity.

Definition at line 483 of file uv_pack.cc.

References blender::geometry::UVAABBIsland::index, blender::max_ff(), pack_islands_alpaca_turbo(), blender::geometry::UVPhi::rotation, blender::geometry::UVPhi::translation, blender::geometry::UVAABBIsland::uv_diagonal, blender::rctf::xmax, and blender::rctf::ymax.

Referenced by pack_islands_alpaca_turbo(), and pack_islands_fast().

◆ pack_islands_fast()

void blender::geometry::pack_islands_fast ( const int64_t exclude_index,
const rctf & exclude,
const Span< std::unique_ptr< UVAABBIsland > > aabbs,
const bool rotate,
const float target_aspect_y,
MutableSpan< UVPhi > r_phis,
rctf * r_extent )
static

Use a fast algorithm to pack the supplied aabbs.

Definition at line 700 of file uv_pack.cc.

References pack_islands_alpaca_rotate(), pack_islands_alpaca_turbo(), pack_islands_fast(), and rotate().

Referenced by pack_islands_fast().

◆ pack_islands_margin_fraction()

float blender::geometry::pack_islands_margin_fraction ( const Span< PackIsland * > islands,
const float margin_fraction,
const bool rescale_margin,
const UVPackIsland_Params & params )
static

Find the optimal scale to pack islands into the unit square. returns largest scale that will pack islands into the unit square.

Definition at line 2036 of file uv_pack.cc.

References blender::BLI_assert(), blender::geometry::PackIsland::can_scale_(), pack_islands_margin_fraction(), pack_islands_scale_margin(), blender::geometry::PackIsland::place_(), scale(), sqrtf, and blender::geometry::UVPackIsland_Params::target_extent.

Referenced by pack_islands(), and pack_islands_margin_fraction().

◆ pack_islands_optimal_pack()

◆ pack_islands_optimal_pack_table()

bool blender::geometry::pack_islands_optimal_pack_table ( const int table_count,
const float max_extent,
const float * optimal,
const char * ,
int64_t island_count,
const float large_uv,
const Span< std::unique_ptr< UVAABBIsland > > aabbs,
const UVPackIsland_Params & params,
MutableSpan< UVPhi > r_phis,
rctf * r_extent )
static

◆ pack_islands_scale_margin()

float blender::geometry::pack_islands_scale_margin ( const Span< PackIsland * > islands,
const float scale,
const float margin,
const UVPackIsland_Params & params,
MutableSpan< UVPhi > r_phis )
static

Pack islands using a mix of other strategies.

Parameters
islandsThe islands to be packed.
scaleScale islands by scale before packing.
marginAdd margin units around islands before packing.
paramsAdditional parameters. Scale and margin information is ignored.
r_phisIsland layout information will be written here.
Returns
Size of square covering the resulting packed UVs. The maximum u or v coordinate.

Definition at line 1839 of file uv_pack.cc.

References blender::geometry::PackIsland::aspect_y, b, blender::Array< T, InlineBufferCapacity, Allocator >::begin(), can_rotate(), blender::geometry::PackIsland::can_scale_(), blender::Array< T, InlineBufferCapacity, Allocator >::end(), blender::geometry::PackIsland::half_diagonal_, blender::if(), pack_islands_scale_margin(), and scale().

Referenced by pack_islands(), pack_islands_margin_fraction(), and pack_islands_scale_margin().

◆ parallel_transform()

template<typename T, typename Func>
void blender::geometry::parallel_transform ( MutableSpan< T > values,
const int64_t grain_size,
const Func & func )
static

◆ perpendicular_distance()

template<typename T>
float blender::geometry::perpendicular_distance ( const Span< float3 > positions,
const Span< T > attribute_data,
const int64_t first_index,
const int64_t last_index,
const int64_t index )

Computes a "perpendicular distance" value for the generic attribute data based on the positions of the curve.

First, we compute a lambda value that represents a factor from the first point to the last point of the current range. This is the projection of the point of interest onto the vector from the first to the last point.

Then this lambda value is used to compute an interpolated value of the first and last point and finally we compute the distance from the interpolated value to the actual value. This is the "perpendicular distance".

Definition at line 31 of file simplify_curves.cc.

References blender::math::distance(), blender::math::dot(), blender::math::interpolate(), blender::math::is_zero(), perpendicular_distance(), and T.

Referenced by perpendicular_distance(), and ramer_douglas_peucker().

◆ phash_insert()

◆ phash_lookup()

◆ phash_new()

◆ phash_next()

PHashLink * blender::geometry::phash_next ( PHash * ph,
PHashKey key,
PHashLink * link )
static

◆ phash_safe_delete()

void blender::geometry::phash_safe_delete ( PHash ** pph)
static

◆ phash_size()

int blender::geometry::phash_size ( PHash * ph)
static

Definition at line 230 of file uv_parametrizer.cc.

References phash_size(), and blender::geometry::PHash::size.

Referenced by p_connect_pairs(), and phash_size().

◆ point_merge_by_distance()

PointCloud * blender::geometry::point_merge_by_distance ( const PointCloud & src_points,
const float merge_distance,
const IndexMask & selection,
const bke::AttributeFilter & attribute_filter )

Merge selected points into other selected points within the merge_distance. The merged indices favor speed over accuracy, since the results will depend on the order of the points.

Definition at line 82 of file point_merge.cc.

References blender::kdtree::calc_duplicates(), blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), blender::threading::parallel_for(), point_merge_by_distance(), and blender::PointCloud::totpoint.

Referenced by point_merge_by_distance(), and blender::nodes::node_geo_merge_by_distance_cc::pointcloud_merge_by_distance().

◆ points_rasterize_attribute_type()

const CPPType & blender::geometry::points_rasterize_attribute_type ( const PointRasterizeType rasterize_type)

◆ points_rasterize_grid_type()

const CPPType & blender::geometry::points_rasterize_grid_type ( const PointRasterizeType rasterize_type)

◆ prepare_attribute_fallbacks()

◆ preprocess_curves()

AllCurvesInfo blender::geometry::preprocess_curves ( const bke::GeometrySet & geometry_set,
const RealizeInstancesOptions & options,
const VariedDepthOptions & varied_depth_option )
static

Definition at line 2238 of file realize_instances.cc.

References attribute, blender::geometry::AllCurvesInfo::attributes, blender::geometry::RealizeCurveInfo::attributes, blender::bke::AttributeAccessor::contains(), blender::geometry::AllCurvesInfo::create_custom_normal_attribute, blender::geometry::AllCurvesInfo::create_fill_id_attribute, blender::geometry::AllCurvesInfo::create_handle_postion_attributes, blender::geometry::AllCurvesInfo::create_id_attribute, blender::geometry::AllCurvesInfo::create_radius_attribute, blender::bke::Curve, blender::geometry::RealizeCurveInfo::curves, blender::geometry::RealizeCurveInfo::custom_normal, blender::Default, blender::bke::GAttributeReader::domain, gather_all_fill_ids(), gather_curves_to_realize(), gather_generic_curve_attributes_to_propagate(), blender::geometry::RealizeCurveInfo::handle_left, blender::geometry::RealizeCurveInfo::handle_right, blender::geometry::RealizeCurveInfo::index_by_fill_id, blender::geometry::OrderedAttributes::index_range(), blender::CPPType::is(), blender::geometry::OrderedAttributes::kinds, blender::bke::AttributeAccessor::lookup(), blender::bke::AttributeAccessor::lookup_or_default(), blender::geometry::OrderedAttributes::names, options, blender::geometry::AllCurvesInfo::order, blender::bke::Point, preprocess_curves(), PRF_scope, blender::geometry::RealizeCurveInfo::radius, blender::geometry::AllCurvesInfo::realize_info, blender::geometry::OrderedAttributes::size(), blender::geometry::RealizeCurveInfo::stored_fill_ids, blender::geometry::RealizeCurveInfo::stored_ids, blender::GVArrayCommon::type(), blender::GVArray::typed(), and blender::bke::GAttributeReader::varray.

Referenced by preprocess_curves(), and realize_instances().

◆ preprocess_grease_pencils()

◆ preprocess_meshes()

AllMeshesInfo blender::geometry::preprocess_meshes ( const bke::GeometrySet & geometry_set,
const RealizeInstancesOptions & options,
const VariedDepthOptions & varied_depth_option )
static

Definition at line 1537 of file realize_instances.cc.

References blender::bke::mesh::NormalJoinInfo::add_mesh(), attribute, blender::geometry::AllMeshesInfo::attributes, blender::geometry::MeshRealizeInfo::attributes, BLI_assert_unreachable, blender::CD_ORIGINDEX, blender::bke::AttributeAccessor::contains(), blender::bke::Corner, blender::geometry::MeshRealizeInfo::corner_edges, blender::geometry::MeshRealizeInfo::corner_verts, blender::bke::mesh::NormalJoinInfo::CornerFan, blender::bke::cpp_type_to_attribute_type(), blender::geometry::AllMeshesInfo::create_id_attribute, blender::geometry::AllMeshesInfo::create_material_index_attribute, blender::geometry::AllMeshesInfo::create_origindex_edge_attribute, blender::geometry::AllMeshesInfo::create_origindex_face_attribute, blender::geometry::AllMeshesInfo::create_origindex_vert_attribute, blender::geometry::MeshRealizeInfo::custom_normal, blender::geometry::AllMeshesInfo::custom_normal_info, blender::CustomData_has_layer(), blender::Default, blender::bke::GAttributeReader::domain, blender::geometry::MeshRealizeInfo::edges, blender::bke::Face, blender::geometry::MeshRealizeInfo::faces, blender::Array< T, InlineBufferCapacity, Allocator >::first(), blender::bke::mesh::NormalJoinInfo::Free, blender::VArray< T >::from_span(), gather_generic_mesh_attributes_to_propagate(), gather_meshes_to_realize(), blender::geometry::OrderedAttributes::index_range(), blender::CPPType::is(), blender::bke::mesh::is_corner_fan_normals(), blender::geometry::OrderedAttributes::kinds, blender::bke::AttributeAccessor::lookup(), blender::bke::AttributeAccessor::lookup_or_default(), blender::geometry::MeshRealizeInfo::material_index_map, blender::geometry::MeshRealizeInfo::material_indices, blender::geometry::AllMeshesInfo::materials, blender::geometry::MeshRealizeInfo::mesh, blender::geometry::OrderedAttributes::names, blender::geometry::AllMeshesInfo::no_loose_edges_hint, blender::geometry::AllMeshesInfo::no_loose_verts_hint, blender::geometry::AllMeshesInfo::no_overlapping_hint, blender::bke::mesh::NormalJoinInfo::None, options, blender::geometry::AllMeshesInfo::order, blender::bke::Point, blender::geometry::MeshRealizeInfo::positions, preprocess_meshes(), PRF_scope, blender::geometry::AllMeshesInfo::realize_info, blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize(), blender::bke::mesh::NormalJoinInfo::result_domain, blender::bke::mesh::NormalJoinInfo::result_type, blender::geometry::OrderedAttributes::size(), blender::geometry::MeshRealizeInfo::stored_vert_ids, blender::GVArrayCommon::type(), blender::GSpan::typed(), blender::GVArray::typed(), and blender::bke::GAttributeReader::varray.

Referenced by preprocess_meshes(), and realize_instances().

◆ preprocess_pointclouds()

AllPointCloudsInfo blender::geometry::preprocess_pointclouds ( const bke::GeometrySet & geometry_set,
const RealizeInstancesOptions & options,
const VariedDepthOptions & varied_depth_option )
static

◆ propagate_edge_attributes()

◆ propagate_instances_to_keep()

void blender::geometry::propagate_instances_to_keep ( const bke::GeometrySet & geometry_set,
const IndexMask & selection,
bke::GeometrySet & new_geometry_set,
const bke::AttributeFilter & attribute_filter )
static

◆ propagate_vert_attributes()

◆ quad_indices_of_tris()

◆ ramer_douglas_peucker()

◆ realize_instances() [1/2]

RealizeInstancesResult blender::geometry::realize_instances ( bke::GeometrySet geometry_set,
const RealizeInstancesOptions & options )

Join all instances into a single geometry component for each geometry type. For example, all mesh instances (including the already realized mesh) are joined into a single mesh. The output geometry set does not contain any instances. If the input did not contain any instances, it is returned directly.

The id attribute has special handling. If there is an id attribute on any component, the output will contain an id attribute as well. The output id is generated by mixing/hashing ids of instances and of the instanced geometry data.

Definition at line 2925 of file realize_instances.cc.

References blender::geometry::VariedDepthOptions::depths, blender::VArray< T >::from_single(), blender::bke::GeometrySet::get_instances(), blender::bke::GeometrySet::has_instances(), blender::bke::Instances::instances_num(), blender::geometry::VariedDepthOptions::MAX_DEPTH, options, realize_instances(), and blender::geometry::VariedDepthOptions::selection.

Referenced by blender::create_array_copies(), blender::create_mirror_copies(), blender::duplicate_strokes(), join_component_type(), blender::ed::curves::join_objects_exec(), blender::ed::pointcloud::join_objects_exec(), blender::nodes::node_geo_grease_pencil_to_curves_cc::node_geo_exec(), blender::nodes::node_geo_realize_instances_cc::node_geo_exec(), realize_instances(), realize_instances(), and blender::geometry::tests::TEST_F().

◆ realize_instances() [2/2]

RealizeInstancesResult blender::geometry::realize_instances ( bke::GeometrySet geometry_set,
const RealizeInstancesOptions & options,
const VariedDepthOptions & varied_depth_option )

Same realize_instances but will realize only the instances chosen by varied_depth_option to there chosen depth.

Definition at line 2939 of file realize_instances.cc.

References blender::geometry::AllInstancesInfo::attribute_fallback, blender::geometry::AllCurvesInfo::attributes, blender::geometry::AllGreasePencilsInfo::attributes, blender::geometry::AllMeshesInfo::attributes, blender::geometry::AllPointCloudsInfo::attributes, blender::geometry::GatherTasks::bundles, blender::bke::InstancesComponent::copy(), blender::geometry::AllCurvesInfo::create_id_attribute, blender::geometry::AllMeshesInfo::create_id_attribute, blender::geometry::AllPointCloudsInfo::create_id_attribute, blender::geometry::GatherTasks::curve_tasks, blender::Default, blender::geometry::VariedDepthOptions::depths, blender::geometry::GatherTasks::edit_data_tasks, execute_instances_tasks(), execute_realize_curve_tasks(), execute_realize_edit_data_tasks(), execute_realize_grease_pencil_tasks(), execute_realize_mesh_tasks(), execute_realize_pointcloud_tasks(), blender::geometry::GatherTasks::first_volume, gather_generic_instance_attributes_to_propagate(), gather_realize_tasks_recursive(), blender::bke::GeometrySet::get_component_for_write(), get_final_points_num(), blender::geometry::GatherTasks::grease_pencil_tasks, blender::bke::GeometrySet::has_instances(), blender::MatBase< float, 4, 4 >::identity(), initialize_curves_builtin_attribute_defaults(), blender::geometry::GatherTasksInfo::instances, blender::geometry::GatherTasksInfo::instances_attriubutes, blender::geometry::AllInstancesInfo::instances_components_to_merge, blender::geometry::AllInstancesInfo::instances_components_transforms, blender::geometry::AllMeshesInfo::materials, blender::geometry::VariedDepthOptions::MAX_DEPTH, blender::threading::memory_bandwidth_bound_task(), blender::geometry::GatherTasks::mesh_tasks, options, blender::geometry::GatherTasks::pointcloud_tasks, preprocess_curves(), preprocess_grease_pencils(), preprocess_meshes(), preprocess_pointclouds(), PRF_scope, PRF_scope_with_name, propagate_instances_to_keep(), blender::geometry::GatherTasksInfo::r_offsets, blender::geometry::GatherTasksInfo::r_tasks, realize_instances(), remove_id_attribute_from_instances(), blender::result, blender::geometry::VariedDepthOptions::selection, and blender::geometry::OrderedAttributes::size().

◆ reassign_loose_edge_verts()

void blender::geometry::reassign_loose_edge_verts ( const int orig_verts_num,
const IndexMask & affected_verts,
const GroupedSpan< int > vert_to_edge_map,
const BitSpan loose_edges,
const BitSpan split_edges,
const Span< Vector< CornerGroup > > corner_groups,
const OffsetIndices< int > new_verts_by_affected_vert,
MutableSpan< int2 > edges )
static

Assign the newly created vertex duplicates to the loose edges around this vertex. Every split loose edge is reattached to a newly created vertex. If there are non-split loose edges attached to the vertex, they all reuse the original vertex.

Definition at line 489 of file mesh_split_edges.cc.

References calc_vert_loose_edges(), blender::index_mask::IndexMask::foreach_index(), blender::exec_mode::grain_size(), reassign_loose_edge_verts(), blender::geometry::VertLooseEdges::selected, blender::IndexRange::size(), split_edges(), swap_edge_vert(), and blender::geometry::VertLooseEdges::unselected.

Referenced by reassign_loose_edge_verts(), and split_edges().

◆ reinsert_modified_geometry_recursive()

◆ remap_edges()

void blender::geometry::remap_edges ( const OffsetIndices< int > src_faces,
const OffsetIndices< int > dst_faces,
const int src_edges_num,
const IndexMask & edge_mask,
const IndexMask & face_mask,
const Span< int > src_corner_edges,
MutableSpan< int > dst_corner_edges )
static

◆ remap_verts()

void blender::geometry::remap_verts ( const OffsetIndices< int > src_faces,
const OffsetIndices< int > dst_faces,
const int src_verts_num,
const IndexMask & vert_mask,
const IndexMask & edge_mask,
const IndexMask & face_mask,
const Span< int2 > src_edges,
const Span< int > src_corner_verts,
MutableSpan< int2 > dst_edges,
MutableSpan< int > dst_corner_verts )
static

◆ remove_id_attribute_from_instances()

◆ remove_points_and_split()

bke::CurvesGeometry blender::geometry::remove_points_and_split ( const bke::CurvesGeometry & curves,
const IndexMask & mask )

Remove the points in the point_mask and split each curve at the points that are removed (if necessary).

Definition at line 21 of file curves_remove_and_split.cc.

References blender::offset_indices::accumulate_counts_to_offsets(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), blender::bke::attribute_filter_from_skip_ref(), blender::bke::CurvesGeometry::attributes_for_write(), blender::BKE_defgroup_copy_list(), blender::array_utils::copy(), blender::bke::Curve, blender::bke::CurvesGeometry::curves_range(), blender::bke::CurvesGeometry::cyclic_for_write(), blender::MutableSpan< T >::drop_back(), blender::IndexRange::drop_front(), blender::array_utils::find_all_ranges(), blender::IndexRange::first(), blender::Vector< T, InlineBufferCapacity, Allocator >::first(), blender::bke::gather_attributes(), blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), blender::IndexRange::last(), blender::Vector< T, InlineBufferCapacity, Allocator >::last(), blender::NURBS_KNOT_MODE_NORMAL, blender::bke::CurvesGeometry::offsets_for_write(), blender::bke::Point, blender::bke::CurvesGeometry::remove_attributes_based_on_types(), remove_points_and_split(), blender::IndexRange::shift(), blender::IndexRange::size(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::bke::CurvesGeometry::update_curve_types(), blender::bke::curves::nurbs::update_custom_knot_modes(), and blender::CurvesGeometry::vertex_group_names.

Referenced by grease_pencil_remove_points_and_split(), and remove_points_and_split().

◆ reorder_and_flip_attributes_group_to_group()

◆ reorder_and_flip_curves()

◆ reorder_attribute_domain()

◆ reorder_attribute_groups()

◆ reorder_attributes_group_to_group()

◆ reorder_curves()

Curves * blender::geometry::reorder_curves ( const Curves & src_curves,
Span< int > old_by_new_map,
const bke::AttributeFilter & attribute_filter )

◆ reorder_curves_geometry()

◆ reorder_customdata()

◆ reorder_customdata_groups()

◆ reorder_instaces()

bke::Instances * blender::geometry::reorder_instaces ( const bke::Instances & src_instances,
Span< int > old_by_new_map,
const bke::AttributeFilter & attribute_filter )

◆ reorder_mesh()

◆ reorder_points()

PointCloud * blender::geometry::reorder_points ( const PointCloud & src_pointcloud,
Span< int > old_by_new_map,
const bke::AttributeFilter & attribute_filter )

◆ reordered_component()

◆ resample_to_count() [1/2]

CurvesGeometry blender::geometry::resample_to_count ( const CurvesGeometry & src_curves,
const fn::FieldContext & field_context,
const fn::Field< bool > & selection_field,
const fn::Field< int > & count_field,
const ResampleCurvesOutputAttributeIDs & output_ids = {} )

◆ resample_to_count() [2/2]

CurvesGeometry blender::geometry::resample_to_count ( const CurvesGeometry & src_curves,
const IndexMask & selection,
const VArray< int > & counts,
const ResampleCurvesOutputAttributeIDs & output_ids = {} )

◆ resample_to_evaluated() [1/2]

◆ resample_to_evaluated() [2/2]

CurvesGeometry blender::geometry::resample_to_evaluated ( const CurvesGeometry & src_curves,
const IndexMask & selection,
const ResampleCurvesOutputAttributeIDs & output_ids = {} )

Evaluate each selected curve to its implicit evaluated points.

Definition at line 566 of file resample_curves.cc.

References blender::offset_indices::accumulate_counts_to_offsets(), attribute, blender::BKE_defgroup_copy_list(), blender::index_mask::IndexMask::complement(), blender::bke::curves::nurbs::copy_custom_knots(), blender::offset_indices::copy_group_sizes(), blender::bke::curves::copy_only_curve_domain(), copy_or_defaults_for_unselected_curves(), blender::CURVE_TYPE_POLY, blender::bke::CurvesGeometry::curves_num(), blender::bke::CurvesGeometry::curves_range(), blender::GMutableSpan::data(), blender::geometry::AttributesForResample::dst, blender::geometry::AttributesForResample::dst_attributes, blender::geometry::AttributesForResample::dst_no_interpolation, blender::geometry::AttributesForResample::dst_normals, blender::geometry::AttributesForResample::dst_tangents, blender::bke::CurvesGeometry::ensure_can_interpolate_to_evaluated(), blender::bke::CurvesGeometry::evaluated_points_by_curve(), blender::bke::CurvesGeometry::evaluated_positions(), blender::bke::CurvesGeometry::fill_curve_types(), blender::index_mask::IndexMask::foreach_segment(), gather_point_attributes_to_interpolate(), blender::exec_mode::grain_size(), blender::bke::CurvesGeometry::interpolate_to_evaluated(), blender::IndexRange::is_empty(), blender::MutableSpan< T >::last(), normalize_curve_point_data(), blender::bke::CurvesGeometry::offsets_for_write(), blender::bke::CurvesGeometry::points_by_curve(), blender::bke::CurvesGeometry::positions_for_write(), resample_to_evaluated(), blender::bke::CurvesGeometry::resize(), blender::IndexRange::size(), blender::GMutableSpan::slice(), blender::offset_indices::OffsetIndices< T >::slice(), blender::Span< T >::slice(), blender::geometry::AttributesForResample::src, blender::geometry::AttributesForResample::src_evaluated_normals, blender::geometry::AttributesForResample::src_evaluated_tangents, blender::GMutableSpan::type(), blender::CPPType::value_initialize_n(), and blender::CurvesGeometry::vertex_group_names.

Referenced by blender::ed::greasepencil::convert_to_catmull_rom(), blender::ed::greasepencil::convert_to_poly(), blender::modifier::greasepencil::ensure_no_bezier_curves(), blender::io::grease_pencil::PDFExporter::export_grease_pencil_objects(), blender::nodes::node_geo_curve_resample_cc::node_geo_exec(), blender::nodes::node_geo_curve_to_points_cc::node_geo_exec(), resample_to_evaluated(), and resample_to_evaluated().

◆ resample_to_length() [1/2]

CurvesGeometry blender::geometry::resample_to_length ( const CurvesGeometry & src_curves,
const fn::FieldContext & field_context,
const fn::Field< bool > & selection_field,
const fn::Field< float > & segment_length_field,
const ResampleCurvesOutputAttributeIDs & output_ids = {},
bool keep_last_segment = false )

◆ resample_to_length() [2/2]

CurvesGeometry blender::geometry::resample_to_length ( const CurvesGeometry & src_curves,
const IndexMask & selection,
const VArray< float > & sample_lengths,
const ResampleCurvesOutputAttributeIDs & output_ids = {},
bool keep_last_segment = false )

Create new curves resampled to make each segment have the length specified by the #segment_length field input, rounded to make the length of each segment the same. The accuracy will depend on the curve's resolution parameter.

Parameters
keep_last_segmentIf false, curves that are too short are collapsed to a single point. If true, they will have at least one segment after resampling. This mainly exists for compatibility.

Definition at line 511 of file resample_curves.cc.

References blender::offset_indices::accumulate_counts_to_offsets(), blender::BKE_defgroup_copy_list(), blender::index_mask::IndexMask::complement(), blender::bke::curves::nurbs::copy_custom_knots(), blender::offset_indices::copy_group_sizes(), blender::bke::curves::copy_only_curve_domain(), blender::bke::CurvesGeometry::curves_num(), blender::bke::CurvesGeometry::curves_range(), blender::bke::CurvesGeometry::cyclic(), blender::bke::CurvesGeometry::ensure_evaluated_lengths(), blender::bke::CurvesGeometry::evaluated_length_total_for_curve(), blender::index_mask::IndexMask::foreach_index(), get_count_from_length(), blender::exec_mode::grain_size(), blender::IndexRange::is_empty(), blender::MutableSpan< T >::last(), blender::bke::CurvesGeometry::offsets_for_write(), blender::bke::CurvesGeometry::points_by_curve(), resample_to_length(), resample_to_uniform(), blender::bke::CurvesGeometry::resize(), and blender::CurvesGeometry::vertex_group_names.

Referenced by blender::io::grease_pencil::GreasePencilExporter::foreach_shape_in_layer(), blender::ed::greasepencil::grease_pencil_stroke_simplify_exec(), blender::modify_drawing(), blender::nodes::node_geo_curve_resample_cc::node_geo_exec(), blender::nodes::node_geo_curve_to_points_cc::node_geo_exec(), resample_to_length(), resample_to_length(), and blender::simplify_drawing().

◆ resample_to_uniform() [1/2]

◆ resample_to_uniform() [2/2]

void blender::geometry::resample_to_uniform ( const CurvesGeometry & src_curves,
const IndexMask & selection,
const ResampleCurvesOutputAttributeIDs & output_ids,
CurvesGeometry & dst_curves )
static

Definition at line 287 of file resample_curves.cc.

References blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), blender::MutableSpan< T >::as_span(), attribute, blender::index_mask::IndexMask::complement(), copy_or_defaults_for_unselected_curves(), blender::CURVE_TYPE_POLY, blender::bke::CurvesGeometry::curve_types(), blender::bke::CurvesGeometry::curves_range(), blender::bke::CurvesGeometry::cyclic(), blender::GMutableSpan::data(), blender::geometry::AttributesForResample::dst, blender::geometry::AttributesForResample::dst_attributes, blender::geometry::AttributesForResample::dst_no_interpolation, blender::geometry::AttributesForResample::dst_normals, blender::geometry::AttributesForResample::dst_tangents, blender::bke::CurvesGeometry::ensure_evaluated_lengths(), blender::bke::CurvesGeometry::evaluated_lengths_for_curve(), blender::bke::CurvesGeometry::evaluated_points_by_curve(), blender::bke::CurvesGeometry::evaluated_positions(), blender::bke::CurvesGeometry::fill_curve_types(), blender::index_mask::IndexMask::foreach_segment(), gather_point_attributes_to_interpolate(), blender::exec_mode::grain_size(), blender::length_parameterize::interpolate(), blender::bke::CurvesGeometry::interpolate_to_evaluated(), blender::IndexRange::is_empty(), blender::Span< T >::is_empty(), normalize_curve_point_data(), blender::bke::CurvesGeometry::points_by_curve(), blender::bke::CurvesGeometry::points_num(), blender::bke::CurvesGeometry::positions_for_write(), resample_to_uniform(), blender::geometry::EvalDataBuffer::resize(), blender::length_parameterize::sample_uniform(), blender::IndexRange::size(), blender::offset_indices::OffsetIndices< T >::size(), blender::GMutableSpan::slice(), blender::Span< T >::slice(), blender::geometry::AttributesForResample::src, blender::geometry::AttributesForResample::src_evaluated_normals, blender::geometry::AttributesForResample::src_evaluated_tangents, T, blender::bke::attribute_math::to_static_type(), blender::GMutableSpan::type(), and blender::CPPType::value_initialize_n().

Referenced by resample_to_count(), resample_to_count(), resample_to_length(), resample_to_length(), resample_to_uniform(), and resample_to_uniform().

◆ retrieve_attribute_spans() [1/2]

◆ retrieve_attribute_spans() [2/2]

◆ reverse_order()

◆ reverse_samples()

◆ rotate_inside_square()

bool blender::geometry::rotate_inside_square ( const Span< std::unique_ptr< UVAABBIsland > > island_indices,
const Span< PackIsland * > islands,
const UVPackIsland_Params & params,
const float scale,
const float margin,
MutableSpan< UVPhi > r_phis,
rctf * r_extent )
static

Find the minimum bounding square that encloses the UVs as specified in r_phis. If that square is smaller than r_extent, then update r_phis accordingly.

Returns
True if r_phis and r_extent are modified.

Definition at line 1542 of file uv_pack.cc.

References blender::geometry::PackIsland::aspect_y, blender::geometry::UVMinimumEnclosingSquareFinder::best_angle, blender::geometry::UVMinimumEnclosingSquareFinder::best_bounds, blender::geometry::UVMinimumEnclosingSquareFinder::best_quad, blender::BLI_convexhull_2d(), blender::BLI_rctf_size_x(), blender::BLI_rctf_size_y(), blender::geometry::PackIsland::build_transformation(), blender::geometry::PackIsland::can_scale_(), blender::Vector< T, InlineBufferCapacity, Allocator >::data(), DEG2RADF, blender::ED_UVPACK_ROTATION_ANY, blender::ED_UVPACK_SHAPE_AABB, get_aspect_scaled_extent(), blender::geometry::UVMinimumEnclosingSquareFinder::indices, blender::mul_m2_v2(), blender::mul_v2_m2v2(), blender::geometry::PackIsland::pivot_, blender::geometry::UVMinimumEnclosingSquareFinder::points, blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), rotate_inside_square(), blender::geometry::UVPackIsland_Params::rotate_method, scale(), blender::geometry::UVPackIsland_Params::shape_method, blender::geometry::UVPackIsland_Params::target_aspect_y, blender::geometry::PackIsland::triangle_vertices_, blender::geometry::UVMinimumEnclosingSquareFinder::update(), blender::geometry::UVMinimumEnclosingSquareFinder::update_recursive(), blender::rctf::xmax, blender::rctf::xmin, blender::rctf::ymax, and blender::rctf::ymin.

Referenced by pack_island_xatlas(), and rotate_inside_square().

◆ sample_bezier_curve_positions_handles()

void blender::geometry::sample_bezier_curve_positions_handles ( const bool cyclic,
const IndexRange src_points,
const Span< float3 > src_pos,
const Span< float3 > src_handle_left,
const Span< float3 > src_handle_right,
const Span< int8_t > src_types_left,
const Span< int8_t > src_types_right,
const Span< int > dst_indices,
const Span< float > dst_factors,
const IndexRange dst_points,
MutableSpan< float3 > dst_pos,
MutableSpan< float3 > dst_left,
MutableSpan< float3 > dst_right,
MutableSpan< int8_t > dst_types_left,
MutableSpan< int8_t > dst_types_right )
static

◆ sample_catmull_rom_curve_positions_handles()

void blender::geometry::sample_catmull_rom_curve_positions_handles ( const bool cyclic,
const IndexRange src_points,
const Span< float3 > src_pos,
const Span< int > dst_indices,
const Span< float > dst_factors,
const IndexRange dst_points,
const int8_t dst_type,
MutableSpan< float3 > dst_pos,
MutableSpan< float3 > dst_left,
MutableSpan< float3 > dst_right,
MutableSpan< int8_t > dst_types_left,
MutableSpan< int8_t > dst_types_right )
static

◆ sample_curve_attribute()

◆ sample_curve_padded() [1/2]

void blender::geometry::sample_curve_padded ( const bke::CurvesGeometry & curves,
int curve_index,
bool cyclic,
bool reverse,
MutableSpan< int > r_indices,
MutableSpan< float > r_factors )

Assign source point indices and interpolation factors to target points for a single curve.

Parameters
curvesSource curves geometry to sample.
curve_indexIndex of the source curve to sample.
cyclicTrue if the source curve is cyclic.
reverseTrue if the curve should be sampled in reverse direction.
r_indicesOutput array of point indices of the source curve.
r_factorsOutput array of interpolation factors between a source point and the next.

Definition at line 206 of file interpolate_curves.cc.

References blender::BLI_assert(), blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), reverse_samples(), sample_curve_padded(), blender::MutableSpan< T >::size(), and blender::Span< T >::size().

◆ sample_curve_padded() [2/2]

void blender::geometry::sample_curve_padded ( const Span< float3 > positions,
bool cyclic,
MutableSpan< int > r_indices,
MutableSpan< float > r_factors )

◆ sample_curve_positions_and_handles()

void blender::geometry::sample_curve_positions_and_handles ( const bke::CurvesGeometry & src_curves,
const Span< int > src_curve_indices,
const OffsetIndices< int > dst_points_by_curve,
const VArray< int8_t > dst_types,
const IndexMask & dst_curve_mask,
const Span< int > dst_sample_indices,
const Span< float > dst_sample_factors,
MutableSpan< float3 > dst_positions,
MutableSpan< float3 > dst_handles_left,
MutableSpan< float3 > dst_handles_right,
MutableSpan< int8_t > dst_handle_types_left,
MutableSpan< int8_t > dst_handle_types_right )
static

◆ sample_curve_uniform()

void blender::geometry::sample_curve_uniform ( const bke::CurvesGeometry & curves,
const int curve_index,
const bool cyclic,
const bool reverse,
MutableSpan< int > r_segment_indices,
MutableSpan< float > r_factors )
static

◆ sample_interval_bezier()

template<bool include_start_point = true>
void blender::geometry::sample_interval_bezier ( const Span< float3 > src_positions,
const Span< float3 > src_handles_l,
const Span< float3 > src_handles_r,
const Span< int8_t > src_types_l,
const Span< int8_t > src_types_r,
MutableSpan< float3 > dst_positions,
MutableSpan< float3 > dst_handles_l,
MutableSpan< float3 > dst_handles_r,
MutableSpan< int8_t > dst_types_l,
MutableSpan< int8_t > dst_types_r,
bke::curves::IndexRangeCyclic src_range,
const IndexRange dst_range,
const bke::curves::CurvePoint start_point,
const bke::curves::CurvePoint end_point )
static

◆ sample_interval_catmull_rom()

template<typename T>
void blender::geometry::sample_interval_catmull_rom ( const Span< T > src_data,
MutableSpan< T > dst_data,
bke::curves::IndexRangeCyclic src_range,
const IndexRange dst_range,
const bke::curves::CurvePoint start_point,
const bke::curves::CurvePoint end_point,
const bool src_cyclic )
static

◆ sample_interval_linear()

template<typename T, bool include_start_point = true>
void blender::geometry::sample_interval_linear ( const Span< T > src_data,
MutableSpan< T > dst_data,
bke::curves::IndexRangeCyclic src_range,
const IndexRange dst_range,
const bke::curves::CurvePoint start_point,
const bke::curves::CurvePoint end_point )
static

Sample source curve data in the interval defined by the points [start_point, end_point]. Uses linear interpolation to compute the endpoints.

Template Parameters
include_start_pointIf False, the 'start_point' point sample will not be copied and not accounted for in the destination range.
Parameters
src_dataSource to sample from.
dst_dataDestination to write samples to.
src_rangeInterval within [start_point, end_point] to copy from the source point domain.
dst_rangeInterval to copy point data to in the destination buffer.
start_pointPoint on the source curve to start sampling from.
end_pointLast point to sample in the source curve.

Definition at line 307 of file trim_curves.cc.

References blender::BLI_assert(), copy_point_data_between_endpoints(), blender::bke::curves::IndexRangeCyclic::drop_front(), blender::IndexRange::first(), blender::bke::curves::CurveSegment::index, blender::bke::curves::CurvePoint::is_controlpoint(), blender::bke::attribute_math::mix2(), blender::bke::curves::CurveSegment::next_index, blender::IndexRange::one_after_last(), blender::bke::curves::CurvePoint::parameter, sample_interval_linear(), and blender::IndexRange::size().

Referenced by sample_interval_linear(), trim_evaluated_curves(), and trim_polygonal_curves().

◆ sample_poly_curve_positions_handles()

void blender::geometry::sample_poly_curve_positions_handles ( const bool cyclic,
const Span< float3 > src_pos,
const Span< int > dst_indices,
const Span< float > dst_factors,
const IndexRange dst_points,
const int8_t dst_type,
MutableSpan< float3 > dst_pos,
MutableSpan< float3 > dst_left,
MutableSpan< float3 > dst_right,
MutableSpan< int8_t > dst_types_left,
MutableSpan< int8_t > dst_types_right )
static

◆ scale_input_assign()

template<typename T>
void blender::geometry::scale_input_assign ( const Span< T > src,
const int scale,
const int offset,
MutableSpan< T > dst )
static

◆ seed_from_curves()

int blender::geometry::seed_from_curves ( const bke::CurvesGeometry & curves)
static

Definition at line 66 of file randomize.cc.

References seed_from_curves().

Referenced by debug_randomize_curve_order(), and seed_from_curves().

◆ seed_from_instances()

int blender::geometry::seed_from_instances ( const bke::Instances & instances)
static

◆ seed_from_mesh()

int blender::geometry::seed_from_mesh ( const Mesh & mesh)
static

We can't use a fully random seed, because then the randomization wouldn't be deterministic, which is important to avoid causing issues when determinism is expected. Using a single constant seed is not ideal either, because then two geometries might be randomized equally or very similar. Ideally, the seed would be a hash of everything that feeds into the geometry processing algorithm before the randomization, but that's too expensive. Just use something simple but correct for now.

Definition at line 56 of file randomize.cc.

References seed_from_mesh().

Referenced by debug_randomize_edge_order(), debug_randomize_face_order(), debug_randomize_vert_order(), and seed_from_mesh().

◆ seed_from_pointcloud()

int blender::geometry::seed_from_pointcloud ( const PointCloud & pointcloud)
static

◆ separate_curves_selection()

◆ separate_geometry()

void blender::geometry::separate_geometry ( bke::GeometrySet & geometry_set,
bke::AttrDomain domain,
GeometryNodeDeleteGeometryMode mode,
const fn::Field< bool > & selection_field,
const bke::AttributeFilter & attribute_filter,
bool & r_is_error )

Returns the parts of the geometry that are on the selection for the given domain. If the domain is not applicable for the component, e.g. face domain for point cloud, nothing happens to that component. If no component can work with the domain, then error_message is set to true.

Definition at line 179 of file separate_geometry.cc.

References blender::bke::Curve, blender::bke::curves_copy_parameters(), blender::bke::curves_new_nomain(), delete_selected_instances(), ELEM, blender::bke::GeometrySet::get_curves(), blender::bke::GeometrySet::get_grease_pencil(), blender::bke::GeometrySet::get_grease_pencil_for_write(), blender::bke::GeometrySet::get_mesh(), blender::bke::GeometrySet::get_pointcloud(), blender::bke::GeometrySet::has_instances(), blender::bke::GeometrySet::has_realized_data(), blender::bke::Instance, blender::bke::Layer, blender::bke::Point, blender::bke::GeometrySet::remove(), blender::bke::GeometrySet::replace_curves(), blender::bke::GeometrySet::replace_grease_pencil(), blender::bke::GeometrySet::replace_mesh(), blender::bke::GeometrySet::replace_pointcloud(), separate_curves_selection(), separate_geometry(), separate_grease_pencil_layer_selection(), separate_mesh_selection(), separate_pointcloud_selection(), blender::bke::greasepencil::Drawing::strokes(), blender::bke::greasepencil::Drawing::strokes_for_write(), and blender::bke::greasepencil::Drawing::tag_topology_changed().

Referenced by blender::nodes::node_geo_delete_geometry_cc::node_geo_exec(), blender::nodes::node_geo_separate_geometry_cc::node_geo_exec(), and separate_geometry().

◆ separate_grease_pencil_layer_selection()

◆ separate_mesh_selection()

◆ separate_pointcloud_selection()

◆ sharing_info_equal()

bool blender::geometry::sharing_info_equal ( const ImplicitSharingInfo * a,
const ImplicitSharingInfo * b )
static

Definition at line 24 of file mix_geometries.cc.

References b, and sharing_info_equal().

Referenced by create_id_index_map(), and sharing_info_equal().

◆ signed_distance_fat_triangle()

float blender::geometry::signed_distance_fat_triangle ( const float2 probe,
const float2 uv0,
const float2 uv1,
const float2 uv2 )
static

◆ simplify_curve_attribute()

◆ sincos_plusminus_90()

float2 blender::geometry::sincos_plusminus_90 ( const float2 & sincos)
static

Rounding helper for "D4" transforms, snapping to -90, 0 & 90 degrees.

Definition at line 225 of file uv_pack.cc.

References DEG2RADF, eps, fabsf, blender::result, sincos(), sincos_plusminus_90(), and sincos_wrap().

Referenced by sincos_plusminus_90().

◆ sincos_rotate_90()

float2 blender::geometry::sincos_rotate_90 ( const float2 & sincos)
static

Add 90 degrees to the angle.

Definition at line 205 of file uv_pack.cc.

References sincos(), and sincos_rotate_90().

Referenced by sincos_rotate_90().

◆ sincos_wrap()

float2 blender::geometry::sincos_wrap ( const float2 & sincos)
static

Wrap the angle into the [-90, 90] degree range.

Angles of exactly +/-90 degrees are negated, matching the previous angle based logic where float(M_PI_2) being slightly larger than M_PI_2 wrapped these to the opposite sign.

Definition at line 216 of file uv_pack.cc.

References sincos(), and sincos_wrap().

Referenced by sincos_plusminus_90(), and sincos_wrap().

◆ skip_transform()

◆ smooth_curve_attribute() [1/2]

◆ smooth_curve_attribute() [2/2]

◆ smooth_curve_positions() [1/2]

◆ smooth_curve_positions() [2/2]

void blender::geometry::smooth_curve_positions ( bke::CurvesGeometry & curves,
const IndexMask & curves_to_smooth,
const VArray< bool > & point_selection,
int iterations,
float influence,
bool smooth_ends,
bool keep_shape )

◆ sort_indices_by_weights()

◆ sort_tris_into_rows()

void blender::geometry::sort_tris_into_rows ( const Span< float2 > uv_map,
const Span< int3 > corner_tris,
const int resolution,
threading::EnumerableThreadSpecific< LocalData > & data_per_thread )
static

Add each triangle to the rows that it is in. After this, the information about each row is still scattered across multiple thread-specific lists. Those separate lists are then joined in a separate step.

Definition at line 92 of file reverse_uv_sampler.cc.

References blender::Span< T >::index_range(), blender::threading::parallel_for(), and sort_tris_into_rows().

Referenced by blender::geometry::ReverseUVSampler::ReverseUVSampler(), and sort_tris_into_rows().

◆ sphere_corner_total()

int blender::geometry::sphere_corner_total ( const int segments,
const int rings )
static

Definition at line 49 of file mesh_primitive_uv_sphere.cc.

References sphere_corner_total().

Referenced by create_uv_sphere_mesh(), and sphere_corner_total().

◆ sphere_edge_total()

int blender::geometry::sphere_edge_total ( const int segments,
const int rings )
static

Definition at line 44 of file mesh_primitive_uv_sphere.cc.

References sphere_edge_total().

Referenced by create_uv_sphere_mesh(), and sphere_edge_total().

◆ sphere_face_total()

int blender::geometry::sphere_face_total ( const int segments,
const int rings )
static

Definition at line 56 of file mesh_primitive_uv_sphere.cc.

References sphere_face_total().

Referenced by create_uv_sphere_mesh(), and sphere_face_total().

◆ sphere_vert_total()

int blender::geometry::sphere_vert_total ( const int segments,
const int rings )
static

◆ split_edges()

◆ subdivide_attribute_catmull_rom()

void blender::geometry::subdivide_attribute_catmull_rom ( const OffsetIndices< int > src_points_by_curve,
const OffsetIndices< int > dst_points_by_curve,
const IndexMask & selection,
const Span< int > all_point_offsets,
const Span< bool > cyclic,
const GSpan src,
GMutableSpan dst )
static

◆ subdivide_attribute_linear() [1/2]

void blender::geometry::subdivide_attribute_linear ( const OffsetIndices< int > src_points_by_curve,
const OffsetIndices< int > dst_points_by_curve,
const IndexMask & selection,
const Span< int > all_point_offsets,
const GSpan src,
GMutableSpan dst )
static

◆ subdivide_attribute_linear() [2/2]

◆ subdivide_bezier_positions()

void blender::geometry::subdivide_bezier_positions ( const Span< float3 > src_positions,
const Span< int8_t > src_types_l,
const Span< int8_t > src_types_r,
const Span< float3 > src_handles_l,
const Span< float3 > src_handles_r,
const OffsetIndices< int > evaluated_offsets,
const bool cyclic,
MutableSpan< float3 > dst_positions,
MutableSpan< int8_t > dst_types_l,
MutableSpan< int8_t > dst_types_r,
MutableSpan< float3 > dst_handles_l,
MutableSpan< float3 > dst_handles_r )
static

◆ subdivide_bezier_segment()

◆ subdivide_curves()

bke::CurvesGeometry blender::geometry::subdivide_curves ( const bke::CurvesGeometry & src_curves,
const IndexMask & selection,
const VArray< int > & cuts,
const bke::AttributeFilter & attribute_filter = {} )

Add more points along each segment, with the amount of points to add in each segment described by the #cuts input. The new points are equidistant in parameter space, but not in the actual distances.

Parameters
selectionA selection of curves to consider when subdividing.

Definition at line 288 of file subdivide_curves.cc.

References attribute, blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), blender::BKE_defgroup_copy_list(), calculate_result_offsets(), blender::index_mask::IndexMask::complement(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), blender::bke::curves::nurbs::copy_custom_knots(), blender::array_utils::copy_group_to_group(), blender::bke::curves::copy_only_curve_domain(), blender::bke::CurvesGeometry::curve_type_counts(), blender::bke::CurvesGeometry::curve_types(), blender::bke::CurvesGeometry::curves_num(), blender::bke::CurvesGeometry::curves_range(), blender::bke::CurvesGeometry::cyclic(), blender::Array< T, InlineBufferCapacity, Allocator >::fill(), blender::bke::curves::foreach_curve_by_type(), blender::index_mask::IndexMask::foreach_index(), blender::exec_mode::grain_size(), blender::bke::CurvesGeometry::handle_positions_left(), blender::bke::CurvesGeometry::handle_positions_left_for_write(), blender::bke::CurvesGeometry::handle_positions_right(), blender::bke::CurvesGeometry::handle_positions_right_for_write(), blender::bke::CurvesGeometry::handle_types_left(), blender::bke::CurvesGeometry::handle_types_left_for_write(), blender::bke::CurvesGeometry::handle_types_right(), blender::bke::CurvesGeometry::handle_types_right_for_write(), blender::bke::CurvesGeometry::is_empty(), blender::bke::CurvesGeometry::offsets(), blender::bke::CurvesGeometry::offsets_for_write(), blender::bke::curves::per_curve_point_offsets_range(), blender::bke::Point, blender::bke::CurvesGeometry::points_by_curve(), blender::bke::CurvesGeometry::points_num(), blender::bke::CurvesGeometry::positions(), blender::bke::CurvesGeometry::positions_for_write(), blender::bke::CurvesGeometry::resize(), blender::bke::retrieve_attributes_for_transfer(), blender::blender::Span< T >::slice(), blender::MutableSpan< T >::slice(), blender::Span< T >::slice(), subdivide_attribute_catmull_rom(), subdivide_attribute_linear(), subdivide_bezier_positions(), subdivide_curves(), and blender::CurvesGeometry::vertex_group_names.

Referenced by blender::ed::curves::subdivide::exec(), blender::ed::greasepencil::gpencil_stroke_subdivide_exec(), subdivide_curves(), blender::nodes::node_geo_curve_subdivide_cc::subdivide_curves(), blender::subdivide_drawing(), blender::nodes::node_geo_curve_subdivide_cc::subdivide_grease_pencil_curves(), blender::ed::greasepencil::subdivide_last_segment(), and blender::ed::sculpt_paint::greasepencil::subdivide_stroke().

◆ swap_edge_vert()

void blender::geometry::swap_edge_vert ( int2 & edge,
const int old_vert,
const int new_vert )
static

Definition at line 474 of file mesh_split_edges.cc.

References swap_edge_vert().

Referenced by reassign_loose_edge_verts(), and swap_edge_vert().

◆ threaded_copy()

◆ threaded_fill()

◆ to_bezier_size()

int blender::geometry::to_bezier_size ( const CurveType src_type,
const bool cyclic,
const KnotsMode knots_mode,
const int src_size )
static

◆ to_nurbs_size()

int blender::geometry::to_nurbs_size ( const CurveType src_type,
const int src_size )
static

◆ toposort_connected_curves()

◆ transform_curve_edit_hints()

◆ transform_geometry()

◆ transform_gizmo_edit_hints()

void blender::geometry::transform_gizmo_edit_hints ( bke::GizmoEditHints & edit_hints,
const float4x4 & transform )
static

◆ transform_grease_pencil_edit_hints()

◆ transform_grease_pencil_layers()

void blender::geometry::transform_grease_pencil_layers ( Span< bke::greasepencil::Layer * > layers,
const float4x4 & transform )
static

◆ transform_greasepencil()

void blender::geometry::transform_greasepencil ( GreasePencil & grease_pencil,
const float4x4 & transform )
static

Definition at line 89 of file geometry/intern/transform.cc.

References layer, and transform_greasepencil().

Referenced by transform_geometry(), and transform_greasepencil().

◆ transform_instances()

void blender::geometry::transform_instances ( bke::Instances & instances,
const float4x4 & transform )
static

◆ transform_mesh()

◆ transform_pointcloud()

void blender::geometry::transform_pointcloud ( PointCloud & pointcloud,
const float4x4 & transform )
static

◆ transform_volume()

◆ transformation_from_sincos()

void blender::geometry::transformation_from_sincos ( const float2 & sincos,
const float aspect_y,
float r_matrix[2][2] )
static

Equivalent to #PackIsland::build_transformation.

Definition at line 240 of file uv_pack.cc.

References sincos(), and transformation_from_sincos().

Referenced by transformation_from_sincos().

◆ translate_curve_edit_hints()

void blender::geometry::translate_curve_edit_hints ( bke::CurvesEditHints & edit_hints,
const float3 & translation )
static

◆ translate_geometry()

◆ translate_gizmos_edit_hints()

void blender::geometry::translate_gizmos_edit_hints ( bke::GizmoEditHints & edit_hints,
const float3 & translation )
static

◆ translate_greasepencil()

void blender::geometry::translate_greasepencil ( GreasePencil & grease_pencil,
const float3 translation )
static

◆ translate_instances()

void blender::geometry::translate_instances ( bke::Instances & instances,
const float3 translation )
static

◆ translate_pointcloud()

◆ translate_positions()

void blender::geometry::translate_positions ( MutableSpan< float3 > positions,
const float3 & translation )
static

◆ translate_volume()

void blender::geometry::translate_volume ( Volume & volume,
const float3 translation )
static

◆ tri_to_cell_bounds()

Bounds< int2 > blender::geometry::tri_to_cell_bounds ( const int3 & tri,
const int resolution,
const Span< float2 > uv_map )
static

◆ tri_to_ordered()

int3 blender::geometry::tri_to_ordered ( const int3 tri)
static

Definition at line 400 of file mesh_triangulate.cc.

References tri_to_ordered().

Referenced by tri_to_ordered(), and tris_in_set().

◆ tri_to_ordered_tri()

Span< int3 > blender::geometry::tri_to_ordered_tri ( MutableSpan< int3 > tris)
static

◆ trim_attribute_linear()

void blender::geometry::trim_attribute_linear ( const bke::CurvesGeometry & src_curves,
bke::CurvesGeometry & dst_curves,
const IndexMask & selection,
const Span< bke::curves::CurvePoint > start_points,
const Span< bke::curves::CurvePoint > end_points,
const Span< bke::curves::IndexRangeCyclic > src_ranges,
MutableSpan< bke::AttributeTransferData > transfer_attributes )
static

◆ trim_bezier_curves()

◆ trim_catmull_rom_curves()

◆ trim_curves()

bke::CurvesGeometry blender::geometry::trim_curves ( const bke::CurvesGeometry & src_curves,
const IndexMask & selection,
const VArray< float > & starts,
const VArray< float > & ends,
GeometryNodeCurveSampleMode mode,
const bke::AttributeFilter & attribute_filter )

Definition at line 955 of file trim_curves.cc.

References blender::offset_indices::accumulate_counts_to_offsets(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), attribute, blender::bke::attribute_filter_with_skip_ref(), blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), blender::BLI_assert(), blender::index_mask::IndexMask::complement(), compute_curve_trim_parameters(), blender::bke::copy_attributes_group_to_group(), blender::offset_indices::copy_group_sizes(), blender::bke::curves::copy_only_curve_domain(), blender::bke::CurvesGeometry::curve_type_counts(), blender::CURVE_TYPE_NURBS, blender::CURVE_TYPE_POLY, blender::bke::CurvesGeometry::curve_types(), blender::bke::CurvesGeometry::curves_num(), blender::bke::CurvesGeometry::curves_range(), blender::Default, blender::bke::CurvesGeometry::ensure_evaluated_lengths(), blender::bke::CurvesGeometry::evaluated_positions(), blender::bke::CurvesGeometry::fill_curve_types(), blender::bke::curves::foreach_curve_by_type(), blender::bke::CurvesGeometry::has_curve_with_type(), blender::index_mask::IndexMask::is_empty(), blender::index_mask::IndexMask::last(), blender::bke::MutableAttributeAccessor::lookup_for_write_span(), blender::index_mask::masked_fill(), blender::bke::CurvesGeometry::nurbs_has_custom_knots(), blender::NURBS_KNOT_MODE_NORMAL, blender::bke::CurvesGeometry::offsets(), blender::bke::CurvesGeometry::offsets_for_write(), blender::bke::Point, blender::bke::CurvesGeometry::points_by_curve(), PRF_scope, blender::bke::MutableAttributeAccessor::remove(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove(), blender::bke::CurvesGeometry::remove_attributes_based_on_types(), blender::bke::CurvesGeometry::resize(), blender::bke::retrieve_attributes_for_transfer(), blender::index_mask::IndexMask::size(), blender::VArrayCommon< T >::size(), blender::bke::CurvesGeometry::tag_topology_changed(), trim_bezier_curves(), trim_catmull_rom_curves(), trim_curves(), trim_evaluated_curves(), trim_polygonal_curves(), and blender::bke::curves::nurbs::update_custom_knot_modes().

Referenced by blender::deform_drawing(), blender::ed::sculpt_paint::CutOperationExecutor::execute(), trim_curves(), and blender::nodes::node_geo_curve_trim_cc::trim_curves().

◆ trim_evaluated_curves()

◆ trim_polygonal_curves()

◆ trim_sample_length()

float blender::geometry::trim_sample_length ( const Span< float > accumulated_lengths,
const float sample_length,
const GeometryNodeCurveSampleMode mode )
static

◆ tris_in_set()

IndexMask blender::geometry::tris_in_set ( const IndexMask & tri_mask,
const OffsetIndices< int > faces,
const Span< int > corner_verts,
const VectorSet< TriKey, 4, DefaultProbingStrategy, FaceHash, FacesEquality, SimpleVectorSetSlot< TriKey, int > > & unique_tris,
IndexMaskMemory & memory )
static

◆ try_join_single_value_attribute() [1/2]

◆ try_join_single_value_attribute() [2/2]

◆ update_corner_verts()

void blender::geometry::update_corner_verts ( const int orig_verts_num,
const Span< Vector< CornerGroup > > corner_groups,
const OffsetIndices< int > new_verts_by_affected_vert,
MutableSpan< int > new_corner_verts )
static

Update corner verts so that each group of corners gets its own vertex. For the last "new vertex" we can reuse the original vertex, which would otherwise become unused by any faces. The loose edge case will have to deal with this later.

Definition at line 316 of file mesh_split_edges.cc.

References blender::threading::parallel_for(), and update_corner_verts().

Referenced by split_edges(), and update_corner_verts().

◆ update_hole_rotate()

void blender::geometry::update_hole_rotate ( float2 & hole,
float2 & hole_diagonal,
bool & hole_rotate,
const float u0,
const float v0,
const float u1,
const float v1 )
static

Helper function for pack_islands_alpaca_rotate

The "Hole" is an AABB region of the UV plane that is stored in an unusual way.

Parameters
holeis the XY position of lower left corner of the AABB.
hole_diagonalis the extent of the AABB, possibly flipped.
hole_rotateis a boolean value, tracking if hole_diagonal is flipped.

Given an alternate AABB specified by (u0, v0, u1, v1), the helper will update the Hole to the candidate location if it is larger.

Definition at line 552 of file uv_pack.cc.

References blender::BLI_assert(), UNUSED_VARS, and update_hole_rotate().

Referenced by pack_islands_alpaca_rotate(), and update_hole_rotate().

◆ update_unselected_edges()

void blender::geometry::update_unselected_edges ( const OffsetIndices< int > faces,
const Span< int > corner_verts,
const GroupedSpan< int > edge_to_corner_map,
const Span< int > corner_to_face_map,
const IndexMask & unselected_edges,
MutableSpan< int2 > edges )
static

◆ use_debug_randomization()

◆ uv_find_pin_index()

◆ uv_parametrizer_aspect_ratio()

◆ uv_parametrizer_average()

◆ uv_parametrizer_construct_end()

◆ uv_parametrizer_edge_set_seam()

◆ uv_parametrizer_face_add()

◆ uv_parametrizer_flush()

◆ uv_parametrizer_flush_restore()

◆ uv_parametrizer_is_slim()

bool blender::geometry::uv_parametrizer_is_slim ( const ParamHandle * phandle)

◆ uv_parametrizer_lscm_begin()

◆ uv_parametrizer_lscm_end()

◆ uv_parametrizer_lscm_solve()

◆ uv_parametrizer_original_bounds()

◆ uv_parametrizer_pack()

void blender::geometry::uv_parametrizer_pack ( ParamHandle * handle,
const UVPackIsland_Params & params )

◆ uv_parametrizer_scale_x()

void blender::geometry::uv_parametrizer_scale_x ( ParamHandle * phandle,
const float scale_x )
static

◆ uv_parametrizer_slim_live_begin()

◆ uv_parametrizer_slim_live_end()

◆ uv_parametrizer_slim_live_solve_iteration()

◆ uv_parametrizer_slim_solve()

void blender::geometry::uv_parametrizer_slim_solve ( ParamHandle * phandle,
const ParamSlimOptions * slim_options,
bool use_original_bounds,
int * count_changed,
int * count_failed )

◆ uv_parametrizer_slim_stretch_iteration()

void blender::geometry::uv_parametrizer_slim_stretch_iteration ( ParamHandle * phandle,
float blend )

◆ uv_parametrizer_stretch_begin()

◆ uv_parametrizer_stretch_blend()

◆ uv_parametrizer_stretch_end()

◆ uv_parametrizer_stretch_iter()

◆ uv_prepare_pin_index()

◆ uv_to_cell()

int2 blender::geometry::uv_to_cell ( const float2 & uv,
const int resolution )
static

◆ valid_int_num()

◆ vert_selection_from_edge()

◆ vert_selection_from_face()

IndexMask blender::geometry::vert_selection_from_face ( OffsetIndices< int > faces,
const IndexMask & face_mask,
Span< int > corner_verts,
int verts_num,
IndexMaskMemory & memory )

◆ weld_face_corner_ctx_alloc()

void blender::geometry::weld_face_corner_ctx_alloc ( const OffsetIndices< int > faces,
const Span< int > corner_verts,
WeldMesh * r_weld_mesh )
static

Build the context weld faces and the corner links for them.

Returns
r_weld_mesh: Corner and face members will be allocated here.

Definition at line 336 of file mesh_merge_verts.cc.

References blender::IndexMask::from_predicate(), blender::offset_indices::OffsetIndices< T >::index_range(), blender::geometry::WeldMesh::vert_affected, and weld_face_corner_ctx_alloc().

Referenced by weld_face_corner_ctx_alloc(), and weld_mesh_context_create().

◆ weld_face_corner_ctx_setup_collapsed_and_split()

void blender::geometry::weld_face_corner_ctx_setup_collapsed_and_split ( const Span< int > corner_verts,
const Span< int > corner_edges,
const int remaining_edge_ctx_num,
WeldMesh * r_weld_mesh )
static

◆ weld_face_find_doubles()

◆ weld_face_split_recursive()

◆ weld_mesh_context_create()

◆ zero_degenerate_radii()

void blender::geometry::zero_degenerate_radii ( const Span< float3 > directions,
const Span< float > angles,
MutableSpan< float > radii )
static

The result isn't well defined for a fully reversed direction (the arc would be infinitely far away) or when a neighboring segment has zero length. Use zero radius for those points so their fillet points stay at the original position.

Definition at line 113 of file fillet_curves.cc.

References blender::MutableSpan< T >::index_range(), blender::math::is_zero(), blender::IndexRange::last(), and zero_degenerate_radii().

Referenced by fillet_curves(), and zero_degenerate_radii().

Variable Documentation

◆ CORR_ZERO_AREA_EPS

const float blender::geometry::CORR_ZERO_AREA_EPS = 1.0e-10f
static

◆ max_neighbors

int blender::geometry::max_neighbors = 5
staticconstexpr

Definition at line 42 of file add_curves_on_mesh.cc.

Referenced by find_curve_neighbors().

◆ P_NGON_STACK_NUM

int blender::geometry::P_NGON_STACK_NUM = 32
staticconstexpr

Definition at line 117 of file uv_parametrizer.cc.

◆ PHashSizes

int blender::geometry::PHashSizes[]
static
Initial value:
= {
1, 3, 5, 11, 17, 37, 67, 131, 257, 521,
1031, 2053, 4099, 8209, 16411, 32771, 65537, 131101, 262147, 524309,
1048583, 2097169, 4194319, 8388617, 16777259, 33554467, 67108879, 134217757, 268435459,
}

Definition at line 194 of file uv_parametrizer.cc.

Referenced by phash_insert(), and phash_new().