Finding the intersection of the Circle and Infinite Cylinder in 3D space

孤者浪人 提交于 2021-02-20 04:32:04

问题


Finding the intersection of the Circle and Infinite Cylinder. (all in 3D) • Circle is defined by center, plane in which it lies and radius. • Cylinder is defined by axis and radius.

how can i get the intersection of these two?


回答1:


WLOG the cylinder has equation X² + Y² = 1 (if not, you can make it so by translation, rotation and scaling).

Then the parametric equation of the circle is

P = C + U cos t + V sin t

where C is the center point and U, V two orthogonal vectors in the circle plane, of length R.

You can rationalize with the substitution cos t = (1 - u²) / (1 + u²), sin t = 2u / (1 + u²).

Combining these equations,

(Cx (1 + u²) + Ux (1 - u²) + Vx 2u)² + (Cy (1 + u²) + Uy (1 - u²) + Vy 2u)² = (1 + u²)²

which is a quartic one. There is no particular simplification of the coefficients.

You can solve numerically or by the closed-form formulas. There can be up to four solutions.


I guess that this is strictly equivalent to finding the intersections between the torus formed by inflating the circle circumference and the straight line obtained by deflating the cylinder to its axis. This is well addressed in the ray-tracing literature.

You can also sse it as a circle/ellipse intersection problem in 2D.




回答2:


Let's some base point of cylinder is A0, unit axis direction vector is AD, radius AR. Circle center is B0, circle plane unit normal is BN, radius BR.

Circle intersects cylinder, if distance from B0 to cyl. axis is smaller than sum of cylinder radius plus projection of circle radius onto normal to axis

Dist <= AR + BR * Abs(Cos(AD, BN)).

Cos(AD, BN) = DotProduct(AD, BN)
Distance(B0, cyl.axis) = Abs(VectorProduct(AD, B0-A0))


来源:https://stackoverflow.com/questions/38841967/finding-the-intersection-of-the-circle-and-infinite-cylinder-in-3d-space

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!