0

How can I visualize the intersection of two 3-D fields? I have the following functions 1. a*b*c ∈ [3,5]

2. a/(b*c) ∈ [80,100] where a,b,c ∈ [0,100].

I am looking for the intersection of those 2 3-D-fields/bodies?

I already found out how to visualize the reduced case (Intersection of 2 surfaces): 1.a*b*c=5
 2. a/(b*c)=99

zlim = 1;  
tol = 0.02; %define width of tube for proximity calculation
crop = @(z) max(min(z,zlim),-zlim); %limit domain   
Cfun = @(x,y) crop(5./(x.*y)); % Apply domain limit to 'Cfun*x*y=5'
Dfun = @(x,y) crop(x./(99*y)); % Apply domain limit to 'x/(Dfun*y)=90'

t = 10:0.2:100;
[X,Y] = meshgrid(t,t);
C = Cfun(X,Y);
D = Dfun(X,Y);

S = NaN(size(C)); 
SI = abs(C-D) < tol*max(abs(C),abs(D)); % checks proximity of function values
S(SI) =max(C(SI),D(SI));

surf(X,Y,S,0.5*ones(size(S)),'EdgeColor','none','LineStyle','none','FaceLighting','phong');
%plot intersection line

I am glad for any piece of code or hint!

  • Just 'find' the points with same values in all the coordinates. – YisasL Aug 27 '14 at 12:34
  • Thanks for your input. Unfortunately I am pretty new to Matlab and don't know how to do that. could you roughly describe how you would do that? – elwuero Aug 28 '14 at 14:15

1 Answers1

1

I would suggest using separating axes theorem. For reference, check S. Gottschalk, M.C. Lin, D. Manocha, OBBTree: A hierarchical structure for rapid interference detection, in: Proc. SIGGRAPH, ACM, New York, NY, USA, 1996, pp. 171-180. It is very powerful and I have used it successfully for interference detection between a cube and a cuboid, with the cuboid intersecting at some arbitrary 3-D angle, to calculate the intersection volume between the two bodies very precisely.

Anurag
  • 11
  • 1
  • thanks a lot. I'll definitely look into that. Considering that I have no dynamics involved, do you think that there might be an easier way to do this? – elwuero Aug 28 '14 at 14:19
  • I did not have any dynamics involved as well. It was a a static problem. You can find many C/Matlab implementation of separating axes theorem on the internet. P.S.: I had posted this a s a response to your post about giving away a printer in GT Thrift shop FB page. Let me know if I was of any help. – Anurag Aug 29 '14 at 06:05