MCPcopy
hub / github.com/CadQuery/cadquery / constrain

Method constrain

cadquery/sketch.py:975–984  ·  view source on GitHub ↗

Add a constraint.

(self: T, tag: str, constraint: ConstraintKind, arg: Any)

Source from the content-addressed store, hash-verified

973 # constraints
974 @multimethod
975 def constrain(self: T, tag: str, constraint: ConstraintKind, arg: Any) -> T:
976 """
977 Add a constraint.
978 """
979
980 self._constraints.append(
981 Constraint((tag,), (self._tags[tag][0],), constraint, arg)
982 )
983
984 return self
985
986 @constrain.register
987 def constrain(

Callers 15

test_constraint_solverFunction · 0.45
test_constrainFunction · 0.45
test_constrain_with_tagsFunction · 0.45
test_expression_grammarFunction · 0.45
test_PointInPlane_paramFunction · 0.45
test_unary_constraintsFunction · 0.45
test_fixed_rotationFunction · 0.45

Calls 2

ConstraintClass · 0.85
appendMethod · 0.80

Tested by 15

test_constraint_solverFunction · 0.36
test_constrainFunction · 0.36
test_constrain_with_tagsFunction · 0.36
test_expression_grammarFunction · 0.36
test_PointInPlane_paramFunction · 0.36
test_unary_constraintsFunction · 0.36
test_fixed_rotationFunction · 0.36