mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
Add imports for typing, add spacing
CURA-7541
This commit is contained in:
parent
736988da7c
commit
092dd8a918
@ -2,7 +2,7 @@
|
|||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
from typing import Optional, List
|
from typing import Optional, List, TextIO
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Used to reduce the size of obj files used for printer platform models.
|
Used to reduce the size of obj files used for printer platform models.
|
||||||
@ -12,6 +12,7 @@ from typing import Optional, List
|
|||||||
Removes any rows that are not a face, vertex or vertex texture
|
Removes any rows that are not a face, vertex or vertex texture
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def process_obj(input_file: str, output_file: str) -> None:
|
def process_obj(input_file: str, output_file: str) -> None:
|
||||||
with open(input_file, "r") as in_obj, open("temp", "w") as temp:
|
with open(input_file, "r") as in_obj, open("temp", "w") as temp:
|
||||||
trim_lines(in_obj, temp)
|
trim_lines(in_obj, temp)
|
||||||
@ -68,6 +69,7 @@ def trim_vertex_texture(values: List[str]) -> str:
|
|||||||
values[i + 1] = str(float(coordinate))
|
values[i + 1] = str(float(coordinate))
|
||||||
return " ".join(values)
|
return " ".join(values)
|
||||||
|
|
||||||
|
|
||||||
def merge_duplicate_vt(in_obj, out_obj):
|
def merge_duplicate_vt(in_obj, out_obj):
|
||||||
# Removes duplicate vertex texture ("vt")
|
# Removes duplicate vertex texture ("vt")
|
||||||
# Points references to all deleted copies in face ("f") to a single vertex texture
|
# Points references to all deleted copies in face ("f") to a single vertex texture
|
||||||
|
Loading…
x
Reference in New Issue
Block a user