Message Boards Message Boards

0
|
4705 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Intersection of a Graphic3D and a RevolutionPlot3D?

Posted 4 years ago
Show[RevolutionPlot3D[{x, -Sqrt[36 - x^2]}, {x, 0, 6}, 
          RevolutionAxis -> "Z", Mesh -> None], 
         Graphics3D[
          InfinitePlane[{0, -1, 0.5}, {{0.5, -0.5, 1}, {-0.5, 0.5, 0}}]], 
         Axes -> False, Boxed -> False]    

enter image description here

Attachments:
POSTED BY: Yaw Antoa Onyina
4 Replies

Thanking every one for the try

POSTED BY: Yaw Antoa Onyina

Or just use good old algebra and define everything for ParametericPlot3D

(*solve equation for plane, since it is in z direction solve to y*)
v1 = {0.5, -0.5, 1}; v2 = {-0.5, 0.5, 0};(*vectors spanning the plane*)
{a, b, c} = Cross[v1, v2];(*normal vector of plane *)
{x0, y0, z0} = {0, -1, 0.5};(*center of plane*)
plane = a (x- x0) + b (y - y0) + c (z - z0);
planeP = First[{x, y, z} /. Solve[plane == 0, y]];

(*solve equation of sphere, since we need bottom half solve to z, has \
to solutions, top and bottom part*)
{x0, y0, z0} = {0, 0, 0};(*center of sphere*)
r = 6;(*radius of sphere*)
sphere = (x - x0)^2 + (y - y0)^2 + (z - z0)^2 - r^2;
sphereP = First[{x, y, z} /. Solve[sphere == 0, z]];

(*solve the intersection, since it is in z direction solve to x an z, first solution is the bottom half*)
interP = First[{x, y, z} /. Quiet@Solve[{plane == 0., sphere == 0.}, {x, z}]];

(*show the solution*)
p1 = ParametricPlot3D[planeP, {x, -10, 10}, {z, -10, 5}, Mesh -> False, Axes -> False, 
   RegionFunction -> Function[{x, y, z}, z < 0], PlotStyle -> Gray, Lighting -> "Neutral"];
p2 = ParametricPlot3D[sphereP, {x, -10, 10}, {y, -10, 10}, Mesh -> False, Axes -> False, 
   PlotStyle -> Gray, Lighting -> "Neutral"];
p3 = ParametricPlot3D[interP, {y, -10, 10}, Mesh -> False, Axes -> False, 
   PlotStyle -> Directive[{Thick, Red}]];
Show[p1, p2, p3, Mesh -> False, Axes -> False]

enter image description here

POSTED BY: Martijn Froeling

I thought we could do it with RegionIntersection, but it does not work:

semisphere = 
  DiscretizeGraphics[
   Most@RevolutionPlot3D[{x, -Sqrt[36 - x^2]}, {x, 0, 6}, 
     RevolutionAxis -> "Z"]];
plane = InfinitePlane[{0, -1, 
    0.5}, {{0.5, -0.5, 1}, {-0.5, 0.5, 0}}];
DiscretizeRegion@RegionIntersection[semisphere, plane]
DiscretizeRegion@
 RegionIntersection[semisphere, 
  RegionIntersection[plane, Cuboid[-5 {1, 1, 1}, 5 {1, 1, 1}]]]
POSTED BY: Gianluca Gorni

Strange - the only way I could make this work was using a (totally!) different definition for semisphere and avoid using InfinitePlane:

semisphere = RegionDifference[Sphere[{0, 0, 0}], HalfSpace[{0, 0, -1}, {0, 0, 0}]];
plane = Polygon[2 {{-1, 0, -1}, {1, 0, -1}, {1, 0, 1}, {-1, 0, 1}}];
DiscretizeRegion@RegionIntersection[semisphere, plane]
POSTED BY: Henrik Schachner
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract