mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-02 04:59:52 +00:00
Fix SVG elevation direction
This commit is contained in:
@@ -372,7 +372,7 @@ void SvgSerializer::write(const IfcGeom::BRepElement<real_t>* brep_obj) {
|
|||||||
gp_Pnt P;
|
gp_Pnt P;
|
||||||
gp_Vec V;
|
gp_Vec V;
|
||||||
crv->D1((u0 + u1) / 2., P, 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));
|
gp_Pln pln(gp_Ax3(P, N, -V));
|
||||||
if (!deferred_section_data_) {
|
if (!deferred_section_data_) {
|
||||||
deferred_section_data_.emplace();
|
deferred_section_data_.emplace();
|
||||||
@@ -703,11 +703,13 @@ void SvgSerializer::write(const geometry_data& data) {
|
|||||||
trsf.SetTransformation(gp::XOY(), pln.Position());
|
trsf.SetTransformation(gp::XOY(), pln.Position());
|
||||||
result.Move(trsf);
|
result.Move(trsf);
|
||||||
|
|
||||||
|
/*
|
||||||
gp_Trsf trsf_mirror;
|
gp_Trsf trsf_mirror;
|
||||||
trsf_mirror.SetMirror(gp_Ax2(gp::Origin(), gp::DY()));
|
trsf_mirror.SetMirror(gp_Ax2(gp::Origin(), gp::DY()));
|
||||||
BRepBuilderAPI_Transform make_transform_mirror(result, trsf_mirror, true);
|
BRepBuilderAPI_Transform make_transform_mirror(result, trsf_mirror, true);
|
||||||
make_transform_mirror.Build();
|
make_transform_mirror.Build();
|
||||||
result = make_transform_mirror.Shape();
|
result = make_transform_mirror.Shape();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(TopTools_HSequenceOfShape) edges = new TopTools_HSequenceOfShape();
|
Handle(TopTools_HSequenceOfShape) edges = new TopTools_HSequenceOfShape();
|
||||||
@@ -939,7 +941,8 @@ void SvgSerializer::finalize() {
|
|||||||
HLRBRep_HLRToShape hlr_shapes(hlr);
|
HLRBRep_HLRToShape hlr_shapes(hlr);
|
||||||
auto hlr_compound_unmirrored = hlr_shapes.VCompound();
|
auto hlr_compound_unmirrored = hlr_shapes.VCompound();
|
||||||
|
|
||||||
// Compound 3D curves for mirroring to work
|
/*
|
||||||
|
// Compute 3D curves for mirroring to work
|
||||||
ShapeFix_Edge sfe;
|
ShapeFix_Edge sfe;
|
||||||
TopExp_Explorer exp(hlr_compound_unmirrored, TopAbs_EDGE);
|
TopExp_Explorer exp(hlr_compound_unmirrored, TopAbs_EDGE);
|
||||||
for (; exp.More(); exp.Next()) {
|
for (; exp.More(); exp.Next()) {
|
||||||
@@ -955,8 +958,9 @@ void SvgSerializer::finalize() {
|
|||||||
BRepBuilderAPI_Transform make_transform_mirror(hlr_compound_unmirrored, trsf_mirror, true);
|
BRepBuilderAPI_Transform make_transform_mirror(hlr_compound_unmirrored, trsf_mirror, true);
|
||||||
make_transform_mirror.Build();
|
make_transform_mirror.Build();
|
||||||
auto hlr_compound = make_transform_mirror.Shape();
|
auto hlr_compound = make_transform_mirror.Shape();
|
||||||
|
*/
|
||||||
|
|
||||||
exp.Init(hlr_compound, TopAbs_EDGE);
|
TopExp_Explorer exp(hlr_compound_unmirrored, TopAbs_EDGE);
|
||||||
BRep_Builder B;
|
BRep_Builder B;
|
||||||
auto& po = start_path(drawing_name, "class=\"projection\"");
|
auto& po = start_path(drawing_name, "class=\"projection\"");
|
||||||
for (; exp.More(); exp.Next()) {
|
for (; exp.More(); exp.Next()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user