[vtkusers] scaling polydata

Majid Mohammad sadeghi majid.msadeghi at yahoo.com
Mon Jan 29 04:55:13 EST 2018


Dear Bill,
Thanks for your time.

Ofcourse I tried "warped_poly=warp->GetOutput();" before sending the email. It does not work!  It gives the following error:
error C2679: binary '=': no operator found which takes a right-hand operand of type 'vtkPointSet *' (or there is no acceptable conversion)
Since Cory told "vtkWarpVector should produce a vtkPolyData" I thought "warped_poly = warp;" might work. Ok I was wrong.

There should be sth else going on here. As in the same example in the new site, still vtksmartpointer is not used for this case. There should be a reason for that:
https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/DataSetSurfaceFilter/
 vtkPolyData* polydata = surfaceFilter->GetOutput();
I finally could get the data using vtkDataSetSurfaceFilter as Cory said. But still I dont undersatand the problem with direct polydata and why not smart pointer?

Any help?
Thanks.

 

    On Friday, January 26, 2018, 4:50:22 PM GMT+2, Bill Lorensen <bill.lorensen at gmail.com> wrote:  
 
 1. The error message tells you what is wrong. You need:
warped_poly=warp->GetOutput();

2. Please go to this site:
https://lorensen.github.io/VTKExamples/site/ for examples. The wiki
site is not supported any more

Try looking at the VTK Book(which is free). https://www.vtk.org/vtk-textbook/

And the examples from the book:
https://lorensen.github.io/VTKExamples/site/VTKBookFigures/


On Fri, Jan 26, 2018 at 1:30 AM, Majid Mohammad sadeghi via vtkusers
<vtkusers at vtk.org> wrote:
> I have 2 questions:
>
> 1.Why is this compile error happening?
>
>    vtkSmartPointer<vtkPolyDataNormals> normals
> =vtkSmartPointer<vtkPolyDataNormals>::New();
>    normals->SetInputData(notSmoothedRotatedX);
>    normals->SplittingOff();
>
>    vtkSmartPointer<vtkWarpVector> warp
> =vtkSmartPointer<vtkWarpVector>::New();
>    warp->SetInputConnection(normals->GetOutputPort());
>    warp->SetInputArrayToProcess(0, 0,
> 0,vtkDataObject::FIELD_ASSOCIATION_POINTS,vtkDataSetAttributes::NORMALS);
>    warp->SetScaleFactor(1.2);
>    warp->Update();
>
>    vtkSmartPointer<vtkPolyData> warped_poly =
> vtkSmartPointer<vtkPolyData>::New();
>    warped_poly = warp;
>
> error C2664: 'vtkPolyData *vtkSmartPointer<vtkPolyData>::CheckType(T *)':
> cannot convert argument 1 from 'vtkWarpVector *' to 'vtkPolyData *'
>
>
> 2. I wonder why sometimes in VTK a vtkpolydata is created without using a
> smart pointer?
>
> Like in this example:
>
> https://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/DataSetSurfaceFilter
>
> Thanks.
>
>
> On Thursday, January 25, 2018, 2:21:03 PM GMT+2, Cory Quammen
> <cory.quammen at kitware.com> wrote:
>
>
> vtkWarpVector should produce a vtkPolyData. If it doesn't you can
> always use vtkDataSetSurface to get a vtkPolyData surface from the
> output of vtkWarpVector.
>
> - Cory
>
> On Thu, Jan 25, 2018 at 6:27 AM, Majid Mohammad sadeghi via vtkusers
> <vtkusers at vtk.org> wrote:
>> Dear All,
>>
>> When I scale a polydata by a uniform scale like: (2,2,2) , the data aslo
>> moves a bit towards a direction depending on where the origin is located
>> in
>> relation to the polydata.
>>
>> Is there a way to make the scaling transformation work as if each surface
>> is
>> moved relative to its normal? (I want an effect like an offset of the
>> shape)
>>
>> I know there is vtkwarpvector but I can not give its output to a plydata.
>> (or maybe I am wrong!)
>>
>> Any help?
>>
>> Thanks.
>>
>> _______________________________________________
>> 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:
>> https://vtk.org/mailman/listinfo/vtkusers
>
>>
>
>
>
> --
> Cory Quammen
> Staff R&D Engineer
> Kitware, Inc.
>
>
> _______________________________________________
> 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:
> https://vtk.org/mailman/listinfo/vtkusers
>



-- 
Unpaid intern in BillsParadise at noware dot com
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180129/a79fc3be/attachment.html>


More information about the vtkusers mailing list