mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-20 20:22:09 +00:00
Proceed with merge
This commit is contained in:
@@ -17,24 +17,33 @@
|
||||
* *
|
||||
********************************************************************************/
|
||||
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include "../ifcgeom/IfcGeom.h"
|
||||
#include "../ifcgeom_schema_agnostic/wire_utils.h"
|
||||
#include "mapping.h"
|
||||
|
||||
#define Kernel MAKE_TYPE_NAME(Kernel)
|
||||
#define mapping POSTFIX_SCHEMA(mapping)
|
||||
|
||||
bool IfcGeom::Kernel::convert(const IfcSchema::IfcArbitraryClosedProfileDef* l, TopoDS_Shape& face) {
|
||||
TopoDS_Wire wire;
|
||||
if (!convert_wire(l->OuterCurve(), wire)) {
|
||||
return false;
|
||||
using namespace ifcopenshell::geometry;
|
||||
|
||||
taxonomy::item* mapping::map_impl(const IfcSchema::IfcArbitraryClosedProfileDef* inst) {
|
||||
auto loop = map(inst->OuterCurve());
|
||||
if (loop) {
|
||||
auto face = new taxonomy::face;
|
||||
((taxonomy::loop*)loop)->external = true;
|
||||
face->children = { loop };
|
||||
|
||||
if (inst->as<IfcSchema::IfcArbitraryProfileDefWithVoids>()) {
|
||||
auto with_voids = inst->as<IfcSchema::IfcArbitraryProfileDefWithVoids>();
|
||||
auto voids = with_voids->InnerCurves();
|
||||
for (auto& v : *voids) {
|
||||
auto inner_loop = map(v);
|
||||
if (inner_loop) {
|
||||
((taxonomy::loop*)inner_loop)->external = false;
|
||||
face->children.push_back(inner_loop);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return face;
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
util::assert_closed_wire(wire, getValue(GV_PRECISION));
|
||||
|
||||
TopoDS_Compound f;
|
||||
bool success = util::convert_wire_to_faces(wire, f, {getValue(GV_NO_WIRE_INTERSECTION_CHECK) < 0., getValue(GV_NO_WIRE_INTERSECTION_TOLERANCE) < 0., 0., getValue(GV_PRECISION)});
|
||||
if (success) {
|
||||
face = f;
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user