| 54 | } |
| 55 | |
| 56 | IfcGeom::ConversionResultShape* IfcGeom::Representation::BRep::as_compound(bool force_meters) const { |
| 57 | ConversionResultShape* accum = nullptr; |
| 58 | |
| 59 | for (auto it = begin(); it != end(); ++it) { |
| 60 | double unit_scale = 1.0; |
| 61 | if (!force_meters && settings().get<ifcopenshell::geometry::settings::ConvertBackUnits>().get()) { |
| 62 | unit_scale = 1.0 / settings().get<ifcopenshell::geometry::settings::LengthUnit>().get(); |
| 63 | } |
| 64 | auto s = it->apply_transform(unit_scale); |
| 65 | if (accum) { |
| 66 | auto n = accum->concat(s); |
| 67 | delete s; |
| 68 | delete accum; |
| 69 | accum = n; |
| 70 | } else { |
| 71 | accum = s->wrap_in_compound(); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | return accum; |
| 76 | } |
| 77 | |
| 78 | bool IfcGeom::Representation::BRep::calculate_surface_area(double& area) const { |
| 79 | std::unique_ptr<ConversionResultShape> s(as_compound()); |
no test coverage detected