Triangle

Triangle

The Triangle is part of the Shape library. It is used to draw a triangle shape on the screen whose direction and angle can be adjusted dynamically.
It is generally used as a static arrow (direction indicator) or for dynamic purposes, such as showing the fill/discharge direction of a tank or indicating the status of a valve.

Common Use Cases
  • Flow Indication: Using it as an arrow to show the direction of flow in a pipeline.
  • Valve Status: Changing direction (Up/Down) based on whether a valve is open or closed.
  • Pointers: Using it as a static indicator to point to a specific area or warning on the screen.
  • Trend Indication: Showing whether a tank level is rising (Up arrow) or falling (Down arrow).

Properties Panel – Key Properties

The dynamic properties of this object are the same as those of the Rectangle and Ellipse objects.

Value

  • Apex Angle:
    • By binding a tag to this property, the angle of the apex (tip) can be changed based on the tag’s value.
  • Fill Color
    • The FillColor can be bound to different states of a tag using the + New (New Condition) button.

Advanced Panel – Key Properties

  • FillColor / FillStyle
    • Determines the triangle’s inner fill color and fill style (Solid, Gradient, etc.).
  • LineColor / LineStyle
    • Determines the color and style (Solid, Dashed, etc.) of the triangle’s border line.
  • LineWidth
    • The thickness of the border line in pixels.
  • TriangleDirection
    • Function: The most critical setting, determining which direction the apex points.
    • Options: Up, Down, Left, Right.
  • ApexAngle
    • Function: Determines the angle of the apex (in degrees). As the value decreases, the triangle becomes sharper (more acute); as it increases, the triangle becomes wider (obtuse).
    • Dynamic Binding: This property can be bound to a Tag under the Value category. For example, the triangle’s apex angle can change dynamically based on a valve’s opening ratio.
Advanced Drawing Settings
  • AntiAlias (Edge Smoothing)
    • When set to False (default), the slanted edges of the triangle may appear pixelated, “broken,” or “jagged.”
  • AlphaLevel
    • Problem: When AntiAlias is set to True, especially on a dark background, faint or white dots (artifacts) may appear along the edges of the line.
    • Solution: This setting (0-255) is used to eliminate these white dots. Increasing the value (e.g., closer to 255) cleans up the edge smoothing and provides a clearer line.

Common Usage Example

Example: Static Flow Arrow 
Goal: To show the direction of flow in a pipeline.

  1. Add a Triangle object to the screen.
  2. Go to the Advanced panel and set the TriangleDirection property to Right.
  3. Set FillColor to “Blue” and LineColor to “Black”.
  4. Set AntiAlias to True to increase drawing quality.

Result: A static, right-pointing arrow appears on the screen, indicating the flow within the pipeline.

Leave a Reply