Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export_vtkjs Does not Include PolyData Normals #3339

Closed
aidanmolnar opened this issue Sep 18, 2022 · 2 comments · Fixed by #4569
Closed

export_vtkjs Does not Include PolyData Normals #3339

aidanmolnar opened this issue Sep 18, 2022 · 2 comments · Fixed by #4569
Labels
bug Uh-oh! Something isn't working as expected. 🍏 low-hanging-fruit A great issue for first time contributors to get their hands dirty

Comments

@aidanmolnar
Copy link

Describe the bug, what's wrong, and what you expected.

Line 362 (shown below) of export_vtkjs that dumps the normals is commented out, causing them not to be included in the file.

    dump_color_array(dataset_dir, data_dir, color_array_info, container, compress)

    # PointData TCoords
    dump_t_coords(dataset_dir, data_dir, dataset, container, compress)
    # dump_normals(dataset_dir, data_dir, dataset, container, compress)

    return root

I expected the normals to be included in the output .vtkjs, but they were not.

I think the line should be uncommented by default or an optional argument could be added to the function. If the feature isn't complete or not working as intended the documentation for the function should be updated to reflect that.

Steps to reproduce the bug.

import pyvista as pv
p = pv.Plotter()
p.add_mesh(pv.Sphere(radius=1.0))
p.export_vtkjs("pyvista")

System Information

--------------------------------------------------------------------------------
  Date: Sat Sep 17 20:28:13 2022 Eastern Daylight Time

                OS : Windows
            CPU(s) : 24
           Machine : AMD64
      Architecture : 64bit
       Environment : Python
        GPU Vendor : NVIDIA Corporation
      GPU Renderer : NVIDIA GeForce RTX 3080/PCIe/SSE2
       GPU Version : 4.5.0 NVIDIA 512.15

  Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64
  bit (AMD64)]

           pyvista : 0.36.1
               vtk : 9.1.0
             numpy : 1.23.3
           imageio : 2.21.3
           appdirs : 1.4.4
            scooby : 0.5.12
        matplotlib : 3.6.0
--------------------------------------------------------------------------------

Screenshots

Here is a comparison of the output for a simple sphere in the vtkjs scene explorer.
Line commented as it is currently:
image
Line uncommented:
image

@aidanmolnar aidanmolnar added the bug Uh-oh! Something isn't working as expected. label Sep 18, 2022
@github-actions
Copy link
Contributor

Hi and welcome! Thanks for posting your first issue in the PyVista project! Someone from @pyvista/developers will chime in before too long. If your question is support related, we may transfer it to the Discussions.

@banesullivan
Copy link
Member

Thanks for digging into this! I'm not sure why that line is commented out... I'd welcome a PR uncommenting that line where we can validate things are still working in the tests and in a review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Uh-oh! Something isn't working as expected. 🍏 low-hanging-fruit A great issue for first time contributors to get their hands dirty
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants