-
Notifications
You must be signed in to change notification settings - Fork 69
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
Implement an API #47
Comments
Reference Issue: #26 (There's at least another - but I cannot find it right now.) |
First step is to refactor so any UI calls are decoupled from the actual work of importing or exporting. Then start writing unit tests of each method, using optional dependency injection in the constructor to make the tests run instantly and without user interaction. For example, instead of calling UI.foo inside our code, we'd inject at constructor time a ui_module param, then all internal calls do through @ui_module.foo. If nothing is passed in, it defaults to the usual UI bit. Then you can write your own UI module inside your unit test where UI.messagebox does something predictable. As for the design of the import/export API itself, I'd need to think about it. Is import always done directly into the model? Should it create and return a new group? Lots of ways... |
Would it be possible to extend Model.export to understand .stl inherently? That might be the best export API. |
Wouldn't that need done on the C++ side? On second thought, could it be done using Ruby by aliasing the export method? |
The way I wrote it is if there is already >0 entities in the model, then a new group is used so as not to interfere. If not, then geometry is added to the model. I think I based it on how the dxf importer worked. |
Yeah, that is how dwgs import. On Wed, Nov 21, 2012 at 4:50 PM, Jim Foltz [email protected] wrote:
|
I think I'd prefer if the Ruby API was modified on the SketchUp side of things so that Model.export would query registered sets of Exporters if they can handle the filetype. (Provided we get an Exporter class, similar to Importer.) |
Discussions around other issues show that we need an API to the importer and exporter. An API will have multiple purposes:
Any thoughts on the design?
The text was updated successfully, but these errors were encountered: