Dimensions

Below we will consider the PMI objects that allow us to measure some property of any geometry (e.g. length, radius) and display a corresponding dimension with a calculated value. The C3D Web Vision supports the following types of dimensions:

  • linear;

  • path;

  • angular;

  • radial.

You can get any dimension via the GetParameters command, as well as add or remove it via the annotation commands. Each dimension uses the same type to represent a visual object everywhere.

New in version 1.5.0: Added the line, angle and radial dimension types.

New in version 1.8.0: Added the path dimension type.

Options

You can specify options for any dimension using an object of the following type.

Type of dimension options (TypeScript):

export type C3DViewDimensionOptions = {
    group?: number
    text?: string
    underlineText?: boolean
    font?: {
        family?: string,
        size?: number,
    }
    colors?: {
        text?: C3DViewRGB
        textBkg?: C3DViewRGB
        lines?: C3DViewRGB
    }
}

Note

The option type above is the same for all C3D Viewer API dimensions.

Let’s consider the options.

  1. group field defines to which annotation group a dimension belongs.

  2. text is a text value of dimension.

  3. underlineText is a flag for underlined text.

  4. font is a group of values to set up a text font:

    • family is a font family;

    • size is a {r, g, b} value of text color (the default is black).

  5. colors is a group of values to set up colors of a graphics object:

    • text is a {r, g, b} value of text color (the default is black);

    • textBkg is a {r, g, b} value of text background color (if undefined, background is transparent);

    • lines is a {r, g, b} value of line color (the default is black).

New in version 1.8.0: Added the group property.