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

LDrawLoader: Improve parts library ergonomics, improve normal smoothing functionality #22249

Merged
merged 4 commits into from
Aug 3, 2021

Conversation

gkjohnson
Copy link
Collaborator

@gkjohnson gkjohnson commented Aug 2, 2021

Related issue: --

Description

  • Change the loader so meshes only receive a single material instead of an array if only one material is present.
  • Add "setPartsLibraryPath" function (see here)
  • Add async "preloadMaterials" function so color files can be preloaded and color codes seeded before loading a model. Without preloading color codes most "unpacked" models don't seem to load.
  • Improve the normal smoothing to handle cases where common edges were not getting normals merged by using a "reference"-like structure with the normals wrapped in an object.

Here are the types of normal issues that have been fixed:

BEFORE AFTER
image image
image image
image image

cc @yomboprime

In the next PR I'll be working to parallelize the downloads when using the parts library to improve load times.

@mrdoob mrdoob added this to the r132 milestone Aug 2, 2021
@yomboprime
Copy link
Collaborator

yomboprime commented Aug 2, 2021

Just an insignificant topic: in the function parseColourMetaDirective, the first comment says the function returns null on error. But it never returns such a value (errors are reported through throw)

@gkjohnson
Copy link
Collaborator Author

the first comment says the function returns null on error. But it never returns such a value (errors are reported through throw)

Thanks! I think that's okay but I'll update that comment in the upcoming PR, then.

@mrdoob
Copy link
Owner

mrdoob commented Aug 3, 2021

Thanks!

@gkjohnson gkjohnson deleted the ldraw-fix-normal-smoothing branch August 3, 2021 14:39
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

Successfully merging this pull request may close these issues.

3 participants