Skip to content

Commit a252c2a

Browse files
committed
Import ConstraintKind from occ_imp.solver
1 parent 083e5da commit a252c2a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

cadquery/assembly.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from .occ_impl.geom import Location
1010
from .occ_impl.assembly import Color
1111
from .occ_impl.solver import (
12+
ConstraintKind,
1213
ConstraintSolver,
1314
ConstraintSpec as Constraint,
1415
UnaryConstraintKind,
@@ -26,7 +27,6 @@
2627

2728
# type definitions
2829
AssemblyObjects = Union[Shape, Workplane, None]
29-
ConstraintKinds = Literal["Plane", "Point", "Axis", "PointInPlane"]
3030
ExportLiterals = Literal["STEP", "XML", "GLTF", "VTKJS", "VRML"]
3131

3232
PATH_DELIM = "/"
@@ -278,14 +278,12 @@ def _subloc(self, name: str) -> Tuple[Location, str]:
278278

279279
@overload
280280
def constrain(
281-
self, q1: str, q2: str, kind: ConstraintKinds, param: Any = None
281+
self, q1: str, q2: str, kind: ConstraintKind, param: Any = None
282282
) -> "Assembly":
283283
...
284284

285285
@overload
286-
def constrain(
287-
self, q1: str, kind: ConstraintKinds, param: Any = None
288-
) -> "Assembly":
286+
def constrain(self, q1: str, kind: ConstraintKind, param: Any = None) -> "Assembly":
289287
...
290288

291289
@overload
@@ -295,14 +293,18 @@ def constrain(
295293
s1: Shape,
296294
id2: str,
297295
s2: Shape,
298-
kind: ConstraintKinds,
296+
kind: ConstraintKind,
299297
param: Any = None,
300298
) -> "Assembly":
301299
...
302300

303301
@overload
304302
def constrain(
305-
self, id1: str, s1: Shape, kind: ConstraintKinds, param: Any = None,
303+
self,
304+
id1: str,
305+
s1: Shape,
306+
kind: ConstraintKind,
307+
param: Any = None,
306308
) -> "Assembly":
307309
...
308310

0 commit comments

Comments
 (0)