Skip to content

Commit

Permalink
revert accidential obj commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedh committed Nov 21, 2024
1 parent f70d345 commit 44713f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
24 changes: 3 additions & 21 deletions trimesh/exchange/obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,10 @@ def _parse_faces_fallback(lines):
for line in lines:
# remove leading newlines then
# take first bit before newline then split by whitespace
split = line.strip().split("\n", 1)[0].split()
split = line.strip().split("\n")[0].split()
# split into: ['76/558/76', '498/265/498', '456/267/456']
len_split = len(split)
if len_split == 3:
# just a triangle
pass
elif len_split == 4:
# triangulate quad face
Expand All @@ -470,33 +469,16 @@ def _parse_faces_fallback(lines):
collect = []
# we need a flat list so append inside
# a list comprehension

fans = util.triangle_fans_to_faces([np.arange(len(split))])

collect_append = collect.append
[
[
collect_append(split[0]),
collect_append(split[i + 1]),
collect_append(split[i + 2]),
]
for i in range(len(split) -2)
for i in range(len(split) - 2)
]


# c2 = [[0, i+1, i+2] for i in range(len(split)-2)]

# since we're not allowed to insert new vertices
# create a triangle fan for each boundary curve
#p = np.arange(len(split))
#fan = np.column_stack((np.ones(len(p) - 3, dtype=int) * p[0], p[1:-2], p[2:-1]))

#from IPython import embed
#embed()


# split = collect
split = [split[i] for i in fans.reshape(-1)]
split = collect
else:
log.debug(f"face needs more values 3>{len(split)} skipping!")
continue
Expand Down
2 changes: 1 addition & 1 deletion trimesh/path/exchange/load.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from ... import util
from ...exchange.ply import load_ply
from ..path import Path
from ...typed import Optional
from ..path import Path
from . import misc
from .dxf import _dxf_loaders
from .svg_io import svg_to_path
Expand Down

0 comments on commit 44713f9

Please sign in to comment.