Split into showables and others.
(
objs,
)
| 88 | |
| 89 | |
| 90 | def _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 | |
| 126 | def _to_vtk_pts( |