Utility functions for computing intersections between geometry in 3D space.

Taken mostly from the euclid package available at https://pypi.org/project/euclid/

Get the two closest Point3D between a LineSegment3D/Ray3D and a Plane.

Parameters
• line_ray – A LineSegment3D or Ray3D object along which the closest point will be determined.

• plane – A Plane object on which a closest point will be determined.

Returns

Two Point3D objects representing

1. The point on the line_ray that is closest to the plane.

2. The point on the plane that is closest to the line_ray.

Will be None if there is an intersection between line_ray and the plane

Get the closest Point3D on a LineSegment3D or Ray3D to the input point.

Parameters
• point – A Point3D object.

• line_ray – A LineSegment3D or Ray3D object along which the closest point will be determined.

Returns

Point3D for the closest point on line_ray to point.

Get the closest Point3D on an infinite extension of a LineSegment3D or Ray3D.

Parameters
• point – A Point3D object.

• line_ray – A LineSegment3D or Ray3D object along which the closest point will be determined.

Returns

Point3D for the closest point on the line_ray to the point.

Get the closest Point3D on a Plane to the input point.

Parameters
• point – A Point3D object.

• plane – A Plane object in which the closest point will be determined.

Returns

Point3D for the closest point on the plane to point.

Get the intersection between a Ray3D/LineSegment3D and a Plane.

Parameters
• line_ray – A LineSegment3D or Ray3D object.

• plane – A Plane object to intersect.

Returns

Point3D of intersection if it exists. None if no intersection exists.

Get the intersection between a Plane and Ray2D/LineSegment2D extended infinitely.

Parameters
• line_ray – ALineSegment2D or Ray2D that will be extended infinitely for intersection.

• plane – A Plane object to intersect.

Returns

Point3D of intersection if it exists. None if no intersection exists.

Get the intersection between this Sphere object and a Ray2D/LineSegment2D.

Parameters
• line_ray – A LineSegment3D or Ray3D for intersection.

• sphere – A Sphere to intersect.

Returns

Two Point3D objects if a full intersection exists. A Point3D if a point of tangency exists. Will be None if no intersection exists.

Get the intersection between two Plane objects.

Parameters
• plane_a – A Plane object.

• plane_b – Another Plane object to intersect.

Returns

Two objects that define the intersection between two planes

1. A Point3D that lies along the intersection of the two planes.

2. A Vector3D that describes the direction of the intersection.

Will be None if no intersection exists (planes are parallel).

Get the intersection of a plane with this Sphere object

Parameters
• plane – A Plane object.

• sphere – A Sphere to intersect.

Returns

If a full intersection exists

1. A Point3D that represents the center of the intersection circle.

2. A Vector3D that represents the normal of the intersection circle.

3. A number that represents the radius of the intersection circle.

A Point3D Object if a point of tangency exists. None if no intersection exists.