Path: Fix header uniformity and remove trailing whitespace

This PR fixes header uniformity across all Path files. It also removes all trailing whitespace.
This commit is contained in:
luz paz
2020-11-03 13:09:58 -05:00
committed by wwmayer
parent 48365ecdbb
commit b75cd3dd52
231 changed files with 545 additions and 743 deletions

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -93,12 +93,12 @@
catch(const char *e) \
{ \
PyErr_SetString(Base::BaseExceptionFreeCADError,e); \
} throw Py::Exception();
} throw Py::Exception();
namespace Path {
class Module : public Py::ExtensionModule<Module>
{
public:
Module() : Py::ExtensionModule<Module>("Path")
@@ -124,7 +124,7 @@ public:
PARAM_PY_DOC(ARG, AREA_PARAMS_PATH)
);
add_keyword_method("sortWires",&Module::sortWires,
"sortWires(shapes, start=Vector(), "
"sortWires(shapes, start=Vector(), "
PARAM_PY_ARGS_DOC(ARG,AREA_PARAMS_ARC_PLANE)
PARAM_PY_ARGS_DOC(ARG,AREA_PARAMS_SORT) ")\n"
"\nReturns (wires,end), where 'wires' is sorted across Z value and with optimized travel distance,\n"
@@ -151,12 +151,12 @@ private:
std::string EncodedName = std::string(Name);
PyMem_Free(Name);
Base::FileInfo file(EncodedName.c_str());
if (PyObject_TypeCheck(pObj, &(App::DocumentObjectPy::Type))) {
App::DocumentObject* obj = static_cast<App::DocumentObjectPy*>(pObj)->getDocumentObjectPtr();
if (obj->getTypeId().isDerivedFrom(Base::Type::fromName("Path::Feature"))) {
const Toolpath& path = static_cast<Path::Feature*>(obj)->Path.getValue();
std::string gcode = path.toGCode();
std::string gcode = path.toGCode();
std::ofstream ofile(EncodedName.c_str());
ofile << gcode;
ofile.close();
@@ -188,7 +188,7 @@ private:
pcDoc = App::GetApplication().getDocument(DocName);
else
pcDoc = App::GetApplication().getActiveDocument();
if (!pcDoc)
if (!pcDoc)
pcDoc = App::GetApplication().newDocument(DocName);
try {
@@ -257,7 +257,7 @@ private:
Path::Toolpath result;
bool first = true;
Base::Placement last;
TopExp_Explorer ExpEdges (shape,TopAbs_EDGE);
while (ExpEdges.More()) {
const TopoDS_Edge& edge = TopoDS::Edge(ExpEdges.Current());
@@ -283,7 +283,7 @@ private:
else {
Path::Command cmd;
cmd.setFromPlacement(tpl);
// write arc data if needed
BRepAdaptor_Curve adapt(edge);
if (adapt.GetType() == GeomAbs_Circle) {
@@ -327,8 +327,8 @@ private:
PyObject *return_end=Py_False;
static char* kwd_list[] = {"shapes", "start", "return_end",
PARAM_FIELD_STRINGS(ARG,AREA_PARAMS_PATH), NULL};
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(),
"O|O!O" PARAM_PY_KWDS(AREA_PARAMS_PATH),
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(),
"O|O!O" PARAM_PY_KWDS(AREA_PARAMS_PATH),
kwd_list, &pShapes, &(Base::VectorPy::Type), &start, &return_end,
PARAM_REF(PARAM_FARG,AREA_PARAMS_PATH)))
throw Py::Exception();
@@ -337,7 +337,7 @@ private:
if (PyObject_TypeCheck(pShapes, &(Part::TopoShapePy::Type)))
shapes.push_back(static_cast<Part::TopoShapePy*>(pShapes)->getTopoShapePtr()->getShape());
else if (PyObject_TypeCheck(pShapes, &(PyList_Type)) ||
PyObject_TypeCheck(pShapes, &(PyTuple_Type)))
PyObject_TypeCheck(pShapes, &(PyTuple_Type)))
{
Py::Sequence shapeSeq(pShapes);
for (Py::Sequence::iterator it = shapeSeq.begin(); it != shapeSeq.end(); ++it) {
@@ -376,14 +376,14 @@ private:
PARAM_PY_DECLARE_INIT(PARAM_FARG,AREA_PARAMS_SORT)
PyObject *pShapes=NULL;
PyObject *start=NULL;
static char* kwd_list[] = {"shapes", "start",
PARAM_FIELD_STRINGS(ARG,AREA_PARAMS_ARC_PLANE),
static char* kwd_list[] = {"shapes", "start",
PARAM_FIELD_STRINGS(ARG,AREA_PARAMS_ARC_PLANE),
PARAM_FIELD_STRINGS(ARG,AREA_PARAMS_SORT), NULL};
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(),
"O|O!"
PARAM_PY_KWDS(AREA_PARAMS_ARC_PLANE)
if (!PyArg_ParseTupleAndKeywords(args.ptr(), kwds.ptr(),
"O|O!"
PARAM_PY_KWDS(AREA_PARAMS_ARC_PLANE)
PARAM_PY_KWDS(AREA_PARAMS_SORT),
kwd_list, &pShapes, &(Base::VectorPy::Type), &start,
kwd_list, &pShapes, &(Base::VectorPy::Type), &start,
PARAM_REF(PARAM_FARG,AREA_PARAMS_ARC_PLANE),
PARAM_REF(PARAM_FARG,AREA_PARAMS_SORT)))
throw Py::Exception();
@@ -409,7 +409,7 @@ private:
Base::Vector3d vec = static_cast<Base::VectorPy*>(start)->value();
pstart.SetCoord(vec.x, vec.y, vec.z);
}
try {
bool need_arc_plane = arc_plane==Area::ArcPlaneAuto;
std::list<TopoDS_Shape> wires = Area::sortWires(shapes,start!=0,&pstart,

View File

@@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2017 Zheng, Lei (realthunder) <realthunder.dev@gmail.com>*
* Copyright (c) 2017 Zheng Lei (realthunder) <realthunder.dev@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -19,6 +19,8 @@
* Suite 330, Boston, MA 02111-1307, USA *
* *
****************************************************************************/
#include "PreCompiled.h"
// From Boost 1.75 on the geometry component requires C++14
@@ -3209,7 +3211,7 @@ void Area::toPath(Toolpath &path, const std::list<TopoDS_Shape> &shapes,
wires = sortWires(shapes,_pstart!=0,&pstart,pend,&stepdown_hint,
PARAM_REF(PARAM_FARG,AREA_PARAMS_ARC_PLANE),
PARAM_FIELDS(PARAM_FARG,AREA_PARAMS_SORT));
if (wires.size() == 0)
return;

View File

@@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2017 Zheng, Lei (realthunder) <realthunder.dev@gmail.com>*
* Copyright (c) 2017 Zheng Lei (realthunder) <realthunder.dev@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2017 Zheng, Lei (realthunder) <realthunder.dev@gmail.com>*
* Copyright (c) 2017 Zheng Lei (realthunder) <realthunder.dev@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2017 Zheng, Lei (realthunder) <realthunder.dev@gmail.com>*
* Copyright (c) 2017 Zheng Lei (realthunder) <realthunder.dev@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2017 Zheng, Lei (realthunder) <realthunder.dev@gmail.com>*
* Copyright (c) 2017 Zheng Lei (realthunder) <realthunder.dev@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2017 Zheng, Lei (realthunder) <realthunder.dev@gmail.com>*
* Copyright (c) 2017 Zheng Lei (realthunder) <realthunder.dev@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2017 Zheng, Lei (realthunder) <realthunder.dev@gmail.com>*
* Copyright (c) 2017 Zheng Lei (realthunder) <realthunder.dev@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2017 Zheng, Lei (realthunder) <realthunder.dev@gmail.com>*
* Copyright (c) 2017 Zheng Lei (realthunder) <realthunder.dev@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -50,7 +50,7 @@ std::string PathPy::representation(void) const
PyObject *PathPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper
{
// create a new instance of PathPy and the Twin object
// create a new instance of PathPy and the Twin object
return new PathPy(new Toolpath);
}
@@ -68,7 +68,7 @@ int PathPy::PyInit(PyObject* args, PyObject* /*kwd*/)
getToolpathPtr()->addCommand(cmd);
} else {
PyErr_SetString(PyExc_TypeError, "The list must contain only Path Commands");
return -1;
return -1;
}
}
}
@@ -80,7 +80,7 @@ int PathPy::PyInit(PyObject* args, PyObject* /*kwd*/)
return 0;
}
PyErr_SetString(PyExc_TypeError, "Argument must be a list of commands or a gcode string");
return -1;
return -1;
}
@@ -234,7 +234,7 @@ PyObject *PathPy::getCustomAttributes(const char* /*attr*/) const
int PathPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
{
return 0;
return 0;
}

View File

@@ -1,6 +1,4 @@
/*
***************************************************************************
* *
/***************************************************************************
* Copyright (c) 2019 sliptonic <shopinthewoods@gmail.com> *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -19,8 +17,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
* USA *
* *
***************************************************************************
*/
***************************************************************************/
#include "PreCompiled.h"
#include "PathSegmentWalker.h"
@@ -53,7 +52,7 @@ Base::Vector3d compensateRotation(const Base::Vector3d &pt, const Base::Rotation
Base::Rotation yawPitchRoll(double a, double b, double c)
{
Base::Rotation rot;
Base::Rotation rot;
rot.setYawPitchRoll(-c, -b, -a);
return rot;
}

View File

@@ -1,6 +1,4 @@
/*
***************************************************************************
* *
/***************************************************************************
* Copyright (c) 2019 sliptonic <shopinthewoods@gmail.com> *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -19,8 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
* USA *
* *
***************************************************************************
*/
***************************************************************************/
#ifndef PATHSEGMENTWALKER_H
#define PATHSEGMENTWALKER_H

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -21,4 +21,4 @@
***************************************************************************/
#include "PreCompiled.h"
#include "PreCompiled.h"

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -60,7 +60,7 @@ void PropertyPath::setValue(const Toolpath& pa)
}
const Toolpath &PropertyPath::getValue(void)const
const Toolpath &PropertyPath::getValue(void)const
{
return _Path;
}
@@ -87,7 +87,7 @@ App::Property *PropertyPath::Copy(void) const
{
PropertyPath *prop = new PropertyPath();
prop->_Path = this->_Path;
return prop;
}

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -58,7 +58,7 @@ void PropertyTool::setValue(const Tool& tt)
}
const Tool &PropertyTool::getValue(void)const
const Tool &PropertyTool::getValue(void)const
{
return _Tool;
}
@@ -85,7 +85,7 @@ App::Property *PropertyTool::Copy(void) const
{
PropertyTool *prop = new PropertyTool();
prop->_Tool = this->_Tool;
return prop;
}

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -58,7 +58,7 @@ void PropertyTooltable::setValue(const Tooltable& tt)
}
const Tooltable &PropertyTooltable::getValue(void)const
const Tooltable &PropertyTooltable::getValue(void)const
{
return _Tooltable;
}
@@ -85,7 +85,7 @@ App::Property *PropertyTooltable::Copy(void) const
{
PropertyTooltable *prop = new PropertyTooltable();
prop->_Tooltable = this->_Tooltable;
return prop;
}

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -237,7 +237,7 @@ int TooltablePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
return 0;
}
Py::Int TooltablePy::getVersion(void) const
Py::Int TooltablePy::getVersion(void) const
{
return Py::Int(getTooltablePtr()->Version);
}

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) sliptonic (shopinthewoods@gmail.com) 2020 *
* Copyright (c) 2020 sliptonic <shopinthewoods@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -264,7 +264,7 @@ bool Voronoi::diagram_type::segmentsAreConnected(int i, int j) const {
}
void Voronoi::colorColinear(Voronoi::color_type color, double degree) {
double rad = degree * M_PI / 180;
double rad = degree * M_PI / 180;
Voronoi::diagram_type::angle_map_t angle;
int psize = vd->points.size();

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) sliptonic (shopinthewoods@gmail.com) 2020 *
* Copyright (c) 2020 sliptonic <shopinthewoods@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) sliptonic (shopinthewoods@gmail.com) 2020 *
* Copyright (c) 2020 sliptonic <shopinthewoods@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) sliptonic (shopinthewoods@gmail.com) 2020 *
* Copyright (c) 2020 sliptonic <shopinthewoods@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) sliptonic (shopinthewoods@gmail.com) 2020 *
* Copyright (c) 2020 sliptonic <shopinthewoods@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) sliptonic (shopinthewoods@gmail.com) 2020 *
* Copyright (c) 2020 sliptonic <shopinthewoods@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) sliptonic (shopinthewoods@gmail.com) 2020 *
* Copyright (c) 2020 sliptonic <shopinthewoods@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) sliptonic (shopinthewoods@gmail.com) 2020 *
* Copyright (c) 2020 sliptonic <shopinthewoods@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) sliptonic (shopinthewoods@gmail.com) 2020 *
* Copyright (c) 2020 sliptonic <shopinthewoods@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) sliptonic (shopinthewoods@gmail.com) 2020 *
* Copyright (c) 2020 sliptonic <shopinthewoods@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) sliptonic (shopinthewoods@gmail.com) 2020 *
* Copyright (c) 2020 sliptonic <shopinthewoods@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) sliptonic (shopinthewoods@gmail.com) 2020 *
* Copyright (c) 2020 sliptonic <shopinthewoods@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -85,7 +85,7 @@ PyMOD_INIT_FUNC(PathGui)
// add resources and reloads the translators
loadPathResource();
// register preferences pages
new Gui::PrefPageProducer<PathGui::DlgSettingsPathColor> ("Path");

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -31,7 +31,7 @@ namespace PathGui {
class Ui_DlgSettingsPathColor;
class DlgSettingsPathColor : public Gui::Dialog::PreferencePage
{
{
Q_OBJECT
public:

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -20,4 +20,4 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include "PreCompiled.h"

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -43,12 +43,12 @@ class TaskWidgetPathCompound : public Gui::TaskView::TaskBox
public:
TaskWidgetPathCompound(ViewProviderPathCompound *CompoundView, QWidget *parent=0);
~TaskWidgetPathCompound();
std::vector<std::string> getList(void) const;
protected:
void changeEvent(QEvent *e);
private:
QWidget* proxy;
Ui_TaskDlgPathCompound* ui;
@@ -72,10 +72,10 @@ public:
virtual bool accept();
/// is called by the framework if the dialog is rejected (Cancel)
virtual bool reject();
/// is called by the framework if the user press the help button
/// is called by the framework if the user press the help button
virtual void helpRequested();
/// returns for Close and Help button
/// returns for Close and Help button
virtual QDialogButtonBox::StandardButtons getStandardButtons(void) const
{ return QDialogButtonBox::Ok|QDialogButtonBox::Cancel; }

View File

@@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2017 Zheng, Lei (realthunder) <realthunder.dev@gmail.com>*
* Copyright (c) 2017 Zheng Lei (realthunder) <realthunder.dev@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2017 Zheng, Lei (realthunder) <realthunder.dev@gmail.com>*
* Copyright (c) 2017 Zheng Lei (realthunder) <realthunder.dev@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -20,7 +20,6 @@
* *
****************************************************************************/
#ifndef PATH_ViewProviderArea_H
#define PATH_ViewProviderArea_H
@@ -38,7 +37,7 @@ public:
ViewProviderArea();
virtual ~ViewProviderArea();
/// grouping handling
/// grouping handling
virtual std::vector<App::DocumentObject*> claimChildren(void) const;
virtual void updateData(const App::Property*);
virtual bool onDelete(const std::vector<std::string> &);

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -97,7 +97,7 @@ public:
setArrow();
return;
}
if(msg.Type!=Gui::SelectionChanges::SetPreselect
if(msg.Type!=Gui::SelectionChanges::SetPreselect
&& msg.Type!=Gui::SelectionChanges::MovePreselect)
return;
auto obj = msg.Object.getObject();
@@ -115,8 +115,8 @@ public:
setArrow();
return;
}
if(vp->pt0Index >= 0) {
if(vp->pt0Index >= 0) {
mat *= linkMat;
mat.inverse();
Base::Vector3d pt = mat*Base::Vector3d(msg.x,msg.y,msg.z);
@@ -230,7 +230,7 @@ ViewProviderPath::ViewProviderPath()
MarkerColor.touch();
DisplayMode.setStatus(App::Property::Status::Hidden, true);
static const char *SelectionStyleEnum[] = {"Shape","BoundBox","None",0};
SelectionStyle.setEnums(SelectionStyleEnum);
unsigned long sstyle = hGrp->GetInt("DefaultSelectionStyle",0);
@@ -358,7 +358,7 @@ void ViewProviderPath::onChanged(const App::Property* prop)
pcMatBind->value = SoMaterialBinding::PER_PART;
// resizing and writing the color vector:
int count = coordEnd-coordStart;
if(count > (int)colorindex.size()-coordStart) count = colorindex.size()-coordStart;
pcLineColor->diffuseColor.setNum(count);
@@ -402,7 +402,7 @@ void ViewProviderPath::onChanged(const App::Property* prop)
void ViewProviderPath::showBoundingBox(bool show) {
if(show) {
if(!pcLineCoords->point.getNum())
if(!pcLineCoords->point.getNum())
return;
}
inherited::showBoundingBox(show);
@@ -602,7 +602,7 @@ private:
void ViewProviderPath::updateVisual(bool rebuild) {
hideSelection();
updateShowConstraints();
pcLines->coordIndex.deleteValues(0);
@@ -632,7 +632,7 @@ void ViewProviderPath::updateVisual(bool rebuild) {
pcLineCoords->point.setNum(points.size());
SbVec3f* verts = pcLineCoords->point.startEditing();
int i=0;
for(const auto &pt : points)
for(const auto &pt : points)
verts[i++].setValue(pt.x,pt.y,pt.z);
pcLineCoords->point.finishEditing();

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -32,7 +32,7 @@
#include <Mod/Part/Gui/SoBrepEdgeSet.h>
class SoCoordinate3;
class SoDrawStyle;
class SoDrawStyle;
class SoMaterial;
class SoBaseColor;
class SoMaterialBinding;
@@ -55,7 +55,7 @@ public:
/// destructor.
~ViewProviderPath();
// Display properties
App::PropertyInteger LineWidth;
App::PropertyColor NormalColor;
@@ -91,7 +91,7 @@ protected:
virtual void onChanged(const App::Property* prop);
virtual unsigned long getBoundColor() const;
SoCoordinate3 * pcLineCoords;
SoCoordinate3 * pcMarkerCoords;
SoDrawStyle * pcDrawStyle;
@@ -116,7 +116,7 @@ protected:
int coordEnd;
};
typedef Gui::ViewProviderPythonFeatureT<ViewProviderPath> ViewProviderPathPython;
} //namespace PathGui

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -34,7 +34,7 @@ class PathGuiExport ViewProviderPathCompound: public ViewProviderPath
PROPERTY_HEADER(PathGui::ViewProviderPathCompound);
public:
std::vector<App::DocumentObject*> claimChildren(void)const;
virtual bool canDragObjects() const;
virtual void dragObject(App::DocumentObject*);

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2014 *
* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -35,7 +35,7 @@ class PathGuiExport ViewProviderPathShape: public ViewProviderPath
public:
/// grouping handling
/// grouping handling
virtual std::vector<App::DocumentObject*> claimChildren(void) const;
virtual void updateData(const App::Property*);
virtual bool onDelete(const std::vector<std::string> &);
@@ -47,7 +47,7 @@ public:
virtual bool canDropObjects() const;
virtual bool canDropObject(App::DocumentObject*) const;
virtual void dropObject(App::DocumentObject*);
QIcon getIcon(void) const;
};

View File

@@ -1,5 +1,5 @@
#***************************************************************************
#* (c) Yorik van Havre (yorik@uncreated.net) 2014 *
#* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
#* *
#* This file is part of the FreeCAD CAx development system. *
#* *
@@ -10,17 +10,17 @@
#* for detail see the LICENCE text file. *
#* *
#* FreeCAD is distributed in the hope that it will be useful, *
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
#* GNU Lesser General Public License for more details. *
#* *
#* You should have received a copy of the GNU Library General Public *
#* License along with FreeCAD; if not, write to the Free Software *
#* License along with FreeCAD; if not, write to the Free Software *
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
#* USA *
#* *
#***************************************************************************/
#***************************************************************************
# Get the Parameter Group of this module
ParGrp = App.ParamGet("System parameter:Modules").GetGroup("Path")

View File

@@ -1,5 +1,5 @@
# ***************************************************************************
# * (c) Yorik van Havre (yorik@uncreated.net) 2014 *
# * Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
@@ -19,7 +19,7 @@
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
# * USA *
# * *
# ***************************************************************************/
# ***************************************************************************
class PathCommandGroup:

View File

@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2016 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
@@ -42,7 +41,7 @@ else:
__title__ = "FreeCAD Path Commands"
__author__ = "sliptonic"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"
class _CommandSelectLoop:
@@ -110,7 +109,7 @@ class _CommandSelectLoop:
QtCore.QT_TRANSLATE_NOOP('Path_SelectLoop', 'Closed loop detection failed.'))
def formsPartOfALoop(self, obj, sub, names):
try:
try:
if names[0][0:4] != 'Edge':
if names[0][0:4] == 'Face' and horizontalFaceLoop(obj, sub, names):
return True

View File

@@ -1,5 +1,7 @@
# /**************************************************************************
# * Copyright (c) Kresimir Tusek (kresimir.tusek@gmail.com) 2018 *
# -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2018 Kresimir Tusek <kresimir.tusek@gmail.com> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * This library is free software; you can redistribute it and/or *
@@ -22,7 +24,7 @@
# * Additional modifications and contributions beginning 2019 *
# * by Schildkroet. (https://github.com/Schildkroet) *
# * *
# **************************************************************************/
# ***************************************************************************
import PathScripts.PathOp as PathOp
@@ -136,7 +138,7 @@ def GenerateGCode(op,obj,adaptiveResults, helixDiameter):
# ml: this is dangerous because it'll hide all unused variables hence forward
# however, I don't know wht lx and ly signify so I leave them for now
# however, I don't know what lx and ly signify so I'll leave them for now
# pylint: disable=unused-variable
lx = adaptiveResults[0]["HelixCenterPoint"][0]
ly = adaptiveResults[0]["HelixCenterPoint"][1]
@@ -248,7 +250,7 @@ def GenerateGCode(op,obj,adaptiveResults, helixDiameter):
for pth in region["AdaptivePaths"]:
motionType = pth[0] #[0] contains motion type
for pt in pth[1]: #[1] contains list of points
for pt in pth[1]: #[1] contains list of points
x = pt[0]
y = pt[1]
@@ -468,7 +470,7 @@ class PathAdaptive(PathOp.ObjectOp):
'''opFeatures(obj) ... returns the OR'ed list of features used and supported by the operation.
The default implementation returns "FeatureTool | FeatureDepths | FeatureHeights | FeatureStartPoint"
Should be overwritten by subclasses.'''
return PathOp.FeatureTool | PathOp.FeatureBaseEdges | PathOp.FeatureDepths | PathOp.FeatureFinishDepth | PathOp.FeatureStepDown | PathOp.FeatureHeights | PathOp.FeatureBaseGeometry | PathOp.FeatureCoolant
return PathOp.FeatureTool | PathOp.FeatureBaseEdges | PathOp.FeatureDepths | PathOp.FeatureFinishDepth | PathOp.FeatureStepDown | PathOp.FeatureHeights | PathOp.FeatureBaseGeometry | PathOp.FeatureCoolant
def initOperation(self, obj):
'''initOperation(obj) ... implement to create additional properties.

View File

@@ -1,5 +1,7 @@
# /**************************************************************************
# * Copyright (c) Kresimir Tusek (kresimir.tusek@gmail.com) 2018 *
# -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2018 Kresimir Tusek <kresimir.tusek@gmail.com> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * This library is free software; you can redistribute it and/or *
@@ -17,7 +19,7 @@
# * write to the Free Software Foundation, Inc., 59 Temple Place, *
# * Suite 330, Boston, MA 02111-1307, USA *
# * *
# ***************************************************************************/
# ***************************************************************************
import PathScripts.PathOpGui as PathOpGui
from PySide import QtCore, QtGui

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
@@ -41,7 +39,7 @@ if FreeCAD.GuiUp:
__title__ = "Base class for PathArea based operations."
__author__ = "sliptonic (Brad Collette)"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"
__doc__ = "Base class and properties for Path.Area based operations."
LOGLEVEL = PathLog.Level.INFO

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2015 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
@@ -31,7 +29,7 @@ from PySide import QtCore, QtGui
__title__ = "Base for Circular Hole based operations' UI"
__author__ = "sliptonic (Brad Collette)"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"
__doc__ = "Implementation of circular hole specific base geometry page controller."
LOGLEVEL = False

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
@@ -39,7 +37,7 @@ def translate(context, text, disambig=None):
__title__ = "Path Collision Utility"
__author__ = "sliptonic (Brad Collette)"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"
"""Path Collision object and FreeCAD command"""

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2015 Dan Falck <ddfalck@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
@@ -21,7 +19,8 @@
# * USA *
# * *
# ***************************************************************************
''' Used for CNC machine comments for Path module. Create a comment and place it in the Document tree.'''
'''Used for CNC machine comments for Path module. Create a comment and place it in the Document tree.'''
import FreeCAD
import FreeCADGui

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *

View File

@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2018 sliptonic <shopinthewoods@gmail.com> *
# * Copyright (c) 2020 Schildkroet *
# * *

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2018 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
@@ -33,7 +31,7 @@ from PySide import QtCore, QtGui
__title__ = "Path Deburr Operation UI"
__author__ = "sliptonic (Brad Collette), Schildkroet"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"
__doc__ = "Deburr operation page controller and command implementation."
LOGLEVEL = False

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2018 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2018 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
@@ -21,6 +19,7 @@
# * USA *
# * *
# ***************************************************************************
import FreeCAD
import Path
import math

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
@@ -21,6 +19,7 @@
# * USA *
# * *
# ***************************************************************************
from __future__ import print_function
import FreeCAD
import math
@@ -422,7 +421,7 @@ class ObjectDressup:
def onDocumentRestored(self, obj):
obj.setEditorMode('BoneBlacklist', 2) # hide this one
def __getstate__(self):
return None

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2014 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
@@ -21,6 +19,7 @@
# * USA *
# * *
# ***************************************************************************
import FreeCAD
import Path
import PathScripts.PathDressup as PathDressup

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2017 LTS <SammelLothar@gmx.de> under LGPL *
# * Copyright (c) 2020 Schildkroet *
# * *
@@ -74,7 +72,7 @@ class ObjectDressup:
obj.addProperty("App::PropertyDistance", "ExtendLeadOut", "Path", QtCore.QT_TRANSLATE_NOOP("App::Property", "Extends LeadOut distance"))
obj.addProperty("App::PropertyBool", "RapidPlunge", "Path", QtCore.QT_TRANSLATE_NOOP("App::Property", "Perform plunges with G0"))
obj.addProperty("App::PropertyBool", "IncludeLayers", "Path", QtCore.QT_TRANSLATE_NOOP("App::Property", "Apply LeadInOut to layers within an operation"))
self.wire = None
self.rapids = None
@@ -123,12 +121,12 @@ class ObjectDressup:
if hasattr(op, 'Direction') and op.Direction == 'CW':
return 'right'
return 'left'
def getSideOfPath(self, obj):
op = PathDressup.baseOp(obj.Base)
if hasattr(op, 'Side'):
return op.Side
return ''
def normalize(self, Vector):
@@ -139,19 +137,19 @@ class ObjectDressup:
vx = round(x / length, 3)
vy = round(y / length, 3)
return FreeCAD.Vector(vx, vy, 0)
def invert(self, Vector):
x = Vector.x * -1
y = Vector.y * -1
z = Vector.z * -1
return FreeCAD.Vector(x, y, z)
def multiply(self, Vector, len):
x = Vector.x * len
y = Vector.y * len
z = Vector.z * len
return FreeCAD.Vector(x, y, z)
def rotate(self, Vector, angle):
s = math.sin(math.radians(angle))
c = math.cos(math.radians(angle))
@@ -186,7 +184,7 @@ class ObjectDressup:
p1 = queue[1].Placement.Base
v = self.normalize(p1.sub(p0))
# PathLog.debug(" CURRENT_IN ARC : P0 X:{} Y:{} P1 X:{} Y:{} ".format(p0.x,p0.y,p1.x,p1.y))
# Calculate offset vector (will be overwritten for arcs)
if self.getDirectionOfPath(obj) == 'right':
off_v = FreeCAD.Vector(v.y*R, -v.x*R, 0.0)
@@ -207,36 +205,36 @@ class ObjectDressup:
pij = copy.deepcopy(p0)
pij.x += queue[1].Parameters['I']
pij.y += queue[1].Parameters['J']
# Check if lead in and operation go in same direction (usually for inner circles)
if arcdir == queue[1].Name:
arcs_identical = True
# Calculate vector circle start -> circle middle
vec_circ = pij.sub(p0)
# Rotate vector to get direction for lead in
if arcdir == "G2":
vec_rot = self.rotate(vec_circ, 90)
else:
vec_rot = self.rotate(vec_circ, -90)
# Normalize and invert vector
vec_n = self.normalize(vec_rot)
v = self.invert(vec_n)
# Calculate offset of lead in
if arcdir == "G3":
off_v = FreeCAD.Vector(-v.y*R, v.x*R, 0.0)
else:
off_v = FreeCAD.Vector(v.y*R, -v.x*R, 0.0)
# Multiply offset by LeadIn length
vec_off = self.multiply(vec_n, obj.ExtendLeadIn)
offsetvector = FreeCAD.Vector(v.x*R-vec_off.x, v.y*R-vec_off.y, 0) # IJ
if obj.RadiusCenter == 'Radius':
leadstart = (p0.add(off_v)).sub(offsetvector) # Rmode
if arcs_identical:
@@ -254,27 +252,27 @@ class ObjectDressup:
results.append(extendcommand)
extendcommand = Path.Command('G0', {"Z": op.SafeHeight.Value})
results.append(extendcommand)
if action == 'layer':
if not obj.KeepToolDown:
extendcommand = Path.Command('G0', {"Z": op.SafeHeight.Value})
results.append(extendcommand)
extendcommand = Path.Command('G0', {"X": leadstart.x, "Y": leadstart.y})
results.append(extendcommand)
if not obj.RapidPlunge:
extendcommand = Path.Command('G1', {"X": leadstart.x, "Y": leadstart.y, "Z": p1.z, "F": vertFeed})
else:
extendcommand = Path.Command('G0', {"X": leadstart.x, "Y": leadstart.y, "Z": p1.z,})
results.append(extendcommand)
if obj.UseMachineCRC:
if self.getDirectionOfPath(obj) == 'right':
results.append(Path.Command('G42', {'D': toolnummer}))
else:
results.append(Path.Command('G41', {'D': toolnummer}))
if obj.StyleOn == 'Arc':
arcmove = Path.Command(arcdir, {"X": p0.x+vec_off.x, "Y": p0.y+vec_off.y, "I": offsetvector.x+vec_off.x, "J": offsetvector.y+vec_off.y, "F": horizFeed}) # add G2/G3 move
results.append(arcmove)
@@ -286,10 +284,10 @@ class ObjectDressup:
results.append(extendcommand)
else:
PathLog.debug(" CURRENT_IN Perp")
currLocation.update(results[-1].Parameters)
currLocation['Z'] = p1.z
return results
def getLeadEnd(self, obj, queue, action):
@@ -299,13 +297,13 @@ class ObjectDressup:
horizFeed = PathDressup.toolController(obj.Base).HorizFeed.Value
R = obj.Length.Value # Radius of roll or length
arcs_identical = False
# Set the correct twist command
if self.getDirectionOfPath(obj) == 'right':
arcdir = "G2"
else:
arcdir = "G3"
if queue[1].Name == "G1": # line
p0 = queue[0].Placement.Base
p1 = queue[1].Placement.Base
@@ -314,12 +312,12 @@ class ObjectDressup:
p0 = queue[0].Placement.Base
p1 = queue[1].Placement.Base
v = self.normalize(p1.sub(p0))
if self.getDirectionOfPath(obj) == 'right':
off_v = FreeCAD.Vector(v.y*R, -v.x*R, 0.0)
else:
off_v = FreeCAD.Vector(-v.y*R, v.x*R, 0.0)
# Check if we leave at line or arc command
if queue[1].Name in movecommands and queue[1].Name not in arccommands:
# We have a line move
@@ -334,27 +332,27 @@ class ObjectDressup:
pij.x += queue[1].Parameters['I']
pij.y += queue[1].Parameters['J']
ve = pij.sub(p1)
if arcdir == queue[1].Name:
arcs_identical = True
if arcdir == "G2":
vec_rot = self.rotate(ve, -90)
else:
vec_rot = self.rotate(ve, 90)
vec_n = self.normalize(vec_rot)
v = vec_n
if arcdir == "G3":
off_v = FreeCAD.Vector(-v.y*R, v.x*R, 0.0)
else:
off_v = FreeCAD.Vector(v.y*R, -v.x*R, 0.0)
vec_inv = self.invert(vec_rot)
vec_off = self.multiply(vec_inv, obj.ExtendLeadOut)
offsetvector = FreeCAD.Vector(v.x*R-vec_off.x, v.y*R-vec_off.y, 0.0)
if obj.RadiusCenter == 'Radius':
leadend = (p1.add(off_v)).add(offsetvector) # Rmode
@@ -365,7 +363,7 @@ class ObjectDressup:
off_v = self.multiply(off_v, -1)
else:
leadend = p1.add(off_v) # Dmode
IJ = off_v # .negative()
#results.append(queue[1])
if obj.StyleOff == 'Arc':
@@ -379,10 +377,10 @@ class ObjectDressup:
results.append(extendcommand)
else:
PathLog.debug(" CURRENT_IN Perp")
if obj.UseMachineCRC: # crc off
results.append(Path.Command('G40', {}))
return results
def generateLeadInOutCurve(self, obj):
@@ -395,7 +393,7 @@ class ObjectDressup:
action = 'start'
prevCmd = ''
layers = []
# Read in all commands
for curCommand in obj.Base.Path.Commands:
#PathLog.debug("CurCMD: {}".format(curCommand))
@@ -403,13 +401,13 @@ class ObjectDressup:
# Don't worry about non-move commands, just add to output
newpath.append(curCommand)
continue
if curCommand.Name in rapidcommands:
# We don't care about rapid moves
prevCmd = curCommand
currLocation.update(curCommand.Parameters)
continue
if curCommand.Name in movecommands:
if prevCmd.Name in rapidcommands and curCommand.Name in movecommands and len(queue) > 0:
# Layer changed: Save current layer cmds and prepare next layer
@@ -420,48 +418,48 @@ class ObjectDressup:
#PathLog.debug("Layer change in move: {}->{}".format(currLocation['Z'], curCommand.z))
layers.append(queue)
queue = []
# Save all move commands
queue.append(curCommand)
currLocation.update(curCommand.Parameters)
prevCmd = curCommand
# Add last layer
if len(queue) > 0:
layers.append(queue)
queue = []
# Go through each layer and add leadIn/Out
idx = 0
for layer in layers:
#PathLog.debug("Layer {}".format(idx))
if obj.LeadIn:
temp = self.getLeadStart(obj, layer, action)
newpath.extend(temp)
for cmd in layer:
#PathLog.debug("CurLoc: {}, NewCmd: {}".format(currLocation, cmd))
#if currLocation['X'] == cmd.x and currLocation['Y'] == cmd.y and currLocation['Z'] == cmd.z and cmd.Name in ['G1', 'G01']:
#continue
newpath.append(cmd)
if obj.LeadOut:
tmp = []
tmp.append(layer[-2])
tmp.append(layer[-1])
temp = self.getLeadEnd(obj, tmp, action)
newpath.extend(temp)
if not obj.KeepToolDown or idx == len(layers)-1:
extendcommand = Path.Command('G0', {"Z": op.ClearanceHeight.Value})
newpath.append(extendcommand)
else:
action = 'layer'
idx += 1
commands = newpath
return Path.Path(commands)

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2019 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
@@ -89,7 +87,7 @@ class DressupPathBoundary(object):
if begin.z < self.clearanceHeight:
cmds.append(self.strG0ZclearanceHeight)
if end:
cmds.append(Path.Command('G0', {'X': end.x, 'Y': end.y}))
cmds.append(Path.Command('G0', {'X': end.x, 'Y': end.y}))
if end.z < self.clearanceHeight:
cmds.append(Path.Command('G0', {'Z': max(self.safeHeight, end.z)}))
if end.z < self.safeHeight:
@@ -109,8 +107,8 @@ class DressupPathBoundary(object):
self.strG0ZclearanceHeight = Path.Command('G0', {'Z': self.clearanceHeight})
boundary = obj.Stock.Shape
cmd = obj.Base.Path.Commands[0]
pos = cmd.Placement.Base # bogus m/c position to create first edge
cmd = obj.Base.Path.Commands[0]
pos = cmd.Placement.Base # bogus m/c position to create first edge
bogusX = True
bogusY = True
commands = [cmd]
@@ -136,7 +134,7 @@ class DressupPathBoundary(object):
# cmd fully included by boundary
if lastExit:
if not ( bogusX or bogusY ) : # don't insert false paths based on bogus m/c position
commands.extend(self.boundaryCommands(obj, lastExit, pos, tc.VertFeed.Value))
commands.extend(self.boundaryCommands(obj, lastExit, pos, tc.VertFeed.Value))
lastExit = None
commands.append(cmd)
pos = PathGeom.commandEndPoint(cmd, pos)
@@ -164,7 +162,7 @@ class DressupPathBoundary(object):
lastExit = None
PathLog.track(e, flip)
if not ( bogusX or bogusY ) : # don't insert false paths based on bogus m/c position
commands.extend(PathGeom.cmdsForEdge(e, flip, False, 50, tc.HorizFeed.Value, tc.VertFeed.Value))
commands.extend(PathGeom.cmdsForEdge(e, flip, False, 50, tc.HorizFeed.Value, tc.VertFeed.Value))
inside.remove(e)
pos = newPos
lastExit = newPos

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2019 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
@@ -21,6 +19,7 @@
# * USA *
# * *
# ***************************************************************************
import FreeCAD
import FreeCADGui
import PathScripts.PathDressupPathBoundary as PathDressupPathBoundary

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2017 Pekka Roivainen <pekkaroi@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
@@ -21,6 +19,7 @@
# * USA *
# * *
# ***************************************************************************
import FreeCAD
import Path
import PathScripts.PathDressup as PathDressup

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
@@ -21,6 +19,7 @@
# * USA *
# * *
# ***************************************************************************
import FreeCAD
import PathScripts.PathDressup as PathDressup
import PathScripts.PathGeom as PathGeom

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
@@ -21,6 +19,7 @@
# * USA *
# * *
# ***************************************************************************
import FreeCAD
import FreeCADGui
import PathScripts.PathGeom as PathGeom

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*
# ***************************************************************************
# * *
# * Copyright (c) 2018 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2020 russ4262 (Russell Johnson) *
# * Copyright (c) 2020 Schildkroet *
@@ -43,7 +41,7 @@ from PySide import QtCore
__title__ = "Path Drilling Operation"
__author__ = "sliptonic (Brad Collette)"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"
__doc__ = "Path Drilling operation."
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
@@ -227,9 +225,9 @@ def Create(name, obj=None):
'''Create(name) ... Creates and returns a Drilling operation.'''
if obj is None:
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", name)
obj.Proxy = ObjectDrilling(obj, name)
if obj.Proxy:
obj.Proxy.findAllHoles(obj)
return obj

View File

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
@@ -34,7 +32,7 @@ from PySide import QtCore
__title__ = "Path Drilling Operation UI."
__author__ = "sliptonic (Brad Collette)"
__url__ = "http://www.freecadweb.org"
__url__ = "https://www.freecadweb.org"
__doc__ = "UI and Command for Path Drilling Operation."
__contributors__ = "IMBack!"
@@ -49,24 +47,24 @@ else:
class TaskPanelOpPage(PathCircularHoleBaseGui.TaskPanelOpPage):
'''Controller for the drilling operation's page'''
def initPage(self, obj):
# pylint: disable=attribute-defined-outside-init
self.peckDepthSpinBox = PathGui.QuantitySpinBox(self.form.peckDepth, obj, 'PeckDepth')
self.peckRetractSpinBox = PathGui.QuantitySpinBox(self.form.peckRetractHeight, obj, 'RetractHeight')
self.dwellTimeSpinBox = PathGui.QuantitySpinBox(self.form.dwellTime, obj, 'DwellTime')
def registerSignalHandlers(self, obj):
self.form.peckEnabled.toggled.connect(self.form.peckDepth.setEnabled)
self.form.peckEnabled.toggled.connect(self.form.dwellEnabled.setDisabled)
self.form.dwellEnabled.toggled.connect(self.form.dwellTime.setEnabled)
self.form.dwellEnabled.toggled.connect(self.form.dwellTimelabel.setEnabled)
self.form.dwellEnabled.toggled.connect(self.form.peckEnabled.setDisabled)
self.form.peckRetractHeight.setEnabled(True)
self.form.retractLabel.setEnabled(True)
if self.form.peckEnabled.isChecked():
self.form.dwellEnabled.setEnabled(False)
self.form.peckDepth.setEnabled(True)
@@ -79,7 +77,7 @@ class TaskPanelOpPage(PathCircularHoleBaseGui.TaskPanelOpPage):
def getForm(self):
'''getForm() ... return UI'''
return FreeCADGui.PySideUic.loadUi(":/panels/PageOpDrillingEdit.ui")
def updateQuantitySpinBoxes(self, index = None):
# pylint: disable=unused-argument
self.peckDepthSpinBox.updateSpinBox()
@@ -142,7 +140,7 @@ class TaskPanelOpPage(PathCircularHoleBaseGui.TaskPanelOpPage):
signals.append(self.form.enableRotation.currentIndexChanged)
return signals
def updateData(self, obj, prop):
if prop in ['PeckDepth', 'RetractHeight'] and not prop in ['Base', 'Disabled']:
self.updateQuantitySpinBoxes()

Some files were not shown because too many files have changed in this diff Show More