creates geometry and business logic segments for horizontal alignment tangent runs
| 84 | |
| 85 | // creates geometry and business logic segments for horizontal alignment tangent runs |
| 86 | std::pair<typename Schema::IfcCurveSegment*, typename Schema::IfcAlignmentSegment*> create_tangent(typename Schema::IfcCartesianPoint* p, double dir, double length) { |
| 87 | // geometry |
| 88 | auto parent_curve = new Schema::IfcLine( |
| 89 | new Schema::IfcCartesianPoint(std::vector<double>({0, 0})), |
| 90 | new Schema::IfcVector(new Schema::IfcDirection(std::vector<double>{1.0, 0.0}), 1.0)); |
| 91 | |
| 92 | auto curve_segment = new Schema::IfcCurveSegment( |
| 93 | Schema::IfcTransitionCode::IfcTransitionCode_CONTSAMEGRADIENT, |
| 94 | new Schema::IfcAxis2Placement2D(p, new Schema::IfcDirection(std::vector<double>{cos(dir), sin(dir)})), |
| 95 | new Schema::IfcLengthMeasure(0.0), // start |
| 96 | new Schema::IfcLengthMeasure(length), |
| 97 | parent_curve); |
| 98 | |
| 99 | // business logic |
| 100 | auto design_parameters = new Schema::IfcAlignmentHorizontalSegment( |
| 101 | boost::none, boost::none, p, dir, 0.0, 0.0, length, boost::none, Schema::IfcAlignmentHorizontalSegmentTypeEnum::IfcAlignmentHorizontalSegmentType_LINE); |
| 102 | |
| 103 | auto alignment_segment = new Schema::IfcAlignmentSegment( |
| 104 | IfcParse::IfcGlobalId(), nullptr, boost::none, boost::none, boost::none, nullptr, nullptr, design_parameters); |
| 105 | |
| 106 | return {curve_segment, alignment_segment}; |
| 107 | } |
| 108 | |
| 109 | // creates geometry and business logic segments for horizontal alignment horizonal curves |
| 110 | std::pair<typename Schema::IfcCurveSegment*, typename Schema::IfcAlignmentSegment*> create_hcurve(typename Schema::IfcCartesianPoint* pc, double dir, double radius, double lc) { |