From 30ef37715f3b083435b3ea0418541b4e68886c04 Mon Sep 17 00:00:00 2001 From: Johannes Reinhardt Date: Tue, 29 Apr 2014 17:34:20 +0200 Subject: [PATCH] added webGL export option for faceloop linewidth --- src/Mod/Arch/importWebGL.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mod/Arch/importWebGL.py b/src/Mod/Arch/importWebGL.py index fece7c52c..ffb71a34b 100644 --- a/src/Mod/Arch/importWebGL.py +++ b/src/Mod/Arch/importWebGL.py @@ -25,7 +25,8 @@ options: importWebGL.wireframeStyle = "faceloop" (can also be "multimaterial" or None) importWebGL.template = a complete html file, where $CameraData is a placeholder for the -FreeCAD camera, and $ObjectsData a placeholder for the FreeCAD objects.""" +FreeCAD camera, and $ObjectsData a placeholder for the FreeCAD objects. +importWebGL.linewidth = an integer, specifyig the width of lines in "faceloop" mode""" import FreeCAD,Draft,Part,DraftGeomUtils @@ -40,6 +41,7 @@ else: tab = " " # the tab size wireframeStyle = "faceloop" # this can be "faceloop", "multimaterial" or None cameraPosition = None # set this to a tuple to change, for ex. (0,0,0) +linewidth = 1 template = """ @@ -205,7 +207,7 @@ def getObjectData(obj,wireframeMode=wireframeStyle): # adding the mesh to the scene with a wireframe copy result += tab+"var mesh = new THREE.Mesh( geom, basematerial );\n" result += tab+"scene.add( mesh );\n" - result += tab+"var linematerial = new THREE.LineBasicMaterial({color: 0x000000,});\n" + result += tab+"var linematerial = new THREE.LineBasicMaterial({linewidth: %d, color: 0x000000,});\n" % linewidth for w in wires: result += tab+"var wire = new THREE.Geometry();\n" for p in w: