Blender V4.3
blender::geometry Namespace Reference

Namespaces

namespace  boolean
 
namespace  curve_constraints
 
namespace  tests
 

Classes

struct  AddCurvesOnMeshInputs
 
struct  AddCurvesOnMeshOutputs
 
struct  AllCurvesInfo
 
struct  AllGreasePencilsInfo
 
struct  AllInstancesInfo
 
struct  AllMeshesInfo
 
struct  AllPointCloudsInfo
 
struct  AttributeFallbacksArray
 
struct  AttributesForInterpolation
 
struct  AttributesForResample
 
struct  ConeAttributeOutputs
 
struct  ConeConfig
 
struct  ConvertCurvesOptions
 
struct  CuboidConfig
 
struct  CurveFromEdgesOutput
 
struct  CurvesElementStartIndices
 
struct  EvalDataBuffer
 
struct  GatherOffsets
 
struct  GatherTasks
 
struct  GatherTasksInfo
 
struct  GeoUVPinIndex
 
struct  GreasePencilRealizeInfo
 
struct  InstanceContext
 
struct  LocalData
 
struct  LocalRowData
 
struct  MeshElementStartIndices
 
struct  MeshRealizeInfo
 
struct  MeshToVolumeResolution
 
struct  NeighborCurve
 
class  Occupancy
 
struct  OrderedAttributes
 
class  OverlapMerger
 
struct  PAbfSystem
 
class  PackIsland
 
class  ParamHandle
 
struct  ParamSlimOptions
 
struct  PChart
 
struct  PEdge
 
struct  PFace
 
struct  PHash
 
struct  PHashLink
 
struct  PointCloudRealizeInfo
 
struct  PropagationAttribute
 
struct  PVert
 
struct  RealizeCurveInfo
 
struct  RealizeCurveTask
 
struct  RealizeEditDataTask
 
struct  RealizeGreasePencilTask
 
struct  RealizeInstancesOptions
 
struct  RealizeMeshTask
 
struct  RealizePointCloudTask
 
struct  ResampleCurvesOutputAttributeIDs
 
class  ReverseUVSampler
 
struct  Row
 
struct  TransformGeometryErrors
 
struct  TriWithRange
 
class  UVAABBIsland
 
class  UVMinimumEnclosingSquareFinder
 
class  UVPackIsland_Params
 
class  UVPhi
 
struct  VariedDepthOptions
 
struct  VertLooseEdges
 
struct  WeldEdge
 
struct  WeldLoop
 
struct  WeldLoopOfPolyIter
 
struct  WeldMesh
 
struct  WeldPoly
 
struct  WeldVertexCluster
 

Typedefs

using ParamKey = uintptr_t
 
using NeighborCurves = Vector<NeighborCurve, max_neighbors>
 
using CornerGroup = Vector<int>
 
using PHashKey = uintptr_t
 

Enumerations

enum class  ConeFillType { None = 0 , NGon = 1 , Triangles = 2 }
 
enum  PHandleState { PHANDLE_STATE_ALLOCATED , PHANDLE_STATE_CONSTRUCTED , PHANDLE_STATE_LSCM , PHANDLE_STATE_STRETCH }
 
enum  Flag { OnStack = 1 , Inserted = 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 }
 

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 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)
 
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, const float mix_factor, bke::CurvesGeometry &dst_curves)
 
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)
 
void join_attributes (const Span< const bke::GeometryComponent * > src_components, bke::GeometryComponent &r_result, const Span< StringRef > ignored_attributes={})
 
bke::CurvesGeometry curves_merge_endpoints (const bke::CurvesGeometry &src_curves, Span< int > connect_to_curve, Span< bool > flip_direction, const bke::AttributeFilter &attribute_filter)
 
GreasePencilmerge_layers (const GreasePencil &src_grease_pencil, Span< Vector< int > > layers_to_merge, 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={})
 
Meshcreate_cuboid_mesh (const float3 &size, int verts_x, int verts_y, int verts_z, const std::optional< StringRef > &uv_id)
 
Meshcreate_cuboid_mesh (const float3 &size, int verts_x, int verts_y, int verts_z)
 
Meshcreate_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)
 
Meshcreate_grid_mesh (int verts_x, int verts_y, float size_x, float size_y, const std::optional< StringRef > &uv_map_id)
 
Meshcreate_line_mesh (float3 start, float3 delta, int count)
 
Bounds< float3calculate_bounds_radial_primitive (float radius_top, float radius_bottom, int segments, float height)
 
Meshcreate_uv_sphere_mesh (float radius, int segments, int rings, const 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 &mask, const bke::AttributeFilter &attribute_filter={})
 
bke::CurvesGeometry mesh_to_curve_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::GeometrySet mix_geometries (bke::GeometrySet a, const bke::GeometrySet &b, float factor)
 
PointCloudpoint_merge_by_distance (const PointCloud &src_points, const float merge_distance, const IndexMask &selection, const bke::AttributeFilter &attribute_filter)
 
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 ()
 
Meshreorder_mesh (const Mesh &src_mesh, Span< int > old_by_new_map, bke::AttrDomain domain, const bke::AttributeFilter &attribute_filter)
 
PointCloudreorder_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)
 
Curvesreorder_curves (const Curves &src_curves, Span< int > old_by_new_map, const bke::AttributeFilter &attribute_filter)
 
bke::Instancesreorder_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)
 
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={})
 
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={})
 
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, 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, 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< TransformGeometryErrorstransform_geometry (bke::GeometrySet &geometry, const float4x4 &transform)
 
void translate_geometry (bke::GeometrySet &geometry, const float3 translation)
 
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)
 
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 Array< NeighborCurvesfind_curve_neighbors (const Span< float3 > root_positions, const KDTree_3d &old_roots_kdtree)
 
template<typename T , typename GetValueF >
void interpolate_from_neighbor_curves (const Span< NeighborCurves > neighbors_per_curve, const T &fallback, const GetValueF &get_value_from_neighbor, MutableSpan< T > r_interpolated_values)
 
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 Span< NeighborCurves > neighbors_per_curve, 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 Span< NeighborCurves > neighbors_per_curve)
 
static void extend_curves_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_curves_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 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 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 bool interpolate_attribute_to_curves (const StringRef attribute_id, const std::array< int, CURVE_TYPES_NUM > &type_counts)
 
static bool interpolate_attribute_to_poly_curve (const StringRef attribute_id)
 
static AttributesForInterpolation retrieve_attribute_spans (const Span< StringRef > ids, 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)
 
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 float mix_factor, const IndexMask &selection, const GMutableSpan dst)
 
static void mix_arrays (const GSpan src_from, const GSpan src_to, const float mix_factor, const IndexMask &group_selection, const OffsetIndices< int > groups, const GMutableSpan dst)
 
static Map< StringRef, AttributeMetaDataget_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 attribute_id, const eCustomDataType data_type, const bke::AttrDomain domain, GMutableSpan dst_span)
 
static void join_instances (const Span< const GeometryComponent * > src_components, 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, GeometrySet &result)
 
GeometrySet join_geometries (const Span< GeometrySet > geometries, const bke::AttributeFilter &attribute_filter, const std::optional< Span< GeometryComponent::Type > > &component_types_to_join)
 
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< inttoposort_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)
 
static void calculate_positions (const CuboidConfig &config, MutableSpan< float3 > positions)
 
static void define_quad (MutableSpan< int > corner_verts, const int loop_index, 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 Meshcreate_vertex_mesh ()
 
static Bounds< float3calculate_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< float3calculate_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 BitVector selection_to_bit_vector (const IndexMask &selection, const int total_size)
 
static int corner_on_edge_connected_to_vert (const Span< int > corner_verts, const int corner, const IndexRange face, const int vert)
 
static Vector< CornerGroupcalc_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< intcalc_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< int2calc_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< intoffsets_to_map (const IndexMask &mask, const OffsetIndices< int > offsets)
 
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 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 Map< int, intcreate_value_to_first_index_map (const Span< int > values)
 
static Array< intcreate_id_index_map (const bke::AttributeAccessor attributes_a, const bke::AttributeAccessor b_attributes)
 
static Array< intget_permutation (const int length, const int seed)
 
static Array< intinvert_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 Array< intmake_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 int64_t get_final_points_num (const GatherTasks &tasks)
 
static bool skip_transform (const float4x4 &transform)
 
static void copy_transformed_positions (const Span< float3 > src, const float4x4 &transform, MutableSpan< float3 > dst)
 
static void transform_positions (const float4x4 &transform, MutableSpan< float3 > positions)
 
static void copy_transformed_normals (const Span< float3 > src, const float4x4 &transform, MutableSpan< float3 > dst)
 
static void threaded_copy (const GSpan src, GMutableSpan dst)
 
static void threaded_fill (const GPointer value, GMutableSpan dst)
 
static void copy_generic_attributes_to_result (const Span< std::optional< GVArraySpan > > 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 Span< int > stored_ids, const int task_id, MutableSpan< int > dst_ids)
 
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, bke::MutableAttributeAccessor dst_attributes)
 
static Array< intinvert_permutation (const Span< int > permutation)
 
static void reorder_mesh_verts_exec (const Mesh &src_mesh, const Span< int > old_by_new_map, Mesh &dst_mesh)
 
static void reorder_mesh_edges_exec (const Mesh &src_mesh, const Span< int > old_by_new_map, Mesh &dst_mesh)
 
static void reorder_mesh_faces_exec (const Mesh &src_mesh, const Span< int > old_by_new_map, Mesh &dst_mesh)
 
static void reorder_mesh_exec (const Mesh &src_mesh, const Span< int > old_by_new_map, const bke::AttrDomain domain, Mesh &dst_mesh)
 
static void reorder_points_exec (const PointCloud &src_pointcloud, const Span< int > old_by_new_map, PointCloud &dst_pointcloud)
 
static void reorder_curves_exec (const bke::CurvesGeometry &src_curves, const Span< int > old_by_new_map, bke::CurvesGeometry &dst_curves)
 
static void reorder_instaces_exec (const bke::Instances &src_instances, const Span< int > old_by_new_map, bke::Instances &dst_instances)
 
static void clean_unused_attributes (const bke::AttributeFilter &attribute_filter, bke::MutableAttributeAccessor attributes)
 
static fn::Field< intget_count_input_max_one (const fn::Field< int > &count_field)
 
static fn::Field< intget_count_input_from_length (const fn::Field< float > &length_field)
 
static bool interpolate_attribute_to_curves (const StringRef attribute_id, const std::array< int, CURVE_TYPES_NUM > &type_counts)
 
static bool interpolate_attribute_to_poly_curve (const StringRef attribute_id)
 
static void retrieve_attribute_spans (const Span< StringRef > ids, const CurvesGeometry &src_curves, CurvesGeometry &dst_curves, Vector< GVArraySpan > &src, Vector< GMutableSpan > &dst, Vector< bke::GSpanAttributeWriter > &dst_attributes)
 
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< int2tri_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< intlookup_tris_in_cell (const int2 cell, const ReverseUVSampler::LookupGrid &lookup_grid)
 
static std::optional< bke::CurvesGeometryseparate_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_point_cloud_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)
 
void separate_geometry (bke::GeometrySet &geometry_set, const AttrDomain domain, const GeometryNodeDeleteGeometryMode mode, const fn::Field< bool > &selection, const bke::AttributeFilter &attribute_filter, bool &r_is_error)
 
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)
 
template<typename T >
static void bezier_generic_to_nurbs (const Span< T > src, MutableSpan< T > dst)
 
static void bezier_generic_to_nurbs (const GSpan src, GMutableSpan 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)
 
template<typename T >
static void nurbs_to_bezier_assign (const Span< T > src, const MutableSpan< T > dst, const KnotsMode knots_mode)
 
static void nurbs_to_bezier_assign (const GSpan src, const KnotsMode knots_mode, GMutableSpan dst)
 
static Vector< float3create_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 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, 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, const bool is_last_cyclic_segment)
 
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 transform_positions (MutableSpan< float3 > positions, const float4x4 &matrix)
 
