Raise error when bad data are encountered.
This commit is contained in:
parent
baf4f81753
commit
2e53de81fa
@ -141,10 +141,7 @@ public:
|
|||||||
return;
|
return;
|
||||||
//Assign default for 1pt polylines.
|
//Assign default for 1pt polylines.
|
||||||
else if (numPoints == 1)
|
else if (numPoints == 1)
|
||||||
{
|
|
||||||
outNormals.Set(ptIndices[0], this->DefaultNorm);
|
outNormals.Set(ptIndices[0], this->DefaultNorm);
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//The following follows the VTK implementation in:
|
//The following follows the VTK implementation in:
|
||||||
@ -331,7 +328,7 @@ public:
|
|||||||
|
|
||||||
//Coincident points.
|
//Coincident points.
|
||||||
if (vtkm::Magnitude(sNext) == 0)
|
if (vtkm::Magnitude(sNext) == 0)
|
||||||
return;
|
this->RaiseError("Coincident points in Tube worklet.");
|
||||||
|
|
||||||
vtkm::Normalize(sNext);
|
vtkm::Normalize(sNext);
|
||||||
auto s = (sPrev + sNext) / 2.;
|
auto s = (sPrev + sNext) / 2.;
|
||||||
@ -342,7 +339,7 @@ public:
|
|||||||
auto w = vtkm::Cross(s, n);
|
auto w = vtkm::Cross(s, n);
|
||||||
//Bad normal
|
//Bad normal
|
||||||
if (vtkm::Magnitude(w) == 0)
|
if (vtkm::Magnitude(w) == 0)
|
||||||
return;
|
this->RaiseError("Bad normal in Tube worklet.");
|
||||||
vtkm::Normalize(w);
|
vtkm::Normalize(w);
|
||||||
|
|
||||||
//create orthogonal coordinate system.
|
//create orthogonal coordinate system.
|
||||||
|
Loading…
Reference in New Issue
Block a user