@@ -378,12 +378,28 @@ namespace ifcopenshell {
378378 static constexpr const char * const name = " model-rotation" ;
379379 static constexpr const char * const description = " Applies an arbitrary quaternion rotation of form 'x,y,z,w' to all placements." ;
380380 };
381+
382+ enum TriangulationMethod {
383+ TRIANGLE_MESH,
384+ POLYHEDRON_WITHOUT_HOLES,
385+ POLYHEDRON_WITH_HOLES
386+ };
387+
388+ std::istream& operator >>(std::istream& in, TriangulationMethod& ioo);
389+
390+ struct TriangulationType : public SettingBase <TriangulationType, TriangulationMethod> {
391+ static constexpr const char * const name = " triangulation-type" ;
392+ static constexpr const char * const description = " Type of planar facet to be emitted" ;
393+ static constexpr TriangulationMethod defaultvalue = TRIANGLE_MESH;
394+ };
395+
396+
381397 }
382398
383399 template <typename settings_t >
384400 class IFC_GEOM_API SettingsContainer {
385401 public:
386- typedef boost::variant<bool , int , double , std::string, std::set<int >, std::set<std::string>, std::vector<double >, IteratorOutputOptions, PiecewiseStepMethod, OutputDimensionalityTypes> value_variant_t ;
402+ 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 ;
387403 private:
388404 settings_t settings;
389405
@@ -470,73 +486,12 @@ namespace ifcopenshell {
470486 };
471487
472488 class IFC_GEOM_API Settings : public SettingsContainer<
473- 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>
489+ 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 >
474490 >
475491 {};
476492}
477493}
478494
479- // namespace ifcopenshell {
480- // namespace geometry {
481- //
482- // class IFC_GEOM_API ConversionSettings {
483- // public:
484- // // Tolerances and settings for various geometrical operations:
485- // enum GeomValue {
486- // //
487- // // Default: 0.001m / 1mm
488- // GV_DEFLECTION_TOLERANCE,
489- //
490- // // The length unit used the creation of TopoDS_Shapes, primarily affects the
491- // // interpretation of IfcCartesianPoints and IfcVector magnitudes
492- // // DefaultL 1.0
493- // GV_LENGTH_UNIT,
494- // // The plane angle unit used for the creation of TopoDS_Shapes, primarily affects
495- // // the interpretation of IfcParamaterValues of IfcTrimmedCurves
496- // // Default: -1.0 (= not set, fist try degrees, then radians)
497- // GV_PLANEANGLE_UNIT,
498- // // The precision used in boolean operations, setting this value too low results
499- // // in artefacts and potentially modelling failures
500- // // Default: 0.00001 (obtained from IfcGeometricRepresentationContext if available)
501- // GV_PRECISION,
502- // // Whether to process shapes of type Face or higher (1) Wire or lower (-1) or all (0)
503- // GV_DIMENSIONALITY,
504- // GV_LAYERSET_FIRST,
505- // GV_DISABLE_BOOLEAN_RESULT,
506- // GV_NO_WIRE_INTERSECTION_CHECK,
507- // GV_PRECISION_FACTOR,
508- // GV_NO_WIRE_INTERSECTION_TOLERANCE,
509- // GV_DEBUG_BOOLEAN,
510- // GV_BOOLEAN_ATTEMPT_2D,
511- // NUM_SETTINGS
512- // };
513- //
514- // void setValue(GeomValue var, double value);
515- //
516- // double getValue(GeomValue var) const;
517- //
518- // private:
519- // std::array<double, NUM_SETTINGS> values_ = {
520- // /* deflection_tolerance = */ 0.001,
521- // // @todo make sure these 'read-only' variables work.
522- // /* minimal_face_area = */ std::numeric_limits<double>::quiet_NaN(),
523- // /* max_faces_to_orient = */ -1.0,
524- // /* ifc_length_unit = */ 1.0,
525- // /* ifc_planeangle_unit = */ -1.0,
526- // /* modelling_precision = */ 0.00001,
527- // /* dimensionality = */ 1.,
528- // /* layerset_first = */ -1.,
529- // /* disable_boolean_result = */ -1.
530- // /* no_wire_intersection_check = */ -1.,
531- // /* precision_factor = */ 10.,
532- // /* no_wire_intersection_tolerance = */ -1.,
533- // /* boolean_debug_setting = */ -1.,
534- // /* boolean_attempt_2d = */ 1.
535- // };
536- // };
537- // }
538- // }
539-
540495// @todo find a place
541496namespace IfcGeom {
542497 class IFC_GEOM_API geometry_exception : public std::exception {
0 commit comments