Path: remove trailing whitespace
This commit is contained in:
@@ -2646,7 +2646,7 @@ struct ShapeInfo {
|
|||||||
if (mySupportEdge) {
|
if (mySupportEdge) {
|
||||||
//if best point is on some edge, split the edge in half
|
//if best point is on some edge, split the edge in half
|
||||||
if (edge.IsEqual(mySupport)) {
|
if (edge.IsEqual(mySupport)) {
|
||||||
//to fix PointProjectionFailed.
|
//to fix PointProjectionFailed.
|
||||||
GeomAPI_ProjectPointOnCurve gpp;
|
GeomAPI_ProjectPointOnCurve gpp;
|
||||||
gpp.Init(myBestPt, curve);
|
gpp.Init(myBestPt, curve);
|
||||||
gpp.Perform(myBestPt);
|
gpp.Perform(myBestPt);
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
||||||
<PythonExport
|
<PythonExport
|
||||||
Father="BaseClassPy"
|
Father="BaseClassPy"
|
||||||
Name="AreaPy"
|
Name="AreaPy"
|
||||||
Twin="Area"
|
Twin="Area"
|
||||||
TwinPointer="Area"
|
TwinPointer="Area"
|
||||||
Include="Mod/Path/App/Area.h"
|
Include="Mod/Path/App/Area.h"
|
||||||
Namespace="Path"
|
Namespace="Path"
|
||||||
FatherInclude="Base/BaseClassPy.h"
|
FatherInclude="Base/BaseClassPy.h"
|
||||||
FatherNamespace="Base"
|
FatherNamespace="Base"
|
||||||
Constructor="true"
|
Constructor="true"
|
||||||
Delete="true">
|
Delete="true">
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ static PyObject * areaSetParams(PyObject *, PyObject *args, PyObject *kwd) {
|
|||||||
|
|
||||||
static char *kwlist[] = {PARAM_FIELD_STRINGS(NAME,AREA_PARAMS_STATIC_CONF),nullptr};
|
static char *kwlist[] = {PARAM_FIELD_STRINGS(NAME,AREA_PARAMS_STATIC_CONF),nullptr};
|
||||||
|
|
||||||
if(args && PySequence_Size(args)>0)
|
if(args && PySequence_Size(args)>0)
|
||||||
PyErr_SetString(PyExc_ValueError,"Non-keyword argument is not supported");
|
PyErr_SetString(PyExc_ValueError,"Non-keyword argument is not supported");
|
||||||
|
|
||||||
//Declare variables defined in the NAME field of the CONF parameter list
|
//Declare variables defined in the NAME field of the CONF parameter list
|
||||||
@@ -62,9 +62,9 @@ static PyObject * areaSetParams(PyObject *, PyObject *args, PyObject *kwd) {
|
|||||||
//populate the CONF variables with params
|
//populate the CONF variables with params
|
||||||
PARAM_FOREACH(AREA_SET,AREA_PARAMS_STATIC_CONF)
|
PARAM_FOREACH(AREA_SET,AREA_PARAMS_STATIC_CONF)
|
||||||
|
|
||||||
//Parse arguments to overwrite CONF variables
|
//Parse arguments to overwrite CONF variables
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kwd,
|
if (!PyArg_ParseTupleAndKeywords(args, kwd,
|
||||||
"|" PARAM_PY_KWDS(AREA_PARAMS_STATIC_CONF), kwlist,
|
"|" PARAM_PY_KWDS(AREA_PARAMS_STATIC_CONF), kwlist,
|
||||||
PARAM_REF(PARAM_FNAME,AREA_PARAMS_STATIC_CONF)))
|
PARAM_REF(PARAM_FNAME,AREA_PARAMS_STATIC_CONF)))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
@@ -258,8 +258,8 @@ PyObject* AreaPy::add(PyObject *args, PyObject *keywds)
|
|||||||
//they added '$' to address that issue.
|
//they added '$' to address that issue.
|
||||||
static char *kwlist[] = {"shape",PARAM_FIELD_STRINGS(ARG,AREA_PARAMS_OPCODE), nullptr};
|
static char *kwlist[] = {"shape",PARAM_FIELD_STRINGS(ARG,AREA_PARAMS_OPCODE), nullptr};
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, keywds,
|
if (!PyArg_ParseTupleAndKeywords(args, keywds,
|
||||||
"O|" PARAM_PY_KWDS(AREA_PARAMS_OPCODE),
|
"O|" PARAM_PY_KWDS(AREA_PARAMS_OPCODE),
|
||||||
kwlist,&pcObj,PARAM_REF(PARAM_FARG,AREA_PARAMS_OPCODE)))
|
kwlist,&pcObj,PARAM_REF(PARAM_FARG,AREA_PARAMS_OPCODE)))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
@@ -303,8 +303,8 @@ PyObject* AreaPy::makeOffset(PyObject *args, PyObject *keywds)
|
|||||||
PARAM_PY_DECLARE_INIT(PARAM_FARG,AREA_PARAMS_OFFSET)
|
PARAM_PY_DECLARE_INIT(PARAM_FARG,AREA_PARAMS_OFFSET)
|
||||||
|
|
||||||
//Parse arguments to overwrite the defaults
|
//Parse arguments to overwrite the defaults
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, keywds,
|
if (!PyArg_ParseTupleAndKeywords(args, keywds,
|
||||||
"|h" PARAM_PY_KWDS(AREA_PARAMS_OFFSET), kwlist,
|
"|h" PARAM_PY_KWDS(AREA_PARAMS_OFFSET), kwlist,
|
||||||
&index,PARAM_REF(PARAM_FARG,AREA_PARAMS_OFFSET)))
|
&index,PARAM_REF(PARAM_FARG,AREA_PARAMS_OFFSET)))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
@@ -325,8 +325,8 @@ PyObject* AreaPy::makePocket(PyObject *args, PyObject *keywds)
|
|||||||
//Override pocket mode default
|
//Override pocket mode default
|
||||||
mode = Area::PocketModeZigZagOffset;
|
mode = Area::PocketModeZigZagOffset;
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, keywds,
|
if (!PyArg_ParseTupleAndKeywords(args, keywds,
|
||||||
"|h" PARAM_PY_KWDS(AREA_PARAMS_POCKET), kwlist,
|
"|h" PARAM_PY_KWDS(AREA_PARAMS_POCKET), kwlist,
|
||||||
&index,PARAM_REF(PARAM_FARG,AREA_PARAMS_POCKET)))
|
&index,PARAM_REF(PARAM_FARG,AREA_PARAMS_POCKET)))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
@@ -339,15 +339,15 @@ PyObject* AreaPy::makePocket(PyObject *args, PyObject *keywds)
|
|||||||
|
|
||||||
PyObject* AreaPy::makeSections(PyObject *args, PyObject *keywds)
|
PyObject* AreaPy::makeSections(PyObject *args, PyObject *keywds)
|
||||||
{
|
{
|
||||||
static char *kwlist[] = {PARAM_FIELD_STRINGS(ARG,AREA_PARAMS_SECTION_EXTRA),
|
static char *kwlist[] = {PARAM_FIELD_STRINGS(ARG,AREA_PARAMS_SECTION_EXTRA),
|
||||||
"heights", "plane", nullptr};
|
"heights", "plane", nullptr};
|
||||||
PyObject *heights = nullptr;
|
PyObject *heights = nullptr;
|
||||||
PyObject *plane = nullptr;
|
PyObject *plane = nullptr;
|
||||||
|
|
||||||
PARAM_PY_DECLARE_INIT(PARAM_FARG,AREA_PARAMS_SECTION_EXTRA)
|
PARAM_PY_DECLARE_INIT(PARAM_FARG,AREA_PARAMS_SECTION_EXTRA)
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, keywds,
|
if (!PyArg_ParseTupleAndKeywords(args, keywds,
|
||||||
"|" PARAM_PY_KWDS(AREA_PARAMS_SECTION_EXTRA) "OO!", kwlist,
|
"|" PARAM_PY_KWDS(AREA_PARAMS_SECTION_EXTRA) "OO!", kwlist,
|
||||||
PARAM_REF(PARAM_FARG,AREA_PARAMS_SECTION_EXTRA),
|
PARAM_REF(PARAM_FARG,AREA_PARAMS_SECTION_EXTRA),
|
||||||
&heights, &(Part::TopoShapePy::Type), &plane))
|
&heights, &(Part::TopoShapePy::Type), &plane))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -380,7 +380,7 @@ PyObject* AreaPy::makeSections(PyObject *args, PyObject *keywds)
|
|||||||
h,plane?GET_TOPOSHAPE(plane):TopoDS_Shape());
|
h,plane?GET_TOPOSHAPE(plane):TopoDS_Shape());
|
||||||
|
|
||||||
Py::List ret;
|
Py::List ret;
|
||||||
for(auto &area : sections)
|
for(auto &area : sections)
|
||||||
ret.append(Py::asObject(new AreaPy(new Area(*area,true))));
|
ret.append(Py::asObject(new AreaPy(new Area(*area,true))));
|
||||||
return Py::new_reference_to(ret);
|
return Py::new_reference_to(ret);
|
||||||
} PY_CATCH_OCC
|
} PY_CATCH_OCC
|
||||||
@@ -403,9 +403,9 @@ PyObject* AreaPy::setParams(PyObject *args, PyObject *keywds)
|
|||||||
//populate the CONF variables with params
|
//populate the CONF variables with params
|
||||||
PARAM_FOREACH(AREA_SET,AREA_PARAMS_CONF)
|
PARAM_FOREACH(AREA_SET,AREA_PARAMS_CONF)
|
||||||
|
|
||||||
//Parse arguments to overwrite CONF variables
|
//Parse arguments to overwrite CONF variables
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, keywds,
|
if (!PyArg_ParseTupleAndKeywords(args, keywds,
|
||||||
"|" PARAM_PY_KWDS(AREA_PARAMS_CONF), kwlist,
|
"|" PARAM_PY_KWDS(AREA_PARAMS_CONF), kwlist,
|
||||||
PARAM_REF(PARAM_FNAME,AREA_PARAMS_CONF)))
|
PARAM_REF(PARAM_FNAME,AREA_PARAMS_CONF)))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
@@ -485,5 +485,5 @@ PyObject *AreaPy::getCustomAttributes(const char* /*attr*/) const
|
|||||||
|
|
||||||
int AreaPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
|
int AreaPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace Path
|
|||||||
class PathExport Command : public Base::Persistence
|
class PathExport Command : public Base::Persistence
|
||||||
{
|
{
|
||||||
TYPESYSTEM_HEADER();
|
TYPESYSTEM_HEADER();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//constructors
|
//constructors
|
||||||
Command();
|
Command();
|
||||||
@@ -47,7 +47,7 @@ namespace Path
|
|||||||
virtual unsigned int getMemSize (void) const;
|
virtual unsigned int getMemSize (void) const;
|
||||||
virtual void Save (Base::Writer &/*writer*/) const;
|
virtual void Save (Base::Writer &/*writer*/) const;
|
||||||
virtual void Restore(Base::XMLReader &/*reader*/);
|
virtual void Restore(Base::XMLReader &/*reader*/);
|
||||||
|
|
||||||
// specific methods
|
// specific methods
|
||||||
Base::Placement getPlacement (const Base::Vector3d pos = Base::Vector3d()) const; // returns a placement from the x,y,z,a,b,c parameters
|
Base::Placement getPlacement (const Base::Vector3d pos = Base::Vector3d()) const; // returns a placement from the x,y,z,a,b,c parameters
|
||||||
Base::Vector3d getCenter (void) const; // returns a 3d vector from the i,j,k parameters
|
Base::Vector3d getCenter (void) const; // returns a 3d vector from the i,j,k parameters
|
||||||
@@ -70,7 +70,7 @@ namespace Path
|
|||||||
std::string Name;
|
std::string Name;
|
||||||
std::map<std::string,double> Parameters;
|
std::map<std::string,double> Parameters;
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace Path
|
} //namespace Path
|
||||||
|
|
||||||
#endif // PATH_COMMAND_H
|
#endif // PATH_COMMAND_H
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
||||||
<PythonExport
|
<PythonExport
|
||||||
Father="PersistencePy"
|
Father="PersistencePy"
|
||||||
Name="CommandPy"
|
Name="CommandPy"
|
||||||
Twin="Command"
|
Twin="Command"
|
||||||
TwinPointer="Command"
|
TwinPointer="Command"
|
||||||
Include="Mod/Path/App/Command.h"
|
Include="Mod/Path/App/Command.h"
|
||||||
Namespace="Path"
|
Namespace="Path"
|
||||||
FatherInclude="Base/PersistencePy.h"
|
FatherInclude="Base/PersistencePy.h"
|
||||||
FatherNamespace="Base"
|
FatherNamespace="Base"
|
||||||
Constructor="true"
|
Constructor="true"
|
||||||
Delete="true">
|
Delete="true">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<Author Licence="LGPL" Name="Yorik van Havre" EMail="yorik@uncreated.net" />
|
<Author Licence="LGPL" Name="Yorik van Havre" EMail="yorik@uncreated.net" />
|
||||||
<UserDocu>Command([name],[parameters]): Represents a basic Gcode command
|
<UserDocu>Command([name],[parameters]): Represents a basic Gcode command
|
||||||
name (optional) is the name of the command, ex. G1
|
name (optional) is the name of the command, ex. G1
|
||||||
parameters (optional) is a dictionary containing string:number
|
parameters (optional) is a dictionary containing string:number
|
||||||
pairs, or a placement, or a vector</UserDocu>
|
pairs, or a placement, or a vector</UserDocu>
|
||||||
</Documentation>
|
</Documentation>
|
||||||
<Attribute Name="Name" ReadOnly="false">
|
<Attribute Name="Name" ReadOnly="false">
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ std::string CommandPy::representation() const
|
|||||||
return str.str();
|
return str.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Py::Dict parameters_copy_dict is now a class member to avoid delete/create/copy on every read access from python code
|
// Py::Dict parameters_copy_dict is now a class member to avoid delete/create/copy on every read access from python code
|
||||||
// Now the pre-filled Py::Dict is returned which is more consistent with normal python behaviour.
|
// Now the pre-filled Py::Dict is returned which is more consistent with normal python behaviour.
|
||||||
// It should be cleared whenever the c++ Parameters object is changed eg setParameters() or other objects invalidate its content, eg setPlacement()
|
// It should be cleared whenever the c++ Parameters object is changed eg setParameters() or other objects invalidate its content, eg setPlacement()
|
||||||
@@ -154,7 +154,7 @@ void CommandPy::setName(Py::String arg)
|
|||||||
Py::Dict CommandPy::getParameters() const
|
Py::Dict CommandPy::getParameters() const
|
||||||
{
|
{
|
||||||
// dict now a class member , https://forum.freecadweb.org/viewtopic.php?f=15&t=50583
|
// dict now a class member , https://forum.freecadweb.org/viewtopic.php?f=15&t=50583
|
||||||
if (parameters_copy_dict.length()==0) {
|
if (parameters_copy_dict.length()==0) {
|
||||||
for(std::map<std::string,double>::iterator i = getCommandPtr()->Parameters.begin(); i != getCommandPtr()->Parameters.end(); ++i) {
|
for(std::map<std::string,double>::iterator i = getCommandPtr()->Parameters.begin(); i != getCommandPtr()->Parameters.end(); ++i) {
|
||||||
parameters_copy_dict.setItem(i->first, Py::Float(i->second));
|
parameters_copy_dict.setItem(i->first, Py::Float(i->second));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
||||||
<PythonExport
|
<PythonExport
|
||||||
Father="DocumentObjectPy"
|
Father="DocumentObjectPy"
|
||||||
Name="FeatureAreaPy"
|
Name="FeatureAreaPy"
|
||||||
Twin="FeatureArea"
|
Twin="FeatureArea"
|
||||||
TwinPointer="FeatureArea"
|
TwinPointer="FeatureArea"
|
||||||
Include="Mod/Path/App/FeatureArea.h"
|
Include="Mod/Path/App/FeatureArea.h"
|
||||||
Namespace="Path"
|
Namespace="Path"
|
||||||
FatherInclude="App/DocumentObjectPy.h"
|
FatherInclude="App/DocumentObjectPy.h"
|
||||||
FatherNamespace="App">
|
FatherNamespace="App">
|
||||||
<Documentation>
|
<Documentation>
|
||||||
<Author Licence="LGPL" Name="Zheng, Lei" EMail="realthunder.dev@gmail.com" />
|
<Author Licence="LGPL" Name="Zheng, Lei" EMail="realthunder.dev@gmail.com" />
|
||||||
|
|||||||
@@ -65,9 +65,9 @@ PyObject* FeatureAreaPy::setParams(PyObject *args, PyObject *keywds)
|
|||||||
//populate the CONF variables with values in properties
|
//populate the CONF variables with values in properties
|
||||||
PARAM_FOREACH(AREA_SET,AREA_PARAMS_CONF)
|
PARAM_FOREACH(AREA_SET,AREA_PARAMS_CONF)
|
||||||
|
|
||||||
//Parse arguments to overwrite CONF variables
|
//Parse arguments to overwrite CONF variables
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, keywds,
|
if (!PyArg_ParseTupleAndKeywords(args, keywds,
|
||||||
"|" PARAM_PY_KWDS(AREA_PARAMS_CONF), kwlist,
|
"|" PARAM_PY_KWDS(AREA_PARAMS_CONF), kwlist,
|
||||||
PARAM_REF(PARAM_FNAME,AREA_PARAMS_CONF)))
|
PARAM_REF(PARAM_FNAME,AREA_PARAMS_CONF)))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ PyObject *Feature::getPyObject()
|
|||||||
// ref counter is set to 1
|
// ref counter is set to 1
|
||||||
PythonObject = Py::Object(new App::DocumentObjectPy(this),true);
|
PythonObject = Py::Object(new App::DocumentObjectPy(this),true);
|
||||||
}
|
}
|
||||||
return Py::new_reference_to(PythonObject);
|
return Py::new_reference_to(PythonObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Feature::onChanged(const App::Property* prop)
|
void Feature::onChanged(const App::Property* prop)
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ App::DocumentObjectExecReturn *FeatureCompound::execute()
|
|||||||
|
|
||||||
result.setCenter(Path.getValue().getCenter());
|
result.setCenter(Path.getValue().getCenter());
|
||||||
Path.setValue(result);
|
Path.setValue(result);
|
||||||
|
|
||||||
return App::DocumentObject::StdReturn;
|
return App::DocumentObject::StdReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public:
|
|||||||
return "PathGui::ViewProviderPathCompound";
|
return "PathGui::ViewProviderPathCompound";
|
||||||
}
|
}
|
||||||
virtual App::DocumentObjectExecReturn *execute(void);
|
virtual App::DocumentObjectExecReturn *execute(void);
|
||||||
|
|
||||||
/// Checks whether the object \a obj is part of this group.
|
/// Checks whether the object \a obj is part of this group.
|
||||||
bool hasObject(const DocumentObject* obj) const;
|
bool hasObject(const DocumentObject* obj) const;
|
||||||
/// Adds an object to this group.
|
/// Adds an object to this group.
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
||||||
<PythonExport
|
<PythonExport
|
||||||
Father="DocumentObjectPy"
|
Father="DocumentObjectPy"
|
||||||
Name="FeaturePathCompoundPy"
|
Name="FeaturePathCompoundPy"
|
||||||
Twin="FeaturePathCompound"
|
Twin="FeaturePathCompound"
|
||||||
TwinPointer="FeatureCompound"
|
TwinPointer="FeatureCompound"
|
||||||
Include="Mod/Path/App/FeaturePathCompound.h"
|
Include="Mod/Path/App/FeaturePathCompound.h"
|
||||||
Namespace="Path"
|
Namespace="Path"
|
||||||
FatherInclude="App/DocumentObjectPy.h"
|
FatherInclude="App/DocumentObjectPy.h"
|
||||||
FatherNamespace="App">
|
FatherNamespace="App">
|
||||||
<Documentation>
|
<Documentation>
|
||||||
<Author Licence="LGPL" Name="Yorik van Havre" EMail="yorik@uncreated.net" />
|
<Author Licence="LGPL" Name="Yorik van Havre" EMail="yorik@uncreated.net" />
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public:
|
|||||||
/// Constructor
|
/// Constructor
|
||||||
FeatureShape();
|
FeatureShape();
|
||||||
virtual ~FeatureShape();
|
virtual ~FeatureShape();
|
||||||
|
|
||||||
// Part::PropertyPartShape Shape;
|
// Part::PropertyPartShape Shape;
|
||||||
App::PropertyLinkList Sources;
|
App::PropertyLinkList Sources;
|
||||||
App::PropertyVector StartPoint;
|
App::PropertyVector StartPoint;
|
||||||
@@ -65,7 +65,7 @@ public:
|
|||||||
virtual const char* getViewProviderName() const {
|
virtual const char* getViewProviderName() const {
|
||||||
return "PathGui::ViewProviderPathShape";
|
return "PathGui::ViewProviderPathShape";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// get called by the container when a property has changed
|
/// get called by the container when a property has changed
|
||||||
//virtual void onChanged (const App::Property* prop);
|
//virtual void onChanged (const App::Property* prop);
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ Base::BoundBox3d Toolpath::getBoundBox() const
|
|||||||
BoundBoxSegmentVisitor visitor;
|
BoundBoxSegmentVisitor visitor;
|
||||||
PathSegmentWalker walker(*this);
|
PathSegmentWalker walker(*this);
|
||||||
walker.walk(visitor, Vector3d(0, 0, 0));
|
walker.walk(visitor, Vector3d(0, 0, 0));
|
||||||
|
|
||||||
return visitor.bb;
|
return visitor.bb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,25 +35,25 @@ namespace Path
|
|||||||
{
|
{
|
||||||
|
|
||||||
/** The representation of a CNC Toolpath */
|
/** The representation of a CNC Toolpath */
|
||||||
|
|
||||||
class PathExport Toolpath : public Base::Persistence
|
class PathExport Toolpath : public Base::Persistence
|
||||||
{
|
{
|
||||||
TYPESYSTEM_HEADER();
|
TYPESYSTEM_HEADER();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Toolpath();
|
Toolpath();
|
||||||
Toolpath(const Toolpath&);
|
Toolpath(const Toolpath&);
|
||||||
~Toolpath();
|
~Toolpath();
|
||||||
|
|
||||||
Toolpath &operator=(const Toolpath&);
|
Toolpath &operator=(const Toolpath&);
|
||||||
|
|
||||||
// from base class
|
// from base class
|
||||||
virtual unsigned int getMemSize (void) const;
|
virtual unsigned int getMemSize (void) const;
|
||||||
virtual void Save (Base::Writer &/*writer*/) const;
|
virtual void Save (Base::Writer &/*writer*/) const;
|
||||||
virtual void Restore(Base::XMLReader &/*reader*/);
|
virtual void Restore(Base::XMLReader &/*reader*/);
|
||||||
void SaveDocFile (Base::Writer &writer) const;
|
void SaveDocFile (Base::Writer &writer) const;
|
||||||
void RestoreDocFile(Base::Reader &reader);
|
void RestoreDocFile(Base::Reader &reader);
|
||||||
|
|
||||||
// interface
|
// interface
|
||||||
void clear(void); // clears the internal data
|
void clear(void); // clears the internal data
|
||||||
void addCommand(const Command &Cmd); // adds a command at the end
|
void addCommand(const Command &Cmd); // adds a command at the end
|
||||||
@@ -65,12 +65,12 @@ namespace Path
|
|||||||
void setFromGCode(const std::string); // sets the path from the contents of the given GCode string
|
void setFromGCode(const std::string); // sets the path from the contents of the given GCode string
|
||||||
std::string toGCode(void) const; // gets a gcode string representation from the Path
|
std::string toGCode(void) const; // gets a gcode string representation from the Path
|
||||||
Base::BoundBox3d getBoundBox(void) const;
|
Base::BoundBox3d getBoundBox(void) const;
|
||||||
|
|
||||||
// shortcut functions
|
// shortcut functions
|
||||||
unsigned int getSize(void) const { return vpcCommands.size(); }
|
unsigned int getSize(void) const { return vpcCommands.size(); }
|
||||||
const std::vector<Command*> &getCommands(void) const { return vpcCommands; }
|
const std::vector<Command*> &getCommands(void) const { return vpcCommands; }
|
||||||
const Command &getCommand(unsigned int pos) const { return *vpcCommands[pos]; }
|
const Command &getCommand(unsigned int pos) const { return *vpcCommands[pos]; }
|
||||||
|
|
||||||
// support for rotation
|
// support for rotation
|
||||||
const Base::Vector3d& getCenter() const { return center; }
|
const Base::Vector3d& getCenter() const { return center; }
|
||||||
void setCenter(const Base::Vector3d &c);
|
void setCenter(const Base::Vector3d &c);
|
||||||
@@ -81,7 +81,7 @@ namespace Path
|
|||||||
std::vector<Command*> vpcCommands;
|
std::vector<Command*> vpcCommands;
|
||||||
Base::Vector3d center;
|
Base::Vector3d center;
|
||||||
//KDL::Path_Composite *pcPath;
|
//KDL::Path_Composite *pcPath;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
inline KDL::Frame toFrame(const Base::Placement &To){
|
inline KDL::Frame toFrame(const Base::Placement &To){
|
||||||
return KDL::Frame(KDL::Rotation::Quaternion(To.getRotation()[0],
|
return KDL::Frame(KDL::Rotation::Quaternion(To.getRotation()[0],
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
||||||
<PythonExport
|
<PythonExport
|
||||||
Father="PersistencePy"
|
Father="PersistencePy"
|
||||||
Name="PathPy"
|
Name="PathPy"
|
||||||
Twin="Toolpath"
|
Twin="Toolpath"
|
||||||
TwinPointer="Toolpath"
|
TwinPointer="Toolpath"
|
||||||
Include="Mod/Path/App/Path.h"
|
Include="Mod/Path/App/Path.h"
|
||||||
Namespace="Path"
|
Namespace="Path"
|
||||||
FatherInclude="Base/PersistencePy.h"
|
FatherInclude="Base/PersistencePy.h"
|
||||||
FatherNamespace="Base"
|
FatherNamespace="Base"
|
||||||
Constructor="true"
|
Constructor="true"
|
||||||
Delete="true">
|
Delete="true">
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
||||||
<PythonExport
|
<PythonExport
|
||||||
Father="BaseClassPy"
|
Father="BaseClassPy"
|
||||||
Name="VoronoiCellPy"
|
Name="VoronoiCellPy"
|
||||||
PythonName="Path.Voronoi.Cell"
|
PythonName="Path.Voronoi.Cell"
|
||||||
Twin="VoronoiCell"
|
Twin="VoronoiCell"
|
||||||
TwinPointer="VoronoiCell"
|
TwinPointer="VoronoiCell"
|
||||||
Include="Mod/Path/App/VoronoiCell.h"
|
Include="Mod/Path/App/VoronoiCell.h"
|
||||||
FatherInclude="Base/BaseClassPy.h"
|
FatherInclude="Base/BaseClassPy.h"
|
||||||
Namespace="Path"
|
Namespace="Path"
|
||||||
FatherNamespace="Base"
|
FatherNamespace="Base"
|
||||||
Constructor="true"
|
Constructor="true"
|
||||||
RichCompare="true"
|
RichCompare="true"
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
||||||
<PythonExport
|
<PythonExport
|
||||||
Father="BaseClassPy"
|
Father="BaseClassPy"
|
||||||
Name="VoronoiEdgePy"
|
Name="VoronoiEdgePy"
|
||||||
PythonName="Path.Voronoi.Edge"
|
PythonName="Path.Voronoi.Edge"
|
||||||
Twin="VoronoiEdge"
|
Twin="VoronoiEdge"
|
||||||
TwinPointer="VoronoiEdge"
|
TwinPointer="VoronoiEdge"
|
||||||
Include="Mod/Path/App/VoronoiEdge.h"
|
Include="Mod/Path/App/VoronoiEdge.h"
|
||||||
FatherInclude="Base/BaseClassPy.h"
|
FatherInclude="Base/BaseClassPy.h"
|
||||||
Namespace="Path"
|
Namespace="Path"
|
||||||
FatherNamespace="Base"
|
FatherNamespace="Base"
|
||||||
Constructor="true"
|
Constructor="true"
|
||||||
RichCompare="true"
|
RichCompare="true"
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
||||||
<PythonExport
|
<PythonExport
|
||||||
Father="BaseClassPy"
|
Father="BaseClassPy"
|
||||||
Name="VoronoiPy"
|
Name="VoronoiPy"
|
||||||
PythonName="Path.Voronoi.Diagram"
|
PythonName="Path.Voronoi.Diagram"
|
||||||
Twin="Voronoi"
|
Twin="Voronoi"
|
||||||
TwinPointer="Voronoi"
|
TwinPointer="Voronoi"
|
||||||
Include="Mod/Path/App/Voronoi.h"
|
Include="Mod/Path/App/Voronoi.h"
|
||||||
Namespace="Path"
|
Namespace="Path"
|
||||||
FatherInclude="Base/BaseClassPy.h"
|
FatherInclude="Base/BaseClassPy.h"
|
||||||
FatherNamespace="Base"
|
FatherNamespace="Base"
|
||||||
Constructor="true"
|
Constructor="true"
|
||||||
Delete="true">
|
Delete="true">
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
||||||
<PythonExport
|
<PythonExport
|
||||||
Father="BaseClassPy"
|
Father="BaseClassPy"
|
||||||
Name="VoronoiVertexPy"
|
Name="VoronoiVertexPy"
|
||||||
PythonName="Path.Voronoi.Vertex"
|
PythonName="Path.Voronoi.Vertex"
|
||||||
Twin="VoronoiVertex"
|
Twin="VoronoiVertex"
|
||||||
TwinPointer="VoronoiVertex"
|
TwinPointer="VoronoiVertex"
|
||||||
Include="Mod/Path/App/VoronoiVertex.h"
|
Include="Mod/Path/App/VoronoiVertex.h"
|
||||||
FatherInclude="Base/BaseClassPy.h"
|
FatherInclude="Base/BaseClassPy.h"
|
||||||
Namespace="Path"
|
Namespace="Path"
|
||||||
FatherNamespace="Base"
|
FatherNamespace="Base"
|
||||||
Constructor="true"
|
Constructor="true"
|
||||||
RichCompare="true"
|
RichCompare="true"
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ from PathScripts import PathUtils
|
|||||||
TOOLTIP = """
|
TOOLTIP = """
|
||||||
This is a postprocessor file for the Path workbench. It is used to
|
This is a postprocessor file for the Path workbench. It is used to
|
||||||
take a pseudo-gcode fragment outputted by a Path object, and output
|
take a pseudo-gcode fragment outputted by a Path object, and output
|
||||||
real GCode suitable for the KineticNC/Beamicon2 Control Software for up to 4 Axis (3 plus rotary).
|
real GCode suitable for the KineticNC/Beamicon2 Control Software for up to 4 Axis (3 plus rotary).
|
||||||
The CORNER_MAX Values are set for a mill with max travel of 1000mm in X, 600mm in Y and 300mm in Z direction.
|
The CORNER_MAX Values are set for a mill with max travel of 1000mm in X, 600mm in Y and 300mm in Z direction.
|
||||||
This postprocessor, once placed in the appropriate PathScripts folder, can be used directly from inside
|
This postprocessor, once placed in the appropriate PathScripts folder, can be used directly from inside
|
||||||
FreeCAD, via the GUI importer or via python scripts with:
|
FreeCAD, via the GUI importer or via python scripts with:
|
||||||
@@ -116,8 +116,8 @@ CORNER_MAX = {"x": 1000, "y": 600, "z": 300}
|
|||||||
PRECISION = 3
|
PRECISION = 3
|
||||||
|
|
||||||
# Preamble text will appear at the beginning of the GCODE output file.
|
# Preamble text will appear at the beginning of the GCODE output file.
|
||||||
PREAMBLE = """%
|
PREAMBLE = """%
|
||||||
G17 G21 G40 G49 G80 G90
|
G17 G21 G40 G49 G80 G90
|
||||||
M08
|
M08
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ PRE_OPERATION = """"""
|
|||||||
POST_OPERATION = """"""
|
POST_OPERATION = """"""
|
||||||
|
|
||||||
# Tool Change commands will be inserted before a tool change
|
# Tool Change commands will be inserted before a tool change
|
||||||
TOOL_CHANGE = """M05
|
TOOL_CHANGE = """M05
|
||||||
M09"""
|
M09"""
|
||||||
|
|
||||||
# to distinguish python built-in open function from the one declared below
|
# to distinguish python built-in open function from the one declared below
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
||||||
<PythonExport
|
<PythonExport
|
||||||
Father="BaseClassPy"
|
Father="BaseClassPy"
|
||||||
Name="PathSimPy"
|
Name="PathSimPy"
|
||||||
Twin="PathSim"
|
Twin="PathSim"
|
||||||
TwinPointer="PathSim"
|
TwinPointer="PathSim"
|
||||||
Include="Mod/Path/PathSimulator/App/PathSim.h"
|
Include="Mod/Path/PathSimulator/App/PathSim.h"
|
||||||
Namespace="PathSimulator"
|
Namespace="PathSimulator"
|
||||||
FatherInclude="Base/BaseClassPy.h"
|
FatherInclude="Base/BaseClassPy.h"
|
||||||
FatherNamespace="Base"
|
FatherNamespace="Base"
|
||||||
Constructor="true"
|
Constructor="true"
|
||||||
Delete="true">
|
Delete="true">
|
||||||
|
|||||||
Reference in New Issue
Block a user