mikedh / trimesh

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

Warning when instantiating primitive #2200

Closed schlegelp closed 6 months ago

schlegelp commented 6 months ago

Hi. With the most recent trimesh version 4.2.3 I get this:

>>> import trimesh as tm
>>> sphere = tm.primitives.Sphere()
primitive faces are immutable: not setting!

I did only minimal testing but it seems that despite the warning I get the expected primitives.

There was one oddity though which I'm not sure is related to the warning:

>>> sphere1 = tm.primitives.Sphere(radius=1, center=(0, 0, 0), subdivisions=2)
>>> sphere2 = tm.primitives.Sphere(radius=1, center=(5, 0, 0), subdivisions=2)
>>> sphere3 = tm.primitives.Sphere(radius=2, center=(10, 0, 0), subdivisions=2)
>>> sphere4 = tm.primitives.Sphere(radius=2, center=(15, 0, 0), subdivisions=0)
Screenshot 2024-03-31 at 09 54 52

Sphere 1 through 4 are lined up left to right. As you can see sphere4 (red) where we use subdivisions=0 did not change the radius.