mikedh / trimesh

Python library for loading and using triangular meshes.
https://trimesh.org
MIT License
3.02k stars 583 forks source link

Fix missing visual copy for primitives #2305

Closed clemense closed 1 month ago

clemense commented 1 month ago

This fixes the following problem:

import trimesh
b = trimesh.primitives.Box()
b.visual.face_colors[:] = [0, 0, 255, 255]

assert b.visual.defined == b.copy().visual.defined

This in turn affects dump and export.

I added include_visual as a parameter just to be consistent with base.py::Trimesh::copy.

mikedh commented 1 month ago

Looks good, thanks for the PR!