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

Method newObject

cadquery/cq.py:1312–1330  ·  view source on GitHub ↗

Create a new workplane object from this one. Overrides CQ.newObject, and should be used by extensions, plugins, and subclasses to create new objects. :param objlist: new objects to put on the stack :type objlist: a list of CAD primitives :return: a

(self: T, objlist: Iterable[CQObject])

Source from the content-addressed store, hash-verified

1310 return ns
1311
1312 def newObject(self: T, objlist: Iterable[CQObject]) -> T:
1313 """
1314 Create a new workplane object from this one.
1315
1316 Overrides CQ.newObject, and should be used by extensions, plugins, and
1317 subclasses to create new objects.
1318
1319 :param objlist: new objects to put on the stack
1320 :type objlist: a list of CAD primitives
1321 :return: a new Workplane object with the current workplane as a parent.
1322 """
1323
1324 # copy the current state to the new object
1325 ns = self.__class__()
1326 ns.plane = copy(self.plane)
1327 ns.parent = self
1328 ns.objects = list(objlist)
1329 ns.ctx = self.ctx
1330 return ns
1331
1332 def _findFromPoint(self, useLocalCoords: bool = False) -> Vector:
1333 """

Callers 15

splitMethod · 0.95
allMethod · 0.95
firstMethod · 0.95
itemMethod · 0.95
lastMethod · 0.95
_selectObjectsMethod · 0.95
ancestorsMethod · 0.95
siblingsMethod · 0.95
rotateMethod · 0.95
mirrorMethod · 0.95
translateMethod · 0.95
shellMethod · 0.95

Calls

no outgoing calls

Tested by 5

importCompoundMethod · 0.64
testTagSelectorsMethod · 0.64
testUnionCompoundMethod · 0.64
test_invokeMethod · 0.64
box_and_vertexFunction · 0.64