ostk.mathematics.geometry.d3.Intersection

class Intersection

Bases: pybind11_object

Represents the intersection of 3D geometric objects.

An Intersection can contain various geometric types resulting from intersecting two objects.

Methods

access_composite

Access the composite object in the intersection.

as_composite

Convert the intersection to a composite.

as_ellipsoid

Convert the intersection to an ellipsoid.

as_line

Convert the intersection to a line.

as_line_string

Convert the intersection to a line string.

as_plane

Convert the intersection to a plane.

as_point

Convert the intersection to a point.

as_point_set

Convert the intersection to a point set.

as_polygon

Convert the intersection to a polygon.

as_pyramid

Convert the intersection to a pyramid.

as_ray

Convert the intersection to a ray.

as_segment

Convert the intersection to a segment.

as_sphere

Convert the intersection to a sphere.

empty

Create an empty intersection.

get_type

Get the type of the intersection.

is_complex

Check if the intersection is complex (contains multiple objects).

is_composite

Check if the intersection is a composite.

is_defined

Check if the intersection is defined.

is_ellipsoid

Check if the intersection is an ellipsoid.

is_empty

Check if the intersection is empty.

is_line

Check if the intersection is a line.

is_line_string

Check if the intersection is a line string.

is_plane

Check if the intersection is a plane.

is_point

Check if the intersection is a point.

is_point_set

Check if the intersection is a point set.

is_polygon

Check if the intersection is a polygon.

is_pyramid

Check if the intersection is a pyramid.

is_ray

Check if the intersection is a ray.

is_segment

Check if the intersection is a segment.

is_sphere

Check if the intersection is a sphere.

line

Create an intersection from a line.

point

Create an intersection from a point.

point_set

Create an intersection from a point set.

ray

Create an intersection from a ray.

segment

Create an intersection from a segment.

string_from_type

Convert an intersection type to a string.

undefined

Create an undefined intersection.

class Type(self: ostk.mathematics.geometry.d3.Intersection.Type, value: int)

Bases: pybind11_object

Members:

Undefined

Empty

Point

PointSet

Line

Ray

Segment

Plane

Sphere

Ellipsoid

Complex

property name
__add__(
self: ostk.mathematics.geometry.d3.Intersection,
arg0: ostk.mathematics.geometry.d3.Intersection,
) ostk.mathematics.geometry.d3.Intersection
access_composite(
self: ostk.mathematics.geometry.d3.Intersection,
) ostk.mathematics.geometry.d3.object.Composite

Access the composite object in the intersection.

Returns:

Reference to the composite object.

Return type:

Composite

Example

>>> composite = intersection.access_composite()
as_composite(
self: ostk.mathematics.geometry.d3.Intersection,
) ostk.mathematics.geometry.d3.object.Composite

Convert the intersection to a composite.

Returns:

The intersection as a composite object.

Return type:

Composite

Example

>>> composite = intersection.as_composite()
as_ellipsoid(
self: ostk.mathematics.geometry.d3.Intersection,
) ostk.mathematics.geometry.d3.object.Ellipsoid

Convert the intersection to an ellipsoid.

Returns:

The intersection as an ellipsoid.

Return type:

Ellipsoid

Example

>>> ellipsoid = intersection.as_ellipsoid()
as_line(
self: ostk.mathematics.geometry.d3.Intersection,
) ostk.mathematics.geometry.d3.object.Line

Convert the intersection to a line.

Returns:

The intersection as a line.

Return type:

Line

Example

>>> intersection = Intersection.line(Line.points(Point(1.0, 2.0, 3.0), Point(3.0, 4.0, 5.0)))
>>> line = intersection.as_line()
as_line_string(
self: ostk.mathematics.geometry.d3.Intersection,
) ostk.mathematics.geometry.d3.object.LineString

Convert the intersection to a line string.

Returns:

The intersection as a line string.

Return type:

LineString

Example

