principle_axis#
- principle_axis(domain, population=None, include_boundaries=None, exclude_boundaries=None, boundary_exclude_distance=0, add_as_label=True, label_name='Principle axis angle', cmap='viridis')#
Returns the principle axis angle, the major and minor axis of shape objects in the domain.
The principle axis is the axis of maximum moment of area. The principle major axis is the axis of maximum moment of area (max bend resistance) whereas the principle minor axis is the axis of minimum moment of area (min bend resistance). Adds principle axis angle as a label if required. Returns the principle axis angle, the major and minor axis of shape objects in the domain. The axes are returned as 2x2 arrays where the first row is the shape centroid and the second row is the end vertex of the unit vector defining the axis. Adds results as a label if required.
- Parameters:
- domainobject
The domain containing the shape objects.
- populationvarious, optional
A query, list/tuple of indices, or a single int specifying the objects to consider. Defaults to None.
- include_boundariesarray-like, query-like, or None, optional
Boundaries to include in the analysis. Defaults to None.
- exclude_boundariesarray-like, query-like, or None, optional
Boundaries to exclude from the analysis. Defaults to None.
- boundary_exclude_distancefloat, optional
Buffer to exclude objects located within boundary_exclude_distance from the boundaries. Defaults to 0.
- add_as_labelbool, optional
Whether to add the principle axis angle as a label. Defaults to True.
- label_namestr, optional
The name of the label to add. Defaults to ‘Principle axis angle’.
- cmapstr, optional
The colormap to use for the label. Defaults to ‘viridis’.
- Returns:
- principle_axis_anglenumpy.ndarray
An array of principle axis angles for the selected objects.
- major_axisnumpy.ndarray
An array of 2x2 arrays where the first row is the start vertex and the second row is the end vertex of the major axis.
- object_indicesnumpy.ndarray
An array of indices of the selected objects.