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 and the major axis of shape objects in the domain.
The principle major axis is the direction of maximum moment of area (max bend resistance). The angle of the principle axis is defined as the angle between the x-axis and the major axis vector which gives an indication of the orientation of a shape along the stretch direction.
Returns the principle axis angle, the major axis shape objects in the domain. The major 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 principle axis angle as a label if specified.
- 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.