Mesher

class Mesher.Mesher(projdir)[source]

Bases: object

Mesher is a python class designed to be run as a subprocess. It uses the pymeshlab library to create the mesh, subdivide the mesh into tiles until each tile has less than 50k verticies, generate textures, and create a low polygon mesh for the entire model.

Parameters:

projdir (pathlib.Path) – Project directory containing .vrp file.

_crop()[source]

Helper function for cropping any extra points added to the mesh which lie outside the bounds of the original point cloud.

_quad_slice(minx, maxx, miny, maxy)[source]

Recursive helper method for subdividing mesh into tiles. Once a tile is below 50k verticies, it generates a texture and export. The passed values allow the method to recurse on smaller portions of the mesh. Bounds are inclusive.

Note

Exported tiles save to the out folder in the current project directory. Their names follow the “tile_#.obj” format, where # is a number that distinguishes the tiles from each other.

Parameters:
  • minx (float) – minimum x axis bound.

  • maxx (float) – maximum x axis bound.

  • miny (float) – minimum y axis bound.

  • maxy (float) – maximum y axis bound.

dense2mesh()[source]

Function to generate tiles with textures as well as a low poly mesh. After being started in main, it runs different pymeshlab functions while updating the progress bar for each one.