rename getClearedAreaFromPath -> getClearedArea
This commit is contained in:
@@ -628,7 +628,7 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
std::shared_ptr<Area> Area::getClearedAreaFromPath(const Toolpath *path, double diameter, double zmax) {
|
||||
std::shared_ptr<Area> Area::getClearedArea(const Toolpath *path, double diameter, double zmax) {
|
||||
build();
|
||||
|
||||
// Precision losses in arc/segment conversions (multiples of Accuracy):
|
||||
@@ -646,7 +646,7 @@ std::shared_ptr<Area> Area::getClearedAreaFromPath(const Toolpath *path, double
|
||||
CAreaConfig conf(params, /*no_fit_arcs*/ true);
|
||||
|
||||
Base::Vector3d pos = Base::Vector3d(0, 0, zmax + 1);
|
||||
printf("getClearedAreaFromPath(path, diameter=%g, zmax=%g:\n", diameter, zmax);
|
||||
printf("getClearedArea(path, diameter=%g, zmax=%g:\n", diameter, zmax);
|
||||
// printf("Gcode:\n");
|
||||
for (auto c : path->getCommands()) {
|
||||
// printf("\t%s ", c->Name.c_str());
|
||||
@@ -725,7 +725,7 @@ std::shared_ptr<Area> Area::getRestArea(std::vector<std::shared_ptr<Area>> clear
|
||||
remaining.Clip(toClipperOp(Area::OperationDifference), &*(clearedAreasInPlane.myArea), SubjectFill, ClipFill);
|
||||
|
||||
// rest = intersect(clearable, offset(remaining, dTool))
|
||||
// add buffer to dTool to compensate for oversizing in getClearedAreaFromPath
|
||||
// add buffer to dTool to compensate for oversizing in getClearedArea
|
||||
printf("Compute rest\n");
|
||||
CArea restCArea(remaining);
|
||||
restCArea.OffsetWithClipper(diameter + buffer, JoinType, EndType, params.MiterLimit, roundPrecision);
|
||||
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
const std::vector<double>& heights = std::vector<double>(),
|
||||
const TopoDS_Shape& plane = TopoDS_Shape());
|
||||
|
||||
std::shared_ptr<Area> getClearedAreaFromPath(const Toolpath *path, double diameter, double zmax);
|
||||
std::shared_ptr<Area> getClearedArea(const Toolpath *path, double diameter, double zmax);
|
||||
std::shared_ptr<Area> getRestArea(std::vector<std::shared_ptr<Area>> clearedAreas, double diameter);
|
||||
TopoDS_Shape toTopoShape();
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ same algorithm</UserDocu>
|
||||
<UserDocu></UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="getClearedAreaFromPath">
|
||||
<Methode Name="getClearedArea">
|
||||
<Documentation>
|
||||
<UserDocu></UserDocu>
|
||||
</Documentation>
|
||||
|
||||
@@ -149,8 +149,8 @@ static const PyMethodDef areaOverrides[] = {
|
||||
"of this Area is used if section mode is 'Workplane'.",
|
||||
},
|
||||
{
|
||||
"getClearedAreaFromPath",nullptr,0,
|
||||
"getClearedAreaFromPath(path, diameter, zmax):\n"
|
||||
"getClearedArea",nullptr,0,
|
||||
"getClearedArea(path, diameter, zmax):\n"
|
||||
"Gets the area cleared when a tool of the specified diameter follows the gcode represented in the path, ignoring cleared space above zmax.\n",
|
||||
},
|
||||
{
|
||||
@@ -404,7 +404,7 @@ PyObject* AreaPy::makeSections(PyObject *args, PyObject *keywds)
|
||||
} PY_CATCH_OCC
|
||||
}
|
||||
|
||||
PyObject* AreaPy::getClearedAreaFromPath(PyObject *args)
|
||||
PyObject* AreaPy::getClearedArea(PyObject *args)
|
||||
{
|
||||
PY_TRY {
|
||||
PyObject *pyPath;
|
||||
@@ -416,7 +416,7 @@ PyObject* AreaPy::getClearedAreaFromPath(PyObject *args)
|
||||
return nullptr;
|
||||
}
|
||||
const PathPy *path = static_cast<PathPy*>(pyPath);
|
||||
std::shared_ptr<Area> clearedArea = getAreaPtr()->getClearedAreaFromPath(path->getToolpathPtr(), diameter, zmax);
|
||||
std::shared_ptr<Area> clearedArea = getAreaPtr()->getClearedArea(path->getToolpathPtr(), diameter, zmax);
|
||||
auto pyClearedArea = Py::asObject(new AreaPy(new Area(*clearedArea, true)));
|
||||
return Py::new_reference_to(pyClearedArea);
|
||||
} PY_CATCH_OCC
|
||||
|
||||
@@ -252,7 +252,7 @@ class ObjectOp(PathOp.ObjectOp):
|
||||
if hasattr(op, "Active") and op.Active and op.Path:
|
||||
tool = op.Proxy.tool if hasattr(op.Proxy, "tool") else op.ToolController.Proxy.getTool(op.ToolController)
|
||||
diameter = tool.Diameter.getValueAs("mm")
|
||||
sectionClearedAreas.append(area.getClearedAreaFromPath(op.Path, diameter, z+0.001))
|
||||
sectionClearedAreas.append(area.getClearedArea(op.Path, diameter, z+0.001))
|
||||
# debugZ = -1.5
|
||||
# if debugZ -.1 < z and z < debugZ + .1:
|
||||
# debugObj = obj.Document.addObject("Part::Feature", "Debug_{}_{}".format(debugZ, op.Name))
|
||||
|
||||
Reference in New Issue
Block a user