selection_lasso

Selects the nodes inside the CSS-pixel polygon points ([x, y] pairs, at least 3, implicitly closed; the even-odd rule, on pixel centres for what is drawn). rule, through, mode and limit as for selection_marquee. Returns { nodeIds: whole node selection, elements?, hit, truncated? }.

CommandAsync

Usage

TypeScript
await surface.executeAsync('selection_lasso', { points, additive?, mode?, rule?, through?, level?, limit? })

Parameters

  • pointsnumber[][]

    Required

  • additiveboolean

    add to the selection instead of replacing it; the same as mode 'add'

    Optional

  • mode"replace" | "add" | "remove" | "toggle"

    how the given ids or targets change the selection (default 'replace'); not with additive

    Optional

  • rule"crossing" | "window"

    'crossing' (default) selects what touches the region, 'window' what lies wholly inside it

    Optional

  • throughboolean

    select through the scene, hidden-behind geometry included (default false: what is drawn)

    Optional

  • level"object" | "face" | "edge" | "point"

    what the region selects: nodes ('object') or elements ('face', 'edge', 'point') into the element selection. Omitted, the slot's level

    Optional

  • limitinteger

    the most ids in hit at the object level, the most elements at an element level (default 100000); truncated: true past it

    Optional

Returns

object with nodeIds, elements, hit, truncated, in the ok: true envelope.

JSON
{
  "type": "object",
  "properties": {
    "nodeIds": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "elements": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "nodeId": {
            "type": "string"
          },
          "elements": {
            "type": "object",
            "properties": {
              "domain": {
                "type": "string",
                "enum": [
                  "point",
                  "edge",
                  "face",
                  "curve",
                  "topology-edge"
                ]
              },
              "ids": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": -2147483648,
                  "maximum": 2147483647
                }
              },
              "from": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": -2147483648,
                  "maximum": 2147483647
                }
              },
              "handleId": {
                "type": "string"
              }
            },
            "required": [
              "domain",
              "ids",
              "handleId"
            ]
          }
        },
        "required": [
          "nodeId",
          "elements"
        ]
      }
    },
    "hit": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "truncated": {
      "type": "boolean"
    }
  },
  "required": [
    "nodeIds",
    "hit"
  ]
}

See also