[vtkusers] scaling polydata

Majid Mohammad sadeghi majid.msadeghi at yahoo.com
Fri Jan 26 04:30:39 EST 2018


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.
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180126/9d014c1f/attachment.html>


More information about the vtkusers mailing list