1
0
mirror of https://github.com/nophead/Mendel90.git synced 2025-09-03 10:02:51 +02:00

Renders of some parts rotated to make identification easier.

fixing_block, rear_fixing_block, atx_short_bracket and z_bar_clamp.
This commit is contained in:
Chris Palmer
2016-01-02 11:21:27 +00:00
parent d53af327c8
commit 831c2362b0
66 changed files with 13 additions and 0 deletions

View File

@@ -1,10 +1,20 @@
import bpy
import sys
import os
import math
global ob
global cam_target
mat = 'abs'
rotations = {
"fixing_block.stl" : 180,
"rear_fixing_block.stl" : 180,
"atx_short_bracket.stl" : -90,
"z_bar_clamp.stl" : 180
}
def load_stl(file_path):
global cam_target,ob
# load
@@ -24,6 +34,9 @@ def load_stl(file_path):
# place
z_dim = ob.dimensions[2]
print(z_dim)
filename = file_path.split(os.sep)[-1]
if filename in rotations:
bpy.ops.transform.rotate(value = rotations[filename] * math.pi / 180.0, axis = (False, False, True))
bpy.ops.transform.translate(value=(0,0,z_dim/2.0))
cam_target = (0,0,z_dim/3.0)
# assign material