Rotate facets given axis and angle.
Angle must be in radiants.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
||
| type(vector_R8P), | intent(in) | :: | axis | Axis of rotation. |
||
| real(kind=R8P), | intent(in) | :: | angle | Angle of rotation. |
||
| logical, | intent(in), | optional | :: | recompute_metrix | Sentinel to activate metrix recomputation. |
elemental subroutine rotate_by_axis_angle(self, axis, angle, recompute_metrix)
!< Rotate facets given axis and angle.
!<
!< Angle must be in radiants.
class(file_stl_object), intent(inout) :: self !< File STL.
type(vector_R8P), intent(in) :: axis !< Axis of rotation.
real(R8P), intent(in) :: angle !< Angle of rotation.
logical, intent(in), optional :: recompute_metrix !< Sentinel to activate metrix recomputation.
real(R8P) :: matrix(3,3) !< Rotation matrix.
integer(I4P) :: f !< Counter.
if (self%facets_number>0) then
matrix = rotation_matrix_R8P(axis=axis, angle=angle)
do f=1, self%facets_number
call self%facet(f)%rotate(matrix=matrix, recompute_metrix=recompute_metrix)
enddo
endif
endsubroutine rotate_by_axis_angle