parasolid中的PK_BCURVE_create函数调用失败,错误类型931,无论怎么更改PK_BCURVE_sf_s的参数错误类型都是931,问题出在哪里?
void parasolid_BCurve()
{
PK_BCURVE_sf_s* bcurve_sf = new PK_BCURVE_sf_s();
bcurve_sf->degree = 2;
bcurve_sf->n_vertices = 8;
bcurve_sf->vertex_dim = 2;
bcurve_sf->is_rational = PK_LOGICAL_false;
bcurve_sf->vertex = new double[bcurve_sf->n_vertices * bcurve_sf->vertex_dim] {
1.0, 1.0, // P0
2.0, 2.0, // P1
3.0, 2.0, // P2
4.0, 1.5, // P3
5.0, 2.0, // P4
6.0, 2.5, // P5
7.0, 2.0, // P6
8.0, 1.5, // P7
};
bcurve_sf->form = PK_BCURVE_form_arbitrary_c;
bcurve_sf->n_knots = 11;
bcurve_sf->knot = new double[bcurve_sf->n_knots] { 0, 0, 0, 1, 2, 3, 4, 4, 5, 5, 5};
bcurve_sf->knot_mult = new int[bcurve_sf->n_knots] { 3, 3, 3, 1, 1, 1, 2, 2, 3, 3, 3};
bcurve_sf->knot_type = PK_knot_uniform_c;
bcurve_sf->is_periodic = PK_LOGICAL_false;
bcurve_sf->is_closed = PK_LOGICAL_false;
bcurve_sf->self_intersecting = PK_self_intersect_false_c;
PK_BCURVE_t bcurve;
PK_ERROR_code_t error = PK_BCURVE_create(bcurve_sf, &bcurve);
if (error != PK_ERROR_no_errors) {
std::cout << "Error creating B-spline curve." << std::endl;
}
delete[] bcurve_sf->vertex;
delete[] bcurve_sf->knot;
}
```