ThreePipe
    Preparing search index...

    Class LineHelper

    Visualizes line/curve geometry with small cube handles at vertices or control points. When the line has geometry.userData.generationParams.curve, creates interactive draggable handles for editing curve control points. See https://threepipe.org/notes/widgets-and-helpers for the full widget system documentation.

    Hierarchy (View Summary)

    Index
    _sChildren?: Object3D<Object3DEventMap>[]

    If this is present, only the objects in this array will be saved in the glb/gltf files, and the object.children array will be ignored. The other properties are expected to be loaded/filled at runtime by default values or from an external asset loaded from IImportResultUserData.rootPath.

    • for embedded objects.
    assetType: "widget" = ...
    autoUpgradeChildren: boolean = false

    Array with object's children.

    THREE.Object3DGroup | Group for info on manually grouping objects.

    []

    color: ColorRepresentation | undefined

    The colour of the lines. When not set: the colour of the light for a light, else the colour of the kind (widgetKinds). A change redraws the widget.

    editableHandleColor: number = 0xEF0065
    editableHandleSize: number = 0.1
    geometry: undefined
    getObjectById: (
        id: number,
    ) =>
        | IObject3D<
            IObject3DEventMap,
            IGeometry<NormalBufferAttributes, BufferGeometryEventMap>
            | undefined,
            IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[] | undefined,
        >
        | undefined

    Searches through an object and its children, starting with the object itself, and returns the first with a matching id.

    Type Declaration

    Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.

    id

    getObjectByName: (
        name: string,
    ) =>
        | IObject3D<
            IObject3DEventMap,
            IGeometry<NormalBufferAttributes, BufferGeometryEventMap>
            | undefined,
            IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[] | undefined,
        >
        | undefined

    Searches through an object and its children, starting with the object itself, and returns the first with a matching name.

    Type Declaration

    Note that for most objects the name is an empty string by default You will have to set it manually to make use of this method.

    getObjectByProperty: (
        name: string,
        value: string,
    ) =>
        | IObject3D<
            IObject3DEventMap,
            IGeometry<NormalBufferAttributes, BufferGeometryEventMap>
            | undefined,
            IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[] | undefined,
        >
        | undefined

    Searches through an object and its children, starting with the object itself, and returns the first with a property that matches the value given.

    Type Declaration

    handleColor: number = 0x0093FD
    handleSize: number = 0.05
    icon: WidgetIcon | undefined

    The icon of the object: a sprite that keeps its size in pixels, drawn on top. Made when the icon is shown (hasIcon) and iconMode is sprite.

    iconMode: WidgetIconMode = 'sprite'

    How the icon is drawn. sprite: the widget has an icon sprite in the scene. dom: the widget has no sprite, and a DOM overlay draws the icon (WidgetIconOverlay, made by Object3DWidgetsPlugin); a widget used without the plugin then shows no icon. Set for all widgets with Object3DWidgetsPlugin.iconMode.

    iconSize: number = 22

    The diameter of the icon in CSS pixels. Set for all widgets with Object3DWidgetsPlugin.iconSize.

    isWidget: true = ...
    kind: WidgetKind | undefined

    The kind of the attached object (a light or a camera kind), for the colour of the lines and the icon. undefined for other objects; those widgets have no icon.

    line: LineType
    material: undefined
    object: Object3D<Object3DEventMap> & IUiConfigContainer<any, string> | undefined
    parent:
        | IObject3D<
            IObject3DEventMap,
            IGeometry<NormalBufferAttributes, BufferGeometryEventMap>
            | undefined,
            IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[] | undefined,
        >
        | null

    Object's parent in the scene graph.

    An object can have at most one parent.

    null

    refreshUi: (this: IObject3D) => void = iObjectCommons.refreshUi
    setDirty: (
        this: IObject3D,
        options?: IObjectSetDirtyOptions,
        ...args: any[],
    ) => void = iObjectCommons.setDirty

    Dispatches 'objectUpdate' event on object.

    showIcon: boolean = true

    Show the icon of the object (only for objects with a kind). Set for all widgets with Object3DWidgetsPlugin.showIcons.

    traverse: (callback: (object: IObject3D) => void) => void

    Executes the callback on this object and all descendants.

    Type Declaration

      • (callback: (object: IObject3D) => void): void
      • Parameters

        • callback: (object: IObject3D) => void

          A function with as first argument an Object3D object.

        Returns void

    Note: Modifying the scene graph inside the callback is discouraged.

    traverseAncestors: (callback: (object: IObject3D) => void) => void

    Executes the callback on all ancestors.

    Type Declaration

      • (callback: (object: IObject3D) => void): void
      • Parameters

        • callback: (object: IObject3D) => void

          A function with as first argument an Object3D object.

        Returns void

    Note: Modifying the scene graph inside the callback is discouraged.

    traverseVisible: (callback: (object: IObject3D) => void) => void

    Like traverse, but the callback will only be executed for visible objects

    Type Declaration

      • (callback: (object: IObject3D) => void): void
      • Parameters

        • callback: (object: IObject3D) => void

          A function with as first argument an Object3D object.

        Returns void

    Descendants of invisible objects are not traversed. Note: Modifying the scene graph inside the callback is discouraged.

    uiConfig: UiObjectConfig<any, string, any> = ...

    An object that can be used to store custom data about the Object3D.

    It should not hold references to functions as these will not be cloned.

    {}

    visible: boolean = true

    Object gets rendered if true.

    true

    • get hasIcon(): boolean

      Whether the icon is shown: the widget is attached to an object with a kind and showIcon is on. The visibility of the widget and its parents applies on top of it.

      Returns boolean

    • get modelObject(): this

      Returns this

      use this instead