>>> intersection = Intersection.point_set(PointSet([Point(1.0, 2.0, 3.0), Point(3.0, 4.0, 5.0)]))
>>> line_string = intersection.as_line_string()
as_plane(
self: ostk.mathematics.geometry.d3.Intersection,
) ostk.mathematics.geometry.d3.object.Plane

Convert the intersection to a plane.

Returns:

The intersection as a plane.

Return type:

Plane

Example

>>> plane = intersection.as_plane()
as_point(
self: ostk.mathematics.geometry.d3.Intersection,
) ostk.mathematics.geometry.d3.object.Point

Convert the intersection to a point.

Returns:

The intersection as a point.

Return type:

Point

Example

>>> intersection = Intersection.point(Point(1.0, 2.0, 3.0))
>>> point = intersection.as_point()
as_point_set(
self: ostk.mathematics.geometry.d3.Intersection,
) ostk.mathematics.geometry.d3.object.PointSet

Convert the intersection to a point set.

Returns:

The intersection as a point set.

Return type:

PointSet

Example

>>> intersection = Intersection.point_set(PointSet([Point(1.0, 2.0, 3.0), Point(3.0, 4.0, 5.0)]))
>>> point_set = intersection.as_point_set()
as_polygon(
self: ostk.mathematics.geometry.d3.Intersection,
) ostk.mathematics.geometry.d3.object.Polygon

Convert the intersection to a polygon.

Returns:

The intersection as a polygon.

Return type:

Polygon

Example

>>> polygon = intersection.as_polygon()
as_pyramid(
self: ostk.mathematics.geometry.d3.Intersection,
) ostk.mathematics.geometry.d3.object.Pyramid

Convert the intersection to a pyramid.

Returns:

The intersection as a pyramid.

Return type:

Pyramid

Example

>>> pyramid = intersection.as_pyramid()
as_ray(
self: ostk.mathematics.geometry.d3.Intersection,
) ostk.mathematics.geometry.d3.object.Ray

Convert the intersection to a ray.

Returns:

The intersection as a ray.

Return type:

Ray

Example

>>> intersection = Intersection.ray(Ray(Point(1.0, 2.0, 3.0), numpy.array([3.0, 4.0, 5.0])))
>>> ray = intersection.as_ray()
as_segment(
self: ostk.mathematics.geometry.d3.Intersection,
) ostk.mathematics.geometry.d3.object.Segment

Convert the intersection to a segment.

Returns:

The intersection as a segment.

Return type:

Segment

Example

>>> intersection = Intersection.segment(Segment(Point(1.0, 2.0, 3.0), Point(3.0, 4.0, 5.0)))
>>> segment = intersection.as_segment()
as_sphere(
self: ostk.mathematics.geometry.d3.Intersection,
) ostk.mathematics.geometry.d3.object.Sphere

Convert the intersection to a sphere.

Returns:

The intersection as a sphere.

Return type:

Sphere

Example

>>> sphere = intersection.as_sphere()
static empty() ostk.mathematics.geometry.d3.Intersection

Create an empty intersection.

Returns:

An empty intersection.

Return type:

Intersection

Example

>>> intersection = Intersection.empty()
>>> intersection.is_empty()  # True
get_type(
self: ostk.mathematics.geometry.d3.Intersection,
) ostk::mathematics::geometry::d3::Intersection::Type

Get the type of the intersection.

Returns:

The type of the intersection.

Return type:

Intersection.Type

Example

>>> intersection = Intersection.point(Point(1.0, 2.0, 3.0))
>>> intersection.get_type()  # Intersection.Type.Point
is_complex(self: ostk.mathematics.geometry.d3.Intersection) bool

Check if the intersection is complex (contains multiple objects).

Returns:

True if the intersection contains multiple objects.

Return type:

bool

Example

>>> intersection = Intersection.point(Point(1.0, 2.0, 3.0)) + Intersection.point(Point(3.0, 4.0, 5.0))
>>> intersection.is_complex()  # True
is_composite(self: ostk.mathematics.geometry.d3.Intersection) bool

