PartLines

class cee.mrk.PartLines()

A part that can show lines in a MarkupModel.

Use MarkupModel.addLinesPart to create a new instance of this class.


Accessors

PartLines.color()

The single color of the part

Return type:Color3Like
PartLines.color(color)
Arguments:
  • color (Color3Like) – None
Return type:

void

PartLines.customData()

Custom data for the part. This field is not used by EnvisionWeb.

Return type:any
PartLines.customData(data)
Arguments:
  • data (any) – None
Return type:

void

PartLines.lineWidth()

Controls the line width (pixels)

Return type:number
PartLines.lineWidth(width)
Arguments:
  • width (number) – None
Return type:

void

PartLines.terminatorDrawMode()

The line terminator draw mode

Return type:LineTerminatorDrawMode
PartLines.terminatorDrawMode(drawMode)
Arguments:
  • drawMode (LineTerminatorDrawMode) – None
Return type:

void

Methods

clearTerminators

PartLines.clearTerminators()

Clear start and end terminators

Return type:void

rayIntersect

PartLines.rayIntersect(ray, hitItem)
Arguments:

Picking

Return type:boolean

setArrowEndTerminator

PartLines.setArrowEndTerminator(arrowHeadLengthInPixels, arrowHeadWidthInPixels)
Arguments:
  • arrowHeadLengthInPixels (number) – None
  • arrowHeadWidthInPixels (number) – None

Draw arrows at end of lines

Return type:void

setArrowStartTerminator

PartLines.setArrowStartTerminator(arrowHeadLengthInPixels, arrowHeadWidthInPixels)
Arguments:
  • arrowHeadLengthInPixels (number) – None
  • arrowHeadWidthInPixels (number) – None

Draw arrows at start of lines

Return type:void

setBarEndTerminator

PartLines.setBarEndTerminator(lengthInPixels)
Arguments:
  • lengthInPixels (number) – None

Draw bars at end of lines

Return type:void

setBarStartTerminator

PartLines.setBarStartTerminator(lengthInPixels)
Arguments:
  • lengthInPixels (number) – None

Draw bars at start of lines

Return type:void

setVertices

PartLines.setVertices(vertices)
Arguments:
  • vertices (ArrayLike) – None

Sets the vertices for the lines.

The coordinates need to be interleaved (x0, y0, z0, x1, y1, z1, …)

Lines will be drawn between [x0, y0, z0] and [x1, y1, z1], and between [x2, y2, z2] and [x3, y3, z3], …, so the number of lines will be vertices.length / 6.

In order to draw a continuous path connecting all the given points, use utils.PathGenerator:

const mrkModel = new cee.mrk.MarkupModel();
const partLines = mrkModel.addLinesPart();
const points: cee.Vec3[] = [ ... ];
const vertices = cee.utils.PathGenerator.generateVerticesForPath(points);
partLines.setVertices(vertices);
Return type:void

setVerticesFloat32Array

PartLines.setVerticesFloat32Array(vertices)
Arguments:
  • vertices (Float32Array) – None

Sets the vertices for the lines from a Float32Array.

The coordinates need to be interleaved (x0, y0, z0, x1, y1, z1, …)

This is the most optimal setting as the PartLines will just hold a reference to the passed array and not copy any data.

Lines will be drawn between [x0, y0, z0] and [x1, y1, z1], and between [x2, y2, z2] and [x3, y3, z3], …, so the number of lines will be vertices.length / 6.

Return type:void