# Find intersection points of arbitrary BSpline curve

I'm researching some computational geometry and am trying to find a method of determining the {x,y} intersection of a circle and BSplineCurve for further processing.

basisPoints = {{0, 0}, {3000, 7000}, {4000, -7000}, {5000,
7000}, {8000, 0}};
f = BSplineFunction[basisPoints];
p = ParametricPlot[f[t], {t, 0, 1}, MeshFunctions -> {"ArcLength"},
Mesh -> {10}, MeshStyle -> {PointSize[0.01], Red}];
points = Cases[Normal[p], _Point, Infinity];
ptsPlus = Point /@ {f, f};
points = SortBy[points~Join~ptsPlus, First];

Show[
ParametricPlot[f[t], {t, 0, 1}],
Graphics[Circle[#, 1400]] & /@ points[[All, 1]],
Graphics[{AbsolutePointSize, Red, points}],
PlotRange -> All
] Most potential solutions I've come across online so far have the curve in a different form. However, for the project we really want to try to use BSplineCurves because of their ease of input by other users, making the final curve somewhat arbitrary. Mathematica is great for offering BSplineFunction in this regard. Before I go through of all the trouble of translating this curve into a more conventional form, is there a straightforward way to find where this Circle and BSplineFunction intersect? cir = Circle[#, 1400] & /@ (Cases[points, Point[x_] :> x, Infinity]);
RegionPlot[{
cir[] // DiscretizeGraphics ,
spline // DiscretizeGraphics},
Frame -> False
]

• p and coords are not defined. Looks like p = ParametricPlot[f[t], {t, 0, 1}, MeshFunctions -> {"ArcLength"}, Mesh -> 10] and coords = points[[All, 1]];?
– kglr
Aug 15, 2020 at 2:21
• I've updated the code. The evaluation should run in a fresh notebook now. Aug 15, 2020 at 15:37

p = ParametricPlot[f[t], {t, 0, 1}, MeshFunctions -> {"ArcLength"}, Mesh -> 10];
points = Cases[Normal[p], _Point, Infinity];
ptsPlus = Point /@ {f, f};
points = SortBy[points~Join~ptsPlus, First];
coords = points[[All, 1]];

circles = Graphics[Circle[#, 1400]] & /@ coords;

intersections = Union @@ (GraphicsMeshFindIntersections[Show[p, #],
GraphicsMeshAllPoints -> False] & /@ circles);

Show[p, circles, Graphics[{AbsolutePointSize, Red, Point @ intersections}],
PlotRange -> All, ImageSize -> 800] Show[p, circles[],
Graphics[{AbsolutePointSize, Red,
Point@GraphicsMeshFindIntersections[Show[p, circles[]],
GraphicsMeshAllPoints -> False]}],
PlotRange -> All, ImageSize -> 800, Axes -> False] • Hmm.. Looking over the post, this is not as straightforward as I thought. I'm at the limits of my knowledge of computational geometry here. 😀 Please bare with me as I run through this code. Aug 15, 2020 at 15:42