Skip to content

Commit

Permalink
Added options to control rendering precision (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-urbanczyk authored Jul 17, 2020
1 parent b1cdadd commit 64d8349
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cq_editor/widgets/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ class OCCViewer(QWidget,ComponentMixin):
{'name': 'Use gradient', 'type': 'bool', 'value': False},
{'name': 'Background color', 'type': 'color', 'value': (95,95,95)},
{'name': 'Background color (aux)', 'type': 'color', 'value': (30,30,30)},
{'name': 'Default object color', 'type': 'color', 'value': "FF0"}])
{'name': 'Default object color', 'type': 'color', 'value': "FF0"},
{'name': 'Deviation', 'type': 'float', 'value': 1e-5, 'dec': True, 'step': 1},
{'name': 'Angular deviation', 'type': 'float', 'value': 0.1, 'dec': True, 'step': 1}])


IMAGE_EXTENSIONS = 'png'

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

self.canvas.update()

ctx = self.canvas.context
ctx.SetDeviationCoefficient(self.preferences['Deviation'])
ctx.SetDeviationAngle(self.preferences['Angular deviation'])

def create_actions(self,parent):

Expand Down

0 comments on commit 64d8349

Please sign in to comment.