ConvexHull2D#
- class pyopenms.ConvexHull2D#
Bases:
objectA 2-dimensional hull representation in [counter]clockwise direction - depending on axis labelling
- __init__() None#
- __init__(arg: pyopenms.ConvexHull2D, /) None
Methods
__init__()addPoint(point)Adds a point to the hull if it is not already contained.
addPointXY(x, y)Adds a point (x, y) to the hull
addPoints(points)addPointsNPY(points[, shape, order])Adds points from a numpy array of shape (N, 2) to the hull
clear()Removes all points
compress()Allows to reduce the disk/memory footprint of a hull
encloses(point)Returns if the point lies in the feature hull
enclosesXY(x, y)Returns if the point (x, y) lies in the feature hull
Expand a convex hull to its bounding box.
Returns the bounding box of the feature hull points
Returns the bounding box of the feature hull points as a DBoundingBox2
Returns the hull points as a numpy array of shape (N, 2)
setHullPoints(points)setHullPointsNPY(points[, shape, order])Sets the hull points from a numpy array of shape (N, 2)
- addPoint(point: tuple[float, float]) bool#
Adds a point to the hull if it is not already contained. Returns if the point was added. This will trigger recomputation of the outer hull points (thus points set with setHullPoints() will be lost)
- addPointXY(x: float, y: float) bool#
Adds a point (x, y) to the hull
- addPoints(points)#
- addPointsNPY(points: ndarray[dtype=float64, shape=(*, *), order='C']) None#
Adds points from a numpy array of shape (N, 2) to the hull
- clear() None#
Removes all points
- compress() int#
Allows to reduce the disk/memory footprint of a hull
- encloses(point: tuple[float, float]) bool#
Returns if the point lies in the feature hull
- enclosesXY(x: float, y: float) bool#
Returns if the point (x, y) lies in the feature hull
- expandToBoundingBox() None#
Expand a convex hull to its bounding box.
- getBoundingBox() pyopenms.DBoundingBox2#
Returns the bounding box of the feature hull points
- getBoundingBox2D() pyopenms.DBoundingBox2#
Returns the bounding box of the feature hull points as a DBoundingBox2
- getHullPoints()#
- getHullPointsNPY() numpy.ndarray[dtype=float64, shape=(*, *)]#
Returns the hull points as a numpy array of shape (N, 2)
- setHullPoints(points)#
- setHullPointsNPY(points: ndarray[dtype=float64, shape=(*, *), order='C']) None#
Sets the hull points from a numpy array of shape (N, 2)