From 3180004a28bce0629a08406d5ecf8d4eb4356f68 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Mon, 2 Jun 2025 13:30:06 +0200 Subject: [PATCH] WKT serializer: adapt section height to geometry height and emit height as geo:length --- src/serializers/TtlWktSerializer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/serializers/TtlWktSerializer.cpp b/src/serializers/TtlWktSerializer.cpp index b6b7698e2a..e7dec1d9db 100644 --- a/src/serializers/TtlWktSerializer.cpp +++ b/src/serializers/TtlWktSerializer.cpp @@ -391,7 +391,12 @@ void TtlWktSerializer::write(const IfcGeom::BRepElement* brep_obj) { double x1, y1, zmin, x2, y2, zmax; bb.Get(x1, y1, zmin, x2, y2, zmax); - gp_Pln pln(gp_Pnt(0, 0, zmin + 1.), gp::DZ()); + auto height = zmax - zmin; + auto section_height = (height < (1. + 1.e-5)) ? (height / 2.0) : 1.0; + + filename_.stream << ttl_object_id(brep_obj) << " geo:hasMetricLength " << height << " .\n\n"; + + gp_Pln pln(gp_Pnt(0, 0, zmin + section_height), gp::DZ()); Handle(TopTools_HSequenceOfShape) wires = new TopTools_HSequenceOfShape();