Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code
This commit is contained in:
commit
0eb6acdc1c
File diff suppressed because one or more lines are too long
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>531</width>
|
<width>553</width>
|
||||||
<height>548</height>
|
<height>612</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -358,6 +358,35 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox_4">
|
||||||
|
<property name="title">
|
||||||
|
<string>WebGL export</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_15">
|
||||||
|
<item>
|
||||||
|
<widget class="Gui::PrefCheckBox" name="checkBox_5">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>If this is checked, wires will be discretized, which results in more accurate curves, but heavier files.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Discretize wires</string>
|
||||||
|
</property>
|
||||||
|
<property name="prefEntry" stdset="0">
|
||||||
|
<cstring>webGlDiscretizeCurves</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="prefPath" stdset="0">
|
||||||
|
<cstring>Mod/Arch</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
|
|
@ -38,6 +38,9 @@ else:
|
||||||
def translate(ctxt,txt):
|
def translate(ctxt,txt):
|
||||||
return txt
|
return txt
|
||||||
|
|
||||||
|
p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch")
|
||||||
|
DISCRETIZE = p.GetBool("webGlDiscretizeCurves",False)
|
||||||
|
|
||||||
tab = " " # the tab size
|
tab = " " # the tab size
|
||||||
wireframeStyle = "faceloop" # this can be "faceloop", "multimaterial" or None
|
wireframeStyle = "faceloop" # this can be "faceloop", "multimaterial" or None
|
||||||
cameraPosition = None # set this to a tuple to change, for ex. (0,0,0)
|
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 f in obj.Shape.Faces:
|
||||||
for w in f.Wires:
|
for w in f.Wires:
|
||||||
wo = Part.Wire(DraftGeomUtils.sortEdges(w.Edges))
|
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"):
|
elif obj.isDerivedFrom("Mesh::Feature"):
|
||||||
mesh = obj.Mesh
|
mesh = obj.Mesh
|
||||||
|
|
Loading…
Reference in New Issue
Block a user