Documentation - v20.0.0-dev
    Preparing search index...

    An object of a MeshController, as addMeshes returns it and its hits give it back (MeshHit.mesh): reads and changes its object's state in the controller, which holds it (no state of its own). Removed (removeMeshes, clear), it is no longer isValid: its setters do nothing, its getters throw.

    The changes are as fast one object at a time as many at once: the tree's commands of a task are merged (see BoxTree).

    Index

    Properties

    isMeshProxy: true
    owner: unknown = null

    The application's object for this one, free (e.g. the viewer's mesh): set it when the object is added, read it back from a hit. Cleared when the object is removed.

    Accessors

    • get active(): boolean

      Whether it is in the BoxTree: bounded, culled in and picked (see MeshController.setActive).

      Returns boolean

    • set active(active: boolean): void

      Parameters

      • active: boolean

      Returns void

    • get edgesVisible(): boolean

      Whether its sharp edges are drawn (default; the scene's settings.meshes.edgesPassEnabled drawing any): without, only its faces and its lines are.

      Returns boolean

    • set edgesVisible(visible: boolean): void

      Parameters

      • visible: boolean

      Returns void

    • get facesVisible(): boolean

      Whether its faces are drawn (default): without, only its sharp edges and its lines are (e.g. a wireframe). Culled and picked as shown either way.

      Returns boolean

    • set facesVisible(visible: boolean): void

      Parameters

      • visible: boolean

      Returns void

    • get ignoreCuttingPlanes(): boolean

      Whether it is left whole whatever the scene's cutting planes (see CuttingPlanesController): every part drawn, culled and picked as without planes.

      Returns boolean

    • set ignoreCuttingPlanes(ignore: boolean): void

      Parameters

      • ignore: boolean

      Returns void

    • get isValid(): boolean

      Whether its object is still in the controller.

      Returns boolean

    • get layer(): MeshLayer

      Returns MeshLayer

    • set layer(layer: MeshLayer): void

      Parameters

      Returns void

    • get partCount(): number

      How many parts its object has.

      Returns number

    • get selected(): boolean

      Whether it is selected: every part drawn in the selection colours, and in the top layer with the controller's selectionOverlay.

      Returns boolean

    • set selected(selected: boolean): void

      Parameters

      • selected: boolean

      Returns void

    • get visible(): boolean

      Whether it is shown: every part.

      Returns boolean

    • set visible(visible: boolean): void

      Parameters

      • visible: boolean

      Returns void

    • get xRay(): boolean

      Whether it is seen through: the opacity of every part and its edges' multiplied by the controller's xRayOpacity, its own opacity kept.

      Returns boolean

    • set xRay(xRay: boolean): void

      Parameters

      • xRay: boolean

      Returns void

    Methods

    • Moves it: applies transform (affine) to the world matrix of every part, or of its part at rank part. Composes, where setMatrix places.

      Parameters

      • transform: Matrix4
      • Optionalpart: number

      Returns void

    • A helper drawing its normals, for debugging (see MeshController.createNormalsHelper).

      Parameters

      • size: number = 1

        The length of a normal, in world units.

      Returns MeshNormalsHelper

    • World bounds, written to target: the union of its parts' boxes, or the box of its part at rank part.

      Parameters

      • target: Box3
      • Optionalpart: number

      Returns Box3

    • Diffuse colour of its part at rank part (its first by default), written to target.

      Parameters

      • target: Color
      • part: number = 0

      Returns Color

    • Colour of the sharp edges of its part at rank part (its first by default), written to target.

      Parameters

      • target: Color
      • part: number = 0

      Returns Color

    • Emissive colour of its part at rank part (its first by default), written to target.

      Parameters

      • target: Color
      • part: number = 0

      Returns Color

    • Dash and gap of the ribbons of its part at rank part, in pixels: both 0 when solid, or 1 pixel wide.

      Parameters

      • part: number = 0

      Returns Pick<LineStyle, "dash" | "gap">

    • Style of the segments of its part at rank part (its first by default): its lines, or the sharp edges of a part of triangles (see LineStyle); null when drawn 1 pixel wide.

      Parameters

      • part: number = 0

      Returns LineStyle | null

    • Width of the ribbons of its part at rank part, in pixels; 0 when 1 pixel wide.

      Parameters

      • part: number = 0

      Returns number

    • The name of the material of its part at rank part (its first by default); null without.

      Parameters

      • part: number = 0

      Returns string | null

    • World matrix of its part at rank part (its first by default), written to target.

      Parameters

      Returns Matrix4

    • Metalness, in 0..1, of its part at rank part (its first by default).

      Parameters

      • part: number = 0

      Returns number

    • Opacity, in 0..1, of its part at rank part (its first by default).

      Parameters

      • part: number = 0

      Returns number

    • The geometry its part at rank part (its first by default) draws.

      Parameters

      • part: number = 0

      Returns MeshPartGeometry

    • Roughness, in 0..1, of its part at rank part (its first by default).

      Parameters

      • part: number = 0

      Returns number

    • Projects point on the segments of its part at rank part (its first by default): the sharp edges of its triangles, or its lines. The nearest point within maxDistance of it, each segment's ends left out (kept between 5 % and 95 % of the segment), e.g. to snap a point picked on the part to its nearest edge.

      Parameters

      • point: Vector3

        World frame, e.g. a hit's point.

      • maxDistance: number

        In world units, from point to its projection.

      • target: Vector3

        The projection, world frame; unchanged when none.

      • part: number = 0

      Returns boolean

      Whether a segment is within maxDistance.

    • Sets the diffuse colour (stored as 8-bit sRGB) of every part, or of its part at part.

      Parameters

      • color: Color
      • Optionalpart: number

      Returns void

    • Sets the colour of the sharp edges (8-bit sRGB) of every part, or of its part at part.

      Parameters

      • color: Color
      • Optionalpart: number

      Returns void

    • Sets the emissive colour (stored as 8-bit sRGB) of every part, or of its part at part.

      Parameters

      • color: Color
      • Optionalpart: number

      Returns void

    • Dashes the ribbons of every part, or of its part at rank part: dash long, gap apart, in pixels (0 for either: solid); the dashes restart at each segment.

      Parameters

      • dash: number
      • gap: number
      • Optionalpart: number

      Returns void

      For a part drawn 1 pixel wide: give it a width first (setLineWidth).

    • Sets the style of the segments of every part, or of its part at rank part: the lines of a line part, the sharp edges of a part of triangles, as ribbons of a width and dashes; null: 1 pixel wide.

      Parameters

      Returns void

      A RangeError for an invalid style (a width not above 0, a negative dash or gap).

    • Sets the width of the ribbons of every part, or of its part at rank part, in pixels: above 0, drawn as ribbons, each part keeping its dashes; 0, back to 1 pixel wide, its dashes dropped.

      Parameters

      • width: number
      • Optionalpart: number

      Returns void

    • Places it: sets the world matrix (affine) of every part, or of its part at rank part, to matrix. Absolute, where applyMatrix4 composes.

      Parameters

      • matrix: Matrix4
      • Optionalpart: number

      Returns void

    • Sets the metalness, in 0..1, of every part, or of its part at rank part.

      Parameters

      • metalness: number
      • Optionalpart: number

      Returns void

    • Sets the opacity, in 0..1, of every part, or of its part at rank part.

      Parameters

      • opacity: number
      • Optionalpart: number

      Returns void

    • Sets the roughness, in 0..1, of every part, or of its part at rank part.

      Parameters

      • roughness: number
      • Optionalpart: number

      Returns void