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

Method translate

cadquery/cq.py:1168–1181  ·  view source on GitHub ↗

Returns a copy of all of the items on the stack moved by the specified translation vector. :param tupleDistance: distance to move, in global coordinates :type tupleDistance: a 3-tuple of float :returns: a CQ object

(self: T, vec: VectorLike)

Source from the content-addressed store, hash-verified

1166 return newS
1167
1168 def translate(self: T, vec: VectorLike) -> T:
1169 """
1170 Returns a copy of all of the items on the stack moved by the specified translation vector.
1171
1172 :param tupleDistance: distance to move, in global coordinates
1173 :type tupleDistance: a 3-tuple of float
1174 :returns: a CQ object
1175 """
1176 return self.newObject(
1177 [
1178 o.translate(Vector(vec)) if isinstance(o, Shape) else o
1179 for o in self.objects
1180 ]
1181 )
1182
1183 def shell(
1184 self: T, thickness: float, kind: Literal["arc", "intersection"] = "arc"

Callers 15

ellipseArcMethod · 0.45
test_bezier_curveMethod · 0.45
testTranslateMethod · 0.45
testDXFMethod · 0.45
testTranslateSolidMethod · 0.45
testTranslateWireMethod · 0.45
testCombineMethod · 0.45
testUnionNoArgsMethod · 0.45
testEnclosureMethod · 0.45
testUnionCompoundMethod · 0.45

Calls 2

newObjectMethod · 0.95
VectorClass · 0.85

Tested by 11

test_bezier_curveMethod · 0.36
testTranslateMethod · 0.36
testDXFMethod · 0.36
testTranslateSolidMethod · 0.36
testTranslateWireMethod · 0.36
testCombineMethod · 0.36
testUnionNoArgsMethod · 0.36
testEnclosureMethod · 0.36
testUnionCompoundMethod · 0.36