-
-
Notifications
You must be signed in to change notification settings - Fork 138
/
global_data.py
98 lines (81 loc) · 2.09 KB
/
global_data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import sys
from enum import Enum
from mathutils import Vector
registered = False
PYPATH = sys.executable
entities = {}
batches = {}
offscreen = None
redraw_selection_buffer = False
hover = -1
ignore_list = []
selected = []
# Allows to highlight a constraint gizmo,
# Value gets unset in the preselection gizmo
highlight_constraint = None
highlight_entities = []
Z_AXIS = Vector((0, 0, 1))
draw_handle = None
COPY_BUFFER = {}
class WpReq(Enum):
"""Workplane requirement options"""
OPTIONAL, FREE, NOT_FREE = range(3)
solver_state_items = [
(
"OKAY",
"Okay",
"Successfully solved sketch.",
"CHECKMARK",
0, # SLVS_RESULT_OKAY
),
(
"INCONSISTENT",
"Inconsistent",
(
f"Cannot solve sketch because of inconsistent constraints, check through the failed constraints "
f"and remove the ones that contradict each other."
),
"ERROR",
1, # SLVS_RESULT_INCONSISTENT
),
(
"DIDNT_CONVERGE",
"Didnt Converge",
"Cannot solve sketch, system didn't converge.",
"ERROR",
2, # SLVS_RESULT_DIDNT_CONVERGE
),
(
"TOO_MANY_UNKNOWNS",
"Too Many Unknowns",
"Cannot solve sketch because of too many unknowns.",
"ERROR",
3, # SLVS_RESULT_TOO_MANY_UNKNOWNS
),
(
"INIT_ERROR",
"Initialize Error",
"Solver failed to initialize.",
"ERROR",
4, # SLVS_RESULT_INIT_ERROR
),
(
"REDUNDANT_OK",
"Redundant Constraints",
(
f"Some constraints seem to be redundant, this might cause an error once the constraints are no longer consistent. "
f"Check through the marked constraints and only keep what's necessary."
),
"INFO",
5, # SLVS_RESULT_REDUNDANT_OK
),
(
"UNKNOWN_FAILURE",
"Unknown Failure",
"Cannot solve sketch because of unknown failure.",
"ERROR",
6,
),
]
# Name of the asset library used for CAD Sketcher assets
LIB_NAME = "CAD Sketcher Assets"