Skip to content

Commit

Permalink
debugging wip
Browse files Browse the repository at this point in the history
  • Loading branch information
shaise authored and yorikvanhavre committed Oct 31, 2017
1 parent b9362df commit 16b1ecc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/Mod/Path/PathSimulator/App/PathSim.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand All @@ -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);
}


Expand Down
9 changes: 6 additions & 3 deletions src/Mod/Path/PathSimulator/App/PathSimPyImp.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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());
Expand All @@ -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();
Expand Down

0 comments on commit 16b1ecc

Please sign in to comment.