Vertex Viewer SDK
    Preparing search index...

    Interface VertexViewerMeasurementDistance

    interface VertexViewerMeasurementDistance {
        anchorLabelOffset?: number;
        camera?: FrameCameraBase;
        distance?: number;
        end?: Vector3.Vector3;
        endJson?: string;
        fractionalDigits?: number;
        hitProvider?: PointToPointHitProvider;
        indicatorPt?: Vector3.Vector3;
        interactingAnchor?: "none" | Anchor;
        invalid?: boolean;
        labelFormatter?: Formatter<number | undefined>;
        lineCapLength?: number;
        measurementModel?: MeasurementModel;
        mode?: ViewerMeasurementDistanceMode;
        onEditBegin?: (
            event: VertexViewerMeasurementDistanceCustomEvent<
                EditBeginEventDetails,
            >,
        ) => void;
        onEditEnd?: (
            event: VertexViewerMeasurementDistanceCustomEvent<EditEndEventDetails>,
        ) => void;
        showAxisReferenceLines?: boolean;
        snapDistance?: number;
        start?: Vector3.Vector3;
        startJson?: string;
        units?: DistanceUnitType;
        viewer?: HTMLVertexViewerElement;
    }
    Index
    anchorLabelOffset?: number

    The distance from an anchor to its label.

    20
    

    The camera used to position the anchors. If viewer is defined, then the projection view matrix of the viewer will be used.

    distance?: number

    The distance between start and end in real world units. Value will be undefined if the start and end positions are undefined, or if the measurement is invalid.

    The world position of the ending anchor.

    endJson?: string

    The world position of the ending anchor, as a JSON string. The JSON string can be an array or object representation in the format of [x, y, z] or {"x": 0, "y": 0, "z": 0}.

    fractionalDigits?: number

    The number of fraction digits to display.

    2
    
    indicatorPt?: Vector3.Vector3
    interactingAnchor?: "none" | Anchor

    A property that reflects which anchor is currently being interacted with.

    'none'
    
    invalid?: boolean

    Indicates if the measurement is invalid. A measurement is invalid if either the start or end position are not on the surface of the model.

    false
    
    labelFormatter?: Formatter<number | undefined>

    An optional formatter that can be used to format the display of a distance. The formatting function is passed a calculated real-world distance and is expected to return a string.

    lineCapLength?: number

    The length of the caps at each end of the distance measurement.

    10
    
    measurementModel?: MeasurementModel

    The measurement model that will be updated when this measurement changes. You can pass this to a component to display measurement outcomes.

    new MeasurementModel()
    

    A mode that specifies how the measurement component should behave.

    When unset, the component will not respond to interactions with the handles.

    When edit, the measurement anchors are interactive and the user is able to reposition them.

    When replace, anytime the user clicks on the canvas, a new measurement will be created and replace any existing measurement. After a measurement is created, the measurement will be editable.

    ''
    
    onEditBegin?: (
        event: VertexViewerMeasurementDistanceCustomEvent<EditBeginEventDetails>,
    ) => void

    An event that is dispatched anytime the user begins editing the measurement.

    An event that is dispatched when the user has finished editing the measurement.

    showAxisReferenceLines?: boolean

    Enables the display of axis reference lines between the start and end point.

    false
    
    snapDistance?: number

    The distance, in pixels, between the mouse and nearest snappable edge. A value of 0 disables snapping.

    16
    

    The world position of the starting anchor.

    startJson?: string

    The world position of the starting anchor, as a JSON string. The JSON string can be an array or object representation in the format of [x, y, z] or {"x": 0, "y": 0, "z": 0}.

    The unit of measurement.

    'millimeters'
    
    viewer?: HTMLVertexViewerElement

    The viewer to connect to this measurement. The measurement will redraw any time the viewer redraws the scene.