Angle
Angle dimension measures the angle between three points. These points can be in the main planes (XZ, XY, YZ) or in a custom plane. It measures angles from 0 to 180 degrees.
Parameters
Components
The angle dimension consists of four components:
- Lines : Two lines that form the angle.
- Number : The numeric value of the angle in degrees.
- Arc : A plane with a transparent material to draw the arc between the two lines.
- Arc Scale Parameter : A parameter to control the scale of the arc GameObject.
Arc Appearance
The arc of the angle dimension is beautifully crafted with the help of its material shader, which offers the essential options of color and degree, as well as additional options to cater to individual requirements.
Automatic Text Adjustment for Tight Angles
When the angle between two lines is too tight, the text may overflow and not fit between them. In this case, the script will automatically move and rotate the text, setting its position above one of the lines in a proper way and aligning the rotation to the direction of the line that the text is placed above.
To customize the position of the text when it overflows and moves to a new position, you can use the Text Offset If Not Fit
parameter, which is a Vector2 input.
Dynamic Transform Support for Angle Dimension
Similar to other dimensions, the angle dimension also supports dynamic transform if you check the isDynamic option. This allows the dimension to adjust and update itself based on the changing positions and orientations of the objects it is measuring.
By enabling this option, you can use the angle dimension with moving or changing objects without needing to recreate it each time.
Drawing an Angle Dimension on a Custom Plane
The angle dimension can be drawn in the main planes (XZ, XY, YZ) or on a custom plane. To draw an angle dimension on a custom plane, simply change the angleMeasurementPlane
parameter to Free
, and then click on the points that you need to measure.
This allows you to measure angles on planes that are not aligned with the main coordinate axes. By selecting the appropriate points, you can define any plane and measure angles on it with the angle dimension.
To reduce any intersection between the dimension and target objects, you can increase thenormalOffset
parameter if the dimension is individual or hitNormalOffset
in the starter script if it's not individual. This parameter will get the first hit point normal and move the dimension along it forward. It will also help to avoid Z-fighting. Always set it to a small amount.