mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 02:31:09 +00:00
Fixes for IfcRectangleHollowProfileDef and filleted profile generation.
This commit is contained in:
@@ -271,11 +271,11 @@ bool IfcGeom::convert(const IfcSchema::IfcRectangleHollowProfileDef* l, TopoDS_S
|
|||||||
const double y = l->YDim() / 2.0f * IfcGeom::GetValue(GV_LENGTH_UNIT);
|
const double y = l->YDim() / 2.0f * IfcGeom::GetValue(GV_LENGTH_UNIT);
|
||||||
const double d = l->WallThickness() * IfcGeom::GetValue(GV_LENGTH_UNIT);
|
const double d = l->WallThickness() * IfcGeom::GetValue(GV_LENGTH_UNIT);
|
||||||
|
|
||||||
const bool fr1 = l->hasInnerFilletRadius();
|
const bool fr1 = l->hasOuterFilletRadius();
|
||||||
const bool fr2 = l->hasInnerFilletRadius();
|
const bool fr2 = l->hasInnerFilletRadius();
|
||||||
|
|
||||||
const double r1 = fr2 ? l->OuterFilletRadius() * IfcGeom::GetValue(GV_LENGTH_UNIT) : 0.;
|
const double r1 = fr1 ? l->OuterFilletRadius() * IfcGeom::GetValue(GV_LENGTH_UNIT) : 0.;
|
||||||
const double r2 = fr1 ? l->InnerFilletRadius() * IfcGeom::GetValue(GV_LENGTH_UNIT) : 0.;
|
const double r2 = fr2 ? l->InnerFilletRadius() * IfcGeom::GetValue(GV_LENGTH_UNIT) : 0.;
|
||||||
|
|
||||||
if ( x < ALMOST_ZERO || y < ALMOST_ZERO ) {
|
if ( x < ALMOST_ZERO || y < ALMOST_ZERO ) {
|
||||||
Logger::Message(Logger::LOG_NOTICE,"Skipping zero sized profile:",l->entity);
|
Logger::Message(Logger::LOG_NOTICE,"Skipping zero sized profile:",l->entity);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#include <gp_Pnt.hxx>
|
#include <gp_Pnt.hxx>
|
||||||
#include <gp_Vec.hxx>
|
#include <gp_Vec.hxx>
|
||||||
@@ -350,15 +351,19 @@ bool IfcGeom::profile_helper(int numVerts, double* verts, int numFillets, int* f
|
|||||||
TopoDS_Face face;
|
TopoDS_Face face;
|
||||||
IfcGeom::convert_wire_to_face(w.Wire(),face);
|
IfcGeom::convert_wire_to_face(w.Wire(),face);
|
||||||
|
|
||||||
if ( numFillets ) {
|
if ( numFillets && *std::max_element(filletRadii, filletRadii + numFillets) > ALMOST_ZERO ) {
|
||||||
BRepFilletAPI_MakeFillet2d fillet (face);
|
BRepFilletAPI_MakeFillet2d fillet (face);
|
||||||
for ( int i = 0; i < numFillets; i ++ ) {
|
for ( int i = 0; i < numFillets; i ++ ) {
|
||||||
const double radius = filletRadii[i];
|
const double radius = filletRadii[i];
|
||||||
if ( radius < ALMOST_ZERO ) continue;
|
if ( radius <= ALMOST_ZERO ) continue;
|
||||||
fillet.AddFillet(vertices[filletIndices[i]],radius);
|
fillet.AddFillet(vertices[filletIndices[i]],radius);
|
||||||
}
|
}
|
||||||
fillet.Build();
|
fillet.Build();
|
||||||
face = TopoDS::Face(fillet.Shape());
|
if (fillet.IsDone()) {
|
||||||
|
face = TopoDS::Face(fillet.Shape());
|
||||||
|
} else {
|
||||||
|
Logger::Message(Logger::LOG_WARNING, "Failed to process profile fillets");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
face_shape = face;
|
face_shape = face;
|
||||||
|
|||||||
Reference in New Issue
Block a user