Files
IfcOpenShell/src/ifcgeom/mapping/IfcSurfaceOfLinearExtrusion.cpp
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
2.4 KiB
C++
Raw Normal View History

2022-06-14 15:02:54 +02:00
/********************************************************************************
* *
* This file is part of IfcOpenShell. *
* *
* IfcOpenShell is free software: you can redistribute it and/or modify *
* it under the terms of the Lesser GNU General Public License as published by *
* the Free Software Foundation, either version 3.0 of the License, or *
* (at your option) any later version. *
* *
* IfcOpenShell is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* Lesser GNU General Public License for more details. *
* *
* You should have received a copy of the Lesser GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
2023-03-21 20:15:01 +01:00
#include "mapping.h"
#define mapping POSTFIX_SCHEMA(mapping)
using namespace ifcopenshell::geometry;
2022-06-14 15:02:54 +02:00
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSurfaceOfLinearExtrusion* inst) {
2023-03-21 20:15:01 +01:00
return nullptr;
2022-06-14 15:02:54 +02:00
2023-03-21 20:15:01 +01:00
/*
2022-06-14 15:02:54 +02:00
TopoDS_Wire wire;
2023-03-21 20:15:01 +01:00
if ( !convert_wire(inst->SweptCurve(), wire) ) {
2022-06-14 15:02:54 +02:00
TopoDS_Face face;
2023-03-21 20:15:01 +01:00
if ( !convert_face(inst->SweptCurve(),face) ) return false;
2022-06-14 15:02:54 +02:00
TopExp_Explorer exp(face, TopAbs_WIRE);
wire = TopoDS::Wire(exp.Current());
}
2023-03-21 20:15:01 +01:00
const double height = inst->Depth() * length_unit_;
2022-06-14 15:02:54 +02:00
gp_Trsf trsf;
bool has_position = true;
#ifdef SCHEMA_IfcSweptSurface_Position_IS_OPTIONAL
2023-03-21 20:15:01 +01:00
has_position = inst->Position() != nullptr;
2022-06-14 15:02:54 +02:00
#endif
if (has_position) {
2023-03-21 20:15:01 +01:00
IfcGeom::Kernel::convert(inst->Position(), trsf);
2022-06-14 15:02:54 +02:00
}
gp_Dir dir;
2023-03-21 20:15:01 +01:00
convert(inst->ExtrudedDirection(),dir);
2022-06-14 15:02:54 +02:00
shape = BRepPrimAPI_MakePrism(wire, height*dir);
if (has_position) {
// IfcSweptSurface.Position (trsf) is an IfcAxis2Placement3D
// and therefore has a unit scale factor
shape.Move(trsf);
}
return !shape.IsNull();
2023-03-21 20:15:01 +01:00
*/
2022-06-14 15:02:54 +02:00
}