bimspot / xeokit-react

Integratation of the xeokit viewer into a React application.
32 stars 22 forks source link

Refactored src to create viewers with factory function pattern. #7

Closed barnabasmolnar closed 5 years ago

barnabasmolnar commented 5 years ago

Core viewer logic is now completely reusable with all kinds of model formats.

According to the xeokit-sdk documentation:

Source formats (so far) include glTF, OBJ, STL, 3DXML and BIMServer. Regardless of where models were loaded from, xeokit exposes their objects via an abstract interface through which we can access them uniformly.

Similarly, we only need one abstract & uniform interface. The src/Viewer.js file contains all the core features and business logic.

Supporting different formats is as easy as importing the appropriate loader plugin in the src/Viewers.js file and passing it to the makeViewer function.

eriadam commented 5 years ago

This looks great, thank you!