Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some formatting inconsistencies #2

Open
tsoj opened this issue Feb 23, 2020 · 0 comments
Open

Some formatting inconsistencies #2

tsoj opened this issue Feb 23, 2020 · 0 comments

Comments

@tsoj
Copy link

tsoj commented Feb 23, 2020

when converting from .obj to .dat vertex data will in some cases be formatted as [float][space][float][space][float]:

return '%s %s %s' % (format_number(x), format_number(y), format_number(z))

But the Dat2ObjTex converter assumes that the vertices are separated by commas:

coordinates = string.split(line, ',') # split line by commas

Also, it assumes that all float values that describe a face are separated by commas:

tokens = string.split(line, ',') # split line by commas

It seems to make more sense to have code like this instead:

# ...
elif (mode == 'FACES'): 
   tokens = string.split(line, '\t')   # split line by tabs
   if (len(tokens) > 3) : 
   	color_data = string.split(tokens[0], ' ')
   	normal_data = string.split(tokens[1], ' ')
   	n_points = tokens[2]
   	point_data = string.split(tokens[3], ' ')
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant