WasmGPU.geometry.line¶
Summary¶
WasmGPU.geometry.line builds geometry data for a primitive or procedural shape. The returned Geometry can be reused by multiple meshes.
Syntax¶
WasmGPU.geometry.line(length?: number, thickness?: number, plane?: "xy" | "xz" | "yz", doubleSided?: boolean): Geometry
const result = wgpu.geometry.line(length, thickness, plane, doubleSided);
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
length |
number |
No | Numeric input controlling length for this operation. |
thickness |
number |
No | Numeric input controlling thickness for this operation. |
plane |
"xy" \| "xz" \| "yz" |
No | Plane in which 2D procedural geometry is embedded (xy, xz, or yz). |
doubleSided |
boolean |
No | Boolean flag that toggles doubleSided behavior. |
Returns¶
Geometry - Generated Geometry object containing vertex/index data and computed bounds.
Type Details¶
Example¶
const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);
const length = 1;
const thickness = 1;
const plane = {};
const doubleSided = true;
const result = wgpu.geometry.line(length, thickness, plane, doubleSided);
console.log(result);
See Also¶
- WasmGPU.geometry.box
- WasmGPU.geometry.cartesianCurve
- WasmGPU.geometry.cartesianSurface
- WasmGPU.geometry.circle
- WasmGPU.geometry.custom
- WasmGPU.geometry.cylinder
- WasmGPU.geometry.ellipse
- WasmGPU.geometry.parametricCurve
- WasmGPU.geometry.parametricSurface
- WasmGPU.geometry.plane
- WasmGPU.geometry.point
- WasmGPU.geometry.prism