static void transform_mesh (Mesh &mesh, const float4x4 &transform)
 
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 bool transform_volume (Volume &volume, const float4x4 &transform)
 
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_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 float angle_match (float angle_radians, float target_radians)
 
static float angle_wrap (float angle_radians)
 
static float plusminus_90_angle (float angle_radians)
 
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 PHashphash_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 PHashLinkphash_lookup (PHash *ph, PHashKey key)
 
static PHashLinkphash_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_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, float(*points)[2])
 
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 PEdgep_wheel_edge_next (PEdge *e)
 
static const PEdgep_wheel_edge_next (const PEdge *e)
 
static PEdgep_wheel_edge_prev (PEdge *e)
 
static PEdgep_boundary_edge_next (PEdge *e)
 
static PEdgep_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 PVertp_vert_add (ParamHandle *handle, PHashKey key, const float co[3], const float weight, PEdge *e)
 
static PVertp_vert_lookup (ParamHandle *handle, PHashKey key, const float co[3], const float weight, PEdge *e)
 
static PVertp_vert_copy (ParamHandle *handle, PVert *v)
 
static PEdgep_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 PFacep_face_add (ParamHandle *handle)
 
static PFacep_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 PFacep_face_add_fill (ParamHandle *handle, PChart *chart, PVert *v1, PVert *v2, PVert *v3)
 
static void p_chart_boundaries (PChart *chart, PEdge **r_outer)
 
static float p_edge_boundary_angle (PEdge *e)
 
static void p_chart_fill_boundary (ParamHandle *handle, PChart *chart, PEdge *be, int nedges)
 
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_free_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_lscm_begin (PChart *chart, bool live, bool abf)
 
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 float p_chart_minimum_area_angle (PChart *chart)
 
static void p_chart_rotate_minimum_area (PChart *chart)
 
static void p_chart_rotate_fit_aabb (PChart *chart)
 
static GeoUVPinIndexnew_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)
 
std::optional< Mesh * > mesh_merge_by_distance_connected (const Mesh &mesh, Span< bool > selection, float merge_distance, bool only_loose_edges)
 
Meshmesh_merge_verts (const Mesh &mesh, MutableSpan< int > vert_dest_map, int vert_dest_map_len, const bool do_mix_data)
 
Realize Instances
bke::GeometrySet realize_instances (bke::GeometrySet geometry_set, const RealizeInstancesOptions &options)
 
bke::GeometrySet 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)
 
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, 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)
 
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, float margin, bool do_rotate, bool ignore_pinned)
 
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 Vector< intweld_vert_ctx_alloc_and_setup (MutableSpan< int > vert_dest_map, const int vert_kill_len)
 
Edge API
static Vector< WeldEdgeweld_edge_ctx_alloc_and_find_collapsed (Span< int2 > edges, Span< int > vert_dest_map, MutableSpan< int > r_edge_dest_map, int *r_edge_collapsed_len)
 
static void weld_edge_find_doubles (Span< WeldEdge > weld_edges, int mvert_num, MutableSpan< int > r_edge_dest_map, int *r_edge_double_kill_len)
 
Poly and Loop API
static bool weld_iter_loop_of_poly_next (WeldLoopOfPolyIter &iter)
 
static bool weld_iter_loop_of_poly_begin (WeldLoopOfPolyIter &iter, const WeldPoly &wp, Span< WeldLoop > wloop, const Span< int > corner_verts, const Span< int > corner_edges, Span< int > loop_map, int *group_buffer)
 
static void weld_poly_loop_ctx_alloc (const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< int > corner_edges, WeldMesh *r_weld_mesh)
 
static void weld_poly_split_recursive (int poly_loop_len, Span< int > vert_dest_map, WeldPoly *r_wp, WeldMesh *r_weld_mesh, int *r_poly_kill, int *r_loop_kill)
 
static void weld_poly_loop_ctx_setup_collapsed_and_split (const int remain_edge_ctx_len, WeldMesh *r_weld_mesh)
 
static int poly_find_doubles (const OffsetIndices< int > poly_corners_offsets, const int poly_num, const Span< int > corners, const int corner_index_max, Vector< int > &r_doubles_offsets, Array< int > &r_doubles_buffer)
 
static void weld_poly_find_doubles (const Span< int > corner_verts, const Span< int > corner_edges, const int medge_len, WeldMesh *r_weld_mesh)
 
Mesh API
static void weld_mesh_context_create (const Mesh &mesh, MutableSpan< int > vert_dest_map, const int vert_kill_len, const bool get_doubles, WeldMesh *r_weld_mesh)
 
CustomData
static void merge_groups_create (Span< int > dest_map, Span< int > double_elems, MutableSpan< int > r_groups_offsets, Array< int > &r_groups_buffer)
 Create groups to merge.
 
static void customdata_weld (const CustomData *source, CustomData *dest, const int *src_indices, int count, int dest_index)
 
static void merge_customdata_all (const CustomData *source, CustomData *dest, Span< int > dest_map, Span< int > double_elems, const int dest_size, const bool do_mix_data, Array< int > &r_final_map)
 Applies to CustomData *dest the values in CustomData *source.
 
Mesh Vertex Merging
static Meshcreate_merged_mesh (const Mesh &mesh, MutableSpan< int > vert_dest_map, const int removed_vertex_count, const bool do_mix_data)
 
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< std::pair< int, GSpan > > 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 Map< StringRef, AttributeKindgather_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, Span< blender::float4x4 > src_base_transforms, OrderedAttributes all_instances_attributes, Span< blender::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 AllPointCloudsInfo &all_pointclouds_info, const Span< RealizePointCloudTask > tasks, const OrderedAttributes &ordered_attributes, bke::GeometrySet &r_realized_geometry)
 
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_vertex_ids, MutableSpan< int > all_dst_material_indices)
 
static void execute_realize_mesh_tasks (const RealizeInstancesOptions &options, const AllMeshesInfo &all_meshes_info, const Span< RealizeMeshTask > tasks, const OrderedAttributes &ordered_attributes, const VectorSet< Material * > &ordered_materials, bke::GeometrySet &r_realized_geometry)
 
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)
 
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 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< float3 > all_handle_left, MutableSpan< float3 > all_handle_right, MutableSpan< float > all_radii, MutableSpan< float > all_nurbs_weights, MutableSpan< int > all_resolutions, MutableSpan< float3 > all_custom_normals)
 
static void execute_realize_curve_tasks (const RealizeInstancesOptions &options, const AllCurvesInfo &all_curves_info, const Span< RealizeCurveTask > tasks, const OrderedAttributes &ordered_attributes, bke::GeometrySet &r_realized_geometry)
 
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 Span< RealizeGreasePencilTask > tasks, const OrderedAttributes &ordered_attributes, bke::GeometrySet &r_realized_geometry)
 
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 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 138 of file mesh_split_edges.cc.

◆ NeighborCurves

◆ ParamKey

Definition at line 27 of file GEO_uv_parametrizer.hh.

◆ PHashKey

Definition at line 49 of file uv_parametrizer.cc.

Enumeration Type Documentation

◆ ConeFillType

Enumerator
None 
NGon 
Triangles 

Definition at line 21 of file GEO_mesh_primitive_cylinder_cone.hh.

◆ Flag

Enumerator
OnStack 
Inserted 

Definition at line 12 of file merge_curves.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 123 of file uv_parametrizer.cc.

◆ PFaceFlag

Enumerator
PFACE_CONNECTED 
PFACE_FILLED 
PFACE_COLLAPSE 
PFACE_DONE 

Definition at line 138 of file uv_parametrizer.cc.

◆ PHandleState

Enumerator
PHANDLE_STATE_ALLOCATED 
PHANDLE_STATE_CONSTRUCTED 
PHANDLE_STATE_LSCM 
PHANDLE_STATE_STRETCH 

Definition at line 30 of file GEO_uv_parametrizer.hh.

◆ PVertFlag

Enumerator
PVERT_PIN 
PVERT_SELECT 
PVERT_INTERIOR 
PVERT_COLLAPSE 
PVERT_SPLIT 

Definition at line 115 of file uv_parametrizer.cc.

Function Documentation

◆ add_curves_on_mesh()

◆ add_instance_attributes_to_single_geometry()

◆ angle_match()

static float blender::geometry::angle_match ( float angle_radians,
float target_radians )
static

Angle rounding helper for "D4" transforms.

Definition at line 211 of file uv_pack.cc.

References DEG2RADF, and fabsf.

Referenced by plusminus_90_angle().

◆ angle_wrap()

static float blender::geometry::angle_wrap ( float angle_radians)
static

Definition at line 219 of file uv_pack.cc.

References BLI_assert, DEG2RADF, floorf, M_PI, and M_PI_2.

Referenced by plusminus_90_angle().

◆ bezier_generic_to_nurbs() [1/2]

static void blender::geometry::bezier_generic_to_nurbs ( const GSpan src,
GMutableSpan dst )
static

◆ bezier_generic_to_nurbs() [2/2]

template<typename T >
static void blender::geometry::bezier_generic_to_nurbs ( const Span< T > src,
MutableSpan< T > dst )
static

The Bezier control point and its handles become three control points on the NURBS curve, so each attribute value is duplicated three times.

Definition at line 46 of file set_curve_type.cc.

References blender::Span< T >::index_range().

Referenced by convert_curves_to_nurbs().

◆ bezier_positions_to_nurbs()

static 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

◆ calc_all_corner_groups()

static 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()

static 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 148 of file mesh_split_edges.cc.

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

Referenced by calc_all_corner_groups().

◆ calc_margin_from_aabb_length_sum()

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

Definition at line 2117 of file uv_pack.cc.

References calc_margin_from_aabb_length_sum(), params, sqrtf, and w().

Referenced by calc_margin_from_aabb_length_sum(), and pack_islands().

◆ calc_new_edges()

static 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

Based on updated corner vertex indices, update the edges in each face. This includes updating corner edge indices, adding new edges, and reusing original edges for the first "split" edge. The main complexity comes from the fact that in the case of single isolated split edges, no new edges are created because they all end up identical. We need to handle this case, but since it's rare, we optimize for the case that it doesn't happen first.

Definition at line 334 of file mesh_split_edges.cc.

References blender::Vector< T, InlineBufferCapacity, Allocator >::append_and_get_index(), blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), calc_new_edges(), edge_from_corner(), blender::Vector< T, InlineBufferCapacity, Allocator >::first(), blender::Vector< T, InlineBufferCapacity, Allocator >::first_index_of_try(), blender::index_mask::IndexMask::foreach_index(), blender::index_mask::IndexMask::foreach_index_optimized(), blender::offset_indices::OffsetIndices< T >::index_range(), int2, mask(), blender::MutableSpan< T >::size(), blender::Span< T >::size(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), size(), blender::offset_indices::OffsetIndices< T >::total_size(), and UNLIKELY.

Referenced by calc_new_edges(), and split_edges().

◆ calc_position_with_interpolation()

◆ calc_position_without_interpolation()

static 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()

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

◆ calc_straight_curve_positions()

static void blender::geometry::calc_straight_curve_positions ( const float3 & a,
const float3 & b,
MutableSpan< float3 > dst )
static

◆ calc_vert_loose_edges()

static 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()

static 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 264 of file mesh_split_edges.cc.

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

Referenced by split_edges().

◆ calculate_angles()

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

◆ calculate_bezier_handles_bezier_mode()

static 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 251 of file fillet_curves.cc.

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

Referenced by calculate_bezier_handles_bezier_mode(), and fillet_curves().

◆ calculate_bezier_handles_poly_mode()

static 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 316 of file fillet_curves.cc.

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

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 12 of file mesh_primitive_uv_sphere.cc.

References delta_phi(), and M_PI.

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

◆ calculate_bounds_uv_sphere()

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

Definition at line 284 of file mesh_primitive_uv_sphere.cc.

References calculate_bounds_radial_primitive(), float, and M_PI.

Referenced by create_uv_sphere_mesh().

◆ calculate_cone_edges()

◆ calculate_cone_faces()

