Skip to content

Commit

Permalink
NF: geometry & mesh
Browse files Browse the repository at this point in the history
  • Loading branch information
m-agour committed Dec 7, 2024
1 parent 7cc0ebb commit 62cafe7
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions fury/actor/geometry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from pygfx import Geometry, Mesh


def buffer_to_geometry(positions, **kwargs):
"""
Convert a buffer to a geometry object.
Parameters
----------
positions : array_like
The positions buffer.
kwargs : dict
A dict of attributes to define on the geometry object. Keys can be "colors", "normals", "texcoords",
"indices", ...
"""
geo = Geometry(positions=positions, **kwargs)
return geo


def create_mesh(geometry, material):
"""
Create a mesh object.
Parameters
----------
geometry : Geometry
The geometry object.
material : Material
The material object.
"""
mesh = Mesh(geometry=geometry, material=material)
return mesh

0 comments on commit 62cafe7

Please sign in to comment.