switch linear pattern to coordinate system axis

This commit is contained in:
Stefan Tröger
2015-05-07 06:53:41 +02:00
parent 4c29efea1f
commit d6440b4143
8 changed files with 98 additions and 32 deletions

View File

@@ -37,6 +37,7 @@
#include "DatumPlane.h"
#include "DatumLine.h"
#include <App/Plane.h>
#include <App/Line.h>
#include <Base/Axis.h>
#include <Base/Exception.h>
#include <Mod/Part/App/TopoShape.h>
@@ -112,10 +113,10 @@ const std::list<gp_Trsf> LinearPattern::getTransformations(const std::vector<App
PartDesign::Line* line = static_cast<PartDesign::Line*>(refObject);
Base::Vector3d d = line->getDirection();
dir = gp_Dir(d.x, d.y, d.z);
} else if (refObject->getTypeId().isDerivedFrom(App::Plane::getClassTypeId())) {
App::Plane* plane = static_cast<App::Plane*>(refObject);
Base::Rotation rot = plane->Placement.getValue().getRotation();
Base::Vector3d d(0,0,1);
} else if (refObject->getTypeId().isDerivedFrom(App::Line::getClassTypeId())) {
App::Line* line = static_cast<App::Line*>(refObject);
Base::Rotation rot = line->Placement.getValue().getRotation();
Base::Vector3d d(1,0,0);
rot.multVec(d, d);
dir = gp_Dir(d.x, d.y, d.z);
} else if (refObject->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) {