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

Method _flatten

cadquery/assembly.py:697–709  ·  view source on GitHub ↗

Generate a dict with all ancestors with keys indicating parent-child relations.

(self, parents=[])

Source from the content-addressed store, hash-verified

695 yield (self.name, self)
696
697 def _flatten(self, parents=[]):
698 """
699 Generate a dict with all ancestors with keys indicating parent-child relations.
700 """
701
702 rv = {}
703
704 for ch in self.children:
705 rv.update(ch._flatten(parents=parents + [self.name]))
706
707 rv[PATH_DELIM.join(parents + [self.name])] = self
708
709 return rv
710
711 def __iter__(
712 self,

Callers 2

addMethod · 0.80
removeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected