mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 22:33:33 +00:00
SVG: Fix storey elevations
This commit is contained in:
@@ -1033,7 +1033,10 @@ void SvgSerializer::write(const geometry_data& data) {
|
|||||||
auto a = data.product->get("Elevation");
|
auto a = data.product->get("Elevation");
|
||||||
if (!a->isNull()) {
|
if (!a->isNull()) {
|
||||||
double elev = *a;
|
double elev = *a;
|
||||||
elev *= lu;
|
|
||||||
|
// @nb we don't actually factor in the length unit.
|
||||||
|
// elev *= lu;
|
||||||
|
|
||||||
if (almost(1.) == lu) {
|
if (almost(1.) == lu) {
|
||||||
// m
|
// m
|
||||||
elev_str = boost::str(boost::format("%.3f") % elev);
|
elev_str = boost::str(boost::format("%.3f") % elev);
|
||||||
@@ -1490,14 +1493,14 @@ void SvgSerializer::finalize() {
|
|||||||
auto svg_name = nameElement(storey);
|
auto svg_name = nameElement(storey);
|
||||||
auto po = &start_path(*pln, drawing_name, svg_name);
|
auto po = &start_path(*pln, drawing_name, svg_name);
|
||||||
|
|
||||||
gp_Pln elev_pln(gp_Ax3(gp_Pnt(0, 0, elev), gp::DZ(), pln->Position().XDirection()));
|
gp_Pln elev_pln(gp_Ax3(gp_Pnt(0, 0, elev), gp::DZ(), gp::DX()));
|
||||||
auto ref_y = pln->Position().YDirection().XYZ().Dot(pln->Position().Location().XYZ());
|
//, pln->Position().XDirection()));
|
||||||
|
// auto ref_y = pln->Position().YDirection().XYZ().Dot(pln->Position().Location().XYZ());
|
||||||
|
|
||||||
double x0, y0, z0, x1, y1, z1;
|
double x0, y0, z0, x1, y1, z1;
|
||||||
bnd_.Get(x0, y0, z0, x1, y1, z1);
|
bnd_.Get(x0, y0, z0, x1, y1, z1);
|
||||||
|
|
||||||
// negate Y, see auto_elevation
|
BRepBuilderAPI_MakeFace mf(elev_pln, x0 - 1., x1 + 1., y0 - 1., y1 + 1.);
|
||||||
BRepBuilderAPI_MakeFace mf(elev_pln, x0 - 1., x1 + 1., -(y1 + 1.), -(y0 - 1.));
|
|
||||||
gp_Trsf trsf;
|
gp_Trsf trsf;
|
||||||
TopoDS_Compound C;
|
TopoDS_Compound C;
|
||||||
BRep_Builder B;
|
BRep_Builder B;
|
||||||
|
|||||||
@@ -152,8 +152,6 @@ protected:
|
|||||||
std::list<geometry_data> element_buffer_;
|
std::list<geometry_data> element_buffer_;
|
||||||
|
|
||||||
hlr_t hlr;
|
hlr_t hlr;
|
||||||
// Handle(HLRBRep_Algo) hlr_brep;
|
|
||||||
// Handle(HLRBRep_PolyAlgo) hlr_poly;
|
|
||||||
|
|
||||||
std::string namespace_prefix_;
|
std::string namespace_prefix_;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user