mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
--svg-write-poly
This commit is contained in:
@@ -392,6 +392,8 @@ int main(int argc, char** argv) {
|
|||||||
"Stores name and guid in a separate namespace as opposed to data-name, data-guid")
|
"Stores name and guid in a separate namespace as opposed to data-name, data-guid")
|
||||||
("svg-poly",
|
("svg-poly",
|
||||||
"Uses the polygonal algorithm for hidden line rendering")
|
"Uses the polygonal algorithm for hidden line rendering")
|
||||||
|
("svg-write-poly",
|
||||||
|
"Approximate every curve as polygonal in SVG output")
|
||||||
("svg-project",
|
("svg-project",
|
||||||
"Always enable hidden line rendering instead of only on elevations")
|
"Always enable hidden line rendering instead of only on elevations")
|
||||||
("door-arcs", "Draw door openings arcs for IfcDoor elements")
|
("door-arcs", "Draw door openings arcs for IfcDoor elements")
|
||||||
@@ -1008,6 +1010,7 @@ int main(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
static_cast<SvgSerializer*>(serializer.get())->setUseNamespace(vmap.count("svg-xmlns") > 0);
|
static_cast<SvgSerializer*>(serializer.get())->setUseNamespace(vmap.count("svg-xmlns") > 0);
|
||||||
static_cast<SvgSerializer*>(serializer.get())->setUseHlrPoly(vmap.count("svg-poly") > 0);
|
static_cast<SvgSerializer*>(serializer.get())->setUseHlrPoly(vmap.count("svg-poly") > 0);
|
||||||
|
static_cast<SvgSerializer*>(serializer.get())->setPolygonal(vmap.count("svg-write-poly") > 0);
|
||||||
static_cast<SvgSerializer*>(serializer.get())->setAlwaysProject(vmap.count("svg-project") > 0);
|
static_cast<SvgSerializer*>(serializer.get())->setAlwaysProject(vmap.count("svg-project") > 0);
|
||||||
if (relative_center_x && relative_center_y) {
|
if (relative_center_x && relative_center_y) {
|
||||||
static_cast<SvgSerializer*>(serializer.get())->setDrawingCenter(*relative_center_x, *relative_center_y);
|
static_cast<SvgSerializer*>(serializer.get())->setDrawingCenter(*relative_center_x, *relative_center_y);
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ void SvgSerializer::write(path_object& p, const TopoDS_Wire& wire, boost::option
|
|||||||
// TODO: ALMOST_THE_SAME utilities in separate header
|
// TODO: ALMOST_THE_SAME utilities in separate header
|
||||||
bool closed = fabs((u1 + PI2) - u2) < 1.e-9;
|
bool closed = fabs((u1 + PI2) - u2) < 1.e-9;
|
||||||
|
|
||||||
if (conical && closed) {
|
if (!polygonal_ && (conical && closed)) {
|
||||||
if (first) {
|
if (first) {
|
||||||
if (ty == STANDARD_TYPE(Geom_Circle)) {
|
if (ty == STANDARD_TYPE(Geom_Circle)) {
|
||||||
Handle(Geom_Circle) circle = Handle(Geom_Circle)::DownCast(curve);
|
Handle(Geom_Circle) circle = Handle(Geom_Circle)::DownCast(curve);
|
||||||
@@ -222,7 +222,7 @@ void SvgSerializer::write(path_object& p, const TopoDS_Wire& wire, boost::option
|
|||||||
growBoundingBox(p2.X(), p2.Y());
|
growBoundingBox(p2.X(), p2.Y());
|
||||||
|
|
||||||
|
|
||||||
if (ty == STANDARD_TYPE(Geom_Circle) || ty == STANDARD_TYPE(Geom_Ellipse)) {
|
if (!polygonal_ && (ty == STANDARD_TYPE(Geom_Circle) || ty == STANDARD_TYPE(Geom_Ellipse))) {
|
||||||
Handle(Geom_Conic) conic = Handle(Geom_Conic)::DownCast(curve);
|
Handle(Geom_Conic) conic = Handle(Geom_Conic)::DownCast(curve);
|
||||||
const bool mirrored = conic->Position().Axis().Direction().Z() < 0;
|
const bool mirrored = conic->Position().Axis().Direction().Z() < 0;
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ protected:
|
|||||||
storey_height_display_types storey_height_display_;
|
storey_height_display_types storey_height_display_;
|
||||||
bool draw_door_arcs_, is_floor_plan_;
|
bool draw_door_arcs_, is_floor_plan_;
|
||||||
bool auto_section_, auto_elevation_;
|
bool auto_section_, auto_elevation_;
|
||||||
bool use_namespace_, use_hlr_poly_, always_project_;
|
bool use_namespace_, use_hlr_poly_, always_project_, polygonal_;
|
||||||
|
|
||||||
IfcParse::IfcFile* file;
|
IfcParse::IfcFile* file;
|
||||||
IfcUtil::IfcBaseEntity* storey_;
|
IfcUtil::IfcBaseEntity* storey_;
|
||||||
@@ -188,6 +188,7 @@ public:
|
|||||||
, use_namespace_(false)
|
, use_namespace_(false)
|
||||||
, use_hlr_poly_(false)
|
, use_hlr_poly_(false)
|
||||||
, always_project_(false)
|
, always_project_(false)
|
||||||
|
, polygonal_(false)
|
||||||
, file(0)
|
, file(0)
|
||||||
, storey_(0)
|
, storey_(0)
|
||||||
, xcoords_begin(0)
|
, xcoords_begin(0)
|
||||||
@@ -249,6 +250,10 @@ public:
|
|||||||
use_hlr_poly_ = b;
|
use_hlr_poly_ = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setPolygonal(bool b) {
|
||||||
|
polygonal_ = b;
|
||||||
|
}
|
||||||
|
|
||||||
void setAlwaysProject(bool b) {
|
void setAlwaysProject(bool b) {
|
||||||
always_project_ = b;
|
always_project_ = b;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user