From: Camron Call on 9 Jul 2010 15:28 I have a complicated 3D patch object (an airplane). I am trying to take a cross-section of it. Meaning I would like to see a 2D plot of where the patch intersects a plane. The data I am using to create the patch is in the form of xdata,ydata,zdata as in the example below: [x y z] = sphere; h = patch(surf2patch(x,y,z,z)); xdata = get(h,'xdata'); ydata = get(h,'ydata'); zdata = get(h,'zdata'); I would like to be able to specify a simple plane like y = .5 and see a circle in the above example. While the ability to specify any plane would be nice, right now I only need a plane parallel to an axis like y = .5 or z = .5 Any ideas?
From: Walter Roberson on 9 Jul 2010 15:51 Camron Call wrote: > I have a complicated 3D patch object (an airplane). I am trying to take > a cross-section of it. Meaning I would like to see a 2D plot of where > the patch intersects a plane. The data I am using to create the patch > is in the form of xdata,ydata,zdata as in the example below: > > [x y z] = sphere; h = patch(surf2patch(x,y,z,z)); xdata = > get(h,'xdata'); ydata = get(h,'ydata'); zdata = get(h,'zdata'); > > I would like to be able to specify a simple plane like y = .5 and see a > circle in the above example. While the ability to specify any plane > would be nice, right now I only need a plane parallel to an axis like y > = .5 or z = .5 > Any ideas? Is the object self-intersecting? For example, for a strut, would the complete strut be present or only the part of the strut that was "outside" of everything else? Self-intersecting requires more effort.
From: Camron Call on 9 Jul 2010 17:11 I am not sure I fully understand what you mean by self intersecting. Right now the object I have is the exterior shell of the fuselage of the plane. However, the floor on the interior and the cargo bays are present. A cross section would look like an oddly shaped circle or oval with horizontal lines for the floors. There isn't much else in the model. But it probably is self intersecting...
From: Camron Call on 9 Jul 2010 17:24 The object is hollow if that makes a difference.
From: Walter Roberson on 9 Jul 2010 17:38
Camron Call wrote: > The object is hollow if that makes a difference. I have become slightly confused about whether you are indicating whether the two floors are simply part of the exterior shell, or if there is instead a floor object contained within (or resting on the inside bottom of) the exterior shell? The object would have been "self-intersecting" in my phrasing if part of one surface penetrated another surface, but your reference to exterior shell satisfies me that that is not happening. If it had happened then finding the cross-section could have required finding the exact points of intersection of the surfaces. If one object (such as the floor) is completely within another object (the exterior shell) then finding the cross-section is not as bad, but that case does complicate finding the right connections between intersection points. Easiest would be just to find the points of cross-section without trying to connect them in the right order. I think I know a theoretical way to find the intersection points relatively easily, but I have not worked out an algorithm to connect them properly. I expect that there are some nice matlab calls to make the process easier, but I do not know at the moment what they are. Perhaps someone else will happen to know, now that we have refined this down to a comparatively simple case. |