JacobLinCool commited on
Commit
373bf3b
·
1 Parent(s): 028f0f5

fix: svg padding offset

Browse files

Former-commit-id: 491d1c0e6282326750e8c7221f79518fb427eca2

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 * (factor * x), -0.5 * (factor * y)))
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

  • SHA256: d956de0c9300fede9c0ca83a1a43dfe2bb463b6f053e8e7c7ddd969305277d0b
  • Pointer size: 132 Bytes
  • Size of remote file: 2.12 MB

Git LFS Details

  • SHA256: d0643e817b547077b85499ffa5e2edd6a9bee9943f4fcdaa45aa57982bfb410b
  • Pointer size: 132 Bytes
  • Size of remote file: 2.12 MB
examples/LogosGithub.png CHANGED

Git LFS Details

  • SHA256: 5b74cac168010a4454c7f4561756f17c1a234524f217ff0720c84f46e9954fd6
  • Pointer size: 132 Bytes
  • Size of remote file: 2.12 MB

Git LFS Details

  • SHA256: 6cf5817de946f45f4200557c36aeec2b880e0575da124046c513e8c731267b1a
  • Pointer size: 132 Bytes
  • Size of remote file: 2.12 MB
examples/LogosGithubIcon.png CHANGED

Git LFS Details

  • SHA256: e7523c2673820ac351b70a0ba47e5e023bd35d5a42996f06cfa1b3eda49e0400
  • Pointer size: 132 Bytes
  • Size of remote file: 2.12 MB

Git LFS Details

  • SHA256: 47478cb224168a4375e5210ae566b685b66b708ee3ad5d62a2c8327c5c367d61
  • Pointer size: 132 Bytes
  • Size of remote file: 2.12 MB