Commit Graph

15 Commits

Author SHA1 Message Date
Petru Conduraru 71c18a9ad1 Serializers: index positions and normals independently in OBJ/DAE output
When vertices are not welded (the default IfcConvert path when normals
are requested), IfcGeom::Representation::Triangulation stores one
position and one normal per triangle corner, so both arrays repeat the
same values many times. The OBJ and COLLADA formats support indexing
positions, normals and texture coordinates independently, but the
serializers were reusing a single combined index for all of them,
inflating output size without needing to. Positions and normals are
now deduplicated by exact value within each serializer and referenced
through their own index streams (UV indices are left untouched, since
a UV depends on both position and normal together).

Verified against a real IFC model (test/input/IfcReinforcingBar.ifc):
DAE output drops from 48.4MB to 20.6MB (-57.5%) and OBJ output from
51.3MB to 23.6MB (-54.0%), with the decoded position/normal value for
every triangle corner checked byte-identical to the unpatched output.

Addresses #46.

Generated with the assistance of an AI coding tool.
2026-07-21 16:20:55 +03:00
Andrej730 2155e3206f logger: use Logger* instead of Logger& to propagate signature using swig
See the comment in IfcLogger.h explaining this.
2026-07-16 17:28:24 +05:00
Thomas Krijnen a7738eeb64 Pass around non-static logger instances and programmatic access to messages in-memory 2026-06-10 18:40:17 +02:00
Thomas Krijnen 4fc2f623cf Count number of emitted normals in OBJ serializer, which might be less than verts when writing line geometries 2025-12-02 16:32:37 +01:00
Thomas Krijnen c01263d721 shared_ptr styles all over #4833 2024-06-10 20:13:12 +02:00
Thomas Krijnen 65e874c67f Drastic settings refactoring 2023-11-15 10:32:33 +01:00
Thomas Krijnen c78b2893de Proceed with merge 2023-03-21 20:15:01 +01:00
Adrien SCHVALBERG 42448cae4e Add missing exports for ifcopenshell-python when we build shared libs. 2022-05-09 14:13:47 +02:00
Thomas Krijnen bdc6fcb66f #1803 Use abstract GeometrySerializer as cache to eliminate cyclic dependencies 2021-10-18 11:38:01 +02:00
Thomas Krijnen 975379a3a4 approach to pass stringstream to serializers 2021-07-11 15:01:31 +02:00
Thomas Krijnen eeaf04c6ea Remove templates on iterator and element 2021-07-11 15:00:59 +02:00
Thomas Krijnen f032378ca7 no double/float parametrization anymore 2021-07-11 11:03:35 +02:00
Thomas Krijnen ac4be43170 Merge branch 'master' into v0.6.0
# Conflicts:
#	src/ifcconvert/IfcConvert.cpp
#	src/ifcgeom/IfcGeomRenderStyles.cpp
#	src/ifcgeom/IfcGeomWires.cpp
#	src/ifcparse/IfcLogger.cpp
#	src/ifcparse/IfcLogger.h
#	src/ifcparse/IfcParse.cpp
#	src/ifcparse/IfcUtil.cpp
#	src/serializers/ColladaSerializer.cpp
#	src/serializers/schema_dependent/XmlSerializer.cpp
2019-03-08 11:40:16 +01:00
Thomas Krijnen 834780b726 Schema dependent serializers 2018-03-16 13:49:11 +01:00
Thomas Krijnen 6685ea6d7a Schema dependent serializers 2018-03-16 12:10:05 +01:00