Plotting dynamic variable generated by checking Region intersections

I have been trying to plot a variable which is nested inside a manipulate. Here is a simplified version of the program.

pts = Table[{i, 0, 1}, {i, 0, 10}];
Manipulate[
R1 = Cylinder[{{3, 0, 0}, {3, 0, 2}}, x];
R2 = Cylinder[{{7, 0, 0}, {7, 0, 2}}, x];
R3 = RegionIntersection[R1, R2];
productY = Count[RegionMember[R3, pts], True];
Column[{
Text[productY],
Graphics3D[{
Point[pts],
Opacity[0.1],
R1,
R2
}],
Plot[productY, {t, 0, 10}]
}], {{x, 1, "variable x"}, 1, 5, 1}]

This creates a program which looks like this: The program shows "5" as 5 dots are within the intersection of the two cylinders with radius "x". What I would like to plot is a graph of the number of dots within the intersection against variable x. Any ideas...?

Thank you.

• Nothing is clear from these explanations. Give an example of your code from start to finish. – Alex Trounev Oct 15 '18 at 6:45
• Alright. Lemme try to get a simplified example. – And a bit of soy. Oct 15 '18 at 7:02

You can also acquire a symbolic solution to this question with Total of Boole (truth value to 0/1) values of membership on parametric regions:

FullSimplify@
Total[Function[{u, v, w},
Evaluate@
Boole@RegionMember[
RegionIntersection[
Cylinder[{{3, 0, 0}, {3, 0, 2}}, x],
Cylinder[{{7, 0, 0}, {7, 0, 2}}, x]], {u, v, w}]] @@@
Table[{i, 0, 1}, {i, 0, 10}]]

Boole[x >= 2] + 2 (Boole[x >= 3] + Boole[x >= 4] + Boole[x >= 5] + Boole[x >= 6] + Boole[x >= 7])

And plot it:

Plot[FullSimplify@
Total[Function[{u, v, w},
Evaluate@
Boole@RegionMember[
RegionIntersection[
Cylinder[{{3, 0, 0}, {3, 0, 2}}, x],
Cylinder[{{7, 0, 0}, {7, 0, 2}}, x]], {u, v, w}]] @@@
Table[{i, 0, 1}, {i, 0, 10}]], {x, 1, 10}, Evaluated -> True] If I understood your question correctly, then you can rip out the inner part of your code above and use ListLinePlot by creating a table containing {x, productY} elements:

pts = Table[{i, 0, 1}, {i, 0, 10}];
ListLinePlot[
Table[{x,
R1 = Cylinder[{{3, 0, 0}, {3, 0, 2}}, x];
R2 = Cylinder[{{7, 0, 0}, {7, 0, 2}}, x];
R3 = RegionIntersection[R1, R2];
Count[RegionMember[R3, pts], True]},
{x, 5}]
] 