BIM.works SDKs - v3.0.0-b.115
    Preparing search index...

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get applicableAreaModes(): AreaMode[]

      Returns AreaMode[]

      The modes that change something for this measurement right now, "gross" always among them

    • get area(): number

      Returns number

      The enclosed area of the polygon, always in square millimeters. For self-intersecting polygons this is the net (shoelace) area. What is measured follows the mode (see areaMode): the openings are subtracted for a net measurement, the convex hull of the ring is measured for a hull one

    • get areaMode(): AreaMode

      Which figure this measurement reports and draws: "gross" (the polygon as it stands), "net" (the openings of the face it was taken from drawn and subtracted) or "hull" (the convex hull of the ring, every concave feature filled in, openings ignored). The setting belongs to this measurement, not to the viewer. It can be cycled with the "toggleAreaHoles" key binding (O by default) while this measurement is being created or while it is the selected one.

      The value is what is actually in force: a mode this polygon cannot honour - "net" without openings, "hull" over an already convex ring - reads back as "gross"

      Returns AreaMode

      The mode in force

    • get coordinates(): vec3[]

      Returns vec3[]

      An array of the polygon coordinates. The closing edge is implied, the first coordinate is not repeated at the end. This is the outer ring only, the openings are reported separately by holes

    • get editable(): boolean

      Whether the points of this measurement can be dragged to a new position after it has been finalized (default true). Supported for area, path and point measurements, and for the laser, which is dragged as a whole by its instrument (a click on it selects it instead); the other types have no draggable points. The points show a pointer cursor on hover; while dragging, vertex snapping applies as during measuring (Shift temporarily disables it) and the label (area/length/position) is updated in realtime. Dropping the point fires the committed listener event, Escape cancels the drag

      Returns boolean

    • set editable(editable: boolean): void

      Parameters

      • editable: boolean

      Returns void

    • get editState(): | {
          index: number
          | null;
          moved: boolean;
          originalText: string | null;
      }
      | null

      The point being dragged (see editable): its index, whether it moved yet, and the measurement's value before the drag as its label shows it. Null when no point is dragged. A right-click during the drag puts the point back, like Escape. For a laser, index is the beam end dragged along its beam (0-2 the ends along the axes, 3-5 those opposite), null while it moves as a whole by its instrument; originalText is null

      Returns { index: number | null; moved: boolean; originalText: string | null } | null

    • get finished(): boolean

      Returns boolean

      Whether this measurement is finished

    • get holes(): vec3[][]

      The openings of the face this measurement was taken from, empty for a measurement drawn by hand. Each is a closed ring with the same convention as coordinates. They have no drag handles: only the outer ring can be edited

      Returns vec3[][]

      An array of rings

    • get hull(): vec3[]

      The convex hull of the outer ring, empty unless this is a hull measurement. Read-only geometry like the openings: the drag handles stay on the ring the user authored

      Returns vec3[]

      The hull as a closed ring, with the same convention as coordinates

    • get hullArea(): boolean

      Whether the convex hull of the ring is drawn and measured instead of the ring itself. Shorthand for areaMode == "hull"

      Returns boolean

      Whether this is a hull area measurement

    • get id(): number

      Get the unique identifier of this measurement

      Returns number

    • get netArea(): boolean

      Whether the openings are drawn and subtracted from the area. Shorthand for areaMode == "net"

      Returns boolean

      Whether this is a net area measurement

    • get normal(): vec3 | null

      Returns vec3 | null

      A copy of the unit normal of the plane the polygon lies in (the face's own normal for a measurement seeded from a face), or null while fewer than 3 non-collinear points have been committed

    • get pointCount(): number

      Returns number

      The points placed so far while this measurement is being taken (objects picked, for an object distance)

    • get preferredAreaMode(): AreaMode

      The mode as chosen, which may not be in force (areaMode is the one in force)

      Returns AreaMode

    • get snapsToVertices(): boolean

      Returns boolean

      Whether the points of this measurement snap to vertices and edges (point, length, area, angle)

    Methods

    • Returns boolean

      Whether finish() would complete this measurement now (enough points for a length or an area)

    • Advance to the next mode that applies here, in the order gross, net, hull. This is what the "toggleAreaHoles" key does

      Returns AreaMode

      The mode now in force, or null when this measurement has neither openings nor a concave ring and there was nothing to switch to

    • Returns vec3[] | null

      The points (viewer measurement coordinates) a camera fit on this measurement encloses, or null when it has none yet

    • Returns boolean

      Whether this measurement is hovered

    • Returns boolean

      Whether this measurement is selected

    • While the measurement is being taken: choose the mode, also one that does not apply yet. It takes effect on the face that is clicked, or once a ring drawn by hand turns concave (hull)

      Parameters

      Returns boolean

      False for a finished measurement (use setAreaMode) or a value that is not a mode

    • Returns void

      Remove this Measurement

    • Returns boolean

      Whether the polygon self-intersects. The area label is hidden in the 3D view while this is the case

    • Put this measurement in one of the three modes

      Parameters

      • mode: boolean | AreaMode

        The mode, or the boolean that predates the third one (true meaning "net")

      Returns boolean

      False when the mode does not apply here: "net" without openings to subtract, or "hull" over an already convex ring

    • Switch between gross and net. Predates the third mode, setAreaMode is the general form

      Parameters

      • net: boolean

        Whether the openings should be subtracted

      Returns boolean

      False when there is nothing to subtract, i.e. the face has no openings or the polygon was drawn by hand

    • Remove the last placed point while this measurement is being taken, see Measuring.undoLastPoint

      Returns boolean

      Whether a point was taken back