diff --git a/src/ifcconvert/IfcConvert.cpp b/src/ifcconvert/IfcConvert.cpp index 0f7f64b8f8..c2187c9d9d 100644 --- a/src/ifcconvert/IfcConvert.cpp +++ b/src/ifcconvert/IfcConvert.cpp @@ -386,6 +386,8 @@ int main(int argc, char** argv) { ("draw-storey-heights", po::value(&storey_height_display)->default_value("none")->implicit_value("full"), "Draws a horizontal line at the height of building storeys in vertical drawings") + ("storey-height-line-length", po::value(), + "Length of the line when --draw-storey-heights=left") ("svg-xmlns", "Stores name and guid in a separate namespace as opposed to data-name, data-guid") ("svg-poly", @@ -1008,6 +1010,11 @@ int main(int argc, char** argv) { if (relative_center_x && relative_center_y) { static_cast(serializer.get())->setDrawingCenter(*relative_center_x, *relative_center_y); } + if (vmap.count("storey-height-line-length")) { + static_cast(serializer.get())->setStoreyHeightLineLength( + vmap["storey-height-line-length"].as() + ); + } } if (convert_back_units) { diff --git a/src/serializers/SvgSerializer.cpp b/src/serializers/SvgSerializer.cpp index 1ff4529977..40325202e5 100644 --- a/src/serializers/SvgSerializer.cpp +++ b/src/serializers/SvgSerializer.cpp @@ -1236,7 +1236,8 @@ void SvgSerializer::write(const geometry_data& data) { auto d = (p1.XYZ() - p0.XYZ()); d.Normalize(); - d *= 3; + const double shll = storey_height_line_length_.get_value_or(2.); + d *= shll; gp_Pnt p1x(p0.XYZ() + d); wire = BRepBuilderAPI_MakePolygon(p0, p1x).Wire(); @@ -1681,7 +1682,9 @@ void SvgSerializer::finalize() { double x0, y0, z0, x1, y1, z1; bnd_.Get(x0, y0, z0, x1, y1, z1); - BRepBuilderAPI_MakeFace mf(elev_pln, x0 - 1., x1 + 1., y0 - 1., y1 + 1.); + const double shll = storey_height_line_length_.get_value_or(2.); + + BRepBuilderAPI_MakeFace mf(elev_pln, x0 - shll, x1 + shll, y0 - shll, y1 + shll); gp_Trsf trsf; TopoDS_Compound C; BRep_Builder B; diff --git a/src/serializers/SvgSerializer.h b/src/serializers/SvgSerializer.h index 762d7ff8f8..f80447d3e7 100644 --- a/src/serializers/SvgSerializer.h +++ b/src/serializers/SvgSerializer.h @@ -137,6 +137,7 @@ protected: boost::optional> section_data_; boost::optional> deferred_section_data_; boost::optional scale_, calculated_scale_, center_x_, center_y_, scale_backup_; + boost::optional storey_height_line_length_; boost::optional> size_, size_backup_; bool with_section_heights_from_storey_, print_space_names_, print_space_areas_; @@ -216,6 +217,7 @@ public: void setPrintSpaceAreas(bool b) { print_space_areas_ = b; } void setDrawStoreyHeights(storey_height_display_types sh) { storey_height_display_ = sh; } void setDrawDoorArcs(bool b) { draw_door_arcs_ = b; } + void setStoreyHeightLineLength(double d) { storey_height_line_length_ = d; } std::array, 3> resize(); void resetScale();