Arch: Turned jreinhardt's fix to webGL into an option

This commit is contained in:
Yorik van Havre
2014-05-02 17:20:17 -03:00
parent 0a44a5b60d
commit 0c4bb217d1
3 changed files with 45 additions and 6 deletions

View File

@@ -38,6 +38,9 @@ else:
def translate(ctxt,txt):
return txt
p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch")
DISCRETIZE = p.GetBool("webGlDiscretizeCurves",False)
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)
@@ -172,7 +175,14 @@ def getObjectData(obj,wireframeMode=wireframeStyle):
for f in obj.Shape.Faces:
for w in f.Wires:
wo = Part.Wire(DraftGeomUtils.sortEdges(w.Edges))
wires.append(wo.discretize(0.1))
if DISCRETIZE:
wires.append(wo.discretize(0.1))
else:
p = []
for v in wo.Vertexes:
p.append(v.Point)
p.append(wo.Vertexes[0].Point)
wires.append(p)
elif obj.isDerivedFrom("Mesh::Feature"):
mesh = obj.Mesh