mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 05:52:33 +00:00
PERMISSIVE_EXTRUSION preproc directive
This commit is contained in:
@@ -114,16 +114,28 @@
|
|||||||
|
|
||||||
#define Kernel MAKE_TYPE_NAME(Kernel)
|
#define Kernel MAKE_TYPE_NAME(Kernel)
|
||||||
|
|
||||||
|
// uncomment if you'd like negative or close to zero extrusion depths to succeed
|
||||||
|
// #define PERMISSIVE_EXTRUSION
|
||||||
|
|
||||||
bool IfcGeom::Kernel::convert(const IfcSchema::IfcExtrudedAreaSolid* l, TopoDS_Shape& shape) {
|
bool IfcGeom::Kernel::convert(const IfcSchema::IfcExtrudedAreaSolid* l, TopoDS_Shape& shape) {
|
||||||
const double height = l->Depth() * getValue(GV_LENGTH_UNIT);
|
const double height = l->Depth() * getValue(GV_LENGTH_UNIT);
|
||||||
if (height < getValue(GV_PRECISION)) {
|
if (height < getValue(GV_PRECISION)) {
|
||||||
Logger::Message(Logger::LOG_ERROR, "Non-positive extrusion height encountered for:", l);
|
Logger::Message(Logger::LOG_ERROR, "Non-positive extrusion height encountered for:", l);
|
||||||
|
#ifndef PERMISSIVE_EXTRUSION
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
TopoDS_Shape face;
|
TopoDS_Shape face;
|
||||||
if ( !convert_face(l->SweptArea(),face) ) return false;
|
if ( !convert_face(l->SweptArea(),face) ) return false;
|
||||||
|
|
||||||
|
#ifdef PERMISSIVE_EXTRUSION
|
||||||
|
if (abs(height) < getValue(GV_PRECISION)) {
|
||||||
|
shape = face;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
gp_Trsf trsf;
|
gp_Trsf trsf;
|
||||||
bool has_position = true;
|
bool has_position = true;
|
||||||
#ifdef SCHEMA_IfcSweptAreaSolid_Position_IS_OPTIONAL
|
#ifdef SCHEMA_IfcSweptAreaSolid_Position_IS_OPTIONAL
|
||||||
|
|||||||
Reference in New Issue
Block a user