Allow passing the tool shape from python
This commit is contained in:
@@ -23,12 +23,10 @@ Create a path simulator object\n</UserDocu>
|
||||
Start a simulation process on a box shape stock with given resolution\n</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="SetCurrentTool">
|
||||
<Methode Name="SetToolShape">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
SetCurrentTool(tool):\n
|
||||
Set the current Path Tool for the subsequent simulator operations.\n
|
||||
</UserDocu>
|
||||
<UserDocu>SetToolShape(shape):\n
|
||||
Set the shape of the tool to be used for simulation\n</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="GetResultMesh">
|
||||
|
||||
@@ -69,13 +69,15 @@ PyObject* PathSimPy::BeginSimulation(PyObject * args, PyObject * kwds)
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
PyObject* PathSimPy::SetCurrentTool(PyObject * args)
|
||||
PyObject* PathSimPy::SetToolShape(PyObject * args)
|
||||
{
|
||||
PyObject *pObjTool;
|
||||
if (!PyArg_ParseTuple(args, "O!", &(Path::ToolPy::Type), &pObjTool))
|
||||
PyObject *pObjToolShape;
|
||||
float resolution;
|
||||
if (!PyArg_ParseTuple(args, "O!f", &(Part::TopoShapePy::Type), &pObjToolShape, &resolution))
|
||||
return 0;
|
||||
PathSim *sim = getPathSimPtr();
|
||||
sim->SetCurrentTool(static_cast<Path::ToolPy*>(pObjTool)->getToolPtr());
|
||||
const TopoDS_Shape& toolShape = static_cast<Part::TopoShapePy*>(pObjToolShape)->getTopoShapePtr()->getShape();
|
||||
sim->SetToolShape(toolShape, resolution);
|
||||
Py_IncRef(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user