You are here: Start » AVL.NET » AVL.ShapeOrientation Method
AVL.ShapeOrientation Method
Computes the shape orientation as angle with value in range 0.0 - 180.0.
Namespace: | AvlNet |
---|---|
Assembly: | AVL.NET.dll |
Syntax
public static void ShapeOrientation( AvlNet.Path inShape, out float outOrientationAngle )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() | inShape | AvlNet.Path | |||
![]() | outOrientationAngle | float |
Description
Shape orientation can be thought of as the direction in which the shape is oriented. Mathematically it is the angle between X-axis and the line passing through the shape mass center, that rotation around this line produces the smallest torque.
Note that if the input path is not a valid shape (i.e. it has at least one self-intersection), the computation may lead to results that are not intuitive.
Examples
![]() |
![]() |
Orientation of the sample region equals to 55.386, which is visualized on the second image by drawing the line of this orientation passing through the mass center of the shape.
Errors
Error type | Description |
---|---|
DomainError | Open path on input in ShapeOrientation. |
DomainError | Degenerate shape on input in ShapeOrientation. |