carputils.mesh.generate

orphan:

carputils.mesh.generate(geom, dirname=None, rootdir='meshes')

Generate the specified geometry, unless it already exists.

This function checks whether the specified mesh already exists, and simply returns it base name if so. Otherwise, the mesh is generated in a new and uniquely named mesh directory, and the base name of this mesh is then returned. This currently only works with carputils.mesh.Block.

To use:

>>> from carputils.mesh import Block, generate
>>> geom = Block(size=(2,2,2))
>>> meshname = generate(geom)
Args:
generate: Block
The geometry to generate
rootdir : str, optional
The parent directory to store and search for meshes, defaults to ‘meshes’
Returns:
str
The mesh base name of the requested name