Neither in #18332 nor in any of the referenced issues a reason is given why the placement of the coordinate axes must be changed.
Only doing it to make the client code look more consistent is not a valid reason.

This change breaks forward and backward compatibility and with #18717 we already have a hard to solve issue. Furthermore, at this
point of time it's not even clear what other collateral damage the change may cause.

So, this commit hides all the implementation details of the DatumElement and restores the original placement for the axes.
This commit makes the line migration code obsolete
This commit is contained in:
wmayer
2024-12-29 22:01:00 +01:00
parent 90d8c34631
commit ad314fea7e
5 changed files with 60 additions and 45 deletions

View File

@@ -69,6 +69,7 @@
#include <Base/Placement.h>
#include <Base/Rotation.h>
#include <Base/Stream.h>
#include <Base/Tools.h>
#include <Mod/Material/App/MaterialManager.h>
#include "Geometry.h"
@@ -76,7 +77,7 @@
#include "PartFeaturePy.h"
#include "PartPyCXX.h"
#include "TopoShapePy.h"
#include "Base/Tools.h"
#include "Tools.h"
using namespace Part;
namespace sp = std::placeholders;
@@ -1026,7 +1027,9 @@ static TopoShape _getTopoShape(const App::DocumentObject* obj,
if (linked->isDerivedFrom(App::Line::getClassTypeId())) {
static TopoDS_Shape _shape;
if (_shape.IsNull()) {
BRepBuilderAPI_MakeEdge builder(gp_Lin(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)));
auto line = static_cast<App::Line*>(linked);
Base::Vector3d dir = line->getBaseDirection();
BRepBuilderAPI_MakeEdge builder(gp_Lin(gp_Pnt(0, 0, 0), Base::convertTo<gp_Dir>(dir)));
_shape = builder.Shape();
_shape.Infinite(Standard_True);
}
@@ -1035,7 +1038,9 @@ static TopoShape _getTopoShape(const App::DocumentObject* obj,
else if (linked->isDerivedFrom(App::Plane::getClassTypeId())) {
static TopoDS_Shape _shape;
if (_shape.IsNull()) {
BRepBuilderAPI_MakeFace builder(gp_Pln(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)));
auto plane = static_cast<App::Plane*>(linked);
Base::Vector3d dir = plane->getBaseDirection();
BRepBuilderAPI_MakeFace builder(gp_Pln(gp_Pnt(0, 0, 0), Base::convertTo<gp_Dir>(dir)));
_shape = builder.Shape();
_shape.Infinite(Standard_True);
}