◆ calculate_cone_uvs()

static 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 523 of file mesh_primitive_cylinder_cone.cc.

References blender::geometry::ConeConfig::bottom_has_center_vert, blender::geometry::ConeConfig::bottom_is_point, blender::geometry::ConeConfig::circle_segments, blender::bke::Corner, blender::geometry::ConeConfig::fill_segments, blender::geometry::ConeConfig::fill_type, blender::bke::SpanAttributeWriter< T >::finish(), float, M_PI, 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 create_cylinder_or_cone_mesh().

◆ calculate_cone_verts()

◆ calculate_corner_verts()

◆ calculate_directions()

static void blender::geometry::calculate_directions ( const Span< float3 > positions,
MutableSpan< float3 > directions )
static

Definition at line 80 of file fillet_curves.cc.

References blender::MutableSpan< T >::last(), and blender::math::normalize().

Referenced by fillet_curves().

◆ calculate_fillet_positions()

static 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()

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

Definition at line 159 of file mesh_primitive_uv_sphere.cc.

References sphere_vert_total().

Referenced by create_uv_sphere_mesh().

◆ calculate_sphere_edge_indices()

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

Definition at line 100 of file mesh_primitive_uv_sphere.cc.

References sphere_vert_total().

Referenced by create_uv_sphere_mesh().

◆ calculate_sphere_faces()

◆ calculate_sphere_uvs()

static BLI_NOINLINE void blender::geometry::calculate_sphere_uvs ( Mesh * mesh,
const float segments,
const float rings,
const StringRef uv_map_id )
static

◆ calculate_sphere_vertex_data()

static 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 59 of file mesh_primitive_uv_sphere.cc.

References delta_phi(), blender::MutableSpan< T >::first(), blender::MutableSpan< T >::last(), M_PI, sin_theta(), and z().

Referenced by create_uv_sphere_mesh().

◆ calculate_uvs() [1/2]

◆ calculate_uvs() [2/2]

static 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()

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

Definition at line 200 of file uv_pack.cc.

References params.

Referenced by pack_islands_scale_margin().

◆ can_rotate_with_method()

◆ catmull_rom_to_bezier_handles()

◆ catmull_rom_to_nurbs_positions()

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

◆ clean_unused_attributes()

◆ components_supported_reordering()

◆ compute_curve_trim_parameters()

static void blender::geometry::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 )
static

◆ compute_surface_point_normal()

◆ convert_bezier_or_catmull_rom_to_poly_before_conversion_to_nurbs()

static 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 755 of file set_curve_type.cc.

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

Referenced by convert_curves().

◆ convert_curves()

bke::CurvesGeometry blender::geometry::convert_curves ( const bke::CurvesGeometry & src_curves,
const IndexMask & selection,
CurveType dst_type,
const bke::AttributeFilter & attribute_filter,
const ConvertCurvesOptions & options = {} )

◆ convert_curves_to_bezier()

static 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 268 of file set_curve_type.cc.

References blender::offset_indices::accumulate_counts_to_offsets(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), ATTR_DOMAIN_MASK_POINT, blender::bke::attribute_filter_with_skip_ref(), blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), BEZIER_HANDLE_ALIGN, BEZIER_HANDLE_VECTOR, blender::bke::CurvesGeometry::calculate_bezier_auto_handles(), catmull_rom_to_bezier_handles(), blender::index_mask::IndexMask::complement(), blender::bke::copy_attributes_group_to_group(), 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(), CURVE_TYPE_BEZIER, blender::bke::CurvesGeometry::curve_type_counts(), CURVE_TYPE_NURBS, blender::bke::CurvesGeometry::curve_types(), blender::bke::CurvesGeometry::curves_num(), blender::bke::CurvesGeometry::curves_range(), blender::bke::CurvesGeometry::cyclic(), blender::Vector< T, InlineBufferCapacity, Allocator >::extend(), blender::bke::CurvesGeometry::fill_curve_types(), blender::bke::curves::fill_points(), blender::bke::curves::foreach_curve_by_type(), 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(), is_nurbs_to_bezier_one_to_one(), blender::MutableSpan< T >::last(), NURBS_KNOT_MODE_NORMAL, blender::bke::CurvesGeometry::nurbs_knots_modes(), nurbs_to_bezier_assign(), 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(), scale_input_assign(), selection, blender::IndexRange::size(), size(), blender::MutableSpan< T >::slice(), blender::Span< T >::slice(), and to_bezier_size().

Referenced by convert_curves().

◆ convert_curves_to_catmull_rom_or_poly()

static 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 629 of file set_curve_type.cc.

References blender::offset_indices::accumulate_counts_to_offsets(), ATTR_DOMAIN_MASK_POINT, blender::bke::attribute_filter_with_skip_ref(), blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), blender::index_mask::IndexMask::complement(), convert_curves_trivial(), blender::bke::copy_attributes_group_to_group(), blender::offset_indices::copy_group_sizes(), blender::array_utils::copy_group_to_group(), blender::bke::curves::copy_only_curve_domain(), CURVE_TYPE_BEZIER, 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::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(), selection, blender::IndexRange::size(), and blender::IndexRange::start().

Referenced by convert_curves().

◆ convert_curves_to_nurbs()

static 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 451 of file set_curve_type.cc.

References blender::offset_indices::accumulate_counts_to_offsets(), ATTR_DOMAIN_MASK_POINT, blender::bke::attribute_filter_with_skip_ref(), blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), bezier_generic_to_nurbs(), bezier_positions_to_nurbs(), catmull_rom_to_nurbs_positions(), blender::index_mask::IndexMask::complement(), blender::bke::AttributeAccessor::contains(), blender::bke::copy_attributes_group_to_group(), blender::offset_indices::copy_group_sizes(), blender::array_utils::copy_group_to_group(), blender::bke::curves::copy_only_curve_domain(), blender::bke::CurvesGeometry::curve_type_counts(), 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::VArrayCommon< T >::get_internal_single(), blender::bke::CurvesGeometry::handle_positions_left(), blender::bke::CurvesGeometry::handle_positions_right(), blender::Span< T >::is_empty(), blender::VArrayCommon< T >::is_single(), blender::MutableSpan< T >::last(), blender::index_mask::masked_fill(), NURBS_KNOT_MODE_BEZIER, NURBS_KNOT_MODE_ENDPOINT, 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(), selection, size(), blender::MutableSpan< T >::slice(), blender::Span< T >::slice(), and to_nurbs_size().

Referenced by convert_curves().

◆ convert_curves_trivial()

◆ copy_generic_attributes_to_result()

static void blender::geometry::copy_generic_attributes_to_result ( const Span< std::optional< GVArraySpan > > 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()

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

Definition at line 81 of file mesh_copy_selection.cc.

References Mesh::runtime.

◆ copy_loose_vert_hint()

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

Definition at line 73 of file mesh_copy_selection.cc.

References Mesh::runtime.

◆ copy_or_defaults_for_unselected_curves()

static void blender::geometry::copy_or_defaults_for_unselected_curves ( const CurvesGeometry & src_curves,
const IndexMask & unselected_curves,
const AttributesForResample & attributes,
CurvesGeometry & dst_curves )
static

◆ copy_overlapping_hint()

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

Definition at line 89 of file mesh_copy_selection.cc.

◆ copy_point_data_between_endpoints()

◆ copy_transformed_normals()

static void blender::geometry::copy_transformed_normals ( const Span< float3 > src,
const float4x4 & transform,
MutableSpan< float3 > dst )
static

◆ copy_transformed_positions()

static void blender::geometry::copy_transformed_positions ( const Span< float3 > src,
const float4x4 & transform,
MutableSpan< float3 > dst )
static

◆ corner_on_edge_connected_to_vert()

static 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 125 of file mesh_split_edges.cc.

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

Referenced by calc_corner_groups_for_vertex().

◆ 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 398 of file mesh_primitive_cuboid.cc.

References create_cuboid_mesh().

◆ create_cuboid_mesh() [2/2]

◆ create_curve_from_vert_indices()

◆ create_cylinder_or_cone_mesh()

◆ create_grid_mesh()

Mesh * blender::geometry::create_grid_mesh ( int verts_x,
int verts_y,
float size_x,
float size_y,
const std::optional< StringRef > & uv_map_id )

◆ create_id_index_map()

◆ create_line_mesh()

◆ create_merged_mesh()

static Mesh * blender::geometry::create_merged_mesh ( const Mesh & mesh,
MutableSpan< int > vert_dest_map,
const int removed_vertex_count,
const bool do_mix_data )
static

◆ create_nurbs_to_bezier_handles()

static Vector< float3 > blender::geometry::create_nurbs_to_bezier_handles ( const Span< float3 > nurbs_positions,
const KnotsMode knots_mode )
static

◆ create_nurbs_to_bezier_positions()

static 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_result_ids()

static void blender::geometry::create_result_ids ( const RealizeInstancesOptions & options,
const Span< int > stored_ids,
const int task_id,
MutableSpan< int > dst_ids )
static

◆ create_uv_sphere_mesh()

◆ create_value_to_first_index_map()

static Map< int, int > blender::geometry::create_value_to_first_index_map ( const Span< int > values)
static

◆ create_vertex_mesh()

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

Definition at line 641 of file mesh_primitive_cylinder_cone.cc.

References BKE_mesh_new_nomain(), and mesh.

Referenced by create_cylinder_or_cone_mesh().

◆ 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 120 of file simplify_curves.cc.

References curve_simplify(), and blender::GSpan::type().

Referenced by curve_simplify().

◆ curve_simplify() [2/2]

template<typename T >
static 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 )

◆ customdata_weld()

◆ debug_randomize_curve_order()

◆ debug_randomize_edge_order()

void blender::geometry::debug_randomize_edge_order ( Mesh * mesh)

◆ debug_randomize_face_order()

◆ debug_randomize_instance_order()

void blender::geometry::debug_randomize_instance_order ( bke::Instances * instances)

◆ debug_randomize_mesh_order()

◆ debug_randomize_point_order()

◆ debug_randomize_vert_order()

void blender::geometry::debug_randomize_vert_order ( Mesh * mesh)

◆ define_quad()

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

Definition at line 106 of file mesh_primitive_cuboid.cc.

Referenced by calculate_corner_verts().

◆ delete_selected_instances()

static void blender::geometry::delete_selected_instances ( bke::GeometrySet & geometry_set,
const fn::Field< bool > & selection_field,
const bke::AttributeFilter & attribute_filter )
static

◆ dist_signed_squared_to_edge()

static 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 81 of file uv_pack.cc.

References blender::math::length_squared().

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

◆ duplicate_fillet_point_data()

static 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()

static 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

Definition at line 317 of file mesh_split_edges.cc.

References edge_from_corner().

Referenced by calc_new_edges(), edge_from_corner(), and update_unselected_edges().

◆ 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 48 of file mesh_selection.cc.

References mapped_corner_selection_from_face().

Referenced by 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 57 of file mesh_selection.cc.

References blender::index_mask::IndexMask::from_predicate().

◆ edges_to_curve_point_indices()

◆ edges_to_curves_convert()

static 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()

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

◆ execute_realize_curve_task()

static 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< float3 > all_handle_left,
MutableSpan< float3 > all_handle_right,
MutableSpan< float > all_radii,
MutableSpan< float > all_nurbs_weights,
MutableSpan< int > all_resolutions,
MutableSpan< float3 > all_custom_normals )
static

◆ execute_realize_curve_tasks()

static void blender::geometry::execute_realize_curve_tasks ( const RealizeInstancesOptions & options,
const AllCurvesInfo & all_curves_info,
const Span< RealizeCurveTask > tasks,
const OrderedAttributes & ordered_attributes,
bke::GeometrySet & r_realized_geometry )
static

Definition at line 1872 of file realize_instances.cc.

