Lines

The viewer provides OccViewer.InteractiveLine allowing users to create and manipulate 3D line segments in a viewer. It supports customization of line properties such as type, width, and markers.

// line creation
const line = new InteractiveLine(Viewer);
line.pointFrom = {x: 0, y: 0, z: 0};
line.pointTo = {x: 100, y: 0, z: 0};
line.color = '#ff0000ff';

Points/Button

The viewer provides OccViewer.InteractivePoint allowing:

  • Create and position 3D points in the viewer.
  • Customize the appearance of points with icons, sizes, and other properties.
  • Load and display images associated with the point.
  • Define the point�s orientation with normals and up directions.
  • Use interactive points as buttons, which can trigger actions when clicked, based on the icon and behavior defined by the user.
// point creation
const point = new InteractivePoint(Viewer);
point.iconId = ButtonIconId.Sphere;
point.size = 1.0;
point.zLayer = ZLayerId.TopOSD;

Text

The viewer provides OccViewer.InteractiveText allowing users to create and manage 3D text labels within the viewer. These labels can be positioned, customized with text, and optionally wrapped based on specified length.

// text creation
const text = new InteractiveText(Viewer);
text.text = 'Text Example';
text.textWrapping = -1.0;
text.position = {x: 0.0, y: 0.0, z: 50.0};
text.color = '#ff0000';