#### IfcBaseAxis

##### Semantic definitions at the function

Function Definition

Definition from ISO/CD 10303-42:1992: This function returns normalized orthogonal directions, u[1], u[2] and, if appropriate, u[3]. In the three-dimensional case, with complete input data, u[3] is in the direction of axis3, u[1] is in the direction of the projection of axis1 onto the plane normal to u[3], andu[2] is orthogonal to both u[1] and u[3], taking the same sense as axis2. In the two-dimensional case u[1] is in the direction of axis1 and u[2] is perpendicular to this, taking its sense from axis2. For incomplete input data appropriate default values are derived.

> NOTE Corresponding STEP function: base_axis. Please refer to ISO/IS 10303-42:1994, p.99 for the final definition of the formal standard.
> HISTORY New function in IFC Release 2x

##### Formal representations

EXPRESS Specification

FUNCTION IfcBaseAxis
(Dim : INTEGER;
Axis1, Axis2, Axis3 : IfcDirection)
: LIST [2:3] OF IfcDirection;
LOCAL
U : LIST [2:3] OF IfcDirection;
Factor : REAL;
D1, D2 : IfcDirection;
END_LOCAL;
IF (Dim = 3) THEN
D1 := NVL(IfcNormalise(Axis3), IfcRepresentationItem() || IfcGeometricRepresentationItem () || IfcDirection([0.0,0.0,1.0]));
D2 := IfcFirstProjAxis(D1, Axis1);
U := [D2, IfcSecondProjAxis(D1, D2, Axis2), D1];
ELSE
IF EXISTS(Axis1) THEN
D1 := IfcNormalise(Axis1);
U := [D1, IfcOrthogonalComplement(D1)];
IF EXISTS(Axis2) THEN
Factor := IfcDotProduct(Axis2, U[2]);
IF (Factor < 0.0) THEN
U[2].DirectionRatios[1] := -U[2].DirectionRatios[1];
U[2].DirectionRatios[2] := -U[2].DirectionRatios[2];
END_IF;
END_IF;
ELSE
IF EXISTS(Axis2) THEN
D1 := IfcNormalise(Axis2);
U := [IfcOrthogonalComplement(D1), D1];
U[1].DirectionRatios[1] := -U[1].DirectionRatios[1];
U[1].DirectionRatios[2] := -U[1].DirectionRatios[2];
ELSE
U := [IfcRepresentationItem() || IfcGeometricRepresentationItem () || IfcDirection([1.0, 0.0]),
IfcRepresentationItem() || IfcGeometricRepresentationItem () || IfcDirection([0.0, 1.0])];
END_IF;
END_IF;
END_IF;
RETURN(U);
END_FUNCTION;

Link to this page