diff --git a/src/Mod/Arch/importWebGL.py b/src/Mod/Arch/importWebGL.py
index c59a6fb44..1079360d5 100644
--- a/src/Mod/Arch/importWebGL.py
+++ b/src/Mod/Arch/importWebGL.py
@@ -32,7 +32,73 @@ else:
FreeCADGui = None
tab = " "
-addWireframe = False
+wireframeStyle = "faceloop" # this can be "faceloop", "multimaterial" or None
+
+
+template = """
+
+
+ FreeCAD model
+
+
+
+
+
+ """
+
if open.__module__ == '__builtin__':
pythonopen = open
@@ -53,10 +119,9 @@ def getHTML(objectsList):
objectsData = ''
for obj in objectsList:
objectsData += getObjectData(obj)
- template = getTemplate()
- template = template.replace("$CameraData",getCameraData())
- template = template.replace("$ObjectsData",objectsData)
- return template
+ t = template.replace("$CameraData",getCameraData())
+ t = t.replace("$ObjectsData",objectsData)
+ return t
def getCameraData():
"returns the position and direction of the camera as three.js snippet"
@@ -75,7 +140,7 @@ def getCameraData():
# print result
return result
-def getObjectData(obj,wireframeMode="faceloop"):
+def getObjectData(obj,wireframeMode=wireframeStyle):
"""returns the geometry data of an object as three.js snippet. wireframeMode
can be multimaterial, faceloop or None"""
@@ -156,73 +221,4 @@ def getObjectData(obj,wireframeMode="faceloop"):
result += tab+"scene.add( mesh );\n"+tab
return result
-
-def getTemplate():
- "returns a html template"
-
- result = """
-
-
- FreeCAD model
-
-
-
-
-
- """
-
- return result