Renamed python class Voronoi to VoronoiDiagram

This commit is contained in:
Markus Lampert
2022-07-29 14:56:24 -07:00
parent 9cc1d277fa
commit 79021f4913
5 changed files with 10 additions and 9 deletions

View File

@@ -77,7 +77,7 @@ PyMOD_INIT_FUNC(Path)
Base::Interpreter().addType(&Path::ToolPy ::Type, pathModule, "Tool");
Base::Interpreter().addType(&Path::TooltablePy ::Type, pathModule, "Tooltable");
Base::Interpreter().addType(&Path::AreaPy ::Type, pathModule, "Area");
Base::Interpreter().addType(&Path::VoronoiPy ::Type, pathModule, "Voronoi");
Base::Interpreter().addType(&Path::VoronoiPy ::Type, pathModule, "VoronoiDiagram");
Base::Interpreter().addType(&Path::VoronoiCellPy ::Type, pathModule, "VoronoiCell");
Base::Interpreter().addType(&Path::VoronoiEdgePy ::Type, pathModule, "VoronoiEdge");
Base::Interpreter().addType(&Path::VoronoiVertexPy ::Type, pathModule, "VoronoiVertex");

View File

@@ -3,6 +3,7 @@
<PythonExport
Father="BaseClassPy"
Name="VoronoiPy"
PythonName="VoronoiDiagram"
Twin="Voronoi"
TwinPointer="Voronoi"
Include="Mod/Path/App/Voronoi.h"

View File

@@ -45,7 +45,7 @@ std::string VoronoiPy::representation(void) const
{
std::stringstream ss;
ss.precision(5);
ss << "Voronoi("
ss << "VoronoiDiagram("
<< "{" << getVoronoiPtr()->numSegments() << ", " << getVoronoiPtr()->numPoints() << "}"
<< " -> "
<< "{" << getVoronoiPtr()->numCells() << ", " << getVoronoiPtr()->numEdges() << ", " << getVoronoiPtr()->numVertices() << "}"

View File

@@ -292,7 +292,7 @@ class ObjectVcarve(PathEngraveBase.ObjectOp):
voronoiWires = []
for f in faces:
vd = Path.Voronoi()
vd = Path.VoronoiDiagram()
insert_many_wires(vd, f.Wires)
vd.construct()
@@ -354,7 +354,7 @@ class ObjectVcarve(PathEngraveBase.ObjectOp):
)
return
try:
if True:
faces = []
for base in obj.BaseShapes:
@@ -383,10 +383,10 @@ class ObjectVcarve(PathEngraveBase.ObjectOp):
)
)
except Exception as e:
PathLog.error(
"Error processing Base object. Engraving operation will produce no output."
)
#except Exception as e:
# PathLog.error(
# "Error processing Base object. Engraving operation will produce no output."
# )
def opUpdateDepths(self, obj, ignoreErrors=False):
"""updateDepths(obj) ... engraving is always done at the top most z-value"""

View File

@@ -49,7 +49,7 @@ def initVD():
ptv = [FreeCAD.Vector(p[0], p[1]) for p in pts]
ptv.append(ptv[0])
vd = Path.Voronoi()
vd = Path.VoronoiDiagram()
for i in range(len(pts)):
vd.addSegment(ptv[i], ptv[i + 1])