def toolLoaded(self): """The user loaded a tool. """ tdef = self.tdefWidget.toolDef sprof = tdef.shankProfile() cprof = tdef.cutterProfile() mesh = RevolvedMesh(cprof) mesh.addProfile(sprof, (0.5, 0.5, 0.5, 1.0)) self.meshview.setMesh(mesh) self.meshview.fitMesh()
def toolModified(self): """The user changed a dimension on the current tool. """ tdef = self.tdefWidget.toolDef sprof = tdef.shankProfile() cprof = tdef.cutterProfile() mesh = RevolvedMesh(cprof) mesh.addProfile(sprof, (0.5, 0.5, 0.5, 1.0)) self.meshview.setMesh(mesh) self.meshview.fitMesh()
def keyPressEvent(self, e): # DEBUG: from math import sin, cos, radians if e.key() == qt.Key_Space: mesh = RevolvedMesh() p = Path2d([0, 0]) p.lineTo(1, .5) p.lineTo(1, .75) p.lineTo(0, 2) # p.arcTo(1, 1, 0, 1, 'cclw') # p.arcTo(2, 2, 2, 1, 'clw') # p.arcTo(3, 3, 2, 3, 'cclw') # p.lineTo(2, 3.5) # p.lineTo(1.5, 3.5) # p.arcTo(1.0, 3., 1.5, 3, 'cclw') mesh.addProfile(p.elements(), close=False) self.meshview.setMesh(mesh) self.meshview.fitMesh()