6
$\begingroup$

This code produces a crude intersection.

a = {-1/2, -1/2, -1/2};
b = {1/2, 1/2, 1/2};
R = RegionIntersection[Ball[a, 1], Ball[b, 1]];
Region[R]


TwoBallsInt
How can I control the quality so that the intersection is cleaner?

$\endgroup$
5
  • 1
    $\begingroup$ Slightly better, but with persistent artifacts: BoundaryDiscretizeRegion[RegionIntersection[Ball[{-1/2, -1/2, -1/2}, 1], Ball[{1/2, 1/2, 1/2}, 1]], MaxCellMeasure -> {"Length" -> 0.01}]. $\endgroup$ Commented Apr 23, 2017 at 2:49
  • $\begingroup$ I think the result only looks bad. R still represents the proper (undiscretzied) region. Region just doesn't display it in a nice way. $\endgroup$
    – Szabolcs
    Commented Apr 23, 2017 at 8:11
  • $\begingroup$ Very nice, @J.M.---Thanks! $\endgroup$ Commented Apr 23, 2017 at 10:56
  • 2
    $\begingroup$ a work-around: RegionPlot3D[RegionMember[R, {x, y, z}], {x, -1/2, 1/2}, {y, -1/2, 1/2}, {z, -1/2, 1/2}, Boxed -> False, Axes -> False, PlotPoints -> 100] $\endgroup$
    – kglr
    Commented Apr 23, 2017 at 15:13
  • 1
    $\begingroup$ CSGRegion["Intersection", {Ball[a, 1], Ball[b, 1]}] $\endgroup$
    – cvgmt
    Commented Mar 13 at 8:30

1 Answer 1

2
$\begingroup$

The updated version 14.1.0 solved such problem.

$Version

a = {-1/2, -1/2, -1/2};
b = {1/2, 1/2, 1/2};
R = RegionIntersection[Ball[a, 1], Ball[b, 1]];
Region[R]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.