mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 22:43:41 +00:00
This commit is contained in:
@@ -101,11 +101,13 @@ namespace IfcGeom
|
||||
IteratorSettings()
|
||||
: settings_(WELD_VERTICES) // OR options that default to true here
|
||||
, deflection_tolerance_(1.e-3)
|
||||
, angular_tolerance_(0.5)
|
||||
{
|
||||
}
|
||||
|
||||
/// Note that this is independent of the IFC length unit, one millimeter by default.
|
||||
double deflection_tolerance() const { return deflection_tolerance_; }
|
||||
double angular_tolerance() const { return angular_tolerance_; }
|
||||
|
||||
void set_deflection_tolerance(double value)
|
||||
{
|
||||
@@ -118,6 +120,10 @@ namespace IfcGeom
|
||||
}
|
||||
}
|
||||
|
||||
void set_angular_tolerance(double value) {
|
||||
angular_tolerance_ = value;
|
||||
}
|
||||
|
||||
/// Get boolean value for a single settings or for a combination of settings.
|
||||
bool get(SettingField setting) const
|
||||
{
|
||||
@@ -143,7 +149,7 @@ namespace IfcGeom
|
||||
|
||||
protected:
|
||||
SettingField settings_;
|
||||
double deflection_tolerance_;
|
||||
double deflection_tolerance_, angular_tolerance_;
|
||||
};
|
||||
|
||||
class IFC_GEOM_API ElementSettings : public IteratorSettings
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace IfcGeom {
|
||||
|
||||
// Triangulate the shape
|
||||
try {
|
||||
BRepMesh_IncrementalMesh(s, settings().deflection_tolerance());
|
||||
BRepMesh_IncrementalMesh(s, settings().deflection_tolerance(), false, settings().angular_tolerance());
|
||||
} catch(...) {
|
||||
Logger::Message(Logger::LOG_ERROR, "Failed to triangulate shape");
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user