Skip to main content
deleted 504 characters in body
Source Link

Given:

  • An arbitrary circular cylinder (defined by startpoint, endpoint, and radius). An Infinite cylinder is acceptable as well, as long as it passes through those points and has the same radius.
  • An axis-aligned box (defined by its minimum and maximum point)
  • The box being completely inside the volume of the cylinder should also count as an intersection

To test if the cylinder and the box intersect.

Does such a test exist?

EDIT: I found this on the mathmatics stack exchange, though at the moment I do not follow it. If there is an example of it in code form that would be fantastic.

EDIT: I think I have realized there is a far, far simpler solution. (Though it still involves rotations)

1: Rotate the cylinder to the Z axis

2: Apply the same rotation to the axis-aligned bounding box vertices

3: Get the distance of every vertex (in x,y) from 0,0. If any of them report a distance less than the radius of the cylinder, part of the box must overlap with the cylinder.

I'm not positive, but I think that should work! If it does, I will put it into a full solution.

Given:

  • An arbitrary circular cylinder (defined by startpoint, endpoint, and radius). An Infinite cylinder is acceptable as well, as long as it passes through those points and has the same radius.
  • An axis-aligned box (defined by its minimum and maximum point)
  • The box being completely inside the volume of the cylinder should also count as an intersection

To test if the cylinder and the box intersect.

Does such a test exist?

EDIT: I found this on the mathmatics stack exchange, though at the moment I do not follow it. If there is an example of it in code form that would be fantastic.

EDIT: I think I have realized there is a far, far simpler solution. (Though it still involves rotations)

1: Rotate the cylinder to the Z axis

2: Apply the same rotation to the axis-aligned bounding box vertices

3: Get the distance of every vertex (in x,y) from 0,0. If any of them report a distance less than the radius of the cylinder, part of the box must overlap with the cylinder.

I'm not positive, but I think that should work! If it does, I will put it into a full solution.

Given:

  • An arbitrary circular cylinder (defined by startpoint, endpoint, and radius). An Infinite cylinder is acceptable as well, as long as it passes through those points and has the same radius.
  • An axis-aligned box (defined by its minimum and maximum point)
  • The box being completely inside the volume of the cylinder should also count as an intersection

To test if the cylinder and the box intersect.

Does such a test exist?

EDIT: I found this on the mathmatics stack exchange, though at the moment I do not follow it. If there is an example of it in code form that would be fantastic.

added 11 characters in body; edited title
Source Link

Looking for a cylinder / axis-aligned box volume intersection test

Given:

  • An arbitrary circular cylinder (defined by startpoint, endpoint, and radius). An Infinite cylinder is acceptable as well, as long as it passes through those points and has the same radius.
  • An axis-aligned box (defined by its minimum and maximum point)
  • The box being completely inside the volume of the cylinder should also count as an intersection

To test if the cylinder and the box intersect.

Does such a test exist?

EDIT: I found this on the mathmatics stack exchange, though at the moment I do not follow it. If there is an example of it in code form that would be fantastic.

EDIT: I think I have realized there is a far, far simpler solution. (Though it still involves rotations)

1: Rotate the cylinder to the Z axis

2: Apply the same rotation to the axis-aligned bounding box vertices

3: Get the distance of every vertex (in x,y) from 0,0. If any of them report a distance less than the radius of the cylinder, part of the box must overlap with the cylinder.

I'm not positive, but I think that should work! If it does, I will put it into a full solution.

Looking for a cylinder / axis-aligned box intersection test

Given:

  • An arbitrary circular cylinder (defined by startpoint, endpoint, and radius). An Infinite cylinder is acceptable as well, as long as it passes through those points and has the same radius.
  • An axis-aligned box (defined by its minimum and maximum point)
  • The box being inside the volume of the cylinder should also count as an intersection

To test if the cylinder and the box intersect.

Does such a test exist?

EDIT: I found this on the mathmatics stack exchange, though at the moment I do not follow it. If there is an example of it in code form that would be fantastic.

