Adding back point coordinate computations in isosurface worklet
This commit is contained in:
parent
1b01d824c6
commit
74dcd1c5cc
@ -176,6 +176,29 @@ public:
|
||||
// Compute the coordinates of the uniform regular grid at each of the cell's eight vertices
|
||||
vtkm::Vec<FieldType, 3> p[8];
|
||||
|
||||
// If we have offset and spacing, can we simplify this computation
|
||||
{
|
||||
vtkm::Vec<FieldType, 3> offset = vtkm::make_Vec(xmin+(xmax-xmin),
|
||||
ymin+(ymax-ymin),
|
||||
zmin+(zmax-zmin) );
|
||||
|
||||
vtkm::Vec<FieldType, 3> spacing = vtkm::make_Vec( 1.0f /((float)(xdim-1)),
|
||||
1.0f /((float)(ydim-1)),
|
||||
1.0f /((float)(zdim-1)));
|
||||
|
||||
vtkm::Vec<FieldType, 3> firstPoint = offset * spacing * vtkm::make_Vec( x, y, z );
|
||||
vtkm::Vec<FieldType, 3> secondPoint = offset * spacing * vtkm::make_Vec( x+1, y+1, z+1 );
|
||||
|
||||
p[0] = vtkm::make_Vec( firstPoint[0], firstPoint[1], firstPoint[2]);
|
||||
p[1] = vtkm::make_Vec( secondPoint[0], firstPoint[1], firstPoint[2]);
|
||||
p[2] = vtkm::make_Vec( secondPoint[0], secondPoint[1], firstPoint[2]);
|
||||
p[3] = vtkm::make_Vec( firstPoint[0], secondPoint[1], firstPoint[2]);
|
||||
p[4] = vtkm::make_Vec( firstPoint[0], firstPoint[1], secondPoint[2]);
|
||||
p[5] = vtkm::make_Vec( secondPoint[0], firstPoint[1], secondPoint[2]);
|
||||
p[6] = vtkm::make_Vec( secondPoint[0], secondPoint[1], secondPoint[2]);
|
||||
p[7] = vtkm::make_Vec( firstPoint[0], secondPoint[1], secondPoint[2]);
|
||||
}
|
||||
|
||||
// Get the scalar source values at the eight vertices
|
||||
float s[8];
|
||||
s[0] = this->Source.Get(i0);
|
||||
|
Loading…
Reference in New Issue
Block a user