:mod:`neuron_morphology.transforms.geometry` ============================================ .. py:module:: neuron_morphology.transforms.geometry .. autoapi-nested-parse:: Some handy utilities for working with vector geometries .. !! processed by numpydoc !! Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: neuron_morphology.transforms.geometry.get_ccw_vertices_from_two_lines neuron_morphology.transforms.geometry.prune_two_lines neuron_morphology.transforms.geometry.get_vertices_from_two_lines neuron_morphology.transforms.geometry.get_ccw_vertices .. function:: get_ccw_vertices_from_two_lines(line1: List[Tuple], line2: List[Tuple]) Convenience method two do both get_vertices_from_two_lines() and get_ccw_vertices() .. !! processed by numpydoc !! .. function:: prune_two_lines(line1: List[Tuple], line2: List[Tuple]) check the boundary to avoid intersections with side lines :Parameters: **line1, line2: List of coordinates describing two lines** .. :Returns: line1, line2: boundary pruned if needed .. .. !! processed by numpydoc !! .. function:: get_vertices_from_two_lines(line1: List[Tuple], line2: List[Tuple]) Generates circular vertices from two lines :Parameters: **line1, line2: List of coordinates describing two lines** .. :Returns: vertices of the simple polygon created from line 1 and 2 .. (first vertex = last vertex) .. 1-2-3-4 .. 5-6-7-8 -> [1-2-3-4-8-7-6-5-1] .. .. !! processed by numpydoc !! .. function:: get_ccw_vertices(vertices: List[Tuple]) Generates counter clockwise vertices from vertices describing a simple polygon Method: Simplification of the shoelace formula, which calculates area of a simple polygon by integrating the area under each line segment of the polygon. If the total area is positive, the vertices were traversed in clockwise order, and if it is negative, they were traversed in counterclockwise order. :Parameters: **vertices: vertices describing a convex polygon** (vertices[0] = vertices[-1]) :Returns: vertices in counter clockwise order .. .. !! processed by numpydoc !!