[vtkusers] scaling polydata

Bill Lorensen bill.lorensen at gmail.com
Fri Jan 26 09:50:21 EST 2018


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


More information about the vtkusers mailing list