omf_io.surface.surface.SurfaceIO

class omf_io.surface.surface.SurfaceIO(surface_data)[source]

Handles the creation and consumption of surface (wireframe) objects.

__init__(surface_data)[source]

Initialize the SurfaceIO instance.

Parameters:

surface_data (dict) – The surface data containing ‘vertices’ and ‘faces’.

Methods

__init__(surface_data)

Initialize the SurfaceIO instance.

from_obj(obj_file)

Create a SurfaceIO instance from an OBJ file.

from_ply_ascii(ply_file)

Create a SurfaceIO instance from an ASCII PLY file.

from_ply_binary(ply_file)

Create a SurfaceIO instance from a binary PLY file.

to_obj(output_file)

Export the surface data to an OBJ file.

to_ply_ascii(output_file)

Export the surface data to an ASCII PLY file.

to_ply_binary(output_file)

Export the surface data to a binary PLY file.

classmethod from_obj(obj_file)[source]

Create a SurfaceIO instance from an OBJ file.

Parameters:

obj_file (Path) – The input OBJ file path.

Returns:

An instance of the class.

Return type:

SurfaceIO

classmethod from_ply_ascii(ply_file)[source]

Create a SurfaceIO instance from an ASCII PLY file.

Parameters:

ply_file (Path) – The input PLY file path.

Returns:

An instance of the class.

Return type:

SurfaceIO

classmethod from_ply_binary(ply_file)[source]

Create a SurfaceIO instance from a binary PLY file.

Parameters:

ply_file (Path) – The input PLY file path.

Returns:

An instance of the class.

Return type:

SurfaceIO

to_obj(output_file)[source]

Export the surface data to an OBJ file.

Parameters:

output_file (Path) – The output OBJ file path.

to_ply_ascii(output_file)[source]

Export the surface data to an ASCII PLY file.

Parameters:

output_file (Path) – The output PLY file path.

to_ply_binary(output_file)[source]

Export the surface data to a binary PLY file.

Parameters:

output_file (Path) – The output PLY file path.