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

Method end

cadquery/cq.py:669–693  ·  view source on GitHub ↗

Return the nth parent of this CQ element :param n: number of ancestor to return (default: 1) :rtype: a CQ object :raises: ValueError if there are no more parents in the chain. For example:: CQ(obj).faces("+Z").vertices().end() will ret

(self, n: int = 1)

Source from the content-addressed store, hash-verified

667 return self.newObject([self.objects[-1]])
668
669 def end(self, n: int = 1) -> "Workplane":
670 """
671 Return the nth parent of this CQ element
672
673 :param n: number of ancestor to return (default: 1)
674 :rtype: a CQ object
675 :raises: ValueError if there are no more parents in the chain.
676
677 For example::
678
679 CQ(obj).faces("+Z").vertices().end()
680
681 will return the same as::
682
683 CQ(obj).faces("+Z")
684 """
685
686 rv = self
687 for _ in range(n):
688 if rv.parent:
689 rv = rv.parent
690 else:
691 raise ValueError("Cannot End the chain-- no parents!")
692
693 return rv
694
695 def _findType(self, types, searchStack=True, searchParents=True):
696

Callers 11

testEndMethod · 0.80
test_MergeTagsMethod · 0.80
testEndMethod · 0.80
nested_assyFunction · 0.80
nested_assy_sphereFunction · 0.80
zMFunction · 0.80
aGFunction · 0.80
NGFunction · 0.80
hzFunction · 0.80
gzFunction · 0.80
vtk.jsFile · 0.80

Calls

no outgoing calls

Tested by 5

testEndMethod · 0.64
test_MergeTagsMethod · 0.64
testEndMethod · 0.64
nested_assyFunction · 0.64
nested_assy_sphereFunction · 0.64