IGLMeshVs
Module: meshvs
GPU mesh wrapper for creating mesh presentations in OpenGL.
Supports rendering of triangles (non-indexed) and lines (non-indexed)
__init__
method
__init__(self, vertices, normals, indices, values, primitive)
Initializes the IGLMeshVs object with mesh data and prepares for GPU rendering.
Args
| Name | Type | Description |
|---|---|---|
| vertices | Array-like of vertex positions, shape (N, 3), where N is the number of vertices. | |
| indices | Optional array-like of triangle indices, shape (M, 3) or flattened (M*3,), for indexed meshes. | |
| face_ids | Optional array-like of face IDs, shape (M,), for picking support. | |
| values | Optional array-like of scalar values, shape (M,), for contouring. | |
| primitive | Rendering primitive type, either "triangles" or "lines". Defaults to "triangles". |
_build
method
_build(self)
draw
method
draw(self)
Renders the mesh using OpenGL draw calls.
Builds VAOs and VBOs if not already created. Supports triangles and lines primitives.
UpdateVertices
method
UpdateVertices(self, vertices)
UpdateScalars
method
UpdateScalars(self, scalars)
BindLUTTexture
method
BindLUTTexture(self, shader, texture)
Binds textures for contour visualization if applicable.
Args
| Name | Type | Description |
|---|---|---|
| shader | The shader program to which textures should be bound. |
UpdateDisplacements
method
UpdateDisplacements(self, displacements)
Parameters
| Name | Type | Description |
|---|---|---|
| displacements | np.ndarray | shape = (N,3) dtype = float32 |
delete
method
delete(self)
Cleans up OpenGL resources by deleting VAOs and VBOs.