Hi list! What is the best way of finding the length of a curve in mayavi? I have a small snippet, which works fine for a most curves, but not always.
In the snippet below "pd" is <tvtk_classes.poly_data.PolyData object at 0xee00d4c>: pd = foo.outputs[0] PTS=pd.points.to_array() lines=pd.lines linesdata=lines.data.to_array() l1=linesdata.reshape(PTS.shape) curvelen=(((PTS[l1[:,1:]][:,1,:]- PTS[l1[:,1:]]:,0,:])**2).sum(axis=1)**.5).sum() A related issue is with mlab.pipeline.stripper: if I use that while producing "foo", filtering the line (foo) with mlab.pipeline.tube later on will cause error messages (mayavi claims the vtk object contains no data) when I change the scalars! The same happens also with mlab.pipeline.surface if I have used DepthSortPolyData to construct what ever I feed to surface. Any idea why? I would have thought setting scene.disable_render = True would prevent that, but it does not seem to have any effect (i.e. I see on screen as mayavi runs thourgh the script: first a surface appears, then a tube, then my title, then the title moves to the right location and finally the view angle is changed). Is this normal? Why? Cheers, Juha ------------------------------------------------------------------------------ Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now! http://www.accelacomm.com/jaw/sfnl/114/51491232/ _______________________________________________ MayaVi-users mailing list MayaVi-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mayavi-users