Cancel
Showing results for
Did you mean:

# how can i draw clamped B-spline curves with control points by using parasolid API functions?

Experimenter

Hi everyone,

I am using parasolid API functions to draw some clamped B-spline curves with control points. to make it clamp Im using non uniform knot type so  I can define multiple knot values to make it clamp, but with that Im getting bad knot error;

following is my code

double vertex_2[12] = {0, 2, 0, 1, 3, 0, 2, 2, 0, 3, 3, 0};

double knot_2_nu[7] = {0, 0, 1.75, 2, 2.5, 3.75, 4.5};
int knot_mult_2[7] = {1, 1, 1, 1, 1, 1, 1};

bcurve_sf.degree = 2;
bcurve_sf.n_vertices = 4;
bcurve_sf.vertex_dim = 3;
bcurve_sf.is_rational = PK_LOGICAL_false;
bcurve_sf.vertex = vertex_2_nu;
bcurve_sf.form = PK_BCURVE_form_unset_c;
bcurve_sf.n_knots = 7;
bcurve_sf.knot_mult = knot_mult_2;
bcurve_sf.knot = knot_2_nu;
bcurve_sf.knot_type = PK_knot_non_uniform_c;
bcurve_sf.is_periodic = PK_LOGICAL_false;
bcurve_sf.is_closed = PK_LOGICAL_false;
bcurve_sf.self_intersecting = PK_LOGICAL_false;

PK_BCURVE_create(&bcurve_sf, &bcurve);

3 REPLIES

# Re: how can i draw clamped B-spline curves with control points by using parasolid API functions?

Siemens Phenom

Your input data is contradictory. Your Knot_mult array says that the first knot has multiplicity = 1, but in fact it has multiplicity = 2.

The values in the knot array must be distinct.

```double knot_2_nu[6] = {0, 1.75, 2, 2.5, 3.75, 4.5};
int knot_mult_2[6] = {2, 1, 1, 1, 1, 1};```