mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-18 02:36:02 +08:00
Improve performance of rotating 3D objects a bit.
This commit is contained in:
parent
fd5751f0fb
commit
fd98542ce9
@ -216,8 +216,8 @@ def DrawSTL(mesh):
|
|||||||
glVertex3f(v3[0], v3[1], v3[2])
|
glVertex3f(v3[0], v3[1], v3[2])
|
||||||
glNormal3f(-mesh.normal[i/3][0], -mesh.normal[i/3][1], -mesh.normal[i/3][2])
|
glNormal3f(-mesh.normal[i/3][0], -mesh.normal[i/3][1], -mesh.normal[i/3][2])
|
||||||
glVertex3f(v1[0], v1[1], v1[2])
|
glVertex3f(v1[0], v1[1], v1[2])
|
||||||
glVertex3f(v2[0], v2[1], v2[2])
|
|
||||||
glVertex3f(v3[0], v3[1], v3[2])
|
glVertex3f(v3[0], v3[1], v3[2])
|
||||||
|
glVertex3f(v2[0], v2[1], v2[2])
|
||||||
glEnd()
|
glEnd()
|
||||||
|
|
||||||
def DrawGCodeLayer(layer):
|
def DrawGCodeLayer(layer):
|
||||||
|
@ -1081,6 +1081,8 @@ class preferencesDialog(configBase.configWindowBase):
|
|||||||
validators.validFloat(c, 0.1)
|
validators.validFloat(c, 0.1)
|
||||||
c = configBase.SettingRow(left, 'Head size - Y towards end (mm)', 'extruder_head_size_max_y', '0', 'Size of your printer head in the Y direction.', type = 'preference')
|
c = configBase.SettingRow(left, 'Head size - Y towards end (mm)', 'extruder_head_size_max_y', '0', 'Size of your printer head in the Y direction.', type = 'preference')
|
||||||
validators.validFloat(c, 0.1)
|
validators.validFloat(c, 0.1)
|
||||||
|
c = configBase.SettingRow(left, 'Head gantry height (mm)', 'extruder_head_size_height', '0', 'The tallest object height that will always fit under your printers gantry system when the printer head is at the lowest Z position.', type = 'preference')
|
||||||
|
validators.validFloat(c)
|
||||||
|
|
||||||
self.okButton = wx.Button(left, -1, 'Ok')
|
self.okButton = wx.Button(left, -1, 'Ok')
|
||||||
left.GetSizer().Add(self.okButton, (left.GetSizer().GetRows(), 1))
|
left.GetSizer().Add(self.okButton, (left.GetSizer().GetRows(), 1))
|
||||||
|
@ -56,17 +56,12 @@ class mesh(object):
|
|||||||
mat10 = math.sin(rotate) * scaleX
|
mat10 = math.sin(rotate) * scaleX
|
||||||
mat11 = math.cos(rotate) * scaleY
|
mat11 = math.cos(rotate) * scaleY
|
||||||
|
|
||||||
for i in xrange(0, len(self.origonalVertexes)):
|
mat = numpy.array([[mat00,mat10,0],[mat01,mat11,0],[0,0,scaleZ]])
|
||||||
x = self.origonalVertexes[i][0]
|
if swapXZ:
|
||||||
y = self.origonalVertexes[i][1]
|
mat = numpy.array([mat[2],mat[1],mat[0]])
|
||||||
z = self.origonalVertexes[i][2]
|
if swapYZ:
|
||||||
if swapXZ:
|
mat = numpy.array([mat[0],mat[2],mat[1]])
|
||||||
x, z = z, x
|
self.vertexes = (numpy.matrix(self.origonalVertexes, copy = False) * numpy.matrix(mat)).getA()
|
||||||
if swapYZ:
|
|
||||||
y, z = z, y
|
|
||||||
self.vertexes[i][0] = x * mat00 + y * mat01
|
|
||||||
self.vertexes[i][1] = x * mat10 + y * mat11
|
|
||||||
self.vertexes[i][2] = z * scaleZ
|
|
||||||
|
|
||||||
for i in xrange(0, len(self.origonalVertexes), 3):
|
for i in xrange(0, len(self.origonalVertexes), 3):
|
||||||
v1 = self.vertexes[i]
|
v1 = self.vertexes[i]
|
||||||
|
@ -177,6 +177,7 @@ preferencesDefaultSettings = {
|
|||||||
'extruder_head_size_min_y': '18.0',
|
'extruder_head_size_min_y': '18.0',
|
||||||
'extruder_head_size_max_x': '18.0',
|
'extruder_head_size_max_x': '18.0',
|
||||||
'extruder_head_size_max_y': '35.0',
|
'extruder_head_size_max_y': '35.0',
|
||||||
|
'extruder_head_size_height': '80.0',
|
||||||
}
|
}
|
||||||
|
|
||||||
#########################################################
|
#########################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user