Skip to content

Commit 46b6aaf

Browse files
authored
Merge pull request #2070 from mikedh/release/fixes
fix export user expansion and default unitize_normals
2 parents e31d3fb + 7c0c536 commit 46b6aaf

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ requires = ["setuptools >= 61.0", "wheel"]
55
[project]
66
name = "trimesh"
77
requires-python = ">=3.7"
8-
version = "4.0.3"
8+
version = "4.0.4"
99
authors = [{name = "Michael Dawson-Haggerty", email = "mikedh@kerfed.com"}]
1010
license = {file = "LICENSE.md"}
1111
description = "Import, export, process, analyze and view triangular meshes."

tests/test_boolean.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ def test_multiple(self):
7070
"""
7171
Make sure boolean operations work on multiple meshes.
7272
"""
73-
for _engine, exists in engines:
73+
for engine, exists in engines:
7474
if not exists:
7575
continue
7676
a = g.trimesh.primitives.Sphere(center=[0, 0, 0])
7777
b = g.trimesh.primitives.Sphere(center=[0, 0, 0.75])
7878
c = g.trimesh.primitives.Sphere(center=[0, 0, 1.5])
7979

80-
r = g.trimesh.boolean.union([a, b, c])
80+
r = g.trimesh.boolean.union([a, b, c], engine=engine)
8181

8282
assert r.is_volume
8383
assert r.body_count == 1

trimesh/exchange/export.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def export_scene(scene, file_obj, file_type=None, resolver=None, **kwargs):
308308
return util.write_encoded(file_obj, data)
309309
elif util.is_string(file_obj):
310310
# assume strings are file paths
311-
file_path = os.path.expanduser(os.path.abspath(file_obj))
311+
file_path = os.path.abspath(os.path.expanduser(file_obj))
312312
with open(file_path, "wb") as f:
313313
util.write_encoded(f, data)
314314

trimesh/exchange/gltf.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def export_gltf(
6666
scene,
6767
include_normals=None,
6868
merge_buffers=False,
69-
unitize_normals=False,
69+
unitize_normals=True,
7070
tree_postprocessor=None,
7171
embed_buffers=False,
7272
extension_webp=False,
@@ -85,6 +85,9 @@ def export_gltf(
8585
Include vertex normals
8686
merge_buffers : bool
8787
Merge buffers into one blob.
88+
unitize_normals
89+
GLTF requires unit normals, however sometimes people
90+
want to include non-unit normals for shading reasons.
8891
resolver : trimesh.resolvers.Resolver
8992
If passed will use to write each file.
9093
tree_postprocesser : None or callable
@@ -160,7 +163,7 @@ def export_gltf(
160163
def export_glb(
161164
scene,
162165
include_normals=None,
163-
unitize_normals=False,
166+
unitize_normals=True,
164167
tree_postprocessor=None,
165168
buffer_postprocessor=None,
166169
extension_webp=False,

0 commit comments

Comments
 (0)