I make two regions and then find I can't combine them using RegionUnion
. Here are the two regions.
r1 = Region@RegionDifference[
RegionDifference[Cylinder[{{0, 0, 0}, {20, 0, 0}}, 6],
Cuboid[{0, 5, -6}, {20, 6, 6}]],
Cuboid[{0, -6, -6}, {20, -5, 6}]
];
r2 = Region[Cylinder[{{20, 0, 0}, {28.5, 0, 0}}, 1/2]];
{r1, r2}
Now I check their dimensions and plot them using Show
.
Show[r1, r2, Axes -> True, AxesLabel -> {"x", "y", "z"},
Boxed -> True]
So far so good. Now I attempt to combine them using RegionUnion
and then plot them over the same dimensions as I used in the Show
r3 = RegionUnion[r1, r2];
Region[r3, PlotRange -> {{0, 30}, {-5, 5}, {-5, 5}}, Axes -> True,
AxesLabel -> {"x", "y", "z"}, Boxed -> True]
All I have is a cuboid at one end of my plot.
What's going wrong? Version 11.3
Edit
@N.J.Evans suggested I try a simpler region. It did't work for him in Version 11.2.
r0 = Region[Cuboid[{15, -5, -5}, {20, 5, 5}]]
Show[r0, r2]
r4 = RegionUnion[r0, r2];
Region[r4]
So that worked in Version 11.3. Looks like we have different problems in different versions.
DiscretizeRegion
. $\endgroup$r3
, and then my CPU started working real hard and I had to kill the kernel. Maybe some kind of bug? I reduced it to the union of a cylinder and a cuboid and it still went crazy. $\endgroup$Region
function is meant for visualization purposes and you can drop it from insideRegionUnion
and friends. $\endgroup$