<div dir="ltr">Hi,<div><br></div><div>Please refer to attached program. I hope it helps.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 27 July 2017 at 13:21, arwtyxouymz <span dir="ltr"><<a href="mailto:arw.tyx-ouy_mz@ezweb.ne.jp" target="_blank">arw.tyx-ouy_mz@ezweb.ne.jp</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
I want to make normal vector of the surface of ellipstic cylinder.<br>
To each surface point, I want to render normal vector, and get surface<br>
point.<br>
The current code is this.<br>
<br>
#include "vtkPoints.h"<br>
#include "vtkSmartPointer.h"<br>
#include "vtkLinearExtrusionFilter.h"<br>
#include "vtkDataSetMapper.h"<br>
#include "vtkPolyDataMapper.h"<br>
#include "vtkActor.h"<br>
#include "vtkProperty.h"<br>
#include "vtkCamera.h"<br>
#include "vtkRenderer.h"<br>
#include "vtkRenderWindow.h"<br>
#include "vtkRenderWindowInteractor.h"<br>
#include "<wbr>vtkInteractorStyleTrackballCam<wbr>era.h"<br>
#include "vtkPolyLine.h"<br>
<br>
<br>
int main(int argc, char *argv[])<br>
{<br>
<br>
    double angle = 0;<br>
    double r1, r2;<br>
    int id = 0;<br>
    int CenterX, CenterY;<br>
    r1 = 50;<br>
    r2 = 30;<br>
    CenterX = 0; CenterY = 0;<br>
<br>
    vtkSmartPointer<vtkPoints> points =<br>
            vtkSmartPointer<vtkPoints>::<wbr>New();<br>
    points->SetNumberOfPoints(31);<br>
    while (angle <= 2.0 * vtkMath::Pi() + (vtkMath::Pi() / 360.0))<br>
    {<br>
        points->InsertPoint(id, r1 * cos(angle) + CenterX, r2 * sin(angle) +<br>
CenterY, 0);<br>
        angle = angle + (vtkMath::Pi() / 360.0);<br>
        id++;<br>
    }<br>
<br>
    vtkSmartPointer<vtkPolyLine> line =<br>
            vtkSmartPointer<vtkPolyLine>::<wbr>New();<br>
    line->GetPointIds()-><wbr>SetNumberOfIds(id);<br>
    for (int k = 0; k < id; ++k) {<br>
        line->GetPointIds()->SetId(k, k);<br>
    }<br>
<br>
    vtkSmartPointer<vtkCellArray> lines =<br>
            vtkSmartPointer<vtkCellArray>:<wbr>:New();<br>
    lines->InsertNextCell(line);<br>
<br>
    vtkSmartPointer<vtkPolyData> polyData =<br>
            vtkSmartPointer<vtkPolyData>::<wbr>New();<br>
    polyData-><wbr>GlobalReleaseDataFlagOff();<br>
    polyData->Allocate(1, 1);<br>
    polyData->SetPoints(points);<br>
    polyData->SetLines(lines);<br>
<br>
    vtkSmartPointer<<wbr>vtkLinearExtrusionFilter> extrude =<br>
            vtkSmartPointer<<wbr>vtkLinearExtrusionFilter>::<wbr>New();<br>
    extrude->SetInputData(<wbr>polyData);<br>
    extrude-><wbr>SetExtrusionTypeToNormalExtrus<wbr>ion();<br>
    extrude->SetVector(0, 0, 100.0);<br>
    extrude->SetScaleFactor(0.5);<br>
    extrude->Update();<br>
<br>
    vtkSmartPointer<<wbr>vtkPolyDataMapper> mapper =<br>
            vtkSmartPointer<<wbr>vtkPolyDataMapper>::New();<br>
    mapper->SetInputConnection(<wbr>extrude->GetOutputPort());<br>
<br>
    /*<br>
    vtkSmartPointer<<wbr>vtkCylinderSource> cylinder =<br>
            vtkSmartPointer<<wbr>vtkCylinderSource>::New();<br>
    cylinder->SetRadius(5.0);<br>
    cylinder->SetHeight(10.0);<br>
    cylinder->SetResolution(100);<br>
<br>
    vtkSmartPointer<<wbr>vtkPolyDataMapper> mapper =<br>
            vtkSmartPointer<<wbr>vtkPolyDataMapper>::New();<br>
    mapper->SetInputConnection(<wbr>cylinder->GetOutputPort());<br>
    */<br>
<br>
    vtkSmartPointer<vtkActor> actor =<br>
            vtkSmartPointer<vtkActor>::<wbr>New();<br>
    actor->SetMapper(mapper);<br>
    actor->GetProperty()-><wbr>SetColor(0.8900, 0.8100, 0.3400);<br>
<br>
    vtkSmartPointer<vtkRenderer> ren =<br>
            vtkSmartPointer<vtkRenderer>::<wbr>New();<br>
    ren->SetBackground(.4, .5, .7);<br>
    ren->AddActor(actor);<br>
<br>
<br>
    vtkSmartPointer<<wbr>vtkRenderWindow> renWin =<br>
            vtkSmartPointer<<wbr>vtkRenderWindow>::New();<br>
    renWin->AddRenderer(ren);<br>
    renWin->SetSize(600, 600);<br>
<br>
    vtkSmartPointer<<wbr>vtkRenderWindowInteractor> iren =<br>
            vtkSmartPointer<<wbr>vtkRenderWindowInteractor>::<wbr>New();<br>
    iren->SetRenderWindow(renWin);<br>
<br>
    vtkSmartPointer<<wbr>vtkInteractorStyleTrackballCam<wbr>era> style =<br>
            vtkSmartPointer<<wbr>vtkInteractorStyleTrackballCam<wbr>era>::New();<br>
    iren->SetInteractorStyle(<wbr>style);<br>
<br>
    renWin->Render();<br>
    iren->Initialize();<br>
    iren->Start();<br>
<br>
    return EXIT_SUCCESS;<br>
}<br>
<br>
please help me!<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Normal-vector-of-the-surface-of-ellipstic-cylinder-tp5744171.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.<wbr>com/Normal-vector-of-the-<wbr>surface-of-ellipstic-cylinder-<wbr>tp5744171.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">thanks & regards,<div>Girish</div><div><br></div></div></div>
</div>

<br>
<font size="2">------------------------------</font><font size="2"><wbr>------------------------------</font><font size="2"><wbr>------------------------------</font><font size="2"><wbr>------------------------------</font><font size="2"><wbr>-<br><font face="Arial"><u><b>Disclaimer:</b></u> This email message including any attachments is confidential, and may be privileged and proprietary to Agiliad. If you are not the intended recipient, please notify us immediately by replying to this message and destroy all copies of this message including any attachments. You are NOT authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. Thank you.</font><br>------------------------------</font><font size="2"><wbr>------------------------------</font><font size="2"><wbr>------------------------------</font><font size="2"><wbr>------------------------------</font>