mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 22:11:36 +00:00
IfcAxis1Placement.Axis is optional #7728
This commit is contained in:
@@ -43,11 +43,20 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcRevolvedAreaSolid* inst) {
|
|||||||
angle = ang;
|
angle = ang;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
taxonomy::direction3::ptr axis;
|
||||||
|
if (inst->Axis()->Axis()) {
|
||||||
|
axis = taxonomy::cast<taxonomy::direction3>(map(inst->Axis()->Axis()));
|
||||||
|
} else {
|
||||||
|
// IfcAxis1Placement.Axis is optional, and defaults to (0, 0, 1) if not provided.
|
||||||
|
axis = taxonomy::make<taxonomy::direction3>(0, 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return taxonomy::make<taxonomy::revolve>(
|
return taxonomy::make<taxonomy::revolve>(
|
||||||
matrix,
|
matrix,
|
||||||
taxonomy::cast<taxonomy::face>(map(inst->SweptArea())),
|
taxonomy::cast<taxonomy::face>(map(inst->SweptArea())),
|
||||||
taxonomy::cast<taxonomy::point3>(map(inst->Axis()->Location())),
|
taxonomy::cast<taxonomy::point3>(map(inst->Axis()->Location())),
|
||||||
taxonomy::cast<taxonomy::direction3>(map(inst->Axis()->Axis())),
|
axis,
|
||||||
angle
|
angle
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -31,11 +31,19 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSurfaceOfRevolution* inst) {
|
|||||||
matrix = taxonomy::cast<taxonomy::matrix4>(map(inst->Position()));
|
matrix = taxonomy::cast<taxonomy::matrix4>(map(inst->Position()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
taxonomy::direction3::ptr axis;
|
||||||
|
if (inst->AxisPosition()->Axis()) {
|
||||||
|
axis = taxonomy::cast<taxonomy::direction3>(map(inst->AxisPosition()->Axis()));
|
||||||
|
} else {
|
||||||
|
// IfcAxis1Placement.Axis is optional, and defaults to (0, 0, 1) if not provided.
|
||||||
|
axis = taxonomy::make<taxonomy::direction3>(0, 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
return taxonomy::make<taxonomy::revolve>(
|
return taxonomy::make<taxonomy::revolve>(
|
||||||
matrix,
|
matrix,
|
||||||
taxonomy::cast<taxonomy::loop>(map(inst->SweptCurve())),
|
taxonomy::cast<taxonomy::loop>(map(inst->SweptCurve())),
|
||||||
taxonomy::cast<taxonomy::point3>(map(inst->AxisPosition()->Location())),
|
taxonomy::cast<taxonomy::point3>(map(inst->AxisPosition()->Location())),
|
||||||
taxonomy::cast<taxonomy::direction3>(map(inst->AxisPosition()->Axis())),
|
axis,
|
||||||
boost::none
|
boost::none
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,16 +24,11 @@ using namespace ifcopenshell::geometry;
|
|||||||
#ifdef SCHEMA_HAS_IfcToroidalSurface
|
#ifdef SCHEMA_HAS_IfcToroidalSurface
|
||||||
|
|
||||||
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcToroidalSurface* inst) {
|
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcToroidalSurface* inst) {
|
||||||
return nullptr;
|
auto c = taxonomy::make<taxonomy::torus>();
|
||||||
|
c->radius1 = inst->MajorRadius() * length_unit_;
|
||||||
/*
|
c->radius2 = inst->MinorRadius() * length_unit_;
|
||||||
gp_Trsf trsf;
|
c->matrix = taxonomy::cast<taxonomy::matrix4>(map(inst->Position()));
|
||||||
IfcGeom::Kernel::convert(inst->Position(), trsf);
|
return c;
|
||||||
|
|
||||||
// IfcElementarySurface.Position has unit scale factor
|
|
||||||
face = BRepBuilderAPI_MakeFace(new Geom_ToroidalSurface(gp::XOY(), inst->MajorRadius() * length_unit_, inst->MinorRadius() * length_unit_), getValue(GV_PRECISION)).Face().Moved(trsf);
|
|
||||||
return true;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -691,6 +691,10 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSurfaceStyle* style) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
taxonomy::ptr mapping::map(const IfcBaseInterface* inst) {
|
taxonomy::ptr mapping::map(const IfcBaseInterface* inst) {
|
||||||
|
if (inst == nullptr) {
|
||||||
|
Logger::Error("Warning nullptr passed to map() function");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
auto iden = inst->as<IfcUtil::IfcBaseClass>()->identity();
|
auto iden = inst->as<IfcUtil::IfcBaseClass>()->identity();
|
||||||
if (use_caching_) {
|
if (use_caching_) {
|
||||||
std::lock_guard<std::mutex> guard(cache_guard_);
|
std::lock_guard<std::mutex> guard(cache_guard_);
|
||||||
|
|||||||
Reference in New Issue
Block a user