References add_instance_attributes_to_single_geometry(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::bke::CurvesGeometry::attributes_for_write(), BKE_curves_copy_for_eval(), blender::geometry::AllCurvesInfo::create_custom_normal_attribute, blender::geometry::AllCurvesInfo::create_handle_postion_attributes, blender::geometry::AllCurvesInfo::create_id_attribute, blender::geometry::AllCurvesInfo::create_nurbs_weight_attribute, blender::geometry::AllCurvesInfo::create_radius_attribute, blender::geometry::AllCurvesInfo::create_resolution_attribute, blender::geometry::CurvesElementStartIndices::curve, blender::geometry::RealizeCurveTask::curve_info, CurvesGeometry::curve_num, blender::geometry::RealizeCurveInfo::curves, execute_realize_curve_tasks(), blender::Span< T >::first(), Curves::geometry, blender::geometry::OrderedAttributes::ids, blender::geometry::OrderedAttributes::index_range(), blender::Span< T >::index_range(), blender::Span< T >::is_empty(), blender::geometry::OrderedAttributes::kinds, blender::MutableSpan< T >::last(), blender::Span< T >::last(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), blender::bke::CurvesGeometry::offsets_for_write(), blender::geometry::CurvesElementStartIndices::point, CurvesGeometry::point_num, blender::bke::GeometrySet::replace_curves(), blender::Span< T >::size(), skip_transform(), and blender::geometry::RealizeCurveTask::start_indices.

Referenced by execute_realize_curve_tasks(), and realize_instances().

◆ execute_realize_edit_data_tasks()

◆ execute_realize_grease_pencil_task()

◆ execute_realize_grease_pencil_tasks()

static void blender::geometry::execute_realize_grease_pencil_tasks ( const AllGreasePencilsInfo & all_grease_pencils_info,
const Span< RealizeGreasePencilTask > tasks,
const OrderedAttributes & ordered_attributes,
bke::GeometrySet & r_realized_geometry )
static

◆ execute_realize_mesh_task()

◆ execute_realize_mesh_tasks()

static void blender::geometry::execute_realize_mesh_tasks ( const RealizeInstancesOptions & options,
const AllMeshesInfo & all_meshes_info,
const Span< RealizeMeshTask > tasks,
const OrderedAttributes & ordered_attributes,
const VectorSet< Material * > & ordered_materials,
bke::GeometrySet & r_realized_geometry )
static

Definition at line 1530 of file realize_instances.cc.

References add_instance_attributes_to_single_geometry(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BKE_id_material_eval_assign(), BKE_mesh_copy_for_eval(), BKE_mesh_copy_parameters_for_eval(), BKE_mesh_new_nomain(), BLI_freelistN(), CD_PROP_FLOAT2, Mesh::corner_data, Mesh::corners_num, blender::geometry::AllMeshesInfo::create_id_attribute, blender::geometry::AllMeshesInfo::create_material_index_attribute, CustomData_get_active_layer_name(), CustomData_get_named_layer(), CustomData_get_render_layer_name(), CustomData_set_layer_active(), CustomData_set_layer_render(), blender::geometry::MeshElementStartIndices::edge, Mesh::edges_num, execute_realize_mesh_tasks(), blender::geometry::MeshElementStartIndices::face, Mesh::faces_num, blender::Span< T >::first(), Mesh::id, blender::geometry::OrderedAttributes::ids, blender::geometry::OrderedAttributes::index_range(), blender::Span< T >::index_range(), blender::Span< T >::is_empty(), blender::geometry::OrderedAttributes::kinds, blender::Span< T >::last(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), blender::geometry::MeshElementStartIndices::loop, blender::geometry::MeshRealizeInfo::mesh, blender::geometry::RealizeMeshTask::mesh_info, blender::bke::GeometrySet::replace_mesh(), blender::Span< T >::size(), blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), skip_transform(), blender::geometry::RealizeMeshTask::start_indices, transform_positions(), blender::geometry::MeshElementStartIndices::vertex, Mesh::vertex_group_names, and Mesh::verts_num.

Referenced by execute_realize_mesh_tasks(), and realize_instances().

◆ execute_realize_pointcloud_task()

◆ execute_realize_pointcloud_tasks()

◆ 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 )

◆ extend_curves_curved()

static void blender::geometry::extend_curves_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_curves_straight()

static void blender::geometry::extend_curves_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

Here we use the vector between two adjacent points around #overshoot_point_param as our reference for the direction of extension, however to have better tolerance for jitter, using the vector (a_few_points_back - end_point) might be a better solution in the future.

Definition at line 27 of file extend_curves.cc.

References blender::math::ceil(), curve, blender::IndexRange::first(), blender::math::floor(), fmodf, blender::math::interpolate(), blender::math::is_zero(), blender::IndexRange::last(), blender::math::length(), and UNLIKELY.

◆ extract_curves()

◆ extract_curves_points()

◆ extract_greasepencil_layer_curves()

◆ extract_greasepencil_layer_points()

◆ extract_greasepencil_layers()

◆ extract_instances()

Array< bke::Instances * > blender::geometry::extract_instances ( const bke::Instances & instances,
const IndexMask & mask,
const bke::AttributeFilter & attribute_filter )

◆ extract_mesh_edges()

◆ extract_mesh_faces()

◆ extract_mesh_vertices()

◆ extract_pointcloud_points()

Array< PointCloud * > blender::geometry::extract_pointcloud_points ( const PointCloud & pointcloud,
const IndexMask & mask,
const bke::AttributeFilter & attribute_filter )

◆ 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 90 of file mesh_selection.cc.

References face_selection_from_mapped_corner().

Referenced by mesh_copy_selection_keep_edges().

◆ face_selection_from_mapped_corner()

static 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 82 of file mesh_selection.cc.

References face_selection_from_mapped_corner().

Referenced by mesh_copy_selection_keep_edges().

◆ fill_bezier_data()

◆ fill_new_attribute()

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

◆ fill_nurbs_data()

◆ fillet_curves()

static 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 365 of file fillet_curves.cc.

References blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), ATTR_DOMAIN_MASK_POINT, blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), calculate_angles(), calculate_bezier_handles_bezier_mode(), calculate_bezier_handles_poly_mode(), calculate_directions(), calculate_fillet_positions(), calculate_result_offsets(), blender::index_mask::IndexMask::complement(), 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::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::Span< T >::last(), limit_radii(), limit_radius(), blender::VArrayCommon< T >::materialize_compressed(), blender::bke::CurvesGeometry::offsets(), blender::bke::CurvesGeometry::offsets_for_write(), 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::IndexRange::size(), blender::MutableSpan< T >::slice(), and blender::Span< T >::slice().

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 )

◆ finalize_geometry()

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

◆ find_best_fit_for_island()

static 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_connected_ranges()

◆ find_curve_neighbors()

static Array< NeighborCurves > blender::geometry::find_curve_neighbors ( const Span< float3 > root_positions,
const KDTree_3d & old_roots_kdtree )
static

◆ finish_rows()

static 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 117 of file reverse_uv_sampler.cc.

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

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

◆ fix_large_angle()

static 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 293 of file uv_parametrizer.cc.

References DEG2RADF, len_v3v3(), sum(), and v2.

Referenced by p_triangle_angles().

◆ foreach_connected_curve()

◆ foreach_geometry_in_reference()

static 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 546 of file realize_instances.cc.

References foreach_geometry_in_reference().

Referenced by foreach_geometry_in_reference(), and gather_realize_tasks_for_instances().

◆ gather_attribute_propagation_components()

static void blender::geometry::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

◆ gather_attribute_propagation_components_with_custom_depths()

◆ gather_attributes_to_propagate()

◆ gather_curve_attributes_to_interpolate()

static AttributesForInterpolation blender::geometry::gather_curve_attributes_to_interpolate ( const CurvesGeometry & from_curves,
const CurvesGeometry & to_curves,
CurvesGeometry & dst_curves )
static

◆ 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()

static void blender::geometry::gather_meshes_to_realize ( const bke::GeometrySet & geometry_set,
VectorSet< const Mesh * > & r_meshes )
static

◆ gather_point_attributes_to_interpolate() [1/2]

◆ gather_point_attributes_to_interpolate() [2/2]

◆ gather_pointclouds_to_realize()

◆ gather_realize_tasks_for_instances()

static 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

◆ gather_realize_tasks_recursive()

static 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 651 of file realize_instances.cc.

References blender::ImplicitSharingInfo::add_user(), blender::geometry::AllInstancesInfo::attribute_fallback, blender::geometry::CurvesElementStartIndices::curve, blender::geometry::GatherTasks::curve_tasks, blender::geometry::GatherTasksInfo::curves, blender::geometry::InstanceContext::curves, blender::geometry::GatherOffsets::curves_offsets, blender::geometry::MeshElementStartIndices::edge, blender::geometry::GatherTasks::edit_data_tasks, blender::geometry::MeshElementStartIndices::face, 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::geometry::InstanceContext::id, blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::index_of(), blender::geometry::GatherTasksInfo::instances, blender::geometry::InstanceContext::instances, blender::geometry::AllInstancesInfo::instances_components_to_merge, blender::geometry::AllInstancesInfo::instances_components_transforms, blender::geometry::MeshElementStartIndices::loop, 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::geometry::CurvesElementStartIndices::point, 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, PointCloud::totpoint, and blender::geometry::MeshElementStartIndices::vertex.

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

◆ gather_vert_attributes()

static void blender::geometry::gather_vert_attributes ( const Mesh & mesh_src,
const bke::AttributeFilter & attribute_filter,
const IndexMask & vert_mask,
Mesh & mesh_dst )
static

◆ 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.
influenceInfluence 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 150 of file smooth_curves.cc.

References gaussian_blur_1D(), and blender::GSpan::type().

Referenced by gaussian_blur_1D(), smooth_curve_attribute(), and smooth_curve_positions().

◆ gaussian_blur_1D() [2/2]

template<typename T >
static 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 21 of file smooth_curves.cc.

References BLI_assert, double(), ELEM, exp(), blender::MutableSpan< T >::index_range(), is_cyclic(), 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()

static 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 111 of file uv_pack.cc.

References BLI_rctf_size_x(), BLI_rctf_size_y(), and params.

Referenced by is_larger().

◆ get_aspect_scaled_extent()

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

Definition at line 101 of file uv_pack.cc.

References BLI_rctf_size_x(), BLI_rctf_size_y(), and params.

Referenced by is_larger(), rotate_inside_square(), and blender::geometry::UVMinimumEnclosingSquareFinder::update().

◆ get_count_input_from_length()

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

Definition at line 33 of file resample_curves.cc.

References count, blender::fn::FieldOperation::Create(), int, and UNLIKELY.

Referenced by resample_to_length().

◆ get_count_input_max_one()

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

Definition at line 24 of file resample_curves.cc.

References blender::fn::FieldOperation::Create().

Referenced by resample_to_count().

◆ get_final_attribute_info()

◆ get_final_points_num()

static int64_t blender::geometry::get_final_points_num ( const GatherTasks & tasks)
static

◆ get_permutation()

static Array< int > blender::geometry::get_permutation ( const int length,
const int seed )
static

◆ guess_initial_scale()

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

Definition at line 1424 of file uv_pack.cc.

References blender::geometry::PackIsland::half_diagonal_, sqrtf, and sum().

Referenced by pack_island_xatlas().

◆ interpolate_attribute_to_curves() [1/2]

