Navigation
Navigate Navigate Navigate Navigate

IfcSameDirection

Definition from IAI: The function compares two IfcDirection's and ensures that they are the same (with an epsilon precision factor).

HISTORY: New function in Release IFC2x Edition 2

EXPRESS specification:

FUNCTION IfcSameDirection
(dir1, dir2 : IfcDirection; Epsilon : REAL)
: LOGICAL;
  LOCAL
    dir1x : REAL := dir1.DirectionRatios[1];
    dir1y : REAL := dir1.DirectionRatios[2];
    dir1z : REAL := 0;
    dir2x : REAL := dir2.DirectionRatios[1];
    dir2y : REAL := dir2.DirectionRatios[2];
    dir2z : REAL := 0;
  END_LOCAL;

  IF (SIZEOF(dir1.DirectionRatios) > 2) THEN
    dir1z := dir1.DirectionRatios[3];
  END_IF;

  IF (SIZEOF(dir2.DirectionRatios) > 2) THEN
    dir2z := dir2.DirectionRatios[3];
  END_IF;
  
  RETURN (IfcSameValue(dir1x,dir2x,Epsilon) AND
          IfcSameValue(dir1y,dir2y,Epsilon) AND
          IfcSameValue(dir1z,dir2z,Epsilon));
END_FUNCTION;