Fix SVG elevation direction

This commit is contained in:
Thomas Krijnen
2020-09-27 11:10:44 +02:00
parent f489487a20
commit 64153eb39a
+7 -3
View File
@@ -372,7 +372,7 @@ void SvgSerializer::write(const IfcGeom::BRepElement<real_t>* brep_obj) {
gp_Pnt P;
gp_Vec V;
crv->D1((u0 + u1) / 2., P, V);
auto N = gp::DZ().Crossed(V);
auto N = V.Crossed(gp::DZ());
gp_Pln pln(gp_Ax3(P, N, -V));
if (!deferred_section_data_) {
deferred_section_data_.emplace();
@@ -703,11 +703,13 @@ void SvgSerializer::write(const geometry_data& data) {
trsf.SetTransformation(gp::XOY(), pln.Position());
result.Move(trsf);
/*
gp_Trsf trsf_mirror;
trsf_mirror.SetMirror(gp_Ax2(gp::Origin(), gp::DY()));
BRepBuilderAPI_Transform make_transform_mirror(result, trsf_mirror, true);
make_transform_mirror.Build();
result = make_transform_mirror.Shape();
*/
}
Handle(TopTools_HSequenceOfShape) edges = new TopTools_HSequenceOfShape();
@@ -939,7 +941,8 @@ void SvgSerializer::finalize() {
HLRBRep_HLRToShape hlr_shapes(hlr);
auto hlr_compound_unmirrored = hlr_shapes.VCompound();
// Compound 3D curves for mirroring to work
/*
// Compute 3D curves for mirroring to work
ShapeFix_Edge sfe;
TopExp_Explorer exp(hlr_compound_unmirrored, TopAbs_EDGE);
for (; exp.More(); exp.Next()) {
@@ -955,8 +958,9 @@ void SvgSerializer::finalize() {
BRepBuilderAPI_Transform make_transform_mirror(hlr_compound_unmirrored, trsf_mirror, true);
make_transform_mirror.Build();
auto hlr_compound = make_transform_mirror.Shape();
*/
exp.Init(hlr_compound, TopAbs_EDGE);
TopExp_Explorer exp(hlr_compound_unmirrored, TopAbs_EDGE);
BRep_Builder B;
auto& po = start_path(drawing_name, "class=\"projection\"");
for (; exp.More(); exp.Next()) {