-cutter wasn't rotated at all with naxis there seems to be a 'delay' in rotation right now...

-fix a bit ballnose vs ball cutters, was creating them a bit wrong and didn't show them in the UI correctly
pull/4/head
vilda.novak@gmail.com 2015-03-03 11:20:39 +00:00
rodzic cbdf7410fa
commit 89dbb58839
3 zmienionych plików z 17 dodań i 4 usunięć

Wyświetl plik

@ -242,8 +242,9 @@ class camOperation(bpy.types.PropertyGroup):
cutter_type = EnumProperty(name='Cutter',
items=(
('END', 'End', 'end - flat cutter'),
('BALL', 'Ball', 'ball cutter'),
('BALLNOSE', 'Ballnose', 'ballnose cutter'),
('VCARVE', 'V-carve', 'v carve cutter'),
('BALL', 'Sphere', 'Sphere cutter'),
('CUSTOM', 'Custom-EXPERIMENTAL', 'modelled cutter - not well tested yet.')),
description='Type of cutter used',
default='END', update = updateZbufferImage)

Wyświetl plik

@ -23,7 +23,7 @@ def getCutterBullet(o):
cutter=bpy.context.active_object
cutter.rigid_body.collision_shape = 'CYLINDER'
elif type=='BALL' or type=='BALLNOSE':
if o.strategy!='PROJECTED_CURVE' and type=='BALLNOSE':#only ball, good for 3 axis and real ball cutters
if o.strategy!='PROJECTED_CURVE' or type=='BALL':#only sphere, good for 3 axis and real ball cutters for undercuts and projected curve
bpy.ops.mesh.primitive_ico_sphere_add(subdivisions=2, size=BULLET_SCALE*o.cutter_diameter/2, view_align=False, enter_editmode=False, location=(-100,-100, -100), rotation=(0, 0, 0))
bpy.ops.rigidbody.object_add(type='ACTIVE')
@ -141,7 +141,10 @@ def getSampleBulletNAxis(cutter, startpoint,endpoint,rotation, cutter_compensati
'''fully 3d collision test for NAxis milling'''
cutterVec=Vector((0,0,1))*cutter_compensation#cutter compensation vector - cutter physics object has center in the middle, while cam needs the tip position.
cutterVec.rotate(Euler(rotation))
#cutterVec = startpoint-endpoint
#cutterVec.normalize()
#cutterVec*=cutter_compensation
#cutterVec=Vector((0,0,0))
start=(startpoint*BULLET_SCALE+cutterVec).to_tuple()
end=((endpoint)*BULLET_SCALE+cutterVec).to_tuple()
#cutter.rotation_euler=rotation

Wyświetl plik

@ -572,11 +572,20 @@ def sampleChunksNAxis(o,pathSamples,layers):
sweepvect.normalize()
####sampling
if rotation!=lastrotation:
cutter.rotation_euler=rotation
#cutter.rotation_euler.x=-cutter.rotation_euler.x
#print(rotation)
if o.cutter_type=='VCARVE':# Bullet cone is always pointing Up Z in the object
cutter.rotation_euler.x+=pi
cutter.update_tag()
#bpy.context.scene.frame_set(-1)
#bpy.context.scene.update()
#bpy.context.scene.frame_set(1)
bpy.context.scene.frame_set(2)#this has to be :( it resets the rigidbody world. No other way to update it probably now :(
bpy.context.scene.frame_set(0)
#bpy.context.scene.update()
#update scene here?
#print(startp,endp)