Repository navigation
v2.15.0
This release adds angular dimensions, dimensions along one component, and convex hulls. The ESIS instrument paper needs all three to draw the schematic of its optical system.
Angular dimensions
na.plt.dimension_angular() is the counterpart of na.plt.dimension() for angles (#269):
- Arc: it draws an arc around a vertex, from one direction to another, with an arrowhead at each end.
- Extension lines: they join each end of the arc back towards the vertex. They start a gap beyond
radius_inner, so they can begin at the edge of the part whose angle is being dimensioned. - Label: it defaults to the size of the angle in degrees. Angles without units are in radians.
- Arrowheads: they take every property of the arc that an arrow has, like its color and line width, and its zorder.
Dimensions along one component
na.plt.dimension(..., along="x") dimensions only the distance along one plotted component (#269). A mechanical drawing does the same for the horizontal or vertical distance between two features that are not level with each other.
- Dimension line: it is parallel to that component,
offsetfroma. - Extension lines: each point is joined to the dimension line by an extension line of its own length.
- Gap: the gap before each extension line is the same at both points. It is a fraction of the longer extension line, and never longer than the line it starts.
Both functions now replace matplotlib's aliases, like c and lw, with the names they stand for before merging them with their defaults. So aliases replace the defaults rather than conflicting with them.
Behavior changes in na.plt.dimension():
- A distance of zero raises a
ValueError, where it used to draw lines of NaN. - A
gapgreater than 1 gives extension lines of zero length. They used to start beyond the dimension line and run back to it.
Convex hulls
na.geometry.convex_hull(points, axis, axis_vertex="vertex", where=True) reduces the points along axis to the vertices of their convex hull, along the new axis axis_vertex (#270).
- Batches: every other axis is a batch axis, and each set of points gets a hull of its own. Each hull is found with Andrew's monotone chain in a Numba kernel, which runs in parallel over the sets.
- Order: the vertices run counterclockwise from the one with the least x, or the least y among a tie.
- Padding: each hull is padded to the size of the largest by repeating its last vertex, which leaves the polygon unchanged.
- Selection:
wherepicks which points take part, such as the rays that are not vignetted. Points with a coordinate that isn't finite are left out. - Degenerate sets:
- Points on an edge are not vertices, and neither are copies of a vertex.
- Collinear points have a hull of their two ends.
- Coincident points have a hull of one vertex.
- A set with no points has a hull of NaN.
- Units and types: the vertices keep the unit of the x-coordinates and the floating-point type of the points.
- Inputs: the points must be a vector with exactly the components x and y. Uncertain points are not supported yet, and raise a
TypeError.
Full Changelog: v2.14.1...v2.15.0