Need surface area of fsurf between two planes
1 次查看(过去 30 天)
显示 更早的评论
Please help. I have generated a cone with fsurf, and two planes to model a real-world welding problem.
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 个评论
采纳的回答
David Goodmanson
2020-3-2
编辑:David Goodmanson
2020-3-4
<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 个评论
David Goodmanson
2020-3-4
编辑:David Goodmanson
2020-3-4
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.
更多回答(1 个)
darova
2020-2-29
Here is what i did
- build all surfaces
- used SurfaceIntersection to get intersection curves (i converted surfaces into patches)
- I got intersection points but in inappropriate order. So i sorted points by angle
- To get the same number of points in each curve i used THIS method. Created patch
See attached script
8 个评论
darova
2020-3-4
Sorry, it's because of start/end
Also origin should be specified
rotate(hs,direction,15,[0 0 0]) % rotate cone
Corrected script. Look now
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Geometry and Mesh 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!