ostk.mathematics.geometry.d3.object.Plane¶
- class Plane(
- self: ostk.mathematics.geometry.d3.object.Plane,
- point: ostk.mathematics.geometry.d3.object.Point,
- normal_vector: numpy.ndarray[numpy.float64[3, 1]],
- point: ostk.mathematics.geometry.d3.object.Point,
Bases:
ObjectCreate a 3D plane from a point and normal vector.
- Parameters:
point (Point) -- A point on the plane.
normal_vector (numpy.array) -- The normal vector to the plane.
Example
>>> point = Point(0.0, 0.0, 0.0) >>> normal = numpy.array([0.0, 0.0, 1.0]) >>> plane = Plane(point, normal)
Methods
Apply a transformation to the plane.
Convert the object to a cone.
Convert the object to an ellipsoid.
Convert the object to a line.
Convert the object to a line string.
Convert the object to a plane.
Convert the object to a point.
Convert the object to a point set.
Convert the object to a polygon.
Convert the object to a pyramid.
Convert the object to a ray.
Convert the object to a segment.
Convert the object to a sphere.
Overloaded function.
Get the normal vector of the plane.
Get a reference point on the plane.
Overloaded function.
Overloaded function.
Check if the object is a cone.
Check if the plane is defined.
Check if the object is an ellipsoid.
Check if the object is a line.
Check if the object is a line string.
Check if the object is a plane.
Check if the object is a point.
Check if the object is a point set.
Check if the object is a polygon.
Check if the object is a pyramid.
Check if the object is a ray.
Check if the object is a segment.
Check if the object is a sphere.
Create an undefined plane.
- apply_transformation(
- self: ostk.mathematics.geometry.d3.object.Plane,
- transformation: ostk::mathematics::geometry::d3::Transformation,
Apply a transformation to the plane.
- Parameters:
transformation (Transformation) -- The transformation to apply.
- Returns:
The transformed plane.
- Return type:
Example
>>> plane = Plane(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0])) >>> transformation = Transformation.identity() >>> transformed = plane.apply_transformation(transformation)
- as_cone( ) ostk::mathematics::geometry::d3::object::Cone¶
Convert the object to a cone.
- Returns:
The cone.
- Return type:
- as_ellipsoid( ) ostk::mathematics::geometry::d3::object::Ellipsoid¶
Convert the object to an ellipsoid.
- Returns:
The ellipsoid.
- Return type:
- as_line( ) ostk::mathematics::geometry::d3::object::Line¶
Convert the object to a line.
- Returns:
The line.
- Return type:
- as_line_string( ) ostk::mathematics::geometry::d3::object::LineString¶
Convert the object to a line string.
- Returns:
The line string.
- Return type:
- as_plane( ) ostk::mathematics::geometry::d3::object::Plane¶
Convert the object to a plane.
- Returns:
The plane.
- Return type:
- as_point( ) ostk::mathematics::geometry::d3::object::Point¶
Convert the object to a point.
- Returns:
The point.
- Return type:
- as_point_set( ) ostk::mathematics::geometry::d3::object::PointSet¶
Convert the object to a point set.
- Returns:
The point set.
- Return type:
- as_polygon( ) ostk::mathematics::geometry::d3::object::Polygon¶
Convert the object to a polygon.
- Returns:
The polygon.
- Return type:
- as_pyramid( ) ostk::mathematics::geometry::d3::object::Pyramid¶
Convert the object to a pyramid.
- Returns:
The pyramid.
- Return type:
- as_ray( ) ostk::mathematics::geometry::d3::object::Ray¶
Convert the object to a ray.
- Returns:
The ray.
- Return type:
- as_segment( ) ostk::mathematics::geometry::d3::object::Segment¶
Convert the object to a segment.
- Returns:
The segment.
- Return type:
- as_sphere( ) ostk::mathematics::geometry::d3::object::Sphere¶
Convert the object to a sphere.
- Returns:
The sphere.
- Return type:
- contains(*args, **kwargs)¶
Overloaded function.
contains(self: ostk.mathematics.geometry.d3.object.Plane, point: ostk.mathematics.geometry.d3.object.Point) -> bool
Check if the plane contains a point.
- Args:
point (Point): The point to check.
- Returns:
bool: True if the plane contains the point, False otherwise.
- Example:
>>> plane = Plane(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0])) >>> plane.contains(Point(1.0, 1.0, 0.0)) # True (z=0 plane)
contains(self: ostk.mathematics.geometry.d3.object.Plane, point_set: ostk.mathematics.geometry.d3.object.PointSet) -> bool
Check if the plane contains a point set.
- Args:
point_set (PointSet): The point set to check.
- Returns:
bool: True if the plane contains all points in the set, False otherwise.
- Example:
>>> plane = Plane(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0])) >>> points = PointSet([Point(1.0, 1.0, 0.0), Point(2.0, 2.0, 0.0)]) >>> plane.contains(points) # True
contains(self: ostk.mathematics.geometry.d3.object.Plane, line: ostk.mathematics.geometry.d3.object.Line) -> bool
Check if the plane contains a line.
- Args:
line (Line): The line to check.
- Returns:
bool: True if the plane contains the entire line, False otherwise.
- Example:
>>> plane = Plane(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0])) >>> line = Line(Point(0.0, 0.0, 0.0), numpy.array([1.0, 0.0, 0.0])) >>> plane.contains(line) # True (line lies in z=0 plane)
contains(self: ostk.mathematics.geometry.d3.object.Plane, ray: ostk.mathematics.geometry.d3.object.Ray) -> bool
Check if the plane contains a ray.
- Args:
ray (Ray): The ray to check.
- Returns:
bool: True if the plane contains the entire ray, False otherwise.
- Example:
>>> plane = Plane(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0])) >>> ray = Ray(Point(0.0, 0.0, 0.0), numpy.array([1.0, 0.0, 0.0])) >>> plane.contains(ray) # True
contains(self: ostk.mathematics.geometry.d3.object.Plane, segment: ostk.mathematics.geometry.d3.object.Segment) -> bool
Check if the plane contains a segment.
- Args:
segment (Segment): The segment to check.
- Returns:
bool: True if the plane contains the entire segment, False otherwise.
- Example:
>>> plane = Plane(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0])) >>> segment = Segment(Point(0.0, 0.0, 0.0), Point(1.0, 0.0, 0.0)) >>> plane.contains(segment) # True
- get_normal_vector( ) numpy.ndarray[numpy.float64[3, 1]]¶
Get the normal vector of the plane.
- Returns:
The normal vector to the plane.
- Return type:
Vector3d
Example
>>> plane = Plane(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0])) >>> normal = plane.get_normal_vector() # [0.0, 0.0, 1.0]
- get_point( ) ostk.mathematics.geometry.d3.object.Point¶
Get a reference point on the plane.
- Returns:
A point on the plane.
- Return type:
Example
>>> plane = Plane(Point(1.0, 2.0, 3.0), numpy.array([0.0, 0.0, 1.0])) >>> point = plane.get_point()
- intersection_with(*args, **kwargs)¶
Overloaded function.
intersection_with(self: ostk.mathematics.geometry.d3.object.Plane, point: ostk.mathematics.geometry.d3.object.Point) -> ostk::mathematics::geometry::d3::Intersection
Compute the intersection of the plane with a point.
- Args:
point (Point): The point to intersect with.
- Returns:
Intersection: The intersection result.
- Example:
>>> plane = Plane(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0])) >>> intersection = plane.intersection_with(Point(1.0, 1.0, 0.0))
intersection_with(self: ostk.mathematics.geometry.d3.object.Plane, point_set: ostk.mathematics.geometry.d3.object.PointSet) -> ostk::mathematics::geometry::d3::Intersection
Compute the intersection of the plane with a point set.
- Args:
point_set (PointSet): The point set to intersect with.
- Returns:
Intersection: The intersection result.
- Example:
>>> plane = Plane(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0])) >>> points = PointSet([Point(1.0, 1.0, 0.0), Point(2.0, 2.0, 1.0)]) >>> intersection = plane.intersection_with(points)
intersection_with(self: ostk.mathematics.geometry.d3.object.Plane, line: ostk.mathematics.geometry.d3.object.Line) -> ostk::mathematics::geometry::d3::Intersection
Compute the intersection of the plane with a line.
- Args:
line (Line): The line to intersect with.
- Returns:
Intersection: The intersection result (point or line if coplanar).
- Example:
>>> plane = Plane(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0])) >>> line = Line(Point(0.0, 0.0, -1.0), numpy.array([0.0, 0.0, 1.0])) >>> intersection = plane.intersection_with(line)
intersection_with(self: ostk.mathematics.geometry.d3.object.Plane, ray: ostk.mathematics.geometry.d3.object.Ray) -> ostk::mathematics::geometry::d3::Intersection
Compute the intersection of the plane with a ray.
- Args:
ray (Ray): The ray to intersect with.
- Returns:
Intersection: The intersection result.
- Example:
>>> plane = Plane(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0])) >>> ray = Ray(Point(0.0, 0.0, -1.0), numpy.array([0.0, 0.0, 1.0])) >>> intersection = plane.intersection_with(ray)
intersection_with(self: ostk.mathematics.geometry.d3.object.Plane, segment: ostk.mathematics.geometry.d3.object.Segment) -> ostk::mathematics::geometry::d3::Intersection
Compute the intersection of the plane with a segment.
- Args:
segment (Segment): The segment to intersect with.
- Returns:
Intersection: The intersection result.
- Example:
>>> plane = Plane(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0])) >>> segment = Segment(Point(0.0, 0.0, -1.0), Point(0.0, 0.0, 1.0)) >>> intersection = plane.intersection_with(segment)
- intersects(*args, **kwargs)¶
Overloaded function.
intersects(self: ostk.mathematics.geometry.d3.object.Plane, point: ostk.mathematics.geometry.d3.object.Point) -> bool
Check if the plane intersects with a point.
- Args:
point (Point): The point to check.
- Returns:
bool: True if the plane intersects the point, False otherwise.
- Example:
>>> plane = Plane(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0])) >>> plane.intersects(Point(1.0, 1.0, 0.0)) # True
intersects(self: ostk.mathematics.geometry.d3.object.Plane, point_set: ostk.mathematics.geometry.d3.object.PointSet) -> bool
Check if the plane intersects with a point set.
- Args:
point_set (PointSet): The point set to check.
- Returns:
bool: True if the plane intersects the point set, False otherwise.
- Example:
>>> plane = Plane(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0])) >>> points = PointSet([Point(1.0, 1.0, 0.0), Point(2.0, 2.0, 0.0)]) >>> plane.intersects(points) # True
intersects(self: ostk.mathematics.geometry.d3.object.Plane, line: ostk.mathematics.geometry.d3.object.Line) -> bool
Check if the plane intersects with a line.
- Args:
line (Line): The line to check.
- Returns:
bool: True if the plane intersects the line, False otherwise.
- Example:
>>> plane = Plane(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0])) >>> line = Line(Point(0.0, 0.0, -1.0), numpy.array([0.0, 0.0, 1.0])) >>> plane.intersects(line) # True
intersects(self: ostk.mathematics.geometry.d3.object.Plane, ray: ostk.mathematics.geometry.d3.object.Ray) -> bool
Check if the plane intersects with a ray.
- Args:
ray (Ray): The ray to check.
- Returns:
bool: True if the plane intersects the ray, False otherwise.
- Example:
>>> plane = Plane(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0])) >>> ray = Ray(Point(0.0, 0.0, -1.0), numpy.array([0.0, 0.0, 1.0])) >>> plane.intersects(ray) # True
intersects(self: ostk.mathematics.geometry.d3.object.Plane, segment: ostk.mathematics.geometry.d3.object.Segment) -> bool
Check if the plane intersects with a segment.
- Args:
segment (Segment): The segment to check.
- Returns:
bool: True if the plane intersects the segment, False otherwise.
- Example:
>>> plane = Plane(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0])) >>> segment = Segment(Point(0.0, 0.0, -1.0), Point(0.0, 0.0, 1.0)) >>> plane.intersects(segment) # True
- is_cone(self: ostk.mathematics.geometry.d3.Object) bool¶
Check if the object is a cone.
- Returns:
True if the object is a cone.
- Return type:
- is_defined(self: ostk.mathematics.geometry.d3.object.Plane) bool¶
Check if the plane is defined.
- Returns:
True if the plane is defined, False otherwise.
- Return type:
Example
>>> plane = Plane(Point(0.0, 0.0, 0.0), numpy.array([0.0, 0.0, 1.0])) >>> plane.is_defined() # True
- is_ellipsoid(self: ostk.mathematics.geometry.d3.Object) bool¶
Check if the object is an ellipsoid.
- Returns:
True if the object is an ellipsoid.
- Return type:
- is_line(self: ostk.mathematics.geometry.d3.Object) bool¶
Check if the object is a line.
- Returns:
True if the object is a line.
- Return type:
- is_line_string(self: ostk.mathematics.geometry.d3.Object) bool¶
Check if the object is a line string.
- Returns:
True if the object is a line string.
- Return type:
- is_plane(self: ostk.mathematics.geometry.d3.Object) bool¶
Check if the object is a plane.
- Returns:
True if the object is a plane.
- Return type:
- is_point(self: ostk.mathematics.geometry.d3.Object) bool¶
Check if the object is a point.
- Returns:
True if the object is a point.
- Return type:
- is_point_set(self: ostk.mathematics.geometry.d3.Object) bool¶
Check if the object is a point set.
- Returns:
True if the object is a point set.
- Return type:
- is_polygon(self: ostk.mathematics.geometry.d3.Object) bool¶
Check if the object is a polygon.
- Returns:
True if the object is a polygon.
- Return type:
- is_pyramid(self: ostk.mathematics.geometry.d3.Object) bool¶
Check if the object is a pyramid.
- Returns:
True if the object is a pyramid.
- Return type:
- is_ray(self: ostk.mathematics.geometry.d3.Object) bool¶
Check if the object is a ray.
- Returns:
True if the object is a ray.
- Return type:
- is_segment(self: ostk.mathematics.geometry.d3.Object) bool¶
Check if the object is a segment.
- Returns:
True if the object is a segment.
- Return type:
- is_sphere(self: ostk.mathematics.geometry.d3.Object) bool¶
Check if the object is a sphere.
- Returns:
True if the object is a sphere.
- Return type:
- static undefined() ostk.mathematics.geometry.d3.object.Plane¶
Create an undefined plane.
- Returns:
An undefined plane.
- Return type:
Example
>>> undefined_plane = Plane.undefined() >>> undefined_plane.is_defined() # False