[vtk-developers] Python and the function GetParametricCoords()
David Gobbi
david.gobbi at gmail.com
Sun Feb 18 18:53:11 EST 2018
Hi Andrew,
It's missing a size hint for the wrappers, it should be declared like this:
virtual double *GetParametricCoords() VTK_SIZEHINT(3);
I've submitted an MR: https://gitlab.kitware.com/vtk/vtk/merge_requests/3944
It's strange, it never had a hint in the old "hints" file, either.
- David
On Sun, Feb 18, 2018 at 3:20 PM, Andrew Maclean <andrew.amaclean at gmail.com>
wrote:
> I was looking at converting Bill's excellent example: https://lorensen.
> github.io/VTKExamples/site/Cxx/GeometricObjects/IsoparametricCellsDemo/
> into Python but I have run into a problem with respect to
> GetParametricCoords()
>
> It seems to return a void pointer not an expected tuple even though the
> example below is a primary cell.
>
> There are no tests in the Python tests for GetParametricCoords() yet it is
> wrapped Ok as far as I can see. Does anyone have a solution?
>
> Here is some test code that illustrates the problem:
>
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
>
> import vtk
>
>
> def main():
> xx = vtk.vtkQuadraticEdge()
> print('Is it a primary cell?', xx.IsPrimaryCell())
> # help(vtk.vtkQuadraticEdge.GetBounds)
> # help(vtk.vtkQuadraticEdge.GetParametricCoords)
> # print(dir(vtk.vtkQuadraticEdge))
> pcoords = xx.GetParametricCoords()
> # Here we expect a tuple of nine floats.
> print('pcoords:', pcoords)
> # GetBounds() works.
> bounds = xx.GetBounds()
> print('bounds:', bounds)
>
>
> if __name__ == '__main__':
> main()
>
>
>
>
> --
> ___________________________________________
> Andrew J. P. Maclean
>
> ___________________________________________
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtk-developers
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtk-developers/attachments/20180218/5198a51f/attachment-0001.html>
More information about the vtk-developers
mailing list