IfcCraneRailAShapeProfileDef for better or worse

This commit is contained in:
Thomas Krijnen
2020-03-17 11:55:54 +01:00
parent 481c6165ca
commit 9a99f85026
2 changed files with 47 additions and 0 deletions
+43
View File
@@ -968,6 +968,49 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcCircleProfileDef* l, TopoDS_Sh
return success;
}
#ifdef SCHEMA_HAS_IfcCraneRailAShapeProfileDef
bool IfcGeom::Kernel::convert(const IfcSchema::IfcCraneRailAShapeProfileDef* l, TopoDS_Shape& face) {
double oh = l->OverallHeight() * getValue(GV_LENGTH_UNIT);
double bw2 = l->BaseWidth2() * getValue(GV_LENGTH_UNIT);
double hw = l->HeadWidth() * getValue(GV_LENGTH_UNIT);
double hd2 = l->HeadDepth2() * getValue(GV_LENGTH_UNIT);
double hd3 = l->HeadDepth3() * getValue(GV_LENGTH_UNIT);
double wt = l->WebThickness() * getValue(GV_LENGTH_UNIT);
double bw4 = l->BaseWidth4() * getValue(GV_LENGTH_UNIT);
double bd1 = l->BaseDepth1() * getValue(GV_LENGTH_UNIT);
double bd2 = l->BaseDepth2() * getValue(GV_LENGTH_UNIT);
double bd3 = l->BaseDepth3() * getValue(GV_LENGTH_UNIT);
gp_Trsf2d trsf2d;
bool has_position = true;
#ifdef SCHEMA_IfcParameterizedProfileDef_Position_IS_OPTIONAL
has_position = l->hasPosition();
#endif
if (has_position) {
IfcGeom::Kernel::convert(l->Position(), trsf2d);
}
double coords[28] = {
-hw / 2., +oh / 2.,
-hw / 2., +oh / 2. - hd3,
-wt / 2., +oh / 2. - hd2,
-wt / 2., -oh / 2. + bd2,
-bw4 / 2., -oh / 2. + bd3,
-bw2 / 2., -oh / 2. + bd1,
-bw2 / 2., -oh / 2.,
+bw2 / 2., -oh / 2.,
+bw2 / 2., -oh / 2. + bd1,
+bw4 / 2., -oh / 2. + bd3,
+wt / 2., -oh / 2. + bd2,
+wt / 2., +oh / 2. - hd2,
+hw / 2., +oh / 2. - hd3,
+hw / 2., +oh / 2.
};
return profile_helper(14, coords, 0, 0, 0, trsf2d, face);
}
#endif
bool IfcGeom::Kernel::convert(const IfcSchema::IfcCircleHollowProfileDef* l, TopoDS_Shape& face) {
const double r = l->Radius() * getValue(GV_LENGTH_UNIT);
const double t = l->WallThickness() * getValue(GV_LENGTH_UNIT);
+4
View File
@@ -121,6 +121,10 @@ FACE(IfcDerivedProfileDef);
// IfcAdvancedFace included in case of IFC4
FACE(IfcFace);
#ifdef SCHEMA_HAS_IfcCraneRailAShapeProfileDef
FACE(IfcCraneRailAShapeProfileDef);
#endif
WIRE(IfcEdgeCurve);
WIRE(IfcSubedge);
WIRE(IfcOrientedEdge);