[vtkusers] Visualize cell normal vector of polydata

Cory Quammen cory.quammen at kitware.com
Tue Nov 28 09:43:43 EST 2017


How did you generate the arrow glyphs? My guess is that the problem is
there rather than in the generation of the cell normals, which appears to
me to be correct.

Thanks,
Cory

On Tue, Nov 28, 2017 at 8:20 AM, woshizyc at gmail.com <woshizyc at gmail.com>
wrote:

> Hi, experts,
>
> I want to visualize the normal vectors of a polydata to be centered in the
> center of each triangle.
> I tried to do this for a sphere generated from vtkSphereSource.
>
> I used the following python codes to calculate the normal vectors of the
> sphere:
> sphere = vtk.vtkSphereSource()
> sphere.SetCenter(0, 0, 0)
> sphere.SetRadius(5.0)
> arrow = vtk.vtkArrowSource()
> arrow.Update()
>
> normals = vtk.vtkPolyDataNormals()
> normals.SetInputConnection(sphere.GetOutputPort())
>
> normals.ComputePointNormalsOff()
> normals.ComputeCellNormalsOn()
> normals.SplittingOff()
> normals.FlipNormalsOff()
> normals.ConsistencyOn()
> normals.AutoOrientNormalsOn()
> normals.Update()
>
> However, it seemed that I did not get the correct normal vectors of each
> triangle, as you can see in the attached figure.
> In addition, I also do not know how to move the vectors to the center of
> each triangle.
>
> Could any experts give me some clue for solving this problem.
>
> Are there any example for doing this?
>
> Thanks in advance.
>
> Best,
>
> Yuanchao
>
>
> ------------------------------
> woshizyc at gmail.com
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>


-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20171128/67758ac0/attachment-0001.html>


More information about the vtkusers mailing list