triangulation-type setting for non-triangulated polyhedral from iterator

This commit is contained in:
Thomas Krijnen
2024-09-18 19:25:37 +02:00
parent 748fcce3f5
commit 2554280e50
12 changed files with 320 additions and 154 deletions
+18 -63
View File
@@ -378,12 +378,28 @@ namespace ifcopenshell {
static constexpr const char* const name = "model-rotation";
static constexpr const char* const description = "Applies an arbitrary quaternion rotation of form 'x,y,z,w' to all placements.";
};
enum TriangulationMethod {
TRIANGLE_MESH,
POLYHEDRON_WITHOUT_HOLES,
POLYHEDRON_WITH_HOLES
};
std::istream& operator>>(std::istream& in, TriangulationMethod& ioo);
struct TriangulationType : public SettingBase<TriangulationType, TriangulationMethod> {
static constexpr const char* const name = "triangulation-type";
static constexpr const char* const description = "Type of planar facet to be emitted";
static constexpr TriangulationMethod defaultvalue = TRIANGLE_MESH;
};
}
template <typename settings_t>
class IFC_GEOM_API SettingsContainer {
public:
typedef boost::variant<bool, int, double, std::string, std::set<int>, std::set<std::string>, std::vector<double>, IteratorOutputOptions, PiecewiseStepMethod, OutputDimensionalityTypes> value_variant_t;
typedef boost::variant<bool, int, double, std::string, std::set<int>, std::set<std::string>, std::vector<double>, IteratorOutputOptions, PiecewiseStepMethod, OutputDimensionalityTypes, TriangulationMethod> value_variant_t;
private:
settings_t settings;
@@ -470,73 +486,12 @@ namespace ifcopenshell {
};
class IFC_GEOM_API Settings : public SettingsContainer<
std::tuple<MesherLinearDeflection, MesherAngularDeflection, ReorientShells, LengthUnit, PlaneUnit, Precision, OutputDimensionality, LayersetFirst, DisableBooleanResult, NoWireIntersectionCheck, NoWireIntersectionTolerance, PrecisionFactor, DebugBooleanOperations, BooleanAttempt2d, WeldVertices, UseWorldCoords, UseMaterialNames, ConvertBackUnits, ContextIds, ContextTypes, ContextIdentifiers, IteratorOutput, DisableOpeningSubtractions, ApplyDefaultMaterials, DontEmitNormals, GenerateUvs, ApplyLayerSets, UseElementHierarchy, ValidateQuantities, EdgeArrows, BuildingLocalPlacement, SiteLocalPlacement, ForceSpaceTransparency, CircleSegments, KeepBoundingBoxes, PiecewiseStepType, PiecewiseStepParam, NoParallelMapping, ModelOffset, ModelRotation>
std::tuple<MesherLinearDeflection, MesherAngularDeflection, ReorientShells, LengthUnit, PlaneUnit, Precision, OutputDimensionality, LayersetFirst, DisableBooleanResult, NoWireIntersectionCheck, NoWireIntersectionTolerance, PrecisionFactor, DebugBooleanOperations, BooleanAttempt2d, WeldVertices, UseWorldCoords, UseMaterialNames, ConvertBackUnits, ContextIds, ContextTypes, ContextIdentifiers, IteratorOutput, DisableOpeningSubtractions, ApplyDefaultMaterials, DontEmitNormals, GenerateUvs, ApplyLayerSets, UseElementHierarchy, ValidateQuantities, EdgeArrows, BuildingLocalPlacement, SiteLocalPlacement, ForceSpaceTransparency, CircleSegments, KeepBoundingBoxes, PiecewiseStepType, PiecewiseStepParam, NoParallelMapping, ModelOffset, ModelRotation, TriangulationType>
>
{};
}
}
// namespace ifcopenshell {
// namespace geometry {
//
// class IFC_GEOM_API ConversionSettings {
// public:
// // Tolerances and settings for various geometrical operations:
// enum GeomValue {
// //
// // Default: 0.001m / 1mm
// GV_DEFLECTION_TOLERANCE,
//
// // The length unit used the creation of TopoDS_Shapes, primarily affects the
// // interpretation of IfcCartesianPoints and IfcVector magnitudes
// // DefaultL 1.0
// GV_LENGTH_UNIT,
// // The plane angle unit used for the creation of TopoDS_Shapes, primarily affects
// // the interpretation of IfcParamaterValues of IfcTrimmedCurves
// // Default: -1.0 (= not set, fist try degrees, then radians)
// GV_PLANEANGLE_UNIT,
// // The precision used in boolean operations, setting this value too low results
// // in artefacts and potentially modelling failures
// // Default: 0.00001 (obtained from IfcGeometricRepresentationContext if available)
// GV_PRECISION,
// // Whether to process shapes of type Face or higher (1) Wire or lower (-1) or all (0)
// GV_DIMENSIONALITY,
// GV_LAYERSET_FIRST,
// GV_DISABLE_BOOLEAN_RESULT,
// GV_NO_WIRE_INTERSECTION_CHECK,
// GV_PRECISION_FACTOR,
// GV_NO_WIRE_INTERSECTION_TOLERANCE,
// GV_DEBUG_BOOLEAN,
// GV_BOOLEAN_ATTEMPT_2D,
// NUM_SETTINGS
// };
//
// void setValue(GeomValue var, double value);
//
// double getValue(GeomValue var) const;
//
// private:
// std::array<double, NUM_SETTINGS> values_ = {
// /* deflection_tolerance = */ 0.001,
// // @todo make sure these 'read-only' variables work.
// /* minimal_face_area = */ std::numeric_limits<double>::quiet_NaN(),
// /* max_faces_to_orient = */ -1.0,
// /* ifc_length_unit = */ 1.0,
// /* ifc_planeangle_unit = */ -1.0,
// /* modelling_precision = */ 0.00001,
// /* dimensionality = */ 1.,
// /* layerset_first = */ -1.,
// /* disable_boolean_result = */ -1.
// /* no_wire_intersection_check = */ -1.,
// /* precision_factor = */ 10.,
// /* no_wire_intersection_tolerance = */ -1.,
// /* boolean_debug_setting = */ -1.,
// /* boolean_attempt_2d = */ 1.
// };
// };
// }
// }
// @todo find a place
namespace IfcGeom {
class IFC_GEOM_API geometry_exception : public std::exception {