spateo.tdr.models.morpho_models.arrow_model
#
Module Contents#
Functions#
|
Create a 3D arrow model. |
|
Create a 3D arrow model. |
|
Create multiple 3D arrows model. |
- spateo.tdr.models.morpho_models.arrow_model._construct_arrow(start_point: Union[list, tuple, numpy.ndarray] = (0.0, 0.0, 0.0), direction: Union[list, tuple, numpy.ndarray] = (1.0, 0.0, 0.0), tip_length: float = 0.25, tip_radius: float = 0.1, tip_resolution: int = 20, shaft_radius: float = 0.05, shaft_resolution: int = 20, scale: Optional[Union[str, float]] = 'auto') pyvista.PolyData [source]#
Create a 3D arrow model.
- Parameters
- start_point
Start location in [x, y, z] of the arrow.
- direction
Direction the arrow points to in [x, y, z].
- tip_length
Length of the tip.
- tip_radius
Radius of the tip.
- tip_resolution
Number of faces around the tip.
- shaft_radius
Radius of the shaft.
- shaft_resolution
Number of faces around the shaft.
- scale
Scale factor of the entire object.
'auto'
scales to length of direction array.
- Returns
Arrow model.
- spateo.tdr.models.morpho_models.arrow_model.construct_arrow(start_point: Union[list, tuple, numpy.ndarray], direction: Union[list, tuple, numpy.ndarray], arrow_scale: Optional[Union[int, float]] = None, key_added: Optional[str] = 'arrow', label: str = 'arrow', color: str = 'gainsboro', alpha: float = 1.0, **kwargs) pyvista.PolyData [source]#
Create a 3D arrow model.
- Parameters
- start_point
Start location in [x, y, z] of the arrow.
- direction
Direction the arrow points to in [x, y, z].
- arrow_scale
Scale factor of the entire object. ‘auto’ scales to length of direction array.
- key_added
The key under which to add the labels.
- label
The label of arrow model.
- color
Color to use for plotting model.
- alpha
The opacity of the color to use for plotting model.
- **kwargs
Additional parameters that will be passed to
_construct_arrow
function.
- Returns
Arrow model.
- spateo.tdr.models.morpho_models.arrow_model.construct_arrows(start_points: numpy.ndarray, direction: numpy.ndarray = None, arrows_scale: Optional[numpy.ndarray] = None, n_sampling: Optional[int] = None, sampling_method: str = 'trn', factor: float = 1.0, key_added: Optional[str] = 'arrow', label: Union[str, list, numpy.ndarray] = 'arrows', color: Union[str, list, dict, numpy.ndarray] = 'gainsboro', alpha: Union[float, int, list, dict, numpy.ndarray] = 1.0, **kwargs) pyvista.PolyData [source]#
Create multiple 3D arrows model.
- Parameters
- start_points
List of Start location in [x, y, z] of the arrows.
- direction
Direction the arrows points to in [x, y, z].
- arrows_scale
Scale factor of the entire object.
- n_sampling
n_sampling is the number of coordinates to keep after sampling. If there are too many coordinates in start_points, the generated arrows model will be too complex and unsightly, so sampling is used to reduce the number of coordinates.
- sampling_method
The method to sample data points, can be one of
['trn', 'kmeans', 'random']
.- factor
Scale factor applied to scaling array.
- key_added
The key under which to add the labels.
- label
The label of arrows models.
- color
Color to use for plotting model.
- alpha
The opacity of the color to use for plotting model.
- **kwargs
Additional parameters that will be passed to
_construct_arrow
function.
- Returns
Arrows model.