MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / write_obj

Function write_obj

eval_code/recons/models/moge/utils3d/io/obj.py:112–124  ·  view source on GitHub ↗
(
        file: Union[str, Path],
        obj: Dict[str, Any],
        encoding: Union[str, None] = None
    )

Source from the content-addressed store, hash-verified

110
111
112def write_obj(
113 file: Union[str, Path],
114 obj: Dict[str, Any],
115 encoding: Union[str, None] = None
116 ):
117 with open(file, 'w', encoding=encoding) as fp:
118 for k in ['v', 'vt', 'vn', 'vp']:
119 if k not in obj:
120 continue
121 for v in obj[k]:
122 print(k, *map(float, v), file=fp)
123 for f in obj['f']:
124 print('f', *((str('/').join(map(int, i)) if isinstance(int(i), Iterable) else i) for i in f), file=fp)
125
126
127def simple_write_obj(

Callers

nothing calls this directly

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected