cylindrical

How to plot data on a cylindrical grid using slice?

此生再无相见时 提交于 2021-01-28 20:46:24
问题 I have input data on a cylindrical grid and want to plot them using slice in MATLAB. To do this I first transform the reference coordinates into Cartesian coordinates using pol2cart . r = linspace(1,4,4); phi = linspace(0,2*pi,10); z = linspace(1,3,3); [rmesh,phimesh,zmesh]=meshgrid(r,phi,z) [xmesh,ymesh,zmesh]=pol2cart(phimesh,rmesh,zmesh) When I use slice now (e.g. slice(xmesh,ymesh,zmesh,ones(10,4,3),2,2,2) ) an error is thrown, because the coordinate matrices are not ordered correctly (

three.js - two points, one cylinder, align issue

浪子不回头ぞ 提交于 2019-12-21 05:13:27
问题 (new to stackoverflow, new to webgl/three.js, ...) I'm using three.js r54 to plot a force-directed graph. the edges between the nodes are THREE.Lines, which is fine, but lines are not selectable with a raycaster. so my aim is to take cylinders instead(/along with) of lines(also because I can do some further stuff: using textures,...) this is what I'm doing to place the cylinders: // init reference vector var upVec = new THREE.Vector3(0,1,0); //---withhin a loop--- // get direction var

Contour plot on the surface of a 3D cylinder

痴心易碎 提交于 2019-12-20 05:53:30
问题 Because of your great help I can now plot a 3D cylinder with a hole inside :) This is my code: import numpy as np import matplotlib as mlp import matplotlib.pyplot as plt import mpl_toolkits.mplot3d.axes3d as axes3d inner_radius = 100 outer_radius = 300 height=50 # input xy coordinates input_xy = np.array([[ri,0],[ra,0],[ra,h],[ri,h],[ri,0]]) # radial component is x values of input r = xy[:,0] # angular component is one revolution of 30 steps phi = np.linspace(0, 2*np.pi, 30) # create grid R

three.js - two points, one cylinder, align issue

萝らか妹 提交于 2019-12-03 16:39:20
(new to stackoverflow, new to webgl/three.js, ...) I'm using three.js r54 to plot a force-directed graph. the edges between the nodes are THREE.Lines, which is fine, but lines are not selectable with a raycaster. so my aim is to take cylinders instead(/along with) of lines(also because I can do some further stuff: using textures,...) this is what I'm doing to place the cylinders: // init reference vector var upVec = new THREE.Vector3(0,1,0); //---withhin a loop--- // get direction var direction = startPoint.subSelf(endPoint).clone(); // half length for cylinder height var halfLength =

Contour plot on the surface of a 3D cylinder

流过昼夜 提交于 2019-12-02 09:54:06
Because of your great help I can now plot a 3D cylinder with a hole inside :) This is my code: import numpy as np import matplotlib as mlp import matplotlib.pyplot as plt import mpl_toolkits.mplot3d.axes3d as axes3d inner_radius = 100 outer_radius = 300 height=50 # input xy coordinates input_xy = np.array([[ri,0],[ra,0],[ra,h],[ri,h],[ri,0]]) # radial component is x values of input r = xy[:,0] # angular component is one revolution of 30 steps phi = np.linspace(0, 2*np.pi, 30) # create grid R,Phi = np.meshgrid(r,phi) # transform to cartesian coordinates X = R*np.cos(Phi) Y = R*np.sin(Phi) # Z

How to draw cylinder in y or x axis in opengl

安稳与你 提交于 2019-11-30 03:55:46
问题 I just want to draw a cylinder in opengl. I found lots of samples but all of them draws cylinders in z axis. I want them be in x or y axis. How can i do this. The code below is the code draw the cylinder in z direction and i dont want it GLUquadricObj *quadratic; quadratic = gluNewQuadric(); gluCylinder(quadratic,0.1f,0.1f,3.0f,32,32); 回答1: You can use glRotate(angle, x, y, z) to rotate your coordinate system: GLUquadricObj *quadratic; quadratic = gluNewQuadric(); glRotatef(90.0f, 0.0f, 1.0f,

Warp Image to Appear in Cylindrical Projection

和自甴很熟 提交于 2019-11-27 17:10:45
I want to warp a flat image in a way that it appears to be the projection coming from a cylinder. I have a flat image like this: and I want to show it as something like this in 2D image: I'm a bit phased out on geometrical projections. I visited some other questions like this but I don't understand how will I represent these cylindrical coordinates (theta and rho) into x,y coordinates in cartesian (x,y) plane. Could you guys help me with an elaborative example? I'm coding it for iPhone and I'm not using any 3rd party library like OpenCV etc. Thanks a bunch. Hammer This is an answer in 2 parts,

Warp Image to Appear in Cylindrical Projection

旧时模样 提交于 2019-11-26 18:52:50
问题 I want to warp a flat image in a way that it appears to be the projection coming from a cylinder. I have a flat image like this: and I want to show it as something like this in 2D image: I'm a bit phased out on geometrical projections. I visited some other questions like this but I don't understand how will I represent these cylindrical coordinates (theta and rho) into x,y coordinates in cartesian (x,y) plane. Could you guys help me with an elaborative example? I'm coding it for iPhone and I