Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/path-invalid-base-geometry-robustness
Browse files Browse the repository at this point in the history
  • Loading branch information
mlampert committed Feb 14, 2021
2 parents d7c4612 + 008e97b commit f7a467c
Show file tree
Hide file tree
Showing 14 changed files with 332 additions and 142 deletions.
2 changes: 1 addition & 1 deletion src/Mod/Draft/draftguitools/gui_orthoarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def Activated(self):
We add callbacks that connect the 3D view with
the widgets of the task panel.
"""
_log("GuiCommand: {}".format(_self.command_name))
_log("GuiCommand: {}".format(self.command_name))
#_msg("{}".format(16*"-"))
#_msg("GuiCommand: {}".format(self.command_name))

Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Draft/drafttaskpanels/task_circulararray.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def create_object(self):
"App.ActiveDocument.recompute()"]

# We commit the command list through the parent command
self.source_command.commit(translate("draft","Circular array", _cmd_list))
self.source_command.commit(translate("draft","Circular array"), _cmd_list)

def get_distances(self):
"""Get the distance parameters from the widgets."""
Expand Down
24 changes: 24 additions & 0 deletions src/Mod/Mesh/App/Mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1497,6 +1497,30 @@ void MeshObject::validateIndices()
this->_segments.clear();
}

bool MeshObject::hasInvalidNeighbourhood() const
{
MeshCore::MeshEvalNeighbourhood eval(_kernel);
return !eval.Evaluate();
}

bool MeshObject::hasPointsOutOfRange() const
{
MeshCore::MeshEvalRangePoint eval(_kernel);
return !eval.Evaluate();
}

bool MeshObject::hasFacetsOutOfRange() const
{
MeshCore::MeshEvalRangeFacet eval(_kernel);
return !eval.Evaluate();
}

bool MeshObject::hasCorruptedFacets() const
{
MeshCore::MeshEvalCorruptedFacets eval(_kernel);
return !eval.Evaluate();
}

void MeshObject::validateDeformations(float fMaxAngle, float fEps)
{
unsigned long count = _kernel.CountFacets();
Expand Down
4 changes: 4 additions & 0 deletions src/Mod/Mesh/App/Mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ class MeshExport MeshObject : public Data::ComplexGeoData
void removeDuplicatedPoints();
void removeDuplicatedFacets();
bool hasNonManifolds() const;
bool hasInvalidNeighbourhood() const;
bool hasPointsOutOfRange() const;
bool hasFacetsOutOfRange() const;
bool hasCorruptedFacets() const;
void removeNonManifolds();
void removeNonManifoldPoints();
bool hasSelfIntersections() const;
Expand Down
24 changes: 22 additions & 2 deletions src/Mod/Mesh/App/MeshPy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ for c in mesh.getSeparatecomponents():
<UserDocu>Check if the mesh has non-manifolds</UserDocu>
</Documentation>
</Methode>
<Methode Name="removeNonManifolds">
<Methode Name="removeNonManifolds">
<Documentation>
<UserDocu>Remove non-manifolds</UserDocu>
</Documentation>
Expand Down Expand Up @@ -284,7 +284,27 @@ for c in mesh.getSeparatecomponents():
<UserDocu>Remove points with invalid coordinates (NaN)</UserDocu>
</Documentation>
</Methode>
<Methode Name="countComponents" Const="true">
<Methode Name="hasInvalidNeighbourhood" Const="true">
<Documentation>
<UserDocu>Check if the mesh has invalid neighbourhood indices</UserDocu>
</Documentation>
</Methode>
<Methode Name="hasPointsOutOfRange" Const="true">
<Documentation>
<UserDocu>Check if the mesh has point indices that are out of range</UserDocu>
</Documentation>
</Methode>
<Methode Name="hasFacetsOutOfRange" Const="true">
<Documentation>
<UserDocu>Check if the mesh has facet indices that are out of range</UserDocu>
</Documentation>
</Methode>
<Methode Name="hasCorruptedFacets" Const="true">
<Documentation>
<UserDocu>Check if the mesh has corrupted facets</UserDocu>
</Documentation>
</Methode>
<Methode Name="countComponents" Const="true">
<Documentation>
<UserDocu>Get the number of topologic independent areas</UserDocu>
</Documentation>
Expand Down
32 changes: 32 additions & 0 deletions src/Mod/Mesh/App/MeshPyImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,38 @@ PyObject* MeshPy::hasNonManifolds(PyObject *args)
return Py_BuildValue("O", (ok ? Py_True : Py_False));
}

PyObject* MeshPy::hasInvalidNeighbourhood(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
bool ok = getMeshObjectPtr()->hasInvalidNeighbourhood();
return Py_BuildValue("O", (ok ? Py_True : Py_False));
}

PyObject* MeshPy::hasPointsOutOfRange(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
bool ok = getMeshObjectPtr()->hasPointsOutOfRange();
return Py_BuildValue("O", (ok ? Py_True : Py_False));
}

PyObject* MeshPy::hasFacetsOutOfRange(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
bool ok = getMeshObjectPtr()->hasFacetsOutOfRange();
return Py_BuildValue("O", (ok ? Py_True : Py_False));
}

PyObject* MeshPy::hasCorruptedFacets(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
bool ok = getMeshObjectPtr()->hasFacetsOutOfRange();
return Py_BuildValue("O", (ok ? Py_True : Py_False));
}

PyObject* MeshPy::removeNonManifolds(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
Expand Down

0 comments on commit f7a467c

Please sign in to comment.