Cartesian <--> Cylindrical conversion in Paraview - paraview

With VisIt, I use OppAtts -> Transforms -> Transform -> Coordinate to change the data from Cartesian to cylindrical coordinates (or vice versa). Is there an Option like this in Paraview?

There's no automatic way to do this.
You should apply the Transform filter and do the transformations by hand.
Help link!

Related

Contour Plot of own coordinates with attached scalar

I have the following coordinate system of (x,y) and attached z value to each coordinate. I need to keep the coordinates the same without using some linear fit function to change it into a grid system of some sort. Is there a way i can create a contour of that data using that data only and not using griddata or something.
x=[0.2,0.2,0.05,1.1,0.8,0.9,1.8,1.9,2.05];
y=[0,1.1,2.1,0.1,1.1,2.2,0.15,1.1,2.05];
z=[0,1,0,0,2,1,0,1,0;];
plot(x,y, 'bo')
The reason is i have another model with 540 thousand coordinate points that is a weird shape and if i start using the other functions it loses its shape and goes rectangular.
One option you have is to use fitto create a fit surface of your data, and then directly plot it. This also has the advantage to give you extra parameters to control the interpolation between your points.
f=fit([x',y'],z','linearinterp')
plot(f,'Style','Contour')
Will create something like:
And
f=fit([x',y'],z','cubicinterp')
plot(f,'Style','Contour')
Will smooth the interpolation into:
Please look here for more information on fit and fit plotting options
https://www.mathworks.com/help/curvefit/fit.html#inputarg_fitType
https://www.mathworks.com/help/curvefit/plot.html

Generate 3D surface from scattered or data points

Can anyone tell me how to generate a 3D surface model like CAD in Matlab ?
1.Input: Input is a collection of points with (x,y,z) where surface is present for an object(I'm using this for a 3D scanner where my inputs are (x,y,z) of surface)
2.Points should be displayed as a surface using some smooth interpolation.
3.More like surface generation from data points.
Thanks you.
In order to plot surfaces, you can use patch function. However, you need along with the points the faces information. In patch a surface consists of polygons that is specified using 3 point, which is the face information.
1
Since it seems like you will be inputting discrete points located on the surface of the object, you will first want to create a Nonconvex Polygon based on the data using Matlab's boundary function.
https://www.mathworks.com/help/matlab/ref/boundary.html
You can then use the trimesh function to create the figure
This question shows the input data and what was produced using this method: How do I create a 3D polygon/mesh over data points?

Visualize 3D data in MATLAB

I have data on the form (x, y, z, v), in other words three spatial coordinates and one velocity magnitude. I would like to plot this in 3D, where the velocity magnitude is shown using color.
What is the best way to do this in MATLAB?
I assume you have trajectory data, so that your spatial coordinates represent the trajectory through space of one or more particles. In that case:
Have a look at quiver3 or coneplot.
If you want colored arrows, then have a look at quiver3d or quiverc (2D only) on the File Exchange.
If you only have 3 spatial coordinates and speed (= velocity magnitude), then your best bet is scatter3.
I could go on, but could you give me a bit more detail on what you want exactly?
Have you tried surf(x,y,z,v)?

How to apply radial spatial filter on Matlab?

I have images that contain a series of concentric circles (artifacts), so I would like to apply some kind of radial spatial filter in order to smoothen these circles.
Any help on this would be really appreciated.
Regards,
Simon
You can:
Find the center of the image using center of mass calculations
Transform the image to polar coordinates (ImToPolar, need to download).
Filter in the radial direction (this would be a 1D filter in the x direction).
Transform back to cartesian coordinates.

Convert image in polar to cartesian coordinates

I am trying to convert an image in polar to cartesian coordinates.
examples to convert image to polar coordinates do it explicitly - want a slick matrix method
I thought using the method used above would be a piece of cake but it really isn't!!
If anyone finds an error into my code please let me know!
phi=(0:.01:1)*2*pi;
r=0:.01:2;
psi=r<0.5;
psi_c=cos(phi).'*psi;
[P R z]=find(psi_c);
L=500;
X=R.*cos(P);
Y=R.*sin(P);
Xmin=min(X);Xmax=max(X);
Ymin=min(Y);Ymax=max(Y);
F=TriScatteredInterp(X,Y,z);
[Xi,Yi]=meshgrid(linspace(-Xmax,Xmax,L),linspace(-Ymax,Ymax,L));
Zi=F(Xi,Yi);
What I find very odd is the fact that when I change phi, it makes radical changes and not in the way I expect!
Cheers!
[X,Y] = pol2cart(THETA,RHO)
in case of conversion from polar grid to cartesian.
Likewise,
[X,Y] = pol2cart(THETA,RHO,Z)
to convert a cylindrical grid into the respective cartesian.
But I'm unsure those functions are what you need.