客户端问题修改
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#include <gr2/types.h>
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
|
||||
int main() {
|
||||
// ScaleShearCurve uses 9 values per control point. A quadratic span reads
|
||||
// three control points, so this is the regression case for the former 3*4
|
||||
// stack buffer in Curve::eval().
|
||||
gr2::Curve curve;
|
||||
curve.degree = 2;
|
||||
curve.dim = 9;
|
||||
curve.knots = {0.0f, 1.0f, 2.0f};
|
||||
curve.controls.resize(27);
|
||||
for (size_t i = 0; i < curve.controls.size(); ++i) {
|
||||
curve.controls[i] = 1.0f + static_cast<float>(i) * 0.01f;
|
||||
}
|
||||
|
||||
float out[9] = {};
|
||||
curve.eval(0.5f, out);
|
||||
for (float value : out) {
|
||||
if (!std::isfinite(value)) {
|
||||
std::fprintf(stderr, "non-finite 9D curve output\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user