IfcConstraintsParamBSpline

Function Definition

注:定义符合ISO/CD 10303-42:1992
此函数检查B样条曲线或(B样条曲面的一个方向)的参数化,如果未发现不一致,则返回TRUE。这些约束是:
度≤1。
结上指数≤2。
控制点上指标≤度。
节点多重性之和=度+(控制点上的上索引)+2。
对于第一个和最后一个结,多重性以1和(度+1)为界。
对于所有其他节点,节点的多重性以1和度为界。
连续的节值在增加。
注:函数根据ISO 10303-42中定义的约束参数b样条进行调整。
IFC4中新增的函数

EXPRESS Specification

FUNCTION IfcConstraintsParamBSpline
( Degree, UpKnots, UpCp : INTEGER;
  KnotMult : LIST OF INTEGER;
  Knots : LIST OF IfcParameterValue ) 
: BOOLEAN;


  LOCAL
    Result : BOOLEAN := TRUE;
    K, Sum : INTEGER;
  END_LOCAL;

  (* Find sum of knot multiplicities. *)
  Sum := KnotMult[1];
  REPEAT i := 2 TO UpKnots;
    Sum := Sum + KnotMult[i];
  END_REPEAT;

  (* Check limits holding for all B-spline parametrisations *)
  IF (Degree < 1) OR (UpKnots < 2) OR (UpCp < Degree) OR
    (Sum <> (Degree + UpCp + 2)) THEN
    Result := FALSE;
    RETURN(Result);
  END_IF;

  K := KnotMult[1];
  IF (K < 1) OR (K > Degree + 1) THEN
    Result := FALSE;
    RETURN(Result);
  END_IF;

  REPEAT i := 2 TO UpKnots;
    IF (KnotMult[i] < 1) OR (Knots[i] <= Knots[i-1]) THEN
      Result := FALSE;
      RETURN(Result);
    END_IF;
    K := KnotMult[i];
    IF (i < UpKnots) AND (K > Degree) THEN
      Result := FALSE;
      RETURN(Result);
    END_IF;
    IF (i = UpKnots) AND (K > Degree + 1) THEN
      Result := FALSE;
      RETURN(Result);
    END_IF;
  END_REPEAT;

  RETURN(result); 
END_FUNCTION;
QQ 3087438119
原文地址:https://www.cnblogs.com/herd/p/14426739.html