public sealed class Dash8
Represents a curve dash pattern to be used in rhino viewport display. Due to implementation details in DisplayPen this struct accepts at most 8 dash-gap-dash-gap values.

Constructors

Dash8

#
public Dash8(float dash1, float gap1, float dash2 = 0, float gap2 = 0, float dash3 = 0, float gap3 = 0, float dash4 = 0, float gap4 = 0)
Create a new dash pattern from the 8 possible values.
dash1 (float)
gap1 (float)
dash2 (float = 0)
gap2 (float = 0)
dash3 (float = 0)
gap3 (float = 0)
dash4 (float = 0)
gap4 (float = 0)

Properties

Count

#
public int Count { get; }
Gets the number of dashes and gaps. If this pattern is solid, the count will be zero.

IsSolid

#
public bool IsSolid { get; }
Gets whether this pattern is a solid line.

Long

#
public static Dash8 Long { get; }
Gets the long dash pattern.

Medium

#
public static Dash8 Medium { get; }
Gets the medium dash pattern.

Short

#
public static Dash8 Short { get; }
Gets the short dash pattern.

Solid

#
public static Dash8 Solid { get; }
Gets the solid dash pattern. Note that nulls are also treated as Solid.

Varying

#
public static Dash8 Varying { get; }
Gets the varying dash pattern.

Indexers

this[]

#
public float this[int index] { get; }
Gets the dash or gap length at the given index.
index (int)

Methods

ToArray

#
public float[] ToArray(float factor)
Create an array using a screen pixel scaling factor.
factor (float)

TryConstruct

#
public static bool TryConstruct(object value, out Dash8 pattern, out string failure)
Try and construct a dash pattern from a value.
value (object)
pattern (out Dash8)
failure (out string)

TryParse

#
public static Result<Dash8> TryParse(string notation)
Try and parse a dash pattern.
notation (string)Notation to parse.
True if a pattern could be successfully parsed.