Check if the intersection is a composite.

Returns:

True if the intersection contains a composite object.

Return type:

bool

Example

>>> intersection = Intersection.point_set(PointSet([Point(1.0, 2.0), Point(3.0, 4.0)]))
>>> intersection.is_composite()  # False
is_defined(self: ostk.mathematics.geometry.d3.Intersection) bool

Check if the intersection is defined.

Returns:

True if the intersection is defined.

Return type:

bool

Example

>>> intersection = Intersection.point(Point(1.0, 2.0, 3.0))
>>> intersection.is_defined()  # True
is_ellipsoid(self: ostk.mathematics.geometry.d3.Intersection) bool

Check if the intersection is an ellipsoid.

Returns:

True if the intersection contains an ellipsoid.

Return type:

bool

Example

>>> intersection = Intersection.point_set(PointSet([Point(1.0, 2.0, 3.0), Point(3.0, 4.0, 5.0)]))
>>> intersection.is_ellipsoid()  # False
is_empty(self: ostk.mathematics.geometry.d3.Intersection) bool

Check if the intersection is empty.

Returns:

True if the intersection contains no objects.

Return type:

bool

Example

>>> intersection = Intersection.empty()
>>> intersection.is_empty()  # True
is_line(self: ostk.mathematics.geometry.d3.Intersection) bool

Check if the intersection is a line.

Returns:

True if the intersection contains a line.

Return type:

bool

Example

>>> intersection = Intersection.line(Line.points(Point(1.0, 2.0, 3.0), Point(3.0, 4.0, 5.0)))
>>> intersection.is_line()  # True
is_line_string(self: ostk.mathematics.geometry.d3.Intersection) bool

Check if the intersection is a line string.

Returns:

True if the intersection contains a line string.

Return type:

bool

Example

>>> intersection = Intersection.point_set(PointSet([Point(1.0, 2.0, 3.0), Point(3.0, 4.0, 5.0)]))
>>> intersection.is_line_string()  # False
is_plane(self: ostk.mathematics.geometry.d3.Intersection) bool

Check if the intersection is a plane.

Returns:

True if the intersection contains a plane.

Return type:

bool

Example

>>> intersection = Intersection.point_set(PointSet([Point(1.0, 2.0, 3.0), Point(3.0, 4.0, 5.0)]))
>>> intersection.is_plane()  # False
is_point(self: ostk.mathematics.geometry.d3.Intersection) bool

Check if the intersection is a point.

Returns:

True if the intersection contains a single point.

Return type:

bool

Example

>>> intersection = Intersection.point(Point(1.0, 2.0, 3.0))
>>> intersection.is_point()  # True
is_point_set(self: ostk.mathematics.geometry.d3.Intersection) bool

Check if the intersection is a point set.

Returns:

True if the intersection contains a point set.

Return type:

bool

Example

>>> intersection = Intersection.point_set(PointSet([Point(1.0, 2.0, 3.0), Point(3.0, 4.0, 5.0)]))
>>> intersection.is_point_set()  # True
is_polygon(self: ostk.mathematics.geometry.d3.Intersection) bool

Check if the intersection is a polygon.

Returns:

True if the intersection contains a polygon.

Return type:

bool

Example

>>> intersection = Intersection.point_set(PointSet([Point(1.0, 2.0, 3.0), Point(3.0, 4.0, 5.0)]))
>>> intersection.is_polygon()  # False
is_pyramid(self: ostk.mathematics.geometry.d3.Intersection) bool

Check if the intersection is a pyramid.

Returns:

True if the intersection contains a pyramid.

Return type:

bool

Example

>>> intersection = Intersection.point_set(PointSet([Point(1.0, 2.0), Point(3.0, 4.0)]))
>>> intersection.is_pyramid()  # False
is_ray(self: ostk.mathematics.geometry.d3.Intersection) bool

