User Tools

Site Tools


visual3d:documentation:pipeline:signal_commands:compute_planar_angle

Compute Planar Angle

Overview

This command computes a planar angle between three points as diagrammed in example 1, or four points as diagrammed in example 2. The location of the points displayed corresponds to the combo boxes containing the signal.

It is possible to compute a 3D angle, or to project the vectors onto one of the principal planes. If the user wants to project onto an arbitrary plane, transform the points into another coordinate system then project onto one of the principal planes of this new coordinate system.

  • The user can select to use a Right Hand or Left Hand Rule to define the sign of the angle.
  • The user can select the range 0 - 360 degrees or -180 to 180 degrees.
  • acos is used to calculate the planar angles. atan is not used.
  • 3D angles can only be computed to 0 - 180 degrees unless a normal vector is specified.

vec1 = vector from vertex 2 to vertex 1 vec2 = vector from vertex 2 to vertex 3 normal= vec1 cross vec2 angle= acos(vec1 dot vec2) If you select a 3D angle and do not specify a projection plane or a normal vector, the answer is simply the angle between these vectors. If you project the vertices onto a plane, the result is a 2D angle. in order to get 3 2D angles, you would need to create 3 different commands with each command projecting onto a different plane If you define the normal vector, you have the ability to specify the direction of the angle. The command can be edited via text editor and dialog. The details on the dialog and command are found below:

Pipeline Command

The Compute Planar Angle command can be found in the Pipeline Workshop within the Signal Math folder as so:

Compute_Planar_Angle
/SIGNAL_TYPES=
! /SIGNAL_FOLDER=ORIGINAL
! /SIGNAL_NAMES=
! /RESULT_FOLDER=PROCESSED
/RESULT_NAME=
! /COMPUTE_3PT_ANGLE=TRUE
! /NORMALX=
! /NORMALY=
! /NORMALZ=
! /REFERENCE_SEGMENT=LAB
! /PROJECTION_PLANE=XY
! /USE_RIGHT_HAND_RULE=TRUE
! /USE_0_TO_360_DEGREES=TRUE
! /MAX_ALLOWABLE_NORMALIZED_DISTANCE_TO_PLANE=0.1
;

Command Parameters

The parameters that can be used to control the command are as follows:

Signal TypesThe type of signal to be evaluated
Signal FolderThe name of the signal folder
Signal NamesThe name of the signal to be evaluated
Result FolderThe name of the resulting signal
Result NameThe name of the resulting folder
Compute 3pt AngleTRUE=3PT, FAlSE=4PT
NORMALX/Y/ZThe normal vector to the 3D angle
Reference SegmentThe reference segment for the planar angle
Projection PlaneThe plane on which the angle will be projected
Use Right Hand RuleTrue or False: use right hand rule to calculate angle, False: Left Hand Rule
Use 0 to 360 DegreesTrue: angle is 0 to 360 degrees False: angle is -180 to 180 degrees
Max Allowable Normalized Distance To PlaneMaximum acceptable distance to the reference plane

Dialog

The command can be edited via text editor and dialog. The details on the dialog and command are found below:

computeplanarangledialog.jpg

Examples

Example 1: Projected angles - 3 Point

Given TARGETS labeled:

DISTAL1, VERTEX, and DISTAL2 and a segment

RFT Project the angle onto one of the Principal Planes of the RFT Segment Coordinate System.

! Compute the planar angle projected on the XY plane of the RFT segment from 3 points (DISTAL1,
! VERTEX, DISTAL2). The resulting signal is named TEST_ANGLE. The Right Hand rule is used and
! the angle is between -180 to 180 degrees.

Compute_Planar_Angle
/SIGNAL_TYPES=TARGET+TARGET+TARGET
/SIGNAL_NAMES=DISTAL1+VERTEX+DISTAL2
/SIGNAL_FOLDER=PROCESSED+PROCESSED+PROCESSED
/RESULT_NAME=TEST_ANGLE
/RESULT_FOLDER=ANGLE
/COMPUTE_3PT_ANGLE=TRUE
! /NORMALX=
! /NORMALY=
! /NORMALZ=
/REFERENCE_SEGMENT=RFT
! /PROJECTION_PLANE=XY
! /USE_RIGHT_HAND_RULE=TRUE
/USE_0_TO_360_DEGREES=FALSE
;

