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

Function _split_showables

cadquery/vis.py:90–123  ·  view source on GitHub ↗

Split into showables and others.

(
    objs,
)

Source from the content-addressed store, hash-verified

88
89
90def _split_showables(
91 objs,
92) -> Tuple[List[ShapeLike], List[Vector], List[Location], List[vtkProp3D]]:
93 """
94 Split into showables and others.
95 """
96
97 rv_s: List[ShapeLike] = []
98 rv_v: List[Vector] = []
99 rv_l: List[Location] = []
100 rv_a: List[vtkProp3D] = []
101
102 for el in objs:
103 if instance_of(el, ShapeLike):
104 rv_s.append(el)
105 elif isinstance(el, Curve):
106 rv_s.append(el.edge())
107 elif isinstance(el, Surface):
108 rv_s.append(el.face())
109 elif isinstance(el, Vector):
110 rv_v.append(el)
111 elif isinstance(el, Location):
112 rv_l.append(el)
113 elif isinstance(el, vtkProp3D):
114 rv_a.append(el)
115 elif isinstance(el, list):
116 tmp1, tmp2, tmp3, tmp4 = _split_showables(el) # split recursively
117
118 rv_s.extend(tmp1)
119 rv_v.extend(tmp2)
120 rv_l.extend(tmp3)
121 rv_a.extend(tmp4)
122
123 return rv_s, rv_v, rv_l, rv_a
124
125
126def _to_vtk_pts(

Callers 3

styleFunction · 0.85
showFunction · 0.85
showMethod · 0.85

Calls 5

instance_ofFunction · 0.85
appendMethod · 0.80
extendMethod · 0.80
edgeMethod · 0.45
faceMethod · 0.45

Tested by

no test coverage detected