Cam simulator feature update (#15597)

* remove redundant code

* Improve lighting, add ambient occlusion

* Add cleanup code. Dialog is now deleted when cloesd.

* change back to ambient occlusion

* Fix G8x drill sequence bug.  issue #14369

* fix bad simulation artifacts under Linux and QT. Issue #14369

* fix merge issue

* fix border artifact on buttons

* support showing path lines. revise the gui.

* add option for arbitrary solids. wip

* use vectors instead of mallocs

* Handle arbitrary stock shapes + show base shape.

* Complete the base shape display feature. eliminate co-planar artifacts.

* support window scaling. upstream issue #14334

* Apply lint fixes

* some missing lints.

* Attend pylint issues

* Apply code fixes based on @kadet1090 review

* fix some clang-tidy warnings.

* CAM: Linter cleanup round 1

---------

Co-authored-by: Chris Hennes <chennes@gmail.com>
This commit is contained in:
Shai Seger
2024-08-21 23:18:52 +03:00
committed by GitHub
parent c4a506146f
commit 778107939c
42 changed files with 2744 additions and 1067 deletions

View File

@@ -73,7 +73,7 @@ PyObject* CAMSimPy::BeginSimulation(PyObject* args, PyObject* kwds)
return nullptr;
}
CAMSim* sim = getCAMSimPtr();
Part::TopoShape* stock = static_cast<Part::TopoShapePy*>(pObjStock)->getTopoShapePtr();
const Part::TopoShape& stock = *static_cast<Part::TopoShapePy*>(pObjStock)->getTopoShapePtr();
sim->BeginSimulation(stock, resolution);
Py_IncRef(Py_None);
return Py_None;
@@ -102,6 +102,28 @@ PyObject* CAMSimPy::AddTool(PyObject* args, PyObject* kwds)
CAMSim* sim = getCAMSimPtr();
sim->addTool(toolProfile, toolNumber, diameter, resolution);
Py_INCREF(Py_None);
return Py_None;
}
PyObject* CAMSimPy::SetBaseShape(PyObject* args, PyObject* kwds)
{
static const std::array<const char*, 3> kwlist {"shape", "resolution", nullptr};
PyObject* pObjBaseShape;
float resolution;
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds,"O!f",
kwlist, &(Part::TopoShapePy::Type), &pObjBaseShape, &resolution)) {
return nullptr;
}
if (!PyArg_ParseTuple(args, "O!f", &(Part::TopoShapePy::Type), &pObjBaseShape, &resolution)) {
return nullptr;
}
CAMSim* sim = getCAMSimPtr();
const Part::TopoShape& baseShape =
static_cast<Part::TopoShapePy*>(pObjBaseShape)->getTopoShapePtr()->getShape();
sim->SetBaseShape(baseShape, resolution);
Py_IncRef(Py_None);
return Py_None;
}
@@ -114,6 +136,8 @@ PyObject* CAMSimPy::AddCommand(PyObject* args)
CAMSim* sim = getCAMSimPtr();
Path::Command* cmd = static_cast<Path::CommandPy*>(pObjCmd)->getCommandPtr();
sim->AddCommand(cmd);
Py_INCREF(Py_None);
return Py_None;
}