Skip to content
Snippets Groups Projects

Upgrade LinearCellDemo and add a PythonicAPI version

Merged Andrew Maclean requested to merge Upgrade-LinearCellDemo into master
2 unresolved threads

Changes are:

  1. A better colour choice, making it easier to distingiush fromt and back surfaces (I hope).
  2. Enlarging the point ID numbers.
  3. Rewrote/upgraded the C++ and Python versions.
  4. Added an example for the new PythonicAPI - this example uses the vtkTextWidget and adds borders.
  5. Updated the documentation to help in identifying the back face.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • @cory.quammen please review

  • Andrew Maclean mentioned in merge request !358 (merged)

    mentioned in merge request !358 (merged)

  • Looks very nice! Would you mind posting an image in the discussion here of the image generated with backface coloring on?

  • I'll do it tomorrow.

  • Backface coloring: LinearCellDemo-b

    Wireframe: LinearCellDemo-w

  • What do you think of this? It think the plane lets the viewer easily distinguish front from back. It came to me at 3AM last night: Default: LinearCellDemo

    Backface: LinearCellDemo-b

    Wireframe: LinearCellDemo-w

    Edited by Andrew Maclean
  • FYI Here is what the new PythonicAPI image looks like. The big difference is the use of vtkTextWidget making text resizing easy and the introduction of borders:

    TestLinearCellDemo

    Edited by Andrew Maclean
  • added 1 commit

    • 9f0a6773 - Upgraded to use a tile as a base to help users orient.

    Compare with previous version

    • @amaclean thanks for posting these images. A couple thoughts on just the 2D snapshots (I realize the full 3D example is far better for understanding):

      • I'm not sure which is the front face and which is the back face color just from looking at the picture. I think front face is a blueish color and backface is orangish, which makes me wonder why the tetrahedron, for example, looks all orange. We must be seeing only the backface and the front face on the sides closest to the camera are quite transparent? If that's the case, then why is the pentagonal prism blue on the side farthest from the camera instead of orange? I was hoping a different backface color this would make things clearer, but it has got me a bit more confused.
      • I like the ground plane. I think it helps establish perspective, which can be useful in understanding the depth of many of the points in the image. If shadows were easier to do in VTK, I would suggest having a light source above to case a shadow on the plane for even more of a depth cue.
      • The orientation of the tetrahedron has been changed. In these 2D snapshots, I find the orientation unclear. I think the previous orientation might have provided a better view.
      1. I think the coloring has a lot to do with the angle of the surfaces relative to the light source. ALso the serfaces are partially transparent so coloring will come through to the front surface.
      2. I might put the ground plane back only for the voxel, hexahedron and the two prisms.
      3. Tehrahedron orientation has been changed back.
    • Thanks, Andrew. I played around with the existing online demo (which is so super awesome, BTW!) to see if there was a better angle for the tetrahedron. I think this might be one:

      image

      The lighting on the bottom triangle is much darker, making that pesky line segment between points 0 and 2 look unambiguously in the back.

    • @cory.quammen, I don't see it. The shading is the same for the projected triangle on edge 0-1 as it is for the one on edge 3-2. The shading adds nothing to disambiguate the depth of nodes 1 and 2. What makes the difference in that picture is the fact that the #2 (closed) sphere is occluded by the triangles, making it impossible to be in the front. If those spheres were gone, the tet would remain ambiguous.

    • The shading adds nothing to disambiguate the depth of nodes 1 and 2.

      Hmm, it might be my advantage of having seen this with 3D motion, but my brain creates a triangle from 0,1,2 and sees the sees the 0-2 line segment on that back face. I could also see a pyramid, but since this is labeled as a tet, I know it can't be that.

    • image

      This is the ambiguity I see. (I removed the spheres and reconstructed the corners to remove the influence of the spheres.) Either of the two projected diagonals could be the one in front. The shading adds nothing to preference either interpretation.

      Edited by Sean Ahern
    • Ah, I see the second interpretation now. It's too bad - and surprising - that the shading of the edge closest to the viewer in the generated tet isn't a sharp black like in your example. The "dulled" black makes the line segment look covered by the transparent geometry.

    • Please register or sign in to reply
  • I don't see anything in these screenshots that helps distinguish depth. I use the tetrahedron as the most difficult case. In all of these screenshots, both interpretations of the tet are valid.

    I could see the introduction of the ground plane helping, but only if you cast the shadow of the cell down onto it. Otherwise, it adds nothing to the interpretation of depth for cases where the ground plane is unobscured (tet, wedge, pyramid).

    I agree with @cory.quammen that the original tet orientation was better.

    Edited by Sean Ahern
  • added 1 commit

    • 5101c596 - Reverting: removing the tile as a base and using original orientations

    Compare with previous version

    • Resolved by Cory Quammen

      If you do move it around with the 3D motion in WASM, it makes it a lot easier to resolve the tetra. As I said I will:

      1. Reintroduce the ground plane for some of the shapes.
      2. Change the interactor style to trackball camera - making it easier to manipulate the image.
      3. Reorient the tetra.
      4. Improve the C++ code a bit more.

      I'll probably have something on Monday.

  • added 1 commit

    • 426d177d - IMproving C++ and Python code. Need to fix tetra orientation

    Compare with previous version

  • Ok, I think this is the best I can do:

    • I have increased the size of the plinth.
    • Rotated Tetra and Pyramid orientating them so that number on the point closest to you obscures the edge making it (I think) more obvious that this is the front.

    What do you think?

    TestLinearCellDemo

    TestLinearCellDemo-w

    TestLinearCellDemo-b

    Edited by Andrew Maclean
    • I think I've got it!

      I have:

      • Changed the color scheme
      • Re-oriented the Tetra - I think the ambiguity of lines and surfaces is much reduced.
      • Put the wedge on a plinth and it is easier ti distinguish front and back surfaces. It actually looks like a wedge now!
      • Line and Poly line are now lines.

      Check out the images and, if you think it's Ok, I'll upload the modified code tomorrow.

      Default: LinearCellDemo

      -w option LinearCellDemo-w

      -b option LinearCellDemo-b

    • I like it. I think the addition of the plinth underneath effectively orients the cell for the viewer. Nice job

      Edited by Sean Ahern
    • Please register or sign in to reply
  • added 1 commit

    • efeeac29 - Updated coloring and orientation of some objects

    Compare with previous version

  • Ok I think this is the best we can do. The plinth and current coloring help to remove ambiguity.

    I have:

    • Changed the background again.
    • Re-oriented the pentagonal and hexagonal pyramids.
    • Added an option to remove the plinth.
  • +2

    Thanks so much for your careful attention and thought on this, @amaclean! And thanks for your feedback, @ahernsean!

  • Andrew Maclean marked this merge request as ready

    marked this merge request as ready

  • Andrew Maclean mentioned in commit 94f6a6e3

    mentioned in commit 94f6a6e3

Please register or sign in to reply
Loading