debugging wip

This commit is contained in:
Shai Seger
2017-10-22 23:43:39 +03:00
committed by Yorik van Havre
parent 1d47ceeaea
commit 84d037cc4b
2 changed files with 10 additions and 4 deletions

View File

@@ -31,6 +31,7 @@
#include <App/Application.h>
#include <App/Document.h>
#include <Base/Exception.h>
#include <Base/Console.h>
#include "PathSim.h"
//#include "VolSim.h"
@@ -58,7 +59,8 @@ PathSim::~PathSim()
void PathSim::BeginSimulation(Part::TopoShape * stock, float resolution)
{
Base::BoundBox3d & bbox = stock->getBoundBox();
m_stock = new cStock(bbox.MinX, bbox.MinY, bbox.MinZ, bbox.LengthX(), bbox.LengthY(), bbox.LengthZ(), resolution);
//m_stock = new cStock(bbox.MinX, bbox.MinY, bbox.MinZ, bbox.LengthX(), bbox.LengthY(), bbox.LengthZ(), resolution);
m_stock = new cStock(0,0,0, bbox.LengthX(), bbox.LengthY(), bbox.LengthZ(), resolution);
}
void PathSim::SetCurrentTool(Tool * tool)
@@ -77,6 +79,7 @@ void PathSim::SetCurrentTool(Tool * tool)
break;
}
m_tool = new cSimTool(tp, tool->Diameter / 2.0, angle);
Base::Console().Log("Diam %f\n", tool->Diameter);
}

View File

@@ -22,13 +22,15 @@
#include "PreCompiled.h"
#include "Mod/Path/PathSimulator/App/PathSim.h"
#include <Base/PlacementPy.h>
#include <Base/VectorPy.h>
#include <Mod/Part/App/TopoShapePy.h>
#include <Mod/Path/App/ToolPy.h>
#include <Mod/Path/App/ToolPy.cpp>
#include <Mod/Path/App/CommandPy.h>
#include <Mod/Path/App/CommandPy.cpp>
#include <Mod/Mesh/App/MeshPy.h>
#include "Mod/Path/PathSimulator/App/PathSim.h"
// inclusion of the generated files (generated out of PathSimPy.xml)
#include "PathSimPy.h"
@@ -72,7 +74,8 @@ PyObject* PathSimPy::BeginSimulation(PyObject * args, PyObject * kwds)
PyObject* PathSimPy::SetCurrentTool(PyObject * args)
{
PyObject *pObjTool;
if (!PyArg_ParseTuple(args, "O!", &(Path::ToolPy::Type), &pObjTool))
//Path::ToolPy tptmp(new Path::Tool);
if (!PyArg_ParseTuple(args, "O", /*tptmp.GetType(),*/ &pObjTool))
return 0;
PathSim *sim = getPathSimPtr();
sim->SetCurrentTool(static_cast<Path::ToolPy*>(pObjTool)->getToolPtr());
@@ -98,7 +101,7 @@ PyObject* PathSimPy::ApplyCommand(PyObject * args, PyObject * kwds)
static char *kwlist[] = { "position", "command", NULL };
PyObject *pObjPlace;
PyObject *pObjCmd;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!O!", kwlist, &(Base::PlacementPy::Type), &pObjPlace, &(Path::CommandPy::Type), &pObjCmd))
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!O", kwlist, &(Base::PlacementPy::Type), &pObjPlace, /*&(Path::CommandPy::Type),*/ &pObjCmd))
return 0;
PathSim *sim = getPathSimPtr();
Base::Placement *pos = static_cast<Base::PlacementPy*>(pObjPlace)->getPlacementPtr();