Open mankoff opened 8 years ago
Initially we planned to include a "open from web feature" but actually it is not possible in a pure client based solution due to Same-origin_policy; in short a web browser permits scripts contained in a first web page to access data in a second web page, but only if both web pages have the same origin, so it is not possible for a script on www.meshlabjs.net to load a mesh that reside on https://graphics.stanford.edu/data/3Dscanrep/.
There are workarounds, but they are a bit cumbersome: either they require non pure-client solutions or they need that the servers providing the files to open implements certain protocols...
But... could I host the MeshLabJS code on http://example.com/ and the data on http://example.com/ ? In my example above, I assumed the bunny would be hosted on http://meshlabjs.net/
Did you find a solution to load a mesh directly at startup?
No. I think it has this ability, but may not be answered now that this ticket was marked as "closed". I'll re-open a new ticket where I phrase the question better if there is no reply here.
I re-opened the issue given the interest in the topic. Give a look at these commits:
https://github.com/cnr-isti-vclab/meshlabjs/commit/fd9245dbd2f026ef5357dbd55e78294d0d2d6253 https://github.com/cnr-isti-vclab/meshlabjs/commit/7b87ccaab4b0607fd2755275db45dca3b54b207f
Re adding this load-from-web support should be not too complicated. I am willing to add it again if you are able to find some public servers (at least one :) ) that support cross site download of meshes.
Hi. Perhaps a misunderstanding. I'm not trying to do cross-site loading, which seems to be a security issue. I'd just like to have a default mesh, hosted on the same server as MeshLabeJS, loaded when the users accesses the site. The docs are fairly low-level and technical, and I couldn't find an example of how to set up this type of installation, hence this ticket.
Ok, that can be done. We already have a rudimental "run at startup" api that will hopefully expanded. The following url show an example of this api. http://www.meshlabjs.net/?filterName=Create%20Noisy%20Isosurface
Thats very interesting. Is the Noisy Isosurface stored as stl file somewhere or is it generated? How to access it with this API?
Create Noisy Isosurface is a filter
Hello folks,
has there been any solution to this? Meaning could I host the MeshLabJS code on http://example.com/ and an mesh.stl file on http://example.com/ and could this mesh.stl file be loaded on startup of the page? Please let me know if anybody has managed to implement this
Hi all,
Any solutions yet for the startup loading file API ?
Since in the current index.html, the following code allows only to create filter by filterName : Module['onRuntimeInitialized'] = function() { filterName = MLJ.util.getURLParam("filterName"); if(filterName) MLJ.core.plugin.Manager.executeCreateFilter(filterName);*/ };
I tried the following:
Module['onRuntimeInitialized'] = function() {
var filePath= MLJ.util.getURLParam("filePath");
if(filePath)
{
fileName = new File(filePath);
if (fileName instanceof File) {
MLJ.core.file.openMeshFile(fileName);
//MLJ.util.loadFile(fileName);
//MLJ.load(fileName);
}
}
};
Any HELPS ? :)
Thanks,
I'd like to have a web-page where visitors see a mesh when they arrive. It isn't clear if MeshLabeJS supports this. For example, could the Bunny mesh be loaded by default when visiting http://www.meshlabjs.net/ ?
I've skimmed the docs but I don't see mention of this feature mentioned there.