Coverage for trimesh/visual/base.py: 75%

24 statements  

« prev     ^ index     » next       coverage.py v7.14.1, created at 2026-06-24 04:40 +0000

1""" 

2base.py 

3------------- 

4 

5The base class for `Visual` objects 

6""" 

7 

8import abc 

9 

10from ..util import ABC 

11 

12 

13class Visuals(ABC): 

14 """ 

15 Parent of Visual classes. 

16 """ 

17 

18 @property 

19 @abc.abstractmethod 

20 def kind(self): 

21 pass 

22 

23 @abc.abstractmethod 

24 def update_vertices(self, mask): 

25 pass 

26 

27 @abc.abstractmethod 

28 def update_faces(self, mask): 

29 pass 

30 

31 @abc.abstractmethod 

32 def concatenate(self, other): 

33 pass 

34 

35 @abc.abstractmethod 

36 def __hash__(self): 

37 pass 

38 

39 @abc.abstractmethod 

40 def copy(self): 

41 pass 

42 

43 def __add__(self, other): 

44 """ 

45 Concatenate two ColorVisuals objects into a single object. 

46 

47 Parameters 

48 ----------- 

49 other : Visuals 

50 Other visual to concatenate 

51 

52 Returns 

53 ----------- 

54 result : Visuals 

55 Object containing information from current 

56 object and other in the order (self, other) 

57 """ 

58 return self.concatenate(other)