geometry-surface

How to plot 4D contour lines (XYZ-V) in MATLAB?

只愿长相守 提交于 2019-12-02 06:18:56
问题 I have dataset of XYZ as the coordinates and V as the value at each point (100x4 matrix). I plot the 3D surface using patch. (by faces & vertices) How can I plot the contour lines of V (NOT Z) over the 3D surface !? ( The Contour3 function plots 3D contour lines of Z ; But I need contour lines of V. ) Actually I want something like this or this. Thanks a billion for your help. Well actually I found out that the isosurface command is exactly what I want. However, this command requires the V

How to plot 4D contour lines (XYZ-V) in MATLAB?

人盡茶涼 提交于 2019-12-02 02:21:37
I have dataset of XYZ as the coordinates and V as the value at each point (100x4 matrix). I plot the 3D surface using patch. (by faces & vertices) How can I plot the contour lines of V (NOT Z) over the 3D surface !? ( The Contour3 function plots 3D contour lines of Z ; But I need contour lines of V. ) Actually I want something like this or this . Thanks a billion for your help. Well actually I found out that the isosurface command is exactly what I want. However, this command requires the V data to be a 3D matrix. But my V is a vector. And the data in it is completely non-uniform and irregular

fitting a linear surface with numpy least squares

余生长醉 提交于 2019-12-01 09:27:44
So I want to solve the equation z= a + b*y +c*x ,. getting a,b,c . ie: making a (plane) surface fit to a load of scatter points in 3D space. But I can't seem to find anything! I thought there would be a simple module for such a simple problem. I have tried, where x,y,z are arrays; ys=zip(x,y) (coeffs, residuals, rank, sing_vals) = np.linalg.lstsq(ys,z) am I right in thinking coeffs = b,c? Or am I going completely in the wrong direction. I just can't seem to find anything else that will work in 3d... I think you're on the right track. You could still try following the example of the scipy

fitting a linear surface with numpy least squares

拟墨画扇 提交于 2019-12-01 07:15:27
问题 So I want to solve the equation z= a + b*y +c*x ,. getting a,b,c . ie: making a (plane) surface fit to a load of scatter points in 3D space. But I can't seem to find anything! I thought there would be a simple module for such a simple problem. I have tried, where x,y,z are arrays; ys=zip(x,y) (coeffs, residuals, rank, sing_vals) = np.linalg.lstsq(ys,z) am I right in thinking coeffs = b,c? Or am I going completely in the wrong direction. I just can't seem to find anything else that will work

Calculate the horizon of a curved face? - Not extrema

╄→гoц情女王★ 提交于 2019-11-30 21:06:09
I need to find the 2 points of the visual horizon , of a curved face. I have: XYZ of the 4 corner points XYZ of the 2 curved edge bezier points And I need to calculate either: XY of the 2 horizon points XYZ of the 2 horizon points Note: I got a solution the last time I asked this question, but it only found the extrema of the curves, not the horizon points , which changes based on the position and rotation of both curves in respect to each other. You don't say how your surface is defined, only that it is bounded by two quadratic Bézier curves. There are lots of ways to build such a surface,

How to plot a surface with a texture map

非 Y 不嫁゛ 提交于 2019-11-30 15:33:24
I want to plot a surface with a texture map on it, but the conditions are not the "ideal" ones. first lets explain what I have. I have a set of points (~7000) that are image coordinates, in a grid. This points do NOT define perfect squares. IT IS NOT A MESHGRID . For the sake of the question, lets assume that we have 9 points. Lets ilustrate what we have with an image: X=[310,270,330,430,410,400,480,500,520] Y=[300,400,500,300,400,500,300,400,500] Lets say we can get the "structure" of the grid, so size1=3; size2=3; points=zeros(size1,size2,2) X=[310,270,330; 430,410,400; 480,500,520] Y=[300

PyGame: Applying transparency to an image with alpha?

怎甘沉沦 提交于 2019-11-30 10:08:11
I want to display an image with alpha with a specified transparency, but can't figure out how to do it. To elaborate on how I'm struggling with this, the blurb below is a slightly modified hunk of code from this SO answer , but if you run it, you'll see that "image" loses it's native alpha, while the alpha of "image2" never changes! Yuck. #!/usr/bin/env python import pygame, sys pygame.init() window = pygame.display.set_mode((200, 200)) background = pygame.Surface((window.get_size())) background.fill((255, 255, 255)) image = image2 = pygame.image.load('alpha.png') image = image.convert() rect

Animation in MATLAB

a 夏天 提交于 2019-11-30 08:39:43
How do I animate a surface if it's coordinates change in time (e.g. ellipsoid) using MATLAB? Here are a couple of examples of ways you can animate plots in MATLAB... Modify a plot in a for loop: You can create a loop in which you change the surface coordinates, update the plot object using the set command, and use the pause command to pause each loop iteration for a short period of time. Here's an example: [x, y, z] = ellipsoid(0, 0, 0, 4, 1, 1); % Make an ellipsoid shape hMesh = mesh(x, y, z); % Plot the shape as a mesh axis equal % Change the axis scaling for longAxis = 4:-0.1:1 [x, y, z] =

Texture mapping in MATLAB

那年仲夏 提交于 2019-11-29 18:56:52
问题 I have points in 3D space and their corresponding 2D image points. How can I make a mesh out of the 3D points, then texture the triangle faces formed by the mesh? 回答1: Note that the function trisurf that you were originally trying to use returns a handle to a patch object. If you look at the 'FaceColor' property for patch objects, you can see that there is no 'texturemap' option. That option is only valid for the 'FaceColor' property of surface objects. You will therefore have to find a way

PyGame: Applying transparency to an image with alpha?

半腔热情 提交于 2019-11-29 15:14:13
问题 I want to display an image with alpha with a specified transparency, but can't figure out how to do it. To elaborate on how I'm struggling with this, the blurb below is a slightly modified hunk of code from this SO answer, but if you run it, you'll see that "image" loses it's native alpha, while the alpha of "image2" never changes! Yuck. #!/usr/bin/env python import pygame, sys pygame.init() window = pygame.display.set_mode((200, 200)) background = pygame.Surface((window.get_size()))