Need surface area of fsurf between two planes
1 view (last 30 days)
Show older comments
Erin Pratt
on 28 Feb 2020
Edited: David Goodmanson
on 4 Mar 2020
Please help. I have generated a cone with fsurf, and two planes to model a real-world welding problem.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/274282/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/274282/image.jpeg)
What I am trying to find is the area of the surface of the cone, but only the area between the two planes. I have spent most of the day looking for ways to solve this, but I was not successful. Please help.
conefun = @(x,y,z0,phi) z0 + sqrt(x.^2 + y.^2)*cotd(phi/2);
direction = [0 1 0];
rotate(fsurf(@(x,y) conefun(x,y,0,90)),direction,45)
axis equal
xlim([-1 1.5])
ylim([-1 1])
zlim([ 0 1.5])
xlabel('x-axis')
ylabel('y-axis')
zlabel('z-axis')
hold on
[x y] = meshgrid(-1.5:0.1:1.5);
z = 0.414*x + 0.406;
surf(x,y,z);
[x y] = meshgrid(-1.5:0.1:1.5);
z = 0.414*x + 0.609;
surf(x,y,z);
Thank you very much
0 Comments
Accepted Answer
David Goodmanson
on 2 Mar 2020
Edited: David Goodmanson
on 4 Mar 2020
<modified>
Hi Erin,
Here is a totally different method, based on the equation for the cone. It finds the surface area of a cone cut by a plane, then subtracts the area under plane 1 from the area under plane 2. In each case the quantity Sbase is the area of the unperturbed cone, from the lowest height where the plane intersects the cone down to the apex. Phi is the cone opening half-angle, 45 degrees in your case.
I have not downloaded SurfaceIntersection so I can't compare results with the previous answer.
% x = z*tan(phi)*cos(theta);
% y = z*tan(phi)*sin(theta);
% dS = dz/cos(phi) * z*tan(phi)*dtheta % surface area element
% z = beta*z*tan(phi)*cos(theta) + z0 % the eqn. of the plane
% z1 = z0/(1+beta*tan(phi)) % min and max z where plane cuts cone
% z2 = z0/(1-beta*tan(phi))
% cos(theta) = (z-z0)./(beta*z*tan(phi)) % limits on theta, to stay under the plane
phi = pi/4;
beta = 0.414;
h = [0.406 0.609];
T = tan(phi)/cos(phi);
S = zeros(1,2);
for k = 1:2
z0 = h(k);
z1 = z0/(1+beta*tan(phi));
z2 = z0/(1-beta*tan(phi));
fun = @(z) 2*z.*acos((z-z0)./(beta*tan(phi)*z)); % modified
Sint = T*integral(fun,z1,z2);
Sbase = pi*T*z1^2;
S(k) = Sint + Sbase;
end
Sfinal = diff(S)
9 Comments
David Goodmanson
on 4 Mar 2020
Edited: David Goodmanson
on 4 Mar 2020
Hello Erin,
I found a missing dot in my posted code and have modified the answer accordingly. I don't know how that happened, but it did. The line should be
fun = @(z) 2*z.*acos((z-z0)./(beta*tan(phi)*z));
instead of
fun = @(z) 2*z.*acos((z-z0)/(beta*tan(phi)*z));
(I also made the minor change of renaming a constant).
I wanted to use an independent method for the area (fill the surface of the cone with ten million randomly selected points, find the number of points in between the planes, divide by point surface density). After resinserting the dot, the results agree well. Of course the random point method will always have a bit of variation, at about the third decimal place in this case.
As far as the planes, say you take just the lower of the two planes. That plane cuts the cone between heights z1 (lower) and z2 (upper). In the code, Sint calculates the surface area between the plane and a horizontal surface cutting the cone at height z1. Then Sbase calculates the surface area from height z1 down to the apex, and Sint + Sbase is the area of the cone from the lower plane down to the apex.
Then do the entire process all over again with the upper plane, which has a new z1 and z2, and find the surface area from the upper plane to the apex. Then subtract the two results.
More Answers (1)
darova
on 29 Feb 2020
Here is what i did
- build all surfaces
- used SurfaceIntersection to get intersection curves (i converted surfaces into patches)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/274398/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/274399/image.png)
- I got intersection points but in inappropriate order. So i sorted points by angle
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/274400/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/274401/image.png)
- To get the same number of points in each curve i used THIS method. Created patch
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/274402/image.png)
See attached script
8 Comments
darova
on 4 Mar 2020
Sorry, it's because of start/end
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/275110/image.png)
Also origin should be specified
rotate(hs,direction,15,[0 0 0]) % rotate cone
Corrected script. Look now
See Also
Categories
Find more on Geometry and Mesh in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!