Welcome to mirror list, hosted at ThFree Co, Russian Federation.

GEO_trim_curves.hh « geometry « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d2ff770f2256f26ce12d1a6e3664d4031b807400 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* SPDX-License-Identifier: GPL-2.0-or-later */

#pragma once

#include "BLI_span.hh"

#include "BKE_curves.hh"
#include "BKE_curves_utils.hh"
#include "BKE_geometry_set.hh"

namespace blender::geometry {

/*
 * Create a new Curves instance by trimming the input curves. Copying the selected splines
 * between the start and end points.
 */
bke::CurvesGeometry trim_curves(const bke::CurvesGeometry &src_curves,
                                IndexMask selection,
                                Span<bke::curves::CurvePoint> start_points,
                                Span<bke::curves::CurvePoint> end_points);

/**
 * Find the point(s) and piecewise segment corresponding to the given distance along the length of
 * the curve. Returns points on the evaluated curve for Catmull-Rom and NURBS splines.
 *
 * \param curves: Curve geometry to sample.
 * \param lengths: Distance along the curve on form [0.0, length] to determine the point for.
 * \param curve_indices: Curve index to lookup for each 'length', negative index are set to 0.
 * \param normalized_factors: If true, 'lengths' are normalized to the interval [0.0, 1.0].
 */
Array<bke::curves::CurvePoint, 12> lookup_curve_points(const bke::CurvesGeometry &curves,
                                                       Span<float> lengths,
                                                       Span<int64_t> curve_indices,
                                                       bool normalized_factors);

}  // namespace blender::geometry