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.tsCreate 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.tsCreate 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 roundtoCap(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.tsCreate 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.tsDraw a torus (ring/donut shape) for aromatic ring visualization.
Parameters
geo(Geometry) — Target geometrycenter(Point) — Center of the torusnormal(Point) — Normal vector to the ring planemajorRadius(number) — Radius from center to tube centerminorRadius(number) — Radius of the tube cross-sectioncolor(Colored) — Color of the torusmajorSegments(number, default: 16) — Segments around the ring (default 16)minorSegments(number, default: 4) — Segments around the tube (default 4)