36 acc += multiplicity[++index];
46 int index = multiplicity.
size();
49 acc += multiplicity[--index];
63 const int order2 = order * 2;
65 knots.
slice(0, order2));
67 knots.
slice(knots.
size() - order2, order2));
73 const int acc_start = std::accumulate(left_mult.
begin(), left_mult.
begin() + leftmost + 1, 0);
74 const int acc_end = std::accumulate(&right_mult[rightmost], right_mult.
end(), 0);
75 int skip_start = acc_start - order;
76 int skip_end = acc_end - order;
91 const std::string &
name)
103 return name_.c_str();
108 return curve_.curve_num;
113 return curve_.points_by_curve()[spline_index].size();
130 return curve_.nurbs_orders()[spline_index] - 1;
140 return curve_.cyclic()[spline_index];
145 const int point_count = curve_.points_by_curve()[spline_index].
size();
146 const int8_t order = curve_.nurbs_orders()[spline_index];
147 const bool cyclic = curve_.cyclic()[spline_index];
151 knot_buffer.
resize(knot_count);
159 const IndexRange point_range = curve_.points_by_curve()[spline_index];
160 return curve_.positions().
slice(point_range);
170 : export_object_eval_(curve_object)
173 export_curve_ =
static_cast<Curve *
>(export_object_eval_->data);
176const Nurb *OBJLegacyCurve::get_spline(
const int spline_index)
const
183 return export_object_eval_->id.name + 2;
193 return export_object_eval_->object_to_world();
198 const Nurb *
const nurb = get_spline(spline_index);
205 const Nurb *
const nurb = get_spline(spline_index);
213 return dynamic_point_buffer.
as_span();
218 const Nurb *
const nurb = get_spline(spline_index);
226 const Nurb *
const nurb = get_spline(spline_index);
232 const Nurb *
const nurb = get_spline(spline_index);
238 const Nurb *
const nurb = get_spline(spline_index);
244 const Nurb *
const nurb = get_spline(spline_index);
250 const Nurb *
const nurb = get_spline(spline_index);
261 knot_buffer.
resize(knot_count);
Low-level operations for curves.
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE void copy_v3_v3(float r[3], const float a[3])
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
BPy_StructRNA * depsgraph
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
constexpr int64_t size() const
constexpr IndexRange drop_back(int64_t n) const
constexpr int64_t size() const
constexpr IndexRange slice(int64_t start, int64_t size) const
constexpr IndexRange drop_front(int64_t n) const
constexpr Span drop_front(int64_t n) const
constexpr Span slice(int64_t start, int64_t size) const
constexpr Span drop_back(int64_t n) const
constexpr int64_t size() const
void resize(const int64_t new_size)
Span< T > as_span() const
int num_control_points_v(int spline_index) const override
const char * get_curve_name() const override
int get_nurbs_degree_u(int spline_index) const override
int total_splines() const override
bool get_cyclic_u(int spline_index) const override
Span< float3 > vertex_coordinates(int spline_index, Vector< float3 > &dynamic_point_buffer) const override
OBJCurves(const bke::CurvesGeometry &curve, const float4x4 &transform, const std::string &name)
const float4x4 & object_transform() const override
int total_spline_vertices(int spline_index) const override
Span< float > get_knots_u(int spline_index, Vector< float > &buffer) const override
int num_control_points_u(int spline_index) const override
int get_nurbs_degree_v(int spline_index) const override
bool get_cyclic_u(int spline_index) const override
const float4x4 & object_transform() const override
int get_nurbs_degree_u(int spline_index) const override
int get_nurbs_degree_v(int spline_index) const override
int num_control_points_u(int spline_index) const override
OBJLegacyCurve(const Depsgraph *depsgraph, Object *curve_object)
const char * get_curve_name() const override
Span< float > get_knots_u(int spline_index, Vector< float > &buffer) const override
int total_spline_vertices(int spline_index) const override
int num_control_points_v(int spline_index) const override
Span< float3 > vertex_coordinates(int spline_index, Vector< float3 > &dynamic_point_buffer) const override
int total_splines() const override
Vector< int > calculate_multiplicity_sequence(Span< float > knots)
void calculate_knots(int points_num, KnotsMode mode, int8_t order, bool cyclic, MutableSpan< float > knots)
int control_points_num(int num_control_points, int8_t order, bool cyclic)
int knots_num(int points_num, int8_t order, bool cyclic)
KnotsMode knots_mode_from_legacy(short flag)
static int find_rightmost_span(const int8_t order, const Span< int > multiplicity)
Span< float > valid_nurb_control_point_range(const int8_t order, const Span< float > knots, IndexRange &point_range)
static int find_leftmost_span(const int8_t order, const Span< int > multiplicity)
MatBase< float, 4, 4 > float4x4