Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Show[
- RegionPlot3D[x^2 + y^3 - z^2 > 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2},
- Boxed -> True, Axes -> True, BoxRatios -> Automatic],
- Graphics3D[Sphere[{0, -3, 0}], Boxed -> False, Axes -> False],
- PlotRange -> All]
- ClearAll[tickF, axesF, boxF];
- tickF[div1_, div2_: - 1] := (If[div2 == -1,Thread[{#, #, {.02, 0}}, List, 2] &@
- FindDivisions[{#1, #2}, div1],
- Join @@ MapAt[Join @@ # &, {Thread[{#, #, {.02, 0}}, List, 2] &@#[[1]],
- Thread[{#, "", {.01, 0}}, List, 2] & /@ #[[2]]} &@
- FindDivisions[{#1, #2}, {div1, div2}], {2}]]) &;
- axesF[div1_, div2_: - 1][gr_] := With[{pr = PlotRange[gr],
- ticks = tickF[div1, div2] @@@ PlotRange[gr],
- min = Transpose[PlotRange[gr]][[1]],
- max = Transpose[PlotRange[gr]][[2]]},
- Flatten@{{Text[#2, {1, 1.2, 1.} {#1 + #3[[1]], min[[2]], min[[3]]}],
- Line[1.05 {min, {max[[1]], min[[2]], min[[3]]}}],
- Line[1.05 {{#1 + #3[[1]], min[[2]], min[[3]]}, {#1 + #3[[1]],
- min[[2]] + If[#2 == "", .1, .2], min[[3]]}}]} & @@@ ticks[[1]],
- {Text[#2, {1., 1., 1.2} {min[[1]], #1 + #3[[1]], max[[3]]}],
- Line[1.05 {{min[[1]], min[[2]], max[[3]]}, {min[[1]], max[[2]], max[[3]]}}],
- Line[1.05 {{min[[1]], #1 + #3[[1]], max[[3]]}, {min[[1]], #1 + #3[[1]],
- max[[3]] - If[#2 == "", .1, .2]}}]} & @@@ ticks[[2]],
- {Text[#2, {1., 1.2, 1} {min[[1]], min[[2]], #1 + #3[[1]]}],
- Line[1.05 {min, {min[[1]], min[[2]], max[[3]]}}],
- Line[1.05 {{min[[1]], min[[2]], #1 + #3[[1]]}, {min[[1]],
- min[[2]] + If[#2 == "", .1, .2], #1 + #3[[1]]}}]} & @@@ ticks[[3]]}];
- boxF[divs__][gr_] := Graphics3D[{axesF[divs][gr], gr[[1]],
- EdgeForm[{AbsoluteThickness[.2], GrayLevel[.4]}], FaceForm[],
- Cuboid @@ (1.05 Transpose[PlotRange[gr]])}, Boxed -> False];
- Show[rp = RegionPlot3D[x^2 + y^3 - z^2 > 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}],
- Graphics3D[{Opacity[1], Sphere[{0, -3, 0}]}], boxF[5, 5][rp],
- Graphics3D[{CapForm["Butt"], Opacity[.7], Red,
- Tube[BezierCurve[{{2, -2, -2}, {3, -2, 0}, {5, 2, 0}, {3, 2, 0}}], .5]}],
- boxF[4]@Graphics3D[{CapForm["Butt"],
- Tube[BezierCurve[{{3, 3, 0}, {3, 2, 0}, {5, 5, 0}}], .5]}],
- PlotRange -> All, Axes -> False, BoxRatios -> Automatic,
- Boxed -> False, ImageSize -> 500]
- Show[rp = RegionPlot3D[x^2 + y^3 - z^2 > 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2},
- Boxed -> True, Axes -> True, BaseStyle -> Opacity[.7], BoxRatios -> Automatic],
- Graphics3D[{Sphere[{0, -3, 0}], EdgeForm[{AbsoluteThickness[.2], GrayLevel[.4]}],
- FaceForm[], Cuboid @@ (1.05 Transpose[PlotRange[rp]])}],
- PlotRange -> All, Boxed -> False, PlotRangePadding -> 0]
- Show[RegionPlot3D[
- x^2 + y^3 - z^2 > 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2},
- Boxed -> True, Axes -> True, BoxRatios -> Automatic], Graphics3D[
- Inset[
- Graphics[
- Inset[
- Graphics3D[Sphere[{0, 0, 0}],
- PlotRange -> {{-1, 1}, {-1, 10}, {-1, 1}}, Boxed -> False,
- Axes -> False], {0, 0}]], {0, -2, 0}]], PlotRange -> All]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement