Write wavefront .obj file, without preprocessing. Args: vertices (np.ndarray): [N, 3] faces (np.ndarray): [T, 3] file (Any): filepath encoding (str, optional):
(
file: Union[str, Path],
vertices: np.ndarray,
faces: np.ndarray,
encoding: Union[str, None] = None
)
| 125 | |
| 126 | |
| 127 | def simple_write_obj( |
| 128 | file: Union[str, Path], |
| 129 | vertices: np.ndarray, |
| 130 | faces: np.ndarray, |
| 131 | encoding: Union[str, None] = None |
| 132 | ): |
| 133 | """ |
| 134 | Write wavefront .obj file, without preprocessing. |
| 135 | |
| 136 | Args: |
| 137 | vertices (np.ndarray): [N, 3] |
| 138 | faces (np.ndarray): [T, 3] |
| 139 | file (Any): filepath |
| 140 | encoding (str, optional): |
| 141 | """ |
| 142 | with open(file, 'w', encoding=encoding) as fp: |
| 143 | for v in vertices: |
| 144 | print('v', *map(float, v), file=fp) |
| 145 | for f in faces: |
| 146 | print('f', *map(int, f + 1), file=fp) |
nothing calls this directly
no outgoing calls
no test coverage detected