visit-dav / visit

VisIt - Visualization and Data Analysis for Mesh-based Scientific Data
https://visit.llnl.gov
BSD 3-Clause "New" or "Revised" License
438 stars 116 forks source link

Centroid zero with projected mesh #5408

Open biagas opened 3 years ago

biagas commented 3 years ago

Describe the bug

From SRE 181

The original note:

I had a user Project a 3d mesh to 2d and he now wants to calculate the centroid,
but it is coming up zero. Here is the user's e-mail.

Thanks, Eric. The Transform operator followed by the Project operator to create a 
projection on a coordinate plane can be used in lieu of a projection to the viewing plane.

As a follow up, I noticed that the query results for the projection produce results that are
not quite intuitive. For example, the 2D area is twice the expected value and is equal to 
the 3D surface area; it’s as though the projection has a front and back “face” and is infinitely
thin (i.e., the volume query returns 0.0). Since the volume query returns 0.0, the centroid is
also returned as a 0.0 value.

We would like to calculate the centroid of the projection. Is there a workaround that you can
think of that would get around the zero volume limitation (which I’m guessing is the cause of
the zero centroid result)?

More thoughts

For Centroid query, I see a couple of problems: First, the logic to determine whether to use
volume or area in the calculation I believe is wrong: It tests topological dimension is 3 
instead of testing spatial dimension. Second, when I modified the query to test spatial dim,
 so that is uses area in its calculation, the calculated area for every cell is 0. This is due to use
 of the verdict area metric, which only calculates area for triangles and quads, but it is receiving
 hexes (in the case of rect3d projected).
brugger1 commented 3 years ago

We should update the Project documentation to describe that it just sets the z coordinates to zero and that there are still 3D elements in the mesh. We should also mention some of these gotchas.

We should set the topological dimension to 2 for the Project operator.

Eric should add the name of the user to this ticket.