4

Anyone have any starting tips for me? I want to learn from this (ie Don't want to be lazy and have someone answer this for me).

I would like to develop my understanding of mathematical 3D surfaces. My own personal project is to produce a 3D surface/graph of the concourse structure in MATLAB.

I found a link with good pictures of its geometry here. I am not expecting to get it 100% perfectly but I'd like to come close!

At the end of this exercise I would like to have a mathematical definition of the geometry as well as a visual representation of the surface. This can involve cartesian equations, parametric equations, matrices, etc.

Any help would be very much appreciated!

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
dnk8n
  • 675
  • 8
  • 21
  • 2
    I'm not sure what the goal is - are you manually modelling the surface function algebraically with the images as reference, or are you looking for a Computer Vision technique that can infer the 3d structure from the pictures? In the second case, if you know (or can approximate) the location and orientation of the camera in each of the pictures, you could try [**photometric stereo**](http://pages.cs.wisc.edu/~csverma/CS766_09/Stereo/stereo.html). It has some limitations but in theory it might work. – Junuxx Oct 29 '12 at 11:29
  • Thanks for your comment! Maybe I should have originally included that what I want to do next after getting the geometry right (in the case of a Cartesian 3D surface function) is project a set of points (x,y) vertically (z) onto the 3D surface. I suppose I was thinking along the lines of your first solution... but your second solution sounds like fun! But mainly I want a mathematical model/definition of the structure which would allow me to neatly program in MATLAB. Out of interest... my next step is to use genetic algorithms to produce a different structure following the same form! – dnk8n Oct 30 '12 at 10:20

2 Answers2

3

To give some specific advice for MATLAB:

I would load in the 'section' image from the web page you have linked, and display this in a MATLAB figure window. You can then try plotting lines over the top until you find one that fits nicely. So you might do something like:

A = imread('~/Desktop/1314019872-1244-n364-1000x707.jpg');
imshow(A)
hold on
axis on

%# my guess at the function - obviously not a good fit
x = [550:900];
plot(x, 0.0001*x.^2 + 300)  

enter image description here

Of course, you might want to move the position of the origin or crop the picture and so on.

As an arguably better alternative to this trial-and-error method, you could trace the outline of the section (e.g by clicking points with something like ginput), and then use one of MATLAB's curve-fitting tools (e.g. fit) to fit a function to the data.

The final 3D shape looks to me (at a casual glance) to be a 3D revolution of the section shape around a central axis. Use of a cylindrical coordinate system could therefore be a good idea.

The final plotting of your 3D shape could be done with a function such as surf or mesh.

Bill Cheatham
  • 11,396
  • 17
  • 69
  • 104
  • 2
    My [closest fit](http://i.imgur.com/4d38o.jpg) so far is a log minus a line plus a square plus a gaussian; `y = 33*log(x) - 1.0*x + 0.00162*x**2 + 24.*2.71**(-(x-145)**2/(80.**2))` with 0,0 at the leftmost point of the curve. – Junuxx Oct 29 '12 at 13:11
  • Thanks Bill. I'm new to most MATLAB functions since I only know the few I've used before. My main problem, I think, is not knowing which tools I have at my disposal. Your input has helped me so much in that area. I agree that the cylindrical co-ordinate system is the way to go. The problem with the form of this concourse is that it's base is only rotated around a very small section of a semi-circle while it's top is rotated around a full semi-circle (does that make sense!?). You can notice that the base members attach to the ground following almost a straight line, instead of a semi-circle. – dnk8n Oct 30 '12 at 10:35
0

I would start by defining a function that defines for each x, y coordinate whether there is a point z, and if so with which altitude.

The shape reminds me a bit of a log or a square root.

Dennis Jaheruddin
  • 21,208
  • 8
  • 66
  • 122
  • 1
    The function to recover is just 1D really, y = f(x) with x the distance from the center. The function can then be [**lathed**](http://en.wikipedia.org/wiki/Lathe_(graphics)) around the vertical axis to get the roof shape. – Junuxx Oct 29 '12 at 11:38
  • Thanks Junuxx for going to the trouble of fitting the cross-sectional curve. That is a great help. I agree that it should be lathed around a vertical axis (I've done a bit of experimentation using SketchUp just to develop ideas) The problem is that it's not a simple semi-circle at the base... ie it seems to rotate more at the top end of the curve and less at the base. – dnk8n Oct 30 '12 at 10:42