mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-16 19:17:57 +01:00
34 lines
726 B
JavaScript
Executable File
34 lines
726 B
JavaScript
Executable File
/**
|
|
* @author mrdoob / http://mrdoob.com/
|
|
* @author zz85 / http://joshuakoo.com/
|
|
*/
|
|
|
|
THREE.SVGLoader = function ( manager ) {
|
|
|
|
this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
|
|
|
|
};
|
|
|
|
THREE.SVGLoader.prototype = {
|
|
|
|
constructor: THREE.MaterialLoader,
|
|
|
|
load: function ( url, onLoad, onProgress, onError ) {
|
|
|
|
var scope = this;
|
|
|
|
var parser = new DOMParser();
|
|
|
|
var loader = new THREE.XHRLoader( scope.manager );
|
|
loader.setCrossOrigin( this.crossOrigin );
|
|
loader.load( url, function ( svgString ) {
|
|
|
|
var doc = parser.parseFromString( svgString, 'image/svg+xml' ); // application/xml
|
|
|
|
onLoad( doc.firstChild );
|
|
|
|
}, onProgress, onError );
|
|
|
|
}
|
|
};
|