K3D lets you create 3D plots backed by WebGL with high-level API (surfaces, isosurfaces, voxels, mesh, cloud points, vtk objects, volume renderer, colormaps, etc). The primary aim of K3D-jupyter is to be easy for use as stand alone package like matplotlib, but also to allow interoperation with existing libraries as VTK.
MIT License
953
stars
121
forks
source link
Supporting user generated normals for Standard Mesh object #415
Users might some times want to use custom normals with their 3d Mesh as opposed to the ones computed by the provider (in this case three.js). This is currently not supported in k3d.
Solution
Introduce a new parameter to the Mesh object and support custom normals in MeshStandard.js.
Proof of Life
Before:
Notice that flat_shading is False, meaning computeNormals is used.
After:
Notice that user generated normals are passed to the mesh factory.
Questions
At it's current state this is a relatively safe change to merge. That said here are some pending questions
Do we need a test case for this? It's not a drastic change, so I'm not sure if a test is needed. But community can vote on this.
It is unclear if MeshVolume should also be getting this normals update. Thoughts?
How to update the document to indicate this new change?
Supporting Normals input for Mesh
Problem
Users might some times want to use custom normals with their 3d Mesh as opposed to the ones computed by the provider (in this case three.js). This is currently not supported in k3d.
Solution
Introduce a new parameter to the Mesh object and support custom normals in MeshStandard.js.
Proof of Life
Before:
Notice that flat_shading is False, meaning computeNormals is used.
After:
Notice that user generated normals are passed to the mesh factory.
Questions
At it's current state this is a relatively safe change to merge. That said here are some pending questions