hrgdavor / jscadui

MIT License
30 stars 7 forks source link

3mf doesn't export from jscad.app properly (exports as string "[ArrayBuffer]") #107

Closed seveibar closed 2 months ago

seveibar commented 2 months ago

This video demonstrates the bug:

https://github.com/hrgdavor/jscadui/assets/1910070/15bc647c-e8a3-4c43-97c9-282a170b9bd9

z3dev commented 2 months ago

@hrgdavor 3MF export is available in V3. Not sure that you can use it but it might help.

hrgdavor commented 2 months ago

@z3dev it is actually using the 3mf serializer form jscad, not the one from jscadui. Problem is not in serializer, but my code that saves the file did not account for situation when serializer returns an array. new Blob() calls toString for things it knows not how to handle. and in this case it got ArrayBuffer wrapped in an array

Blob contructor uses array of items, but new Blob([[ArrayBuffer]]) gives result from video. I just needed to flatten the array, so blob constructor is called: new Blob([ArrayBuffer])

fix is already on the main, and it will be shortly published to jscad.app

hrgdavor commented 2 months ago

@seveibar it is ficed and published on https://jscad.app ... check it and pls close the ticket if ok

seveibar commented 2 months ago

confirmed 🥂