static bool blender::geometry::interpolate_attribute_to_curves ( const StringRef attribute_id,
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 28 of file interpolate_curves.cc.

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

Referenced by gather_point_attributes_to_interpolate(), and gather_point_attributes_to_interpolate().

◆ interpolate_attribute_to_curves() [2/2]

static bool blender::geometry::interpolate_attribute_to_curves ( const StringRef attribute_id,
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 59 of file resample_curves.cc.

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

◆ interpolate_attribute_to_poly_curve() [1/2]

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

◆ interpolate_attribute_to_poly_curve() [2/2]

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

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

Definition at line 77 of file resample_curves.cc.

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

◆ interpolate_catmull_rom()

template<typename T >
static T blender::geometry::interpolate_catmull_rom ( const Span< T > src_data,
const bke::curves::CurvePoint insertion_point,
const bool src_cyclic )
static

◆ interpolate_curves()

◆ interpolate_from_neighbor_curves()

template<typename T , typename GetValueF >
void blender::geometry::interpolate_from_neighbor_curves ( const Span< NeighborCurves > neighbors_per_curve,
const T & fallback,
const GetValueF & get_value_from_neighbor,
MutableSpan< T > r_interpolated_values )

◆ invert_permutation() [1/2]

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

◆ invert_permutation() [2/2]

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

◆ is_larger()

static 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 121 of file uv_pack.cc.

References b, compare_ff_relative(), get_aspect_scaled_area(), get_aspect_scaled_extent(), and params.

Referenced by 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()

static 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 23 of file set_curve_type.cc.

References ELEM, NURBS_KNOT_MODE_ENDPOINT, and NURBS_KNOT_MODE_NORMAL.

Referenced by convert_curves_to_bezier(), create_nurbs_to_bezier_handles(), create_nurbs_to_bezier_positions(), 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 )

◆ join_geometries() [2/2]

◆ join_instances()

◆ join_volumes()

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

Definition at line 138 of file join_geometries.cc.

References join_volumes().

Referenced by join_component_type(), and join_volumes().

◆ knot_insert_bezier()

static bke::curves::bezier::Insertion blender::geometry::knot_insert_bezier ( const Span< float3 > positions,
const Span< float3 > handles_left,
const Span< float3 > handles_right,
const bke::curves::CurvePoint insertion_point )
static

◆ limit_radii()

static void blender::geometry::limit_radii ( const Span< float3 > positions,
const Span< float > angles,
const Span< float > radii,
const bool cyclic,
MutableSpan< float > radii_clamped )
static

◆ limit_radius()

static 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 101 of file fillet_curves.cc.

References blender::math::distance(), and blender::math::safe_divide().

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

◆ linear_interpolation()

template<typename T >
static void blender::geometry::linear_interpolation ( const T & a,
const T & b,
MutableSpan< T > dst )
inlinestatic

◆ lookup_curve_point()

static 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]

static 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]

static 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

Find the point on a Bezier curve using the 'bezier_offsets' cache.

Definition at line 91 of file trim_curves.cc.

References blender::Span< T >::begin(), blender::Span< T >::end(), left, and blender::length_parameterize::sample_at_length().

Referenced by lookup_curve_point(), and lookup_point_bezier().

◆ lookup_point_polygonal()

static 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 66 of file trim_curves.cc.

References blender::length_parameterize::sample_at_length().

Referenced by lookup_curve_point().

◆ lookup_point_uniform_spacing()

static 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 37 of file trim_curves.cc.

References BLI_assert, and blender::length_parameterize::sample_at_length().

Referenced by lookup_curve_point(), and lookup_point_bezier().

◆ lookup_tris_in_cell()

◆ make_new_offset_indices()

static Array< int > blender::geometry::make_new_offset_indices ( const OffsetIndices< int > old_offsets,
const Span< int > old_by_new_map )
static

◆ mapped_corner_selection_from_face()

static 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_customdata_all()

static void blender::geometry::merge_customdata_all ( const CustomData * source,
CustomData * dest,
Span< int > dest_map,
Span< int > double_elems,
const int dest_size,
const bool do_mix_data,
Array< int > & r_final_map )
static

Applies to CustomData *dest the values in CustomData *source.

This function creates the CustomData of the resulting mesh according to the merge map in dest_map. The resulting customdata will not have the source elements, so the indexes will be modified. To indicate the new indices r_final_map is also created.

Parameters
dest_mapMap that defines the source and target elements. The source elements will be merged into the target. Each target corresponds to a group.
double_elemsSource and target elements in dest_map. For quick access.
do_mix_dataIf true the target element will have the custom data interpolated with all sources pointing to it.
Returns
r_final_map: Array indicating the new indices of the elements.

Definition at line 1442 of file mesh_merge_by_distance.cc.

References BLI_assert, count, CustomData_copy_data(), customdata_weld(), ELEM_COLLAPSED, blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), merge_groups_create(), OUT_OF_CONTEXT, blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize(), blender::IndexRange::size(), blender::Span< T >::size(), blender::IndexRange::start(), and UNUSED_VARS_NDEBUG.

Referenced by create_merged_mesh().

◆ merge_groups_create()

static void blender::geometry::merge_groups_create ( Span< int > dest_map,
Span< int > double_elems,
MutableSpan< int > r_groups_offsets,
Array< int > & r_groups_buffer )
static

Create groups to merge.

This function creates groups for merging elements based on the provided dest_map.

Parameters
dest_mapMap that defines the source and target elements. The source elements will be merged into the target. Each target corresponds to a group.
double_elemsSource and target elements in dest_map. For quick access.
Returns
r_groups_map: Map that points out the group of elements that an element belongs to.
r_groups_buffer: Buffer containing the indices of all elements that merge.
r_groups_offs: Array that indicates where each element group starts in the buffer.

Definition at line 1298 of file mesh_merge_by_distance.cc.

References BLI_assert, blender::MutableSpan< T >::fill(), blender::Span< T >::index_range(), blender::MutableSpan< T >::last(), blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize(), blender::Array< T, InlineBufferCapacity, Allocator >::size(), blender::MutableSpan< T >::size(), and blender::Span< T >::size().

Referenced by merge_customdata_all().

◆ merge_layers()

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

Creates a new grease pencil geometry that has groups of layers merged into one layer per group.

Parameters
layers_to_mergeA list of source layer indices for each new layers. Each new layer must have at least one source layer.

Definition at line 42 of file merge_layers.cc.

References blender::bke::AttributeFilter::allow_skip(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BKE_grease_pencil_new_nomain(), BLI_assert, CD_PROP_STRING, blender::bke::attribute_math::convert_to_static_type(), blender::bke::AttributeIter::data_type, blender::bke::GSpanAttributeWriter::finish(), blender::bke::AttributeIter::get(), blender::Span< T >::index_range(), blender::math::invert(), blender::Span< T >::is_empty(), join_curves(), blender::bke::Layer, blender::bke::greasepencil::Layer::local_transform(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), GreasePencil::material_array, GreasePencil::material_array_num, MEM_dupallocN, blender::bke::AttributeIter::name, blender::threading::parallel_for(), GreasePencil::runtime, blender::bke::greasepencil::Layer::set_local_transform(), blender::Span< T >::size(), blender::bke::GSpanAttributeWriter::span, blender::bke::greasepencil::Drawing::strokes_for_write(), blender::GMutableSpan::type(), blender::GMutableSpan::typed(), blender::GVArray::typed(), and blender::bke::GAttributeReader::varray.

Referenced by blender::ed::object::apply_eval_grease_pencil_data(), and blender::nodes::node_geo_merge_layers_cc::merge_layers().

◆ mesh_copy_selection()

◆ mesh_copy_selection_keep_edges()

◆ mesh_copy_selection_keep_verts()

◆ mesh_merge_by_distance_all()

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

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 1697 of file mesh_merge_by_distance.cc.

References create_merged_mesh(), blender::Array< T, InlineBufferCapacity, Allocator >::data(), OUT_OF_CONTEXT, and tree.

Referenced by calculate_weld(), blender::io::ply::convert_ply_to_mesh(), 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 )

Merge selected vertices along edges to other selected vertices. Only vertices connected by edges are considered for merging.

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 1725 of file mesh_merge_by_distance.cc.

References blender::geometry::WeldVertexCluster::co, copy_v3_v3(), blender::bke::LooseGeomCache::count, create_merged_mesh(), blender::Array< T, InlineBufferCapacity, Allocator >::data(), blender::bke::LooseGeomCache::is_loose_bits, len_squared_v3(), madd_v3_v3fl(), blender::geometry::WeldVertexCluster::merged_verts, OUT_OF_CONTEXT, range_vn_i(), square_f(), sub_v3_v3v3(), v, and v2.

Referenced by calculate_weld(), and blender::nodes::node_geo_merge_by_distance_cc::mesh_merge_by_distance_connected().

◆ mesh_merge_verts()

Mesh * blender::geometry::mesh_merge_verts ( const Mesh & mesh,
MutableSpan< int > vert_dest_map,
int vert_dest_map_len,
const bool do_mix_data )

Merge Verts indicated in the targets map.

This frees the given mesh and returns a new mesh.

Parameters
vert_dest_mapThe table that maps vertices to target vertices. a value of -1 indicates a vertex is a target, and is to be kept. This array is aligned with 'mesh->verts_num'
Warning
vert_merge_map must not contain any chained mapping (v1 -> v2 -> v3 etc.), this is not supported and will likely generate corrupted geometry.
Parameters
vert_dest_map_lenThe number of non '-1' values in vert_dest_map. (not the size)
do_mix_dataIf true, the groups of vertices in the vert_dest_map_len, defined by source vertices 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 1819 of file mesh_merge_by_distance.cc.

References create_merged_mesh().

◆ mesh_to_curve_convert()

bke::CurvesGeometry blender::geometry::mesh_to_curve_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 215 of file mesh_to_curve_convert.cc.

References blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), edges_to_curves_convert(), and blender::array_utils::gather().

Referenced by blender::nodes::node_geo_mesh_to_curve_cc::node_geo_exec().

◆ mix() [1/2]

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

Definition at line 64 of file mix_geometries.cc.

◆ mix() [2/2]

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

Definition at line 53 of file mix_geometries.cc.

◆ mix_arrays() [1/3]

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

◆ mix_arrays() [2/3]

static void blender::geometry::mix_arrays ( const GSpan src_from,
const GSpan src_to,
const float mix_factor,
const IndexMask & selection,
const GMutableSpan dst )
static

◆ mix_arrays() [3/3]

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

◆ mix_attributes()

static 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 72 of file mix_geometries.cc.

References mix_attributes().

Referenced by mix_attributes(), and mix_geometries().

◆ mix_geometries()

bke::GeometrySet blender::geometry::mix_geometries ( bke::GeometrySet a,
const bke::GeometrySet & b,
float factor )

Mixes both geometries if possible (e.g. if corresponding meshes have the same number of vertices).

If mixing is not possible, the geometry from the a input is returned.

Definition at line 150 of file mix_geometries.cc.

References b, create_id_index_map(), mix_attributes(), and mix_geometries().

Referenced by blender::nodes::mix_baked_data_item(), and mix_geometries().

◆ mix_with_indices() [1/2]

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

Definition at line 42 of file mix_geometries.cc.

References mix_with_indices().

◆ 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 )

Definition at line 26 of file mix_geometries.cc.

References blender::threading::parallel_for().

Referenced by mix_with_indices().

◆ 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 55 of file uv_pack.cc.

References b, double(), and float.

Referenced by island_uv_transform(), and uv_parametrizer_pack().

◆ new_geo_uv_pinindex()

static GeoUVPinIndex * blender::geometry::new_geo_uv_pinindex ( ParamHandle * handle,
const float uv[2] )
static

◆ normalize_curve_point_data()

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

Definition at line 237 of file resample_curves.cc.

References normalize_span().

Referenced by resample_to_evaluated(), and resample_to_uniform().

◆ normalize_span()

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

Definition at line 230 of file resample_curves.cc.

References blender::math::normalize().

Referenced by normalize_curve_point_data().

◆ nurbs_to_bezier_assign() [1/2]

static void blender::geometry::nurbs_to_bezier_assign ( const GSpan src,
const KnotsMode knots_mode,
GMutableSpan dst )
static

◆ nurbs_to_bezier_assign() [2/2]

◆ offsets_to_map()

static 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 504 of file mesh_split_edges.cc.

References offsets_to_map(), and blender::offset_indices::OffsetIndices< T >::total_size().

Referenced by offsets_to_map(), and split_edges().

◆ overlap_aabb()

static 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 2137 of file uv_pack.cc.

References overlap_aabb().

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

◆ p_abf_adjust_alpha()

static 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()

static void blender::geometry::p_abf_compute_sines ( PAbfSystem * sys)
static

◆ p_abf_free_system()

◆ p_abf_matrix_invert()

◆ p_abf_setup_system()

◆ p_add_ngon()

static 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()

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

Definition at line 399 of file uv_parametrizer.cc.

References v2.

Referenced by p_chart_convex_hull().

◆ p_boundary_edge_next()

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

Definition at line 540 of file uv_parametrizer.cc.

References e.

Referenced by p_chart_convex_hull(), p_chart_fill_boundary(), and p_chart_symmetry_pins().

◆ p_boundary_edge_prev()

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

Definition at line 545 of file uv_parametrizer.cc.

References e, and p_wheel_edge_next().

Referenced by p_chart_fill_boundary(), and p_chart_symmetry_pins().

◆ p_chart_abf_solve()

◆ p_chart_boundaries()

static void blender::geometry::p_chart_boundaries ( PChart * chart,
PEdge ** r_outer )
static

◆ p_chart_collapse_doubles()

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

◆ p_chart_convex_hull()

static 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()

static bool blender::geometry::p_chart_correct_degenerate_triangle_point ( PFace * f,
float min_area,
float min_angle_cos )
static

◆ p_chart_correct_degenerate_triangles()

static bool UNUSED_FUNCTION_NO_SLIM blender::geometry::p_chart_correct_degenerate_triangles ( PChart * chart,
const float min_area,
const float min_angle )
static

◆ p_chart_correct_degenerate_triangles2()

◆ p_chart_extrema_verts()

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

◆ p_chart_fill_boundaries()

static void blender::geometry::p_chart_fill_boundaries ( ParamHandle * handle,
PChart * chart,
const PEdge * outer )
static

◆ p_chart_fill_boundary()

◆ p_chart_flush_collapsed_uvs()

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

◆ p_chart_lscm_begin()

◆ p_chart_lscm_end()

◆ p_chart_lscm_solve()

◆ p_chart_lscm_transform_single_pin()

◆ p_chart_minimum_area_angle()

static float blender::geometry::p_chart_minimum_area_angle ( PChart * chart)
static

◆ p_chart_pin_positions()

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

◆ p_chart_post_collapse_flush()

◆ p_chart_rotate_fit_aabb()

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

◆ p_chart_rotate_minimum_area()

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

◆ p_chart_simplify_compute()

◆ p_chart_stretch_minimize()

static void blender::geometry::p_chart_stretch_minimize ( PChart * chart,
RNG * rng )
static

◆ p_chart_symmetry_pins()

static bool blender::geometry::p_chart_symmetry_pins ( PChart * chart,
PEdge * outer,
PVert ** pin1,
PVert ** pin2 )
static

◆ p_chart_uv_area()

static float blender::geometry::p_chart_uv_area ( PChart * chart)
static

◆ p_chart_uv_bbox()

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

◆ p_chart_uv_scale()

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

◆ p_chart_uv_to_array()

static void blender::geometry::p_chart_uv_to_array ( PChart * chart,
float(*) points[2] )
static

Definition at line 492 of file uv_parametrizer.cc.

References copy_v2_v2(), v, and blender::geometry::PChart::verts.

Referenced by p_chart_rotate_fit_aabb().

◆ p_chart_uv_transform()

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

◆ p_chart_uv_translate()

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

◆ p_collapse_allowed_topologic()

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

Definition at line 1825 of file uv_parametrizer.cc.

References p_collapsing_verts(), and p_vert_interior().

Referenced by p_collapse_doubles_allowed().

◆ p_collapse_cost_vertex()

static 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

Definition at line 2044 of file uv_parametrizer.cc.

References e, blender::geometry::PVert::edge, and p_wheel_edge_next().

Referenced by p_chart_simplify_compute().

◆ p_collapse_doubles_allowed()

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

◆ p_collapse_doubles_cost()

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

Definition at line 4424 of file uv_parametrizer.cc.

References p_edge_length_squared().

Referenced by p_chart_collapse_doubles().

◆ p_collapse_edge()

◆ p_collapsing_verts()

static void blender::geometry::p_collapsing_verts ( PEdge * edge,
PEdge * pair,
PVert ** r_newv,
PVert ** r_keepv )
static

◆ p_compare_geometric_uv()

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

Definition at line 3457 of file uv_parametrizer.cc.

References b, blender::geometry::PVert::uv, and v2.

Referenced by p_chart_convex_hull().

◆ p_connect_pairs()

◆ p_edge_boundary_angle()

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

◆ p_edge_connect_pair()

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

Definition at line 899 of file uv_parametrizer.cc.

References e, p_edge_has_pair(), p_face_flip(), and PFACE_CONNECTED.

Referenced by p_connect_pairs().

◆ p_edge_has_pair()

static bool blender::geometry::p_edge_has_pair ( ParamHandle * handle,
PEdge * e,
bool topology_from_uvs,
PEdge ** r_pair )
static

◆ p_edge_implicit_seam()

◆ p_edge_length()

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

◆ p_edge_length_squared()

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

Definition at line 418 of file uv_parametrizer.cc.

References BMVert::co, e, and len_squared_v3v3().

Referenced by p_collapse_doubles_allowed(), and p_collapse_doubles_cost().

◆ p_edge_lookup()

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

Definition at line 771 of file uv_parametrizer.cc.

References e, PHASH_edge, phash_lookup(), and phash_next().

Referenced by uv_parametrizer_edge_set_seam().

◆ p_edge_matrix() [1/2]

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

◆ p_edge_matrix() [2/2]

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

Definition at line 4609 of file uv_parametrizer.cc.

References BMVert::co, copy_v3_v3(), e, p_edge_matrix(), R, and sub_v3_v3().

◆ p_edge_uv_length()

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

Definition at line 423 of file uv_parametrizer.cc.

References e, and len_v2v2().

Referenced by p_chart_stretch_minimize(), and p_face_stretch().

◆ p_face_add()

◆ p_face_add_construct()

◆ p_face_add_fill()

◆ p_face_angles()

static 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()

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

◆ p_face_exists()

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

Definition at line 790 of file uv_parametrizer.cc.

References e, PHASH_edge, phash_lookup(), and phash_next().

Referenced by uv_parametrizer_face_add().

◆ p_face_flip()

◆ p_face_restore_uvs()

static void blender::geometry::p_face_restore_uvs ( PFace * f)
static

◆ p_face_stretch()

◆ p_face_uv_area_signed()

◆ p_flush_uvs()

static void blender::geometry::p_flush_uvs ( ParamHandle * handle,
PChart * chart )
static

◆ p_intersect_line_2d_dir()

static 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 502 of file uv_parametrizer.cc.

References v2.

Referenced by p_rectangle_area().

◆ p_rectangle_area()

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

Definition at line 3546 of file uv_parametrizer.cc.

References corner1, corner2, len_v2v2(), and p_intersect_line_2d_dir().

Referenced by p_chart_minimum_area_angle().

◆ p_split_charts()

◆ p_split_vert()

◆ p_stretch_compute_vertex()

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

Definition at line 3375 of file uv_parametrizer.cc.

References e, p_face_stretch(), p_wheel_edge_next(), sum(), and v.

Referenced by p_chart_stretch_minimize().

◆ p_stretch_pin_boundary()

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

Definition at line 3304 of file uv_parametrizer.cc.

References PVERT_PIN, v, and blender::geometry::PChart::verts.

Referenced by uv_parametrizer_stretch_begin().

◆ p_triangle_angles()

static 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

Definition at line 336 of file uv_parametrizer.cc.

References angle_v3v3v3(), fix_large_angle(), max_dd(), and v2.

Referenced by p_face_angles().

◆ p_triangle_cos()

static 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()

static 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()

static 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()

static 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()

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

Definition at line 366 of file uv_parametrizer.cc.

References cos_v3v3v3(), and v2.

Referenced by p_chart_correct_degenerate_triangles2(), and p_triangle_cos().

◆ p_vert_add()

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

Definition at line 713 of file uv_parametrizer.cc.

References BLI_memarena_alloc(), BMVert::co, copy_v3_v3(), e, phash_insert(), UNLIKELY, and v.

Referenced by p_vert_lookup().

◆ p_vert_copy()

◆ p_vert_fix_edge_pointer()

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

Definition at line 1652 of file uv_parametrizer.cc.

References p_wheel_edge_prev(), and v.

Referenced by p_collapse_edge().

◆ p_vert_interior()

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

Definition at line 557 of file uv_parametrizer.cc.

References v.

Referenced by p_chart_abf_solve(), and p_collapse_allowed_topologic().

◆ p_vert_load_pin_select_uvs()

static void blender::geometry::p_vert_load_pin_select_uvs ( ParamHandle * handle,
PVert * v )
static

◆ p_vert_lookup()

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

Definition at line 742 of file uv_parametrizer.cc.

References e, p_vert_add(), phash_lookup(), and v.

Referenced by p_face_add_construct().

◆ p_wheel_edge_next() [1/2]

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

Definition at line 530 of file uv_parametrizer.cc.

References e.

◆ p_wheel_edge_next() [2/2]

◆ p_wheel_edge_prev()

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

Definition at line 535 of file uv_parametrizer.cc.

References e.

Referenced by p_collapse_edge(), p_split_vert(), and p_vert_fix_edge_pointer().

◆ pack_gobel()

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

Frits Göbel, 1979.

Definition at line 692 of file uv_pack.cc.

References cosf, DEG2RADF, int, and sqrtf.

Referenced by pack_islands_optimal_pack().

◆ pack_island_box_pack_2d()

static void blender::geometry::pack_island_box_pack_2d ( const Span< std::unique_ptr< UVAABBIsland > > aabbs,
const UVPackIsland_Params & params,
MutableSpan< UVPhi > r_phis,
rctf * r_extent )
static

Definition at line 1091 of file uv_pack.cc.

References BLI_box_pack_2d(), is_larger(), MEM_freeN(), MEM_mallocN, params, and BoxPack::w.

◆ pack_island_xatlas()

static 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 1622 of file uv_pack.cc.

References blender::geometry::Occupancy::bitmap_radix, blender::geometry::PackIsland::can_rotate_(), blender::geometry::PackIsland::can_scale_(), blender::geometry::PackIsland::can_translate_(), blender::geometry::Occupancy::clear(), ED_UVPACK_SHAPE_AABB, find_best_fit_for_island(), G, blender::geometry::PackIsland::get_diagonal_support(), guess_initial_scale(), blender::geometry::Occupancy::increase_scale(), is_larger(), params, blender::geometry::PackIsland::pivot_, rotate_inside_square(), blender::MutableSpan< T >::size(), sqrt(), sqrtf, sub_v2_v2(), blender::geometry::Occupancy::trace_island(), rctf::xmax, and rctf::ymax.

◆ pack_islands() [1/2]

◆ pack_islands() [2/2]

◆ pack_islands_alpaca_rotate()

static 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 569 of file uv_pack.cc.

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

Referenced by pack_islands_fast().

◆ pack_islands_alpaca_turbo()

static 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 458 of file uv_pack.cc.

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

Referenced by pack_islands_fast().

◆ pack_islands_fast()

static 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 675 of file uv_pack.cc.

References pack_islands_alpaca_rotate(), and pack_islands_alpaca_turbo().

◆ pack_islands_margin_fraction()

static 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 2003 of file uv_pack.cc.

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

Referenced by pack_islands(), and pack_islands_margin_fraction().

◆ pack_islands_optimal_pack()

static void blender::geometry::pack_islands_optimal_pack ( const Span< std::unique_ptr< UVAABBIsland > > aabbs,
const UVPackIsland_Params & params,
MutableSpan< UVPhi > r_phis,
rctf * r_extent )
static

◆ pack_islands_optimal_pack_table()

static 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

Definition at line 728 of file uv_pack.cc.

References is_larger(), and params.

Referenced by pack_islands_optimal_pack().

◆ pack_islands_scale_margin()

static 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 co-ordinate.

Definition at line 1806 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_, and params.

Referenced by pack_islands(), and pack_islands_margin_fraction().

◆ 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 27 of file simplify_curves.cc.

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

Referenced by ramer_douglas_peucker().

◆ phash_insert()

