Spaces:
Runtime error
Runtime error
Commit
·
373bf3b
1
Parent(s):
028f0f5
fix: svg padding offset
Browse filesFormer-commit-id: 491d1c0e6282326750e8c7221f79518fb427eca2
- create-3d-icon.py +3 -3
- examples/LogosBlender.png +2 -2
- examples/LogosGithub.png +2 -2
- examples/LogosGithubIcon.png +2 -2
create-3d-icon.py
CHANGED
@@ -93,7 +93,7 @@ def capture(
|
|
93 |
bpy.ops.import_curve.svg(filepath=filepath)
|
94 |
|
95 |
collection = bpy.data.collections[os.path.basename(filepath)]
|
96 |
-
x, y, z = collection_dimensions(collection)
|
97 |
|
98 |
for obj in collection.objects:
|
99 |
obj.select_set(True)
|
@@ -104,7 +104,7 @@ def capture(
|
|
104 |
|
105 |
# move the objects
|
106 |
bpy.ops.transform.translate(
|
107 |
-
value=(0, -0.5 *
|
108 |
|
109 |
# rotate the objects
|
110 |
bpy.ops.transform.rotate(value=math.pi * -0.5 +
|
@@ -169,7 +169,7 @@ def collection_dimensions(collection):
|
|
169 |
|
170 |
x, y, z = max_x - min_x, max_y - min_y, max_z - min_z
|
171 |
|
172 |
-
return x, y, z
|
173 |
|
174 |
|
175 |
def deg_to_rad(deg):
|
|
|
93 |
bpy.ops.import_curve.svg(filepath=filepath)
|
94 |
|
95 |
collection = bpy.data.collections[os.path.basename(filepath)]
|
96 |
+
x, y, z, min_x, min_y, min_z = collection_dimensions(collection)
|
97 |
|
98 |
for obj in collection.objects:
|
99 |
obj.select_set(True)
|
|
|
104 |
|
105 |
# move the objects
|
106 |
bpy.ops.transform.translate(
|
107 |
+
value=(0, factor * (-0.5 * x - min_x), factor * (-0.5 * y - min_y)))
|
108 |
|
109 |
# rotate the objects
|
110 |
bpy.ops.transform.rotate(value=math.pi * -0.5 +
|
|
|
169 |
|
170 |
x, y, z = max_x - min_x, max_y - min_y, max_z - min_z
|
171 |
|
172 |
+
return x, y, z, min_x, min_y, min_z
|
173 |
|
174 |
|
175 |
def deg_to_rad(deg):
|
examples/LogosBlender.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
examples/LogosGithub.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
examples/LogosGithubIcon.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|