GLDraw

Source: GLDraw.ts

Lower level utilities for creating WebGL shape geometries.
These are not intended for general consumption.


Static Methods

drawCone( geo: Geometry, from: Point, to: Point, radius: number, color: Color, )

static
GLDraw.ts

Create a cone

Parameters

  • geo (Geometry)
  • from (Point)
  • to (Point)
  • radius (number)
  • color (Color)

drawCylinder( geo: Geometry, from: Point, to: Point, radius: number, color: Color, fromCap: CAP, toCap: CAP, )

static
GLDraw.ts

Create a cylinder

Parameters

  • geo (Geometry)
  • from (Point)
  • to (Point)
  • radius (number)
  • color (Color)
  • fromCap (CAP, default: 0) — 0 for none, 1 for flat, 2 for round
  • toCap (CAP, default: 0) — = 0 for none, 1 for flat, 2 for round

drawSphere( geo: Geometry, pos: Point, radius: number, color: Color, sphereQuality: number, )

static
GLDraw.ts

Create a sphere.

Parameters

  • geo (Geometry)
  • pos (Point)
  • radius (number)
  • color (Color)
  • sphereQuality (number) — Quality of sphere (default 2, higher increases number of triangles)

drawTorus( geo: Geometry, center: Point, normal: Point, majorRadius: number, minorRadius: number, color: Colored, majorSegments: number, minorSegments: number, )

static
GLDraw.ts

Draw a torus (ring/donut shape) for aromatic ring visualization.

Parameters

  • geo (Geometry) — Target geometry
  • center (Point) — Center of the torus
  • normal (Point) — Normal vector to the ring plane
  • majorRadius (number) — Radius from center to tube center
  • minorRadius (number) — Radius of the tube cross-section
  • color (Colored) — Color of the torus
  • majorSegments (number, default: 16) — Segments around the ring (default 16)
  • minorSegments (number, default: 4) — Segments around the tube (default 4)