Check if the intersection is a ray.

Returns:

True if the intersection contains a ray.

Return type:

bool

Example

>>> intersection = Intersection.ray(Ray(Point(1.0, 2.0, 3.0), numpy.array([3.0, 4.0, 5.0])))
>>> intersection.is_ray()  # True
is_segment(self: ostk.mathematics.geometry.d3.Intersection) bool

Check if the intersection is a segment.

Returns:

True if the intersection contains a segment.

Return type:

bool

Example

>>> intersection = Intersection.segment(Segment(Point(1.0, 2.0, 3.0), Point(3.0, 4.0, 5.0)))
>>> intersection.is_segment()  # True
is_sphere(self: ostk.mathematics.geometry.d3.Intersection) bool

Check if the intersection is a sphere.

Returns:

True if the intersection contains a sphere.

Return type:

bool

Example

>>> intersection = Intersection.point_set(PointSet([Point(1.0, 2.0, 3.0), Point(3.0, 4.0, 5.0)]))
>>> intersection.is_sphere()  # False
static line(
line: ostk.mathematics.geometry.d3.object.Line,
) ostk.mathematics.geometry.d3.Intersection

Create an intersection from a line.

Parameters:

line (Line) -- The line.

Returns:

An intersection containing the line.

Return type:

Intersection

Example

>>> intersection = Intersection.line(Line(Point(1.0, 2.0, 3.0), Point(3.0, 4.0, 5.0)))
>>> intersection.is_defined()  # True
static point(
point: ostk.mathematics.geometry.d3.object.Point,
) ostk.mathematics.geometry.d3.Intersection

Create an intersection from a point.

Parameters:

point (Point) -- The point.

Returns:

An intersection containing the point.

Return type:

Intersection

Example

>>> intersection = Intersection.point(Point(1.0, 2.0, 3.0))
>>> intersection.is_defined()  # True
static point_set(
point_set: ostk.mathematics.geometry.d3.object.PointSet,
) ostk.mathematics.geometry.d3.Intersection

Create an intersection from a point set.

Parameters:

point_set (PointSet) -- The point set.

Returns:

An intersection containing the point set.

Return type:

Intersection

Example

>>> intersection = Intersection.point_set(PointSet([Point(1.0, 2.0, 3.0), Point(3.0, 4.0, 5.0)]))
>>> intersection.is_defined()  # True
static ray(
ray: ostk.mathematics.geometry.d3.object.Ray,
) ostk.mathematics.geometry.d3.Intersection

Create an intersection from a ray.

Parameters:

ray (Ray) -- The ray.

Returns:

An intersection containing the ray.

Return type:

Intersection

Example

>>> intersection = Intersection.ray(Ray(Point(1.0, 2.0, 3.0), Vector(3.0, 4.0, 5.0)))
>>> intersection.is_defined()  # True
static segment(
segment: ostk.mathematics.geometry.d3.object.Segment,
) ostk.mathematics.geometry.d3.Intersection

Create an intersection from a segment.

Parameters:

segment (Segment) -- The segment.

Returns:

An intersection containing the segment.

Return type:

Intersection

Example

>>> intersection = Intersection.segment(Segment(Point(1.0, 2.0, 3.0), Point(3.0, 4.0, 5.0)))
>>> intersection.is_defined()  # True
static string_from_type(
type: ostk::mathematics::geometry::d3::Intersection::Type,
) ostk.core.type.String

Convert an intersection type to a string.

Parameters:

type (Intersection.Type) -- The intersection type.

Returns:

The string representation of the type.

Return type:

str

Example

>>> Intersection.string_from_type(Intersection.Type.Point)  # "Point"
static undefined() ostk.mathematics.geometry.d3.Intersection

Create an undefined intersection.

Returns:

An undefined intersection.

Return type:

Intersection

Example

>>> intersection = Intersection.undefined()
>>> intersection.is_defined()  # False