Last minute refactoring

This commit is contained in:
Thomas Krijnen
2026-08-08 07:42:45 +02:00
parent 8870ffb018
commit af58eaf79f
300 changed files with 5230 additions and 5150 deletions
@@ -307,8 +307,8 @@ Here is a typical example to serialising to glTF / glb. Example settings to
serialise to other formats are shown commented out. Different serialisations
may require different settings.
In addition to geometry settings, serialisation has its own set of
:doc:`../ifcopenshell/serialiser_settings`.
The same settings object also exposes the
:doc:`serialisation options <../ifcopenshell/serialiser_settings>`.
.. code-block:: python
@@ -331,15 +331,14 @@ In addition to geometry settings, serialisation has its own set of
# settings.set("apply-default-materials", True)
# settings.set("use-world-coords", True)
serialiser_settings = ifcopenshell.geom.serializer_settings()
# Setting element GUIDs is optional, but useful to uniquely identify objects in non-semantic formats.
serialiser_settings.set("use-element-guids", True)
settings.set("use-element-guids", True)
# Serialise to glTF / glb
serialiser = ifcopenshell.geom.serializers.gltf("output.glb", settings, serialiser_settings)
serialiser = ifcopenshell.geom.serializers.gltf("output.glb", settings)
# Serialise to obj
# serialiser = ifcopenshell.geom.serializers.obj('output.obj', 'output.mtl', settings, serialiser_settings)
# serialiser = ifcopenshell.geom.serializers.obj('output.obj', 'output.mtl', settings)
serialiser.setFile(ifc_file)
serialiser.setUnitNameAndMagnitude("METER", 1.0)
@@ -10,8 +10,8 @@ Here's an example of changing settings in C++:
.. code-block:: c++
SerializerSettings settings;
settings.set(IfcGeom::IteratorSettings::APPLY_DEFAULT_MATERIALS, true);
ifcopenshell::geom::settings settings;
settings.get<ifcopenshell::geom::settings::ApplyDefaultMaterials>().value = true;
Here's an example of changing settings in Python:
@@ -78,7 +78,7 @@ In C++, this is set when the iterator is constructed:
.. code-block:: c++
IfcGeom::Iterator geom_iterator(settings, ifc_file, filter_funcs, num_threads);
ifcopenshell::geom::iterator geom_iterator(settings, ifc_file, filter_funcs, num_threads);
In Python, this is set when the iterator is constructed, and requires a list of
IFC entity instances:
@@ -102,7 +102,7 @@ In C++, this is set when the iterator is constructed:
.. code-block:: c++
IfcGeom::Iterator geom_iterator(settings, ifc_file, filter_funcs, num_threads);
ifcopenshell::geom::iterator geom_iterator(settings, ifc_file, filter_funcs, num_threads);
In Python, this is set when the iterator is constructed:
@@ -272,10 +272,10 @@ Here is an example in C++:
.. code-block:: c++
SerializerSettings settings;
std::vector<int> context_ids;
ifcopenshell::geom::settings settings;
std::set<int> context_ids;
// ...
settings.set_context_ids(context_ids);
settings.get<ifcopenshell::geom::settings::ContextIds>().value = context_ids;
Here is an example in Python:
@@ -582,10 +582,10 @@ Here is an example in C++:
.. code-block:: c++
SerializerSettings settings;
ifcopenshell::geom::settings settings;
double tolerance;
// ...
settings.set_angular_tolerance(tolerance);
settings.get<ifcopenshell::geom::settings::MesherAngularDeflection>().value = tolerance;
Here is an example in Python:
@@ -609,10 +609,10 @@ Here is an example in C++:
.. code-block:: c++
SerializerSettings settings;
ifcopenshell::geom::settings settings;
double tolerance;
// ...
settings.set_deflection_tolerance(tolerance);
settings.get<ifcopenshell::geom::settings::MesherLinearDeflection>().value = tolerance;
Here is an example in Python:
@@ -1,15 +1,15 @@
Serialiser settings
===================
The geometry serialiser has a variety of settings which can impact its output.
This is set during the construction of the serialiser.
Geometry serialisers use the same settings object as geometry conversion. These
options affect serialised output and are set before constructing a serialiser.
Here's an example of changing settings in Python:
.. code-block:: python
serialiser_settings = ifcopenshell.geom.serializer_settings()
serialiser_settings.set("use-element-guids", True)
settings = ifcopenshell.geom.settings()
settings.set("use-element-guids", True)
base-uri
^^^^^^^^