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

Method transformed

cadquery/cq.py:1283–1310  ·  view source on GitHub ↗

Create a new workplane based on the current one. The origin of the new plane is located at the existing origin+offset vector, where offset is given in coordinates local to the current plane The new plane is rotated through the angles specified by the components of th

(
        self: T, rotate: VectorLike = (0, 0, 0), offset: VectorLike = (0, 0, 0)
    )

Source from the content-addressed store, hash-verified

1281 return self.newObject([s])
1282
1283 def transformed(
1284 self: T, rotate: VectorLike = (0, 0, 0), offset: VectorLike = (0, 0, 0)
1285 ) -> T:
1286 """
1287 Create a new workplane based on the current one.
1288 The origin of the new plane is located at the existing origin+offset vector, where offset is
1289 given in coordinates local to the current plane
1290 The new plane is rotated through the angles specified by the components of the rotation
1291 vector.
1292
1293 :param rotate: 3-tuple of angles to rotate, in degrees relative to work plane coordinates
1294 :param offset: 3-tuple to offset the new plane, in local work plane coordinates
1295 :return: a new work plane, transformed as requested
1296 """
1297
1298 # old api accepted a vector, so we'll check for that.
1299 if isinstance(rotate, Vector):
1300 rotate = rotate.toTuple()
1301
1302 if isinstance(offset, Vector):
1303 offset = offset.toTuple()
1304
1305 p = self.plane.rotated(rotate)
1306 p.origin = self.plane.toWorldCoords(offset)
1307 ns = self.newObject([p.origin])
1308 ns.plane = p
1309
1310 return ns
1311
1312 def newObject(self: T, objlist: Iterable[CQObject]) -> T:
1313 """

Callers 12

testRevolveCutMethod · 0.80
testAngledHolesMethod · 0.80
testCutThroughAllMethod · 0.80
testDoubleTwistedLoftMethod · 0.80
testTwistedLoftMethod · 0.80
testExtrudeUntilFaceMethod · 0.80
testCutBlindUntilFaceMethod · 0.80
test_assembleEdgesMethod · 0.80
test_interpPlateMethod · 0.80
testNthDistanceMethod · 0.80

Calls 4

newObjectMethod · 0.95
rotatedMethod · 0.80
toWorldCoordsMethod · 0.80
toTupleMethod · 0.45

Tested by 10

testRevolveCutMethod · 0.64
testAngledHolesMethod · 0.64
testCutThroughAllMethod · 0.64
testDoubleTwistedLoftMethod · 0.64
testTwistedLoftMethod · 0.64
testExtrudeUntilFaceMethod · 0.64
testCutBlindUntilFaceMethod · 0.64
test_assembleEdgesMethod · 0.64
test_interpPlateMethod · 0.64
testNthDistanceMethod · 0.64