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

X3D/VRML Importer/Exporter Improvements #581

Merged
merged 2 commits into from
Sep 24, 2024
Merged

Conversation

elblake
Copy link
Collaborator

@elblake elblake commented May 9, 2024

Made some improvements to x3d_import and wpc_wrl:

  • Normals implemented in importer
  • Crease angle implemented in importer when there are no normals.
  • Added X3D JSON in import/export

NOTE: X3D/VRML Improvements, X3D JSON support.

  * Normals implemented in importer.
  * creaseAngle implemented in importer when there are no normals.
  * Added X3D JSON in import/export

NOTE: X3D/VRML Improvements, X3D JSON support.
Copy link
Owner

@dgud dgud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might already know this but if not, wings throws away the normals eventually,
it only uses the normals to determine if the object inside out or not and to calculate
hard edges.

So you normally don't have to do the extra effort to include them, if you have the hard edges.


rv_coordpairs_from_shapes(SL) ->
CoordPairs = lists:append([rv_coordpairs_from_shapes_1(S) || S <- SL]),
sets:from_list(CoordPairs).
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This old sets is really slow, I don't know how large these sets are, but in wings we have used gb_sets instead,
nowadays: sets:from_list([List], [{version, 2}]) is faster uses erlang:maps instead.

Maybe add you should add:
wings_u:sets_new() and a wings_u:sets_from_list(List), that adds the [{version,2}] clutch, and use them instead.
or maybe wings_util, take a look which fits best.

@dgud dgud self-assigned this May 9, 2024
@elblake
Copy link
Collaborator Author

elblake commented May 9, 2024

It's true I wasn't sure if the normals were used for anything a while back until I found out it was used when the hard edge list is empty.

I'll add wings_u:sets_from_list(List) and update the pull request soon. Thanks for letting me know about the new option.

@dgud
Copy link
Owner

dgud commented May 9, 2024

Double check if you should use wings_u or wings_util I didn't check, was too lazy :-)

@elblake
Copy link
Collaborator Author

elblake commented Sep 23, 2024

I forgot to leave a comment after making the fix. I've chosen wings_util to make the change since it looks like where the data structure and non-GUI stuff goes. Let me know if there's anything I should change.

@dgud
Copy link
Owner

dgud commented Sep 23, 2024

Nah it is me who have been busy with work and vacation, and sadly a lack of interest of coding wings.

Kind of to old to spend my nights hacking wings.

I'll try to take a look soon.

@dgud dgud merged commit 4aa697e into dgud:master Sep 24, 2024
2 checks passed
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.

2 participants