ostk.mathematics.geometry.d3.Intersection¶
- class Intersection¶
Bases:
pybind11_objectRepresents the intersection of 3D geometric objects.
An Intersection can contain various geometric types resulting from intersecting two objects.
Methods
Access the composite object in the intersection.
Convert the intersection to a composite.
Convert the intersection to an ellipsoid.
Convert the intersection to a line.
Convert the intersection to a line string.
Convert the intersection to a plane.
Convert the intersection to a point.
Convert the intersection to a point set.
Convert the intersection to a polygon.
Convert the intersection to a pyramid.
Convert the intersection to a ray.
Convert the intersection to a segment.
Convert the intersection to a sphere.
Create an empty intersection.
Get the type of the intersection.
Check if the intersection is complex (contains multiple objects).
Check if the intersection is a composite.
Check if the intersection is defined.
Check if the intersection is an ellipsoid.
Check if the intersection is empty.
Check if the intersection is a line.
Check if the intersection is a line string.
Check if the intersection is a plane.
Check if the intersection is a point.
Check if the intersection is a point set.
Check if the intersection is a polygon.
Check if the intersection is a pyramid.
Check if the intersection is a ray.
Check if the intersection is a segment.
Check if the intersection is a sphere.
Create an intersection from a line.
Create an intersection from a point.
Create an intersection from a point set.
Create an intersection from a ray.
Create an intersection from a segment.
Convert an intersection type to a string.
Create an undefined intersection.
- class Type(self: ostk.mathematics.geometry.d3.Intersection.Type, value: int)¶
Bases:
pybind11_objectMembers:
Undefined
Empty
Point
PointSet
Line
Ray
Segment
Plane
Sphere
Ellipsoid
Complex
- property name¶
- __add__( ) ostk.mathematics.geometry.d3.Intersection¶
- access_composite( ) ostk.mathematics.geometry.d3.object.Composite¶
Access the composite object in the intersection.
- Returns:
Reference to the composite object.
- Return type:
Example
>>> composite = intersection.access_composite()
- as_composite( ) ostk.mathematics.geometry.d3.object.Composite¶
Convert the intersection to a composite.
- Returns:
The intersection as a composite object.
- Return type:
Example
>>> composite = intersection.as_composite()
- as_ellipsoid( ) ostk.mathematics.geometry.d3.object.Ellipsoid¶
Convert the intersection to an ellipsoid.
- Returns:
The intersection as an ellipsoid.
- Return type:
Example
>>> ellipsoid = intersection.as_ellipsoid()
- as_line( ) ostk.mathematics.geometry.d3.object.Line¶
Convert the intersection to a line.
- Returns:
The intersection as a line.
- Return type:
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( ) ostk.mathematics.geometry.d3.object.LineString¶
Convert the intersection to a line string.
- Returns:
The intersection as a line string.
- Return type:
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( ) ostk.mathematics.geometry.d3.object.Plane¶
Convert the intersection to a plane.
- Returns:
The intersection as a plane.
- Return type:
Example
>>> plane = intersection.as_plane()
- as_point( ) ostk.mathematics.geometry.d3.object.Point¶
Convert the intersection to a point.
- Returns:
The intersection as a point.
- Return type:
Example
>>> intersection = Intersection.point(Point(1.0, 2.0, 3.0)) >>> point = intersection.as_point()
- as_point_set( ) ostk.mathematics.geometry.d3.object.PointSet¶
Convert the intersection to a point set.
- Returns:
The intersection as a point set.
- Return type:
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( ) ostk.mathematics.geometry.d3.object.Polygon¶
Convert the intersection to a polygon.
- Returns:
The intersection as a polygon.
- Return type:
Example
>>> polygon = intersection.as_polygon()
- as_pyramid( ) ostk.mathematics.geometry.d3.object.Pyramid¶
Convert the intersection to a pyramid.
- Returns:
The intersection as a pyramid.
- Return type:
Example
>>> pyramid = intersection.as_pyramid()
- as_ray( ) ostk.mathematics.geometry.d3.object.Ray¶
Convert the intersection to a ray.
- Returns:
The intersection as a ray.
- Return type:
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( ) ostk.mathematics.geometry.d3.object.Segment¶
Convert the intersection to a segment.
- Returns:
The intersection as a segment.
- Return type:
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( ) ostk.mathematics.geometry.d3.object.Sphere¶
Convert the intersection to a sphere.
- Returns:
The intersection as a sphere.
- Return type:
Example
>>> sphere = intersection.as_sphere()
- static empty() ostk.mathematics.geometry.d3.Intersection¶
Create an empty intersection.
- Returns:
An empty intersection.
- Return type:
Example
>>> intersection = Intersection.empty() >>> intersection.is_empty() # True
- get_type( ) ostk::mathematics::geometry::d3::Intersection::Type¶
Get the type of the intersection.
- Returns:
The type of the intersection.
- Return 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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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( ) ostk.mathematics.geometry.d3.Intersection¶
Create an intersection from a line.
- Parameters:
line (Line) -- The line.
- Returns:
An intersection containing the line.
- Return type:
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( ) ostk.mathematics.geometry.d3.Intersection¶
Create an intersection from a point.
- Parameters:
point (Point) -- The point.
- Returns:
An intersection containing the point.
- Return type:
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,
Create an intersection from a point set.
- Parameters:
point_set (PointSet) -- The point set.
- Returns:
An intersection containing the point set.
- Return type:
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( ) ostk.mathematics.geometry.d3.Intersection¶
Create an intersection from a ray.
- Parameters:
ray (Ray) -- The ray.
- Returns:
An intersection containing the ray.
- Return type:
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( ) ostk.mathematics.geometry.d3.Intersection¶
Create an intersection from a segment.
- Parameters:
segment (Segment) -- The segment.
- Returns:
An intersection containing the segment.
- Return type:
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,
Convert an intersection type to a string.
- Parameters:
type (Intersection.Type) -- The intersection type.
- Returns:
The string representation of the type.
- Return type:
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:
Example
>>> intersection = Intersection.undefined() >>> intersection.is_defined() # False