EDIT: I think I have realized there is a far, far simpler solution. (Though it still involves rotations)

1: Rotate the cylinder to the Z axis

2: Apply the same rotation to the axis-aligned bounding box vertices

3: Get the distance of every vertex (in x,y) from 0,0. If any of them report a distance less than the radius of the cylinder, part of the box must overlap with the cylinder.

I'm not positive, but I think that should work! If it does, I will put it into a full solution.

Looking for a cylinder / axis-aligned box volume intersection test

Given:

  • An arbitrary circular cylinder (defined by startpoint, endpoint, and radius). An Infinite cylinder is acceptable as well, as long as it passes through those points and has the same radius.
  • An axis-aligned box (defined by its minimum and maximum point)
  • The box being completely inside the volume of the cylinder should also count as an intersection

To test if the cylinder and the box intersect.

Does such a test exist?

EDIT: I found this on the mathmatics stack exchange, though at the moment I do not follow it. If there is an example of it in code form that would be fantastic.

EDIT: I think I have realized there is a far, far simpler solution. (Though it still involves rotations)

1: Rotate the cylinder to the Z axis

2: Apply the same rotation to the axis-aligned bounding box vertices

3: Get the distance of every vertex (in x,y) from 0,0. If any of them report a distance less than the radius of the cylinder, part of the box must overlap with the cylinder.

I'm not positive, but I think that should work! If it does, I will put it into a full solution.

added 495 characters in body
Source Link

Given:

  • An arbitrary circular cylinder (defined by startpoint, endpoint, and radius). An Infinite cylinder is acceptable as well, as long as it passes through those points and has the same radius.
  • An axis-aligned box (defined by its minimum and maximum point)
  • The box being inside the volume of the cylinder should also count as an intersection

To test if the cylinder and the box intersect.

Does such a test exist?

EDIT: I found this on the mathmatics stack exchange, though at the moment I do not follow it. If there is an example of it in code form that would be fantastic.

EDIT: I think I have realized there is a far, far simpler solution. (Though it still involves rotations)

1: Rotate the cylinder to the Z axis

2: Apply the same rotation to the axis-aligned bounding box vertices

3: Get the distance of every vertex (in x,y) from 0,0. If any of them report a distance less than the radius of the cylinder, part of the box must overlap with the cylinder.

I'm not positive, but I think that should work! If it does, I will put it into a full solution.

Given:

  • An arbitrary circular cylinder (defined by startpoint, endpoint, and radius). An Infinite cylinder is acceptable as well, as long as it passes through those points and has the same radius.
  • An axis-aligned box (defined by its minimum and maximum point)
  • The box being inside the volume of the cylinder should also count as an intersection

To test if the cylinder and the box intersect.

Does such a test exist?

EDIT: I found this on the mathmatics stack exchange, though at the moment I do not follow it. If there is an example of it in code form that would be fantastic.

Given:

  • An arbitrary circular cylinder (defined by startpoint, endpoint, and radius). An Infinite cylinder is acceptable as well, as long as it passes through those points and has the same radius.
  • An axis-aligned box (defined by its minimum and maximum point)
  • The box being inside the volume of the cylinder should also count as an intersection

To test if the cylinder and the box intersect.

Does such a test exist?

EDIT: I found this on the mathmatics stack exchange, though at the moment I do not follow it. If there is an example of it in code form that would be fantastic.

EDIT: I think I have realized there is a far, far simpler solution. (Though it still involves rotations)

1: Rotate the cylinder to the Z axis

2: Apply the same rotation to the axis-aligned bounding box vertices

3: Get the distance of every vertex (in x,y) from 0,0. If any of them report a distance less than the radius of the cylinder, part of the box must overlap with the cylinder.

I'm not positive, but I think that should work! If it does, I will put it into a full solution.

added 13 characters in body
Source Link
Loading
added 88 characters in body
Source Link
Loading
added 45 characters in body
Source Link
Loading
added 67 characters in body
Source Link
Loading
added 218 characters in body
Source Link
Loading
Source Link
Loading