| 22 | using namespace ifcopenshell::geometry; |
| 23 | |
| 24 | taxonomy::ptr mapping::map_impl(const IfcSchema::IfcHalfSpaceSolid* inst) { |
| 25 | IfcSchema::IfcSurface* surface = inst->BaseSurface(); |
| 26 | if (!surface->declaration().is(IfcSchema::IfcPlane::Class())) { |
| 27 | Logger::Message(Logger::LOG_ERROR, "Unsupported BaseSurface:", surface); |
| 28 | return nullptr; |
| 29 | } |
| 30 | auto p = taxonomy::make<taxonomy::plane>(); |
| 31 | p->matrix = taxonomy::cast<taxonomy::matrix4>(map(((IfcSchema::IfcPlane*)surface)->Position())); |
| 32 | auto f = taxonomy::make<taxonomy::face>(); |
| 33 | f->orientation.reset(!inst->AgreementFlag()); |
| 34 | f->basis = p; |
| 35 | auto sh = taxonomy::make<taxonomy::shell>(); |
| 36 | sh->children.push_back(f); |
| 37 | auto so = taxonomy::make<taxonomy::solid>(); |
| 38 | so->children.push_back(sh); |
| 39 | return so; |
| 40 | } |