Example 2: Compute Planar Angle using transform segment coordinate system

This example transforms the targets DISTAL1, VERTEX, DISTAL2 into the segment RFT coordinate system and then computes the planar angle TEST_ANGLE.

! First transform the locations into the segment coordinate system 

Transform_Data_Coordinate_System
/SIGNAL_TYPES=TARGET+TARGET+TARGET
/SIGNAL_NAMES=DISTAL1+VERTEX+DISTAL2
/SIGNAL_FOLDER=PROCESSED+PROCESSED+PROCESSED
/FROM_SEGMENT_CS=LAB
/TO_SEGMENT_CS=RFT
 /RESULT_TYPE=TARGET
 /RESULT_FOLDER=RFT
/RESULT_SUFFIX=
;

! Compute the planar angle projected on the XY plane of the RFT segment.

Compute_Planar_Angle
/SIGNAL_TYPES=TARGET+TARGET+TARGET
/SIGNAL_NAMES=DISTAL1+VERTEX+DISTAL2
/SIGNAL_FOLDER=RFT+RFT+RFT
/RESULT_NAME=TEST_ANGLE
/RESULT_FOLDER=ANGLE
/COMPUTE_3PT_ANGLE=TRUE
! /NORMALX=
! /NORMALY=
! /NORMALZ=
! /REFERENCE_SEGMENT=LAB
! /PROJECTION_PLANE=XY
! /USE_RIGHT_HAND_RULE=TRUE
/USE_0_TO_360_DEGREES=FALSE
;

Example 3: Projected angles - 4 Point

Given TARGETS labeled:

PROX1, PROX2, DISTAL1, and DISTAL2 and a segment

RFT Project the angle onto one of the Principal Planes of the RFT Segment Coordinate System.

! Compute the planar angle projected on the YZ plane of the RFT segment from 4 points
! (PROX1,PROX2,DISTAL1,DISTAL2). The resulting signal is named TEST_ANGLE. The Right Hand rule
! is used and the angle is between -180 to 180 degrees.

Compute_Planar_Angle
/SIGNAL_TYPES=TARGET+TARGET+TARGET+TARGET
/SIGNAL_NAMES=PROX1+PROX2+DISTAL1+DISTAL2
/SIGNAL_FOLDER=PROCESSED+PROCESSED+PROCESSED+PROCESSED
/RESULT_NAME=TEST_ANGLE
/RESULT_FOLDER=ANGLE
/COMPUTE_3PT_ANGLE=FALSE
! /NORMALX=
! /NORMALY=
! /NORMALZ=
! /REFERENCE_SEGMENT=LAB
/PROJECTION_PLANE=YZ
! /USE_RIGHT_HAND_RULE=TRUE
/USE_0_TO_360_DEGREES=FALSE
;

Example 4: Using ROTATION type signals as locations for an arm slot calculation

Given a left handed pitcher, create a virtual LANDMARK below the shoulder labeled: LSHOULDER_Z

and two ROTATION signals at the upper arm and hand: l_uarm_4X4 and l_hand_4X4

Compute the arm slot.

Compute_Planar_Angle
/SIGNAL_TYPES=LANDMARK+ROTATION+ROTATION
! /SIGNAL_FOLDER=ORIGINAL
/SIGNAL_NAMES=LSHOULDER_Z+l_uarm_4X4+l_hand_4X4
! /RESULT_FOLDER=PROCESSED
/RESULT_NAME=ARM_SLOT
! /COMPUTE_3PT_ANGLE=TRUE
! /NORMALX=
! /NORMALY=
! /NORMALZ=
! /REFERENCE_SEGMENT=LAB
/PROJECTION_PLANE=XZ
! /USE_RIGHT_HAND_RULE=TRUE
! /USE_0_TO_360_DEGREES=TRUE
! /MAX_ALLOWABLE_NORMALIZED_DISTANCE_TO_PLANE=0.1
;
visual3d/documentation/pipeline/signal_commands/compute_planar_angle.txt · Last modified: by wikisysop