8000 Added options to control rendering precision (#162) · CadQuery/CQ-editor@64d8349 · GitHub
[go: up one dir, main page]

Skip to content

Commit 64d8349

Browse files
Added options to control rendering precision (#162)
1 parent b1cdadd commit 64d8349

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cq_editor/widgets/viewer.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ class OCCViewer(QWidget,ComponentMixin):
3737
{'name': 'Use gradient', 'type': 'bool', 'value': False},
3838
{'name': 'Background color', 'type': 'color', 'value': (95,95,95)},
3939
{'name': 'Background color (aux)', 'type': 'color', 'value': (30,30,30)},
40-
{'name': 'Default object color', 'type': 'color', 'value': "FF0"}])
40+
{'name': 'Default object color', 'type': 'color', 'value': "FF0"},
41+
{'name': 'Deviation', 'type': 'float', 'value': 1e-5, 'dec': True, 'step': 1},
42+
{'name': 'Angular deviation', 'type': 'float', 'value': 0.1, 'dec': True, 'step': 1}])
43+
4144

4245
IMAGE_EXTENSIONS = 'png'
4346

@@ -70,6 +73,10 @@ def updatePreferences(self,*args):
7073
self.canvas.view.SetBgGradientColors(color1,color2,theToUpdate=True)
7174

7275
self.canvas.update()
76+
77+
ctx = self.canvas.context
78+
ctx.SetDeviationCoefficient(self.preferences['Deviation'])
79+
ctx.SetDeviationAngle(self.preferences['Angular deviation'])
7380

7481
def create_actions(self,parent):
7582

0 commit comments

Comments
 (0)
0