OV.ImporterThreeSvg = class extends OV.ImporterThreeBase
{
    constructor ()
    {
        super ();
    }

    CanImportExtension (extension)
    {
        return extension === 'svg';
    }

    GetUpDirection ()
    {
        return OV.Direction.Z;
    }

    GetExternalLibraries ()
    {
        return [
            'three_loaders/SVGLoader.js'
        ];
    }

    CreateLoader (manager)
    {
        return new THREE.SVGLoader (manager);
    }

    GetMainObject (loadedObject)
    {
        function ShowFill (path)
        {
            const style = path.userData.style;
            if (style.fill === undefined || style.fill === 'none') {
                return false;
            }
            return true;
        }

        function ShowStroke (path)
        {
            const style = path.userData.style;
            if (style.stroke === undefined || style.stroke === 'none') {
                return false;
            }
            return true;
        }

        let object = new THREE.Object3D ();

        let fillsObject = new THREE.Object3D ();
        let strokesObject = new THREE.Object3D ();

        fillsObject.name = 'Fills';
        strokesObject.name = 'Strokes';

        object.add (fillsObject);
        object.add (strokesObject);

        const material = new THREE.MeshPhongMaterial ({
            color: 0xcc0000
        });
        for (let path of loadedObject.paths) {
            const shapes = THREE.SVGLoader.createShapes (path);
            if (ShowFill (path)) {
                for (const shape of shapes) {
                    const geometry = new THREE.ShapeGeometry (shape);
                    const mesh = new THREE.Mesh (geometry, material);
                    fillsObject.add (mesh);
                }
            }
            if (ShowStroke (path)) {
                for (const subPath of path.subPaths) {
                    const geometry = THREE.SVGLoader.pointsToStroke (subPath.getPoints (), path.userData.style);
                    if (geometry) {
                        const mesh = new THREE.Mesh (geometry, material);
                        strokesObject.add (mesh);
                    }
                }
            }
        }
        return object;
    }
};

@@ -747,185 +747,351 @@
 ion 
-ShowStroke (path)%0A        %7B%0A            const style = path.userData.style;%0A            if (style.stroke === undefined %7C%7C style.stroke === 'none') %7B%0A                return false;
+GetOrCreateMaterial (materials, style, opacity)%0A        %7B%0A            let material = null;%0A            for (let existingMaterial of materials) %7B%0A                if (existingMaterial.style === style && existingMaterial.opacity === opacity) %7B%0A                    material = existingMaterial.material;%0A                    break;%0A                %7D
 %0A   
@@ -1109,36 +1109,48 @@
             
-return true;
+if (material === null) %7B
 %0A        %7D%0A%0A
@@ -1146,27 +1146,24 @@
         
-%7D%0A%0A
         
 let obje
@@ -1158,18 +1158,16 @@
     
-let object
+material
  = n
@@ -1179,366 +1179,530 @@
 REE.
-Object3D ();%0A%0A        let fillsObject = new THREE.Object3D ();%0A        let strokesObject = new THREE.Object3D ();%0A%0A        fillsObject.name = 'Fills';%0A        strokesObject.name = 'Strokes';%0A%0A        object.add (fillsObject);%0A        object.add (strokesObject);%0A%0A        const material = new THREE.MeshPhongMaterial (%7B%0A            color: 0xcc0000%0A        %7D);
+MeshPhongMaterial (%7B%0A                    color: new THREE.Color ().setStyle (style),%0A                    opacity: opacity,%0A                    transparent: opacity %3C 1.0%0A                %7D);%0A                materials.push (%7B%0A                    style : style,%0A                    opacity : opacity,%0A                    material : material%0A                %7D);%0A            %7D%0A            return material;%0A        %7D%0A%0A        let materials = %5B%5D;%0A%0A        let object = new THREE.Object3D ();%0A        object.rotation.x = Math.PI;%0A
 %0A   
@@ -1864,239 +1864,193 @@
     
-for (const shape of shapes) %7B%0A                    const geometry = new THREE.ShapeGeometry (shape);%0A                    const mesh = new THREE.Mesh (geometry, material);%0A                    fillsObject.add (mesh);%0A                %7D
+let pathStyle = path.userData.style;%0A                let pathMaterial = GetOrCreateMaterial (materials, pathStyle.fill, pathStyle.opacity);%0A                for (const shape of shapes) %7B
 %0A   
@@ -2054,34 +2054,32 @@
             
-%7D%0A
         
     if (Show
@@ -2070,204 +2070,139 @@
     
-    if (ShowStroke (path)) %7B%0A                for (const subPath of path.subPaths) %7B%0A                    const geometry = THREE.SVGLoader.pointsToStroke (subPath.getPoints (), path.userData.style);
+const geometry = new THREE.ExtrudeGeometry (shape, %7B%0A                        depth: 10,%0A                        bevelEnabled: false
 %0A   
@@ -2222,28 +2222,12 @@
     
-if (geometry) %7B%0A    
+%7D);%0A
     
@@ -2281,17 +2281,21 @@
 ometry, 
-m
+pathM
 aterial)
@@ -2320,36 +2320,41 @@
     
-    strokesObject.add (mesh)
+mesh.name = path.userData.node.id
 ;%0A  
@@ -2363,33 +2363,50 @@
                 
-%7D
+object.add (mesh);
 %0A               

Use materials in svg importer.