◆ phash_lookup()

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

◆ phash_new()

◆ phash_next()

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

◆ phash_safe_delete()

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

◆ phash_size()

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

Definition at line 215 of file uv_parametrizer.cc.

References blender::geometry::PHash::size.

Referenced by p_connect_pairs().

◆ plusminus_90_angle()

static float blender::geometry::plusminus_90_angle ( float angle_radians)
static

Angle rounding helper for "D4" transforms.

Definition at line 228 of file uv_pack.cc.

References angle_match(), angle_wrap(), BLI_assert, and DEG2RADF.

◆ 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 )

◆ poly_find_doubles()

◆ prepare_attribute_fallbacks()

static Vector< std::pair< int, GSpan > > blender::geometry::prepare_attribute_fallbacks ( GatherTasksInfo & gather_info,
const Instances & instances,
const OrderedAttributes & ordered_attributes )
static

◆ preprocess_curves()

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

Definition at line 1703 of file realize_instances.cc.

References blender::geometry::AllCurvesInfo::attributes, blender::geometry::RealizeCurveInfo::attributes, blender::geometry::AllCurvesInfo::create_custom_normal_attribute, blender::geometry::AllCurvesInfo::create_handle_postion_attributes, blender::geometry::AllCurvesInfo::create_id_attribute, blender::geometry::AllCurvesInfo::create_nurbs_weight_attribute, blender::geometry::AllCurvesInfo::create_radius_attribute, blender::geometry::AllCurvesInfo::create_resolution_attribute, blender::geometry::RealizeCurveInfo::curves, blender::geometry::RealizeCurveInfo::custom_normal, gather_curves_to_realize(), gather_generic_curve_attributes_to_propagate(), Curves::geometry, blender::GVArrayCommon::get_internal_span(), blender::geometry::RealizeCurveInfo::handle_left, blender::geometry::RealizeCurveInfo::handle_right, blender::geometry::OrderedAttributes::ids, blender::geometry::OrderedAttributes::index_range(), blender::geometry::OrderedAttributes::kinds, blender::geometry::RealizeCurveInfo::nurbs_weight, options, blender::geometry::AllCurvesInfo::order, preprocess_curves(), blender::geometry::RealizeCurveInfo::radius, blender::geometry::AllCurvesInfo::realize_info, blender::geometry::RealizeCurveInfo::resolution, blender::geometry::OrderedAttributes::size(), blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), blender::geometry::RealizeCurveInfo::stored_ids, blender::GSpan::typed(), and blender::bke::GAttributeReader::varray.

Referenced by preprocess_curves(), and realize_instances().

◆ preprocess_grease_pencils()

◆ preprocess_meshes()

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

Definition at line 1330 of file realize_instances.cc.

References blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::geometry::AllMeshesInfo::attributes, blender::geometry::MeshRealizeInfo::attributes, blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::begin(), blender::geometry::MeshRealizeInfo::corner_edges, blender::geometry::MeshRealizeInfo::corner_verts, blender::geometry::AllMeshesInfo::create_id_attribute, blender::geometry::AllMeshesInfo::create_material_index_attribute, blender::geometry::MeshRealizeInfo::edges, blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::end(), blender::geometry::MeshRealizeInfo::faces, blender::Array< T, InlineBufferCapacity, Allocator >::first(), gather_generic_mesh_attributes_to_propagate(), gather_meshes_to_realize(), blender::GVArrayCommon::get_internal_span(), blender::geometry::OrderedAttributes::ids, blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::index_of(), blender::geometry::OrderedAttributes::index_range(), blender::geometry::OrderedAttributes::kinds, blender::geometry::MeshRealizeInfo::material_index_map, blender::geometry::MeshRealizeInfo::material_indices, blender::geometry::AllMeshesInfo::materials, blender::geometry::MeshRealizeInfo::mesh, mesh, blender::geometry::AllMeshesInfo::no_loose_edges_hint, blender::geometry::AllMeshesInfo::no_loose_verts_hint, blender::geometry::AllMeshesInfo::no_overlapping_hint, options, blender::geometry::AllMeshesInfo::order, blender::geometry::MeshRealizeInfo::positions, preprocess_meshes(), blender::geometry::AllMeshesInfo::realize_info, blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize(), blender::geometry::OrderedAttributes::size(), blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::size(), blender::geometry::MeshRealizeInfo::stored_vertex_ids, blender::GSpan::typed(), and blender::bke::GAttributeReader::varray.

Referenced by preprocess_meshes(), and realize_instances().

◆ preprocess_pointclouds()

◆ propagate_edge_attributes()

◆ propagate_instances_to_keep()

static 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()

◆ ramer_douglas_peucker()

◆ realize_instances() [1/2]

bke::GeometrySet 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 2279 of file realize_instances.cc.

References blender::geometry::VariedDepthOptions::depths, blender::bke::GeometrySet::get_instances(), blender::bke::GeometrySet::has_instances(), blender::bke::Instances::instances_num(), 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::nodes::node_geo_grease_pencil_to_curves_cc::node_geo_exec(), blender::nodes::node_geo_realize_instances_cc::node_geo_exec(), realize_instances(), and realize_instances().

◆ realize_instances() [2/2]

bke::GeometrySet 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 2293 of file realize_instances.cc.

References blender::bke::GeometrySet::add(), blender::geometry::AllInstancesInfo::attribute_fallback, blender::geometry::AllCurvesInfo::attributes, blender::geometry::AllGreasePencilsInfo::attributes, blender::geometry::AllMeshesInfo::attributes, blender::geometry::AllPointCloudsInfo::attributes, 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::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::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::GatherTasks::mesh_tasks, options, blender::geometry::GatherTasks::pointcloud_tasks, preprocess_curves(), preprocess_grease_pencils(), preprocess_meshes(), preprocess_pointclouds(), propagate_instances_to_keep(), blender::geometry::GatherTasksInfo::r_tasks, realize_instances(), remove_id_attribute_from_instances(), blender::geometry::VariedDepthOptions::selection, and blender::geometry::OrderedAttributes::size().

◆ reassign_loose_edge_verts()

static 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 464 of file mesh_split_edges.cc.

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

Referenced by reassign_loose_edge_verts(), and split_edges().

◆ remap_edges()

static 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()

static 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()

static void blender::geometry::remove_id_attribute_from_instances ( bke::GeometrySet & geometry_set)
static

◆ reorder_and_flip_attributes_group_to_group()

◆ reorder_and_flip_curves()

◆ 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_exec()

◆ reorder_curves_geometry()

bke::CurvesGeometry blender::geometry::reorder_curves_geometry ( const bke::CurvesGeometry & src_curves,
Span< int > old_by_new_map,
const bke::AttributeFilter & attribute_filter )

◆ reorder_customdata()

◆ reorder_customdata_groups()

static void blender::geometry::reorder_customdata_groups ( CustomData & data,
const OffsetIndices< int > old_offsets,
const OffsetIndices< int > new_offsets,
const Span< int > new_by_old_map )
static

◆ 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_instaces_exec()

static void blender::geometry::reorder_instaces_exec ( const bke::Instances & src_instances,
const Span< int > old_by_new_map,
bke::Instances & dst_instances )
static

◆ reorder_mesh()

Mesh * blender::geometry::reorder_mesh ( const Mesh & src_mesh,
Span< int > old_by_new_map,
bke::AttrDomain domain,
const bke::AttributeFilter & attribute_filter )

◆ reorder_mesh_edges_exec()

static void blender::geometry::reorder_mesh_edges_exec ( const Mesh & src_mesh,
const Span< int > old_by_new_map,
Mesh & dst_mesh )
static

◆ reorder_mesh_exec()

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

◆ reorder_mesh_faces_exec()

static void blender::geometry::reorder_mesh_faces_exec ( const Mesh & src_mesh,
const Span< int > old_by_new_map,
Mesh & dst_mesh )
static

◆ reorder_mesh_verts_exec()

static void blender::geometry::reorder_mesh_verts_exec ( const Mesh & src_mesh,
const Span< int > old_by_new_map,
Mesh & dst_mesh )
static

◆ reorder_points()

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

◆ reorder_points_exec()

static void blender::geometry::reorder_points_exec ( const PointCloud & src_pointcloud,
const Span< int > old_by_new_map,
PointCloud & dst_pointcloud )
static

Definition at line 164 of file reorder.cc.

References Geometry::attributes, and reorder_points_exec().

Referenced by reorder_points(), and reorder_points_exec().

◆ reordered_component()

bke::GeometryComponentPtr blender::geometry::reordered_component ( const bke::GeometryComponent & src_component,
Span< int > old_by_new_map,
bke::AttrDomain domain,
const bke::AttributeFilter & attribute_filter )

◆ 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 = {} )

Definition at line 467 of file resample_curves.cc.

References get_count_input_max_one(), and resample_to_uniform().

◆ 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]

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

◆ resample_to_evaluated() [2/2]

◆ 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 = {} )

Definition at line 514 of file resample_curves.cc.

References get_count_input_from_length(), and resample_to_uniform().

◆ resample_to_length() [2/2]

◆ resample_to_uniform() [1/2]

◆ resample_to_uniform() [2/2]

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

◆ retrieve_attribute_spans() [1/2]

◆ retrieve_attribute_spans() [2/2]

◆ reverse_order()

◆ rotate_inside_square()

static 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

◆ sample_curve_attribute()

◆ sample_interval_bezier()

template<bool include_start_point = true>
static 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 >
static 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>
static 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 306 of file trim_curves.cc.

References 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, and blender::IndexRange::size().

◆ scale_input_assign()

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

◆ seed_from_curves()

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

Definition at line 64 of file randomize.cc.

Referenced by debug_randomize_curve_order().

◆ seed_from_instances()

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

Definition at line 69 of file randomize.cc.

Referenced by debug_randomize_instance_order().

◆ seed_from_mesh()

static 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 54 of file randomize.cc.

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

◆ seed_from_pointcloud()

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

Definition at line 59 of file randomize.cc.

References PointCloud::totpoint.

Referenced by debug_randomize_point_order().

◆ selection_to_bit_vector()

static BitVector blender::geometry::selection_to_bit_vector ( const IndexMask & selection,
const int total_size )
static

Definition at line 111 of file mesh_split_edges.cc.

Referenced by split_edges().

◆ separate_curves_selection()

static std::optional< bke::CurvesGeometry > blender::geometry::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

◆ separate_geometry() [1/2]

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.

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

◆ separate_geometry() [2/2]

◆ separate_grease_pencil_layer_selection()

static std::optional< GreasePencil * > blender::geometry::separate_grease_pencil_layer_selection ( const GreasePencil & src_grease_pencil,
const fn::Field< bool > & selection_field,
const bke::AttributeFilter & attribute_filter )
static

◆ separate_mesh_selection()

static std::optional< Mesh * > blender::geometry::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

◆ separate_point_cloud_selection()

static std::optional< PointCloud * > blender::geometry::separate_point_cloud_selection ( const PointCloud & src_pointcloud,
const fn::Field< bool > & selection_field,
const bke::AttributeFilter & attribute_filter )
static
Returns
std::nullopt if the geometry should remain unchanged.

Definition at line 54 of file separate_geometry.cc.

References Geometry::attributes, BKE_pointcloud_new_nomain(), blender::bke::gather_attributes(), and PointCloud::totpoint.

Referenced by separate_geometry().

◆ sharing_info_equal()

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

Definition at line 17 of file mix_geometries.cc.

References b.

Referenced by create_id_index_map().

◆ signed_distance_fat_triangle()

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

◆ simplify_curve_attribute()

IndexMask blender::geometry::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 )

Compute an index masks of points to remove to simplify the curve attribute using the Ramer-Douglas-Peucker algorithm.

Definition at line 137 of file simplify_curves.cc.

References blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::index_mask::IndexMask::foreach_index(), simplify_curve_attribute(), and blender::GSpan::type().

Referenced by simplify_curve_attribute(), and blender::simplify_drawing().

◆ skip_transform()

◆ smooth_curve_attribute() [1/2]

