Spaces:
Runtime error
Runtime error
Commit
·
e6081dc
1
Parent(s):
ea3fcd6
feat: support short options
Browse filesFormer-commit-id: 199dc517c93b227c55dbbe7553835ac05587072e
- create-3d-icon.py +20 -14
create-3d-icon.py
CHANGED
|
@@ -6,31 +6,37 @@ import argparse
|
|
| 6 |
|
| 7 |
parser = argparse.ArgumentParser()
|
| 8 |
parser.add_argument("filepath", help="path to svg file")
|
| 9 |
-
parser.add_argument("
|
| 10 |
type=float, default=0)
|
| 11 |
-
parser.add_argument("
|
| 12 |
type=float, default=0)
|
| 13 |
-
parser.add_argument("
|
| 14 |
type=float, default=0)
|
|
|
|
|
|
|
| 15 |
parser.add_argument(
|
| 16 |
-
"
|
| 17 |
-
parser.add_argument(
|
| 18 |
"--distance", help="distance of the camera", type=float, default=1)
|
| 19 |
parser.add_argument(
|
|
|
|
| 20 |
"--light-x", help="x position of the light", type=float, default=0)
|
| 21 |
parser.add_argument(
|
|
|
|
| 22 |
"--light-y", help="y position of the light", type=float, default=0)
|
| 23 |
parser.add_argument(
|
|
|
|
| 24 |
"--light-z", help="z position of the light", type=float, default=0)
|
| 25 |
parser.add_argument(
|
|
|
|
| 26 |
"--light-strength", help="strength of the light", type=float, default=1)
|
| 27 |
-
parser.add_argument("
|
| 28 |
type=float, default=-1)
|
| 29 |
-
parser.add_argument("
|
| 30 |
type=float, default=-1)
|
| 31 |
-
parser.add_argument("
|
| 32 |
type=float, default=-1)
|
| 33 |
parser.add_argument(
|
|
|
|
| 34 |
"--size", help="size of the image", type=int, default=2048)
|
| 35 |
parser.add_argument(
|
| 36 |
"--bevel", help="bevel depth of the icon", type=float, default=1
|
|
@@ -42,18 +48,18 @@ def main():
|
|
| 42 |
args = parser.parse_args()
|
| 43 |
|
| 44 |
filepath = args.filepath
|
| 45 |
-
rotate_x = args.
|
| 46 |
-
rotate_y = args.
|
| 47 |
-
rotate_z = args.
|
| 48 |
thickness = args.thickness
|
| 49 |
distance = args.distance
|
| 50 |
light_x = args.light_x
|
| 51 |
light_y = args.light_y
|
| 52 |
light_z = args.light_z
|
| 53 |
light_strength = args.light_strength
|
| 54 |
-
color_r = args.
|
| 55 |
-
color_g = args.
|
| 56 |
-
color_b = args.
|
| 57 |
size = args.size
|
| 58 |
bevel = args.bevel
|
| 59 |
|
|
|
|
| 6 |
|
| 7 |
parser = argparse.ArgumentParser()
|
| 8 |
parser.add_argument("filepath", help="path to svg file")
|
| 9 |
+
parser.add_argument("-rx", "--rotate-x", help="rotate x axis",
|
| 10 |
type=float, default=0)
|
| 11 |
+
parser.add_argument("-ry", "--rotate-y", help="rotate y axis",
|
| 12 |
type=float, default=0)
|
| 13 |
+
parser.add_argument("-rz", "--rotate-z", help="rotate z axis",
|
| 14 |
type=float, default=0)
|
| 15 |
+
parser.add_argument("-th",
|
| 16 |
+
"--thickness", help="thickness of the icon", type=float, default=1)
|
| 17 |
parser.add_argument(
|
| 18 |
+
"-d",
|
|
|
|
| 19 |
"--distance", help="distance of the camera", type=float, default=1)
|
| 20 |
parser.add_argument(
|
| 21 |
+
"-lx",
|
| 22 |
"--light-x", help="x position of the light", type=float, default=0)
|
| 23 |
parser.add_argument(
|
| 24 |
+
"-ly",
|
| 25 |
"--light-y", help="y position of the light", type=float, default=0)
|
| 26 |
parser.add_argument(
|
| 27 |
+
"-lz",
|
| 28 |
"--light-z", help="z position of the light", type=float, default=0)
|
| 29 |
parser.add_argument(
|
| 30 |
+
"-ls",
|
| 31 |
"--light-strength", help="strength of the light", type=float, default=1)
|
| 32 |
+
parser.add_argument("-r", "--red", help="red color",
|
| 33 |
type=float, default=-1)
|
| 34 |
+
parser.add_argument("-g", "--green", help="green color",
|
| 35 |
type=float, default=-1)
|
| 36 |
+
parser.add_argument("-b", "--blue", help="blue color",
|
| 37 |
type=float, default=-1)
|
| 38 |
parser.add_argument(
|
| 39 |
+
"-s",
|
| 40 |
"--size", help="size of the image", type=int, default=2048)
|
| 41 |
parser.add_argument(
|
| 42 |
"--bevel", help="bevel depth of the icon", type=float, default=1
|
|
|
|
| 48 |
args = parser.parse_args()
|
| 49 |
|
| 50 |
filepath = args.filepath
|
| 51 |
+
rotate_x = args.rotate_x
|
| 52 |
+
rotate_y = args.rotate_y
|
| 53 |
+
rotate_z = args.rotate_z
|
| 54 |
thickness = args.thickness
|
| 55 |
distance = args.distance
|
| 56 |
light_x = args.light_x
|
| 57 |
light_y = args.light_y
|
| 58 |
light_z = args.light_z
|
| 59 |
light_strength = args.light_strength
|
| 60 |
+
color_r = args.red
|
| 61 |
+
color_g = args.green
|
| 62 |
+
color_b = args.blue
|
| 63 |
size = args.size
|
| 64 |
bevel = args.bevel
|
| 65 |
|