Open CHONGE opened 11 months ago
HttpDataAccessHelper.fetchBinary( ${__BASE_PATH__}/data/StanfordOil.vtkjs, {} ).then((zipContent) => { const dataAccessHelper = DataAccessHelper.get('zip', { zipContent, callback: (zip) => { // 读取自己数据 // writerReader.parseAsArrayBuffer(zip); // maps.byteLength = maps.buffer.byteLength; const sceneImporter = vtkHttpSceneLoader.newInstance({ renderer, dataAccessHelper, });
${__BASE_PATH__}/data/StanfordOil.vtkjs
sceneImporter.setUrl('index.json'); sceneImporter.onReady(() => { console.log(sceneImporter.getScene()); sceneImporter.getScene()[0].actor.setVisibility(false); const source = sceneImporter.getScene()[0].source; cutter.setInputConnection(source.getOutputPort()); cubeMapper.setInputConnection(source.getOutputPort()); renderer.resetCamera(); updatePlaneFunction(); }); const blob = new Blob([zipContent],{type:'application/octet-steam' }); const a = window.document.createElement('a'); a.href = window.URL.createObjectURL(blob, { type: 'application/octet-steam', }); a.download = 'test.stl'; a.text = 'Download'; a.style.position = 'absolute'; a.style.left = '50%'; a.style.bottom = '10px'; document.body.appendChild(a); a.style.background = 'white'; a.style.padding = '5px'; },
}); });
The exported stl file format is incorrect,Ask for help, thanks
hello, this is not the correct way to export to STL format, you need to use STLWriter
Feature Request
HttpDataAccessHelper.fetchBinary(
${__BASE_PATH__}/data/StanfordOil.vtkjs
, {} ).then((zipContent) => { const dataAccessHelper = DataAccessHelper.get('zip', { zipContent, callback: (zip) => { // 读取自己数据 // writerReader.parseAsArrayBuffer(zip); // maps.byteLength = maps.buffer.byteLength; const sceneImporter = vtkHttpSceneLoader.newInstance({ renderer, dataAccessHelper, });}); });
Motivation and Detailed Description
The exported stl file format is incorrect,Ask for help, thanks