# How to display full 3D region?

Answers to an earlier posting, ConvexHullMesh inconsistency, have let me construct a particular 3D region by intersecting a pyramid with a halfspace:

Rint = RegionIntersection[Rhalfspace, RPyramid]


The construction is correct, and the region displays like this upon executing the above command:

The slanted plane is (correctly) caused by Rhalfspace. The two vertical planes are caused by some type of plotrange clipping. My question is simple:

Q. How do I display the full region?

I've tried RegionPlot3D, DiscretizeRegion, but nothing I try allows me to e.g., use PlotRange. I am missing something basic about how to convert a region to a 3D graphics object.

Rhalfspace = HalfSpace[{0.694747,0.186157,0.694747},{0.622008,0.166667,0.333333}];

pts={{1., 0., 0.}, {0.866025, 0.5, 0.}, {0.5, 0.866025, 0.}, {0., 1.,
0.}, {-0.5, 0.866025, 0.}, {-0.866025, 0.5, 0.}, {-1., 0.,
0.}, {-0.866025, -0.5, 0.}, {-0.5, -0.866025, 0.}, {0., -1.,
0.}, {0.5, -0.866025, 0.}, {0.866025, -0.5, 0.}, {0., 0., 2.}};

RPyramid = Region[BoundaryMesh[DelaunayMesh[pts]]]

Rint = RegionIntersection[Rhalfspace, RPyramid]


***Added***. Following @flinty's use of ImplicitRegion:

• What did DiscretizeRegion say? Please post the errors and give something we can execute, as we don't have Rhalfspace, RPyramid. If you have the mesh from mesh = DiscretizeRegion[...] then that is the whole mesh - To embed in Graphics3D just put it in there Graphics3D[{mesh}] Commented Jul 18, 2020 at 14:58
• @flinty: OK, will include code. Will take a bit ... Commented Jul 18, 2020 at 15:03
• @flinty: Graphics3D[{Rint}] says Region is not a Graphics3D primitive or directive. Commented Jul 18, 2020 at 15:09
• SolidRegionQ[Rhalfspace] is False - instead of intersecting with a HalfSpace, use a big cuboid instead. These operations with HalfSpace crash on my machine 12.1.1 after the first run. Commented Jul 18, 2020 at 15:14
• This works: reg = ImplicitRegion[-3 < {0.694747, 0.186157, 0.694747}.({x, y, z} - {0.622008, 0.166667, 0.333333}) < 0 && -2 < x < 2 && -2 < y < 2 && -2 < z < 2, {x, y, z}]; then RegionIntersection[DiscretizeRegion@reg, RPyramid] Commented Jul 18, 2020 at 15:43

There appear to be some problems using HalfSpace. I've worked around this using an ImplicitRegion instead that matches up with the HalfSpace but produces a bounded object when discretized:

reg = ImplicitRegion[-3 < {0.694747, 0.186157,
0.694747}.({x, y, z} - {0.622008, 0.166667, 0.333333}) <
0 && -2 < x < 2 && -2 < y < 2 && -2 < z < 2, {x, y, z}];

RegionIntersection[DiscretizeRegion@reg, RPyramid]


This produces the full part of the cone you wanted with the top removed:

• Thanks so much for experimenting! I really appreciate it. Commented Jul 18, 2020 at 16:01

If I do the following incantation:

bounds = RegionBounds[Rint]

(*  {{-1., 1.}, {-1., 1.}, {0., 2.}}  *)

Append[Rint, PlotRange -> %]


I get this:

This also often succeeds:

Append[Rint, PlotRange -> {{-1., 1.}, {-1., 1.}, {0., 2.}}]


Either of these has usually failed in my trials (runs until I kill the kernel; succeeded only once each in say a dozen or more tries):

Append[Rint, PlotRange -> bounds]
Append[Rint, PlotRange -> RegionBounds[Rint]]


Sometimes, I have to kill the kernel twice: When it restarts, it hangs when it computes Rint.

Doing the first command multiple times (or any of the commands, if they succeed at first) ultimately hangs the kernel.

• Could you explain the use of Append here? Why does it work to append graphics options to a region? Commented Jul 18, 2020 at 16:28
• @JosephO'Rourke From the docs for Region: "Region has the same options as Graphics for embedding dimension 2 and the same options as Graphics3D for embedding dimension 3, with the following additions and changes...." You can also add them to RegionIntersection and probably most other region operations, but in your example, the kernel always hangs for me, and I have to kill it. Commented Jul 18, 2020 at 18:14