From cfa435e9c8dcb0280383cdd4e9f4dd72ff2a2ec3 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sun, 31 Oct 2021 20:03:28 +1100 Subject: [PATCH] Do the same things in 10 times less code thanks to aothms :) --- src/serializers/SvgSerializer.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/serializers/SvgSerializer.cpp b/src/serializers/SvgSerializer.cpp index aabc10d634..19a1c9591f 100644 --- a/src/serializers/SvgSerializer.cpp +++ b/src/serializers/SvgSerializer.cpp @@ -634,26 +634,13 @@ void SvgSerializer::write(const IfcGeom::BRepElement* brep_obj) { // (Poly) is wrong otherwise. double pu, pv; - if (!emit_building_storeys_ && scale && size) { - Handle_Geom_Surface surf = new Geom_Plane(*pln); - GeomAPI_ProjectPointOnSurf project_point_on_surf = GeomAPI_ProjectPointOnSurf( - gp::Origin(), surf, size->first/-2, size->first/2, size->second/-2, size->second/2 - ); - project_point_on_surf.Parameters(1, pu, pv); - } - Extrema_ExtPElS ext; ext.Perform(gp::Origin(), *pln, 1.e-5); auto P0 = pln->Location(); pln->SetLocation(ext.Point(1).Value()); + ext.Point(1).Parameter(pu, pv); if (!emit_building_storeys_ && scale && size) { - auto P1 = pln->Location(); - gp_Vec v(P1.XYZ() - P0.XYZ()); - gp_Trsf pi; - pi.SetTransformation(pln->Position()); - pi.Invert(); - v.Transform(pi); offset_2d_ = std::make_pair( ((-size->first / 2.) - pu) * 1000 * *scale_, ((-size->second / 2.) + pv) * 1000 * *scale_