1{
2 lib,
3 python,
4 buildPythonPackage,
5 fetchFromGitHub,
6 setuptools,
7 pytestCheckHook,
8 pythonOlder,
9 numpy,
10 lxml,
11 trimesh,
12}:
13
14buildPythonPackage rec {
15 pname = "trimesh";
16 version = "4.6.8";
17 pyproject = true;
18
19 disabled = pythonOlder "3.8";
20
21 src = fetchFromGitHub {
22 owner = "mikedh";
23 repo = "trimesh";
24 tag = version;
25 hash = "sha256-ut5wCEjhC4h299TJufBOmWZHtu24Ve/BsgMaNpRDAPg=";
26 };
27
28 build-system = [ setuptools ];
29
30 dependencies = [ numpy ];
31
32 optional-dependencies = with python.pkgs; {
33 easy =
34 [
35 colorlog
36 manifold3d
37 charset-normalizer
38 lxml
39 jsonschema
40 networkx
41 svg-path
42 pycollada
43 shapely
44 xxhash
45 rtree
46 httpx
47 scipy
48 pillow
49 # vhacdx # not packaged
50 mapbox-earcut
51 ]
52 ++ lib.optionals embreex.meta.available [
53 embreex
54 ];
55 };
56
57 nativeCheckInputs = [
58 lxml
59 pytestCheckHook
60 ];
61
62 disabledTests = [
63 # requires loading models which aren't part of the Pypi tarball
64 "test_load"
65 ];
66
67 pytestFlagsArray = [ "tests/test_minimal.py" ];
68
69 pythonImportsCheck = [
70 "trimesh"
71 "trimesh.ray"
72 "trimesh.path"
73 "trimesh.path.exchange"
74 "trimesh.scene"
75 "trimesh.voxel"
76 "trimesh.visual"
77 "trimesh.viewer"
78 "trimesh.exchange"
79 "trimesh.resources"
80 "trimesh.interfaces"
81 ];
82
83 meta = {
84 description = "Python library for loading and using triangular meshes";
85 homepage = "https://trimesh.org/";
86 changelog = "https://github.com/mikedh/trimesh/releases/tag/${src.tag}";
87 license = lib.licenses.mit;
88 mainProgram = "trimesh";
89 maintainers = with lib.maintainers; [
90 pbsds
91 ];
92 };
93}