Skip to main content
3 of 4
deleted 6 characters in body
ubpdqn
  • 67.8k
  • 3
  • 66
  • 164

This takes some time for pre-processing:

h1 = Hexahedron[{{-1.1666666666666667`, 0.8333333333333334`, 0.8333333333333334`}, {0.16666666666666666`, 2.1666666666666665`, 0.16666666666666666`}, {1.5`, 1.5`, 1.5`}, {0.16666666666666666`, 0.16666666666666666`, 2.1666666666666665`}, {-0.5`, -0.5`, -0.5`}, {0.8333333333333334`, 0.8333333333333334`, -1.1666666666666667`}, {2.1666666666666665`, 0.16666666666666666`, 0.16666666666666666`}, {0.8333333333333334`, -1.1666666666666667`, 0.8333333333333334`}}]; h2 = Hexahedron[{{-1.`, 1.`, -1.`}, {1.`, 1.`, -1.`}, {1.`, 1.`, 1.`}, {-1.`, 1.`, 1.`}, {-1.`, -1.`, -1.`}, {1.`, -1.`, -1.`}, {1.`, -1.`, 1.`}, {-1.`, -1.`, 1.`}}]; ri = RegionIntersection[h1, h2]; rd1 = RegionDifference[h1, ri]; rd2 = RegionDifference[h2, ri]; 

Visualizing:

With[{rp1 = RegionPlot3D[ri, PlotPoints -> 100, PlotStyle -> Red], rp2 = RegionPlot3D[rd1, PlotPoints -> 100, PlotStyle -> Green], rp3 = RegionPlot3D[rd2, PlotPoints -> 100, PlotStyle -> Blue]}, Manipulate[ Show[If[p == 1, rp1, Graphics3D[]], If[q == 1, rp2, Graphics3D[]], If[r == 1, rp3, Graphics3D[]], Boxed -> False, Axes -> False, Background -> Black, PlotRange -> Table[{-3, 3}, {3}]], {p, {0, 1}}, {q, {0, 1}}, {r, {0, 1}}]] 

enter image description here

An estimate of volume of intersection: Volume[DiscretizeRegion@ri] is 3.61699

Update

To find points of intersection:

pts = Part[vertices1, #] & /@ faces; pts2 = Part[vertices2, #] & /@ faces; ip1 = InfinitePlane[#[[1 ;; 3]]] & /@ pts; ip2 = InfinitePlane[#[[1 ;; 3]]] & /@ pts2; ans = Cases[ RegionIntersection @@@ Tuples[RegionIntersection @@@ Tuples[{ip1, ip2}], 2], Point[x_]]; rmfun1[x_] := Or @@ Through[(RegionMember /@ (Polygon /@ pts))[x]] rmfun2[x_] := Or @@ Through[(RegionMember /@ (Polygon /@ pts2))[x]] rmf[x_] := And[rmfun1[x], rmfun2[x]] pck = Union[Pick[ans, rmf /@ ans[[All, 1]]]]; Graphics3D[{Red, PointSize[0.02], pck, , Blue, Opacity[0.5], Polygon /@ pts, Yellow, Polygon /@ pts2}] 

enter image description here

ubpdqn
  • 67.8k
  • 3
  • 66
  • 164