void blender::geometry::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 )

◆ 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,
int iterations,
float influence,
bool smooth_ends,
bool keep_shape )

Definition at line 353 of file smooth_curves.cc.

References smooth_curve_positions().

◆ sort_tris_into_rows()

static 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 87 of file reverse_uv_sampler.cc.

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

Referenced by blender::geometry::ReverseUVSampler::ReverseUVSampler().

◆ sphere_corner_total()

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

Definition at line 41 of file mesh_primitive_uv_sphere.cc.

Referenced by create_uv_sphere_mesh().

◆ sphere_edge_total()

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

Definition at line 36 of file mesh_primitive_uv_sphere.cc.

Referenced by create_uv_sphere_mesh().

◆ sphere_face_total()

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

Definition at line 48 of file mesh_primitive_uv_sphere.cc.

Referenced by create_uv_sphere_mesh().

◆ sphere_vert_total()

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

◆ split_edges()

◆ subdivide_attribute_catmull_rom()

static 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]

static 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]

template<typename T >
static 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 Span< T > src,
MutableSpan< T > dst )
static

◆ subdivide_bezier_positions()

static 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()

static void blender::geometry::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,
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,
const bool is_last_cyclic_segment )
static

◆ 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 271 of file subdivide_curves.cc.

References ATTR_DOMAIN_MASK_POINT, blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), calculate_result_offsets(), blender::index_mask::IndexMask::complement(), 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::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::Span< T >::last(), blender::bke::CurvesGeometry::offsets(), blender::bke::CurvesGeometry::offsets_for_write(), 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(), selection, blender::MutableSpan< T >::slice(), blender::Span< T >::slice(), subdivide_attribute_catmull_rom(), subdivide_attribute_linear(), subdivide_bezier_positions(), and subdivide_curves().

Referenced by subdivide_curves(), blender::nodes::node_geo_curve_subdivide_cc::subdivide_curves(), blender::subdivide_drawing(), and blender::nodes::node_geo_curve_subdivide_cc::subdivide_grease_pencil_curves().

◆ swap_edge_vert()

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

Definition at line 449 of file mesh_split_edges.cc.

References swap_edge_vert().

Referenced by reassign_loose_edge_verts(), and swap_edge_vert().

◆ threaded_copy()

static void blender::geometry::threaded_copy ( const GSpan src,
GMutableSpan dst )
static

◆ threaded_fill()

static void blender::geometry::threaded_fill ( const GPointer value,
GMutableSpan dst )
static

◆ to_bezier_size()

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

Definition at line 240 of file set_curve_type.cc.

References CURVE_TYPE_NURBS, and is_nurbs_to_bezier_one_to_one().

Referenced by convert_curves_to_bezier().

◆ to_nurbs_size()

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

Definition at line 257 of file set_curve_type.cc.

References CURVE_TYPE_BEZIER, and CURVE_TYPE_CATMULL_ROM.

Referenced by convert_curves_to_nurbs().

◆ toposort_connected_curves()

◆ transform_curve_edit_hints()

◆ transform_geometry()

◆ transform_gizmo_edit_hints()

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

◆ transform_grease_pencil_layers()

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

◆ transform_greasepencil()

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

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

References transform_greasepencil().

Referenced by transform_geometry(), and transform_greasepencil().

◆ transform_instances()

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

◆ transform_mesh() [1/2]

static void blender::geometry::transform_mesh ( Mesh & mesh,
const float4x4 & transform )
static

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

References transform_mesh(), and transform_positions().

◆ transform_mesh() [2/2]

◆ transform_pointcloud()

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

◆ transform_positions() [1/2]

static void blender::geometry::transform_positions ( const float4x4 & transform,
MutableSpan< float3 > positions )
static

Definition at line 384 of file realize_instances.cc.

◆ transform_positions() [2/2]

static void blender::geometry::transform_positions ( MutableSpan< float3 > positions,
const float4x4 & matrix )
static

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

◆ transform_volume()

◆ translate_curve_edit_hints()

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

◆ translate_geometry()

◆ translate_gizmos_edit_hints()

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

◆ translate_greasepencil()

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

◆ translate_instances()

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

◆ translate_pointcloud()

static void blender::geometry::translate_pointcloud ( PointCloud & pointcloud,
const float3 translation )
static

◆ translate_positions()

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

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

References blender::threading::parallel_for().

◆ translate_volume()

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

◆ tri_to_cell_bounds()

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

Definition at line 64 of file reverse_uv_sampler.cc.

References blender::math::max(), blender::math::min(), and uv_to_cell().

◆ trim_attribute_linear()

static 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 929 of file trim_curves.cc.

References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), ATTR_DOMAIN_MASK_POINT, blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), BLI_assert, blender::index_mask::IndexMask::complement(), compute_curve_trim_parameters(), blender::bke::CurvesGeometry::curve_type_counts(), CURVE_TYPE_NURBS, CURVE_TYPE_POLY, blender::bke::CurvesGeometry::curve_types(), blender::bke::CurvesGeometry::curves_num(), blender::bke::CurvesGeometry::curves_range(), blender::bke::CurvesGeometry::ensure_evaluated_lengths(), blender::bke::CurvesGeometry::evaluated_positions(), blender::bke::CurvesGeometry::fill_curve_types(), blender::bke::CurvesGeometry::has_curve_with_type(), blender::index_mask::IndexMask::is_empty(), blender::Span< T >::last(), blender::bke::MutableAttributeAccessor::lookup_for_write_span(), blender::bke::CurvesGeometry::offsets(), blender::bke::CurvesGeometry::offsets_for_write(), blender::bke::CurvesGeometry::points_by_curve(), 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(), selection, blender::VArrayCommon< T >::size(), blender::bke::CurvesGeometry::tag_topology_changed(), trim_bezier_curves(), trim_catmull_rom_curves(), trim_curves(), trim_evaluated_curves(), and trim_polygonal_curves().

Referenced by blender::deform_drawing(), trim_curves(), and blender::nodes::node_geo_curve_trim_cc::trim_curves().

◆ trim_evaluated_curves()

◆ trim_polygonal_curves()

◆ trim_sample_length()

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

◆ update_corner_verts()

static 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 300 of file mesh_split_edges.cc.

References update_corner_verts().

Referenced by split_edges(), and update_corner_verts().

◆ update_hole_rotate()

static 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 527 of file uv_pack.cc.

References BLI_assert, and UNUSED_VARS.

Referenced by pack_islands_alpaca_rotate().

◆ update_unselected_edges()

static 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()

void blender::geometry::uv_parametrizer_aspect_ratio ( ParamHandle * handle,
float aspect_y )

◆ uv_parametrizer_average()

◆ uv_parametrizer_construct_end()

◆ uv_parametrizer_edge_set_seam()

◆ uv_parametrizer_face_add()

◆ uv_parametrizer_flush()

◆ uv_parametrizer_flush_restore()

void blender::geometry::uv_parametrizer_flush_restore ( ParamHandle * handle)

◆ 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_pack()

◆ uv_parametrizer_scale_x()

static 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,
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()

void blender::geometry::uv_parametrizer_stretch_blend ( ParamHandle * handle,
float blend )

◆ uv_parametrizer_stretch_end()

void blender::geometry::uv_parametrizer_stretch_end ( ParamHandle * handle)

◆ uv_parametrizer_stretch_iter()

◆ uv_prepare_pin_index()

void blender::geometry::uv_prepare_pin_index ( ParamHandle * handle,
const int bmvertindex,
const float uv[2] )

◆ uv_to_cell()

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

◆ vert_selection_from_edge()

static IndexMask blender::geometry::vert_selection_from_edge ( Span< int2 > edges,
const IndexMask & selected_edges,
int verts_num,
IndexMaskMemory & memory )

A vertex is selected if it's used by a selected edge.

Definition at line 13 of file mesh_selection.cc.

References blender::index_mask::IndexMask::foreach_index_optimized(), and blender::index_mask::IndexMask::from_bools().

Referenced by split_edges().

◆ 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 )

A vertex is selected if it is used by a selected face.

Definition at line 39 of file mesh_selection.cc.

References mapped_corner_selection_from_face().

◆ weld_edge_ctx_alloc_and_find_collapsed()

static Vector< WeldEdge > blender::geometry::weld_edge_ctx_alloc_and_find_collapsed ( Span< int2 > edges,
Span< int > vert_dest_map,
MutableSpan< int > r_edge_dest_map,
int * r_edge_collapsed_len )
static

Alloc Weld Edges.

Returns
r_edge_dest_map: First step to create map of indices pointing edges that will be merged.

Definition at line 330 of file mesh_merge_by_distance.cc.

References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), ELEM_COLLAPSED, OUT_OF_CONTEXT, blender::Vector< T, InlineBufferCapacity, Allocator >::reserve(), and v2.

Referenced by weld_mesh_context_create().

◆ weld_edge_find_doubles()

static void blender::geometry::weld_edge_find_doubles ( Span< WeldEdge > weld_edges,
int mvert_num,
MutableSpan< int > r_edge_dest_map,
int * r_edge_double_kill_len )
static

Fills r_edge_dest_map indicating the duplicated edges.

Parameters
weld_edgesCandidate edges for merging (edges that don't collapse and that have at least one weld vertex).
r_edge_dest_mapResulting map of indices pointing the source edges to each target.
r_edge_double_kill_lenResulting number of duplicate edges to be destroyed.

Definition at line 377 of file mesh_merge_by_distance.cc.

References BLI_assert, blender::geometry::WeldEdge::edge_orig, ELEM, ELEM_COLLAPSED, blender::Span< T >::index_range(), blender::Span< T >::is_empty(), blender::Array< T, InlineBufferCapacity, Allocator >::last(), OUT_OF_CONTEXT, blender::Span< T >::size(), blender::geometry::WeldEdge::vert_a, and blender::geometry::WeldEdge::vert_b.

Referenced by weld_mesh_context_create().

◆ weld_iter_loop_of_poly_begin()

◆ weld_iter_loop_of_poly_next()

◆ weld_mesh_context_create()

◆ weld_poly_find_doubles()

◆ weld_poly_loop_ctx_alloc()

◆ weld_poly_loop_ctx_setup_collapsed_and_split()

static void blender::geometry::weld_poly_loop_ctx_setup_collapsed_and_split ( const int remain_edge_ctx_len,
WeldMesh * r_weld_mesh )
static

Alloc Weld Polygons and Weld Loops.

Parameters
remain_edge_ctx_lenContext weld edges that won't be destroyed by merging.
r_vlinksAn uninitialized buffer used to compute groups of WeldPolys attached to each weld target vertex. It doesn't need to be passed as a parameter but this is done to reduce allocations.
Returns
r_weld_mesh: Loop and face members will be configured here.

Definition at line 864 of file mesh_merge_by_distance.cc.

References BLI_assert, blender::geometry::WeldLoop::edge, ELEM_COLLAPSED, blender::geometry::WeldMesh::face_kill_len, blender::geometry::WeldLoop::flag, blender::geometry::WeldPoly::flag, l, blender::geometry::WeldPoly::loop_end, blender::geometry::WeldMesh::loop_kill_len, blender::geometry::WeldMesh::loop_map, blender::geometry::WeldLoop::loop_next, blender::geometry::WeldLoop::loop_orig, blender::geometry::WeldPoly::loop_start, OUT_OF_CONTEXT, blender::geometry::WeldMesh::vert_dest_map, weld_poly_split_recursive(), blender::geometry::WeldMesh::wloop, and blender::geometry::WeldMesh::wpoly.

Referenced by weld_mesh_context_create().

◆ weld_poly_split_recursive()

◆ weld_vert_ctx_alloc_and_setup()

static Vector< int > blender::geometry::weld_vert_ctx_alloc_and_setup ( MutableSpan< int > vert_dest_map,
const int vert_kill_len )
static

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 38 of file add_curves_on_mesh.cc.

Referenced by find_curve_neighbors().

◆ 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 179 of file uv_parametrizer.cc.

Referenced by phash_insert(), and phash_new().