editor › Globals › LineVisualizationHelper
Class: LineVisualizationHelper
Hierarchy
- LineVisualizationHelper
Index
Methods
Methods
Static addLine
▸ addLine(lastPoint: Vector3, nextPoint: Vector3, mesh: Mesh, color: Color, lineThickness: number, usePrettierLines: boolean): ThreeMesh
Defined in src/util/LineVisualizationHelper.ts:66
Add a new line to an already existing mesh.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
lastPoint |
Vector3 | - | line starting point, already part of the mesh |
nextPoint |
Vector3 | - | line ending point, not part of the mesh yet |
mesh |
Mesh | - | mesh to be modified |
color |
Color | - | line color |
lineThickness |
number | - | - |
usePrettierLines |
boolean | true | make edges smooth It returns a ThreeMesh, to make it visible, you have to add it to a threeNode. |
Returns: ThreeMesh
Static renderLine
▸ renderLine(start: Vector3, end: Vector3, color: Color, thickness: number): ThreeMesh
Defined in src/util/LineVisualizationHelper.ts:13
This renders a line as a cylinder with 8 sides. It returns a ThreeMesh, to make it visible, you have to add it to a threeNode.
Parameters:
| Name | Type |
|---|---|
start |
Vector3 |
end |
Vector3 |
color |
Color |
thickness |
number |
Returns: ThreeMesh
Static renderPoint
▸ renderPoint(center: Vector3, color: Color, thickness: number): ThreeMesh
Defined in src/util/LineVisualizationHelper.ts:21
This renders a point as a sphere. It returns a ThreeMesh, to make it visible, you have to add it to a threeNode.
Parameters:
| Name | Type |
|---|---|
center |
Vector3 |
color |
Color |
thickness |
number |
Returns: ThreeMesh
Static renderPrettyLine
▸ renderPrettyLine(start: Vector3, end: Vector3, color: Color, thickness: number, roundBothEdges: boolean): ThreeMesh[]
Defined in src/util/LineVisualizationHelper.ts:40
This renders a line as a sphere and a cylinder. That way, you get smooth edges when you build a line out of multiple segments. +----------------+ xxxx----------------+ | xxx | xxx +------+ x | ==> | | | | +----------+ | +----------+ | | | | | | | | | | | | | | | | + + + +
Parameters:
| Name | Type | Default |
|---|---|---|
start |
Vector3 | - |
end |
Vector3 | - |
color |
Color | - |
thickness |
number | - |
roundBothEdges |
boolean | false |
Returns: ThreeMesh[]