Coverage for trimesh/__init__.py: 79%

19 statements  

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

1""" 

2https://github.com/mikedh/trimesh 

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

4 

5Trimesh is a pure Python (3.10+) library for loading and using triangular 

6meshes with an emphasis on watertight meshes. The goal of the library is to 

7provide a fully featured Trimesh object which allows for easy manipulation 

8and analysis, in the style of the Polygon object in the Shapely library. 

9""" 

10 

11# avoid a circular import in trimesh.base 

12from . import ( 

13 boolean, 

14 bounds, 

15 caching, 

16 collision, 

17 comparison, 

18 convex, 

19 creation, 

20 curvature, 

21 decomposition, 

22 exceptions, 

23 geometry, 

24 graph, 

25 grouping, 

26 inertia, 

27 intersections, 

28 iteration, 

29 nsphere, 

30 permutate, 

31 poses, 

32 primitives, 

33 proximity, 

34 ray, 

35 registration, 

36 remesh, 

37 repair, 

38 sample, 

39 smoothing, 

40 transformations, 

41 triangles, 

42 units, 

43 util, 

44) 

45from .base import Trimesh 

46 

47# general numeric tolerances 

48from .constants import tol 

49 

50# loader functions 

51from .exchange.load import ( 

52 available_formats, 

53 load, 

54 load_mesh, 

55 load_path, 

56 load_remote, 

57 load_scene, 

58) 

59 

60# geometry objects 

61from .parent import Geometry 

62from .points import PointCloud 

63from .scene.scene import Scene 

64from .transformations import transform_points 

65 

66# utility functions 

67from .util import unitize 

68from .version import __version__ 

69 

70try: 

71 # handle vector paths 

72 from . import path 

73except BaseException as E: 

74 # raise a useful error if path hasn't loaded 

75 path = exceptions.ExceptionWrapper(E) 

76 

77 

78try: 

79 from . import voxel 

80except BaseException as E: 

81 # requires non-minimal imports 

82 voxel = exceptions.ExceptionWrapper(E) 

83 

84 

85__all__ = [ 

86 "Geometry", 

87 "PointCloud", 

88 "Scene", 

89 "Trimesh", 

90 "__version__", 

91 "available_formats", 

92 "boolean", 

93 "bounds", 

94 "caching", 

95 "collision", 

96 "comparison", 

97 "convex", 

98 "creation", 

99 "curvature", 

100 "decomposition", 

101 "exceptions", 

102 "geometry", 

103 "graph", 

104 "grouping", 

105 "inertia", 

106 "intersections", 

107 "iteration", 

108 "load", 

109 "load_mesh", 

110 "load_path", 

111 "load_remote", 

112 "load_scene", 

113 "nsphere", 

114 "path", 

115 "permutate", 

116 "poses", 

117 "primitives", 

118 "proximity", 

119 "ray", 

120 "registration", 

121 "remesh", 

122 "repair", 

123 "sample", 

124 "smoothing", 

125 "tol", 

126 "transform_points", 

127 "transformations", 

128 "triangles", 

129 "unitize", 

130 "units", 

131 "util", 

132 "voxel", 

133]