FUNCTION constraints_param_b_spline

(* SCHEMA integrated_cnc_schema; *)
FUNCTION constraints_param_b_spline (
    degree    : INTEGER;
    up_knots  : INTEGER;
    up_cp     : INTEGER;
    knot_mult : LIST OF INTEGER;
    knots     : LIST OF parameter_value 
    ) : BOOLEAN;
  LOCAL
    result : BOOLEAN := TRUE;
    k : INTEGER;
    sum : INTEGER;
  END_LOCAL;
    sum := knot_mult[1];
    REPEAT i := 2 TO up_knots;
      sum := sum + knot_mult[i];
    END_REPEAT;
    IF (((degree < 1) OR (up_knots < 2)) OR (up_cp < degree)) OR (sum <> 
      degree + up_cp + 2) THEN
      result := FALSE;
      RETURN (result);
    END_IF;
    k := knot_mult[1];
    IF (k < 1) OR (k > degree + 1) THEN
      result := FALSE;
      RETURN (result);
    END_IF;
    REPEAT i := 2 TO up_knots;
      IF (knot_mult[i] < 1) OR (knots[i] <= knots[(i - 1)]) THEN
        result := FALSE;
        RETURN (result);
      END_IF;
      k := knot_mult[i];
      IF (i < up_knots) AND (k > degree) THEN
        result := FALSE;
        RETURN (result);
      END_IF;
      IF (i = up_knots) AND (k > degree + 1) THEN
        result := FALSE;
        RETURN (result);
      END_IF;
    END_REPEAT;
    RETURN (result);
END_FUNCTION; -- 10303-42: geometry_schema

Referenced By

Defintion constraints_param_b_spline is references by the following definitions:
DefinitionType
 b_spline_curve_with_knots ENTITY
 b_spline_surface_with_knots ENTITY


[Top Level Definitions]

Generated by STEP ToolsTM EXPRESS to HTML Converter
on 2010-01-12T10:42:25-02:00