Page MenuHome

Setting origin to Center of Mass on zero-volume objects produces wrong results now in 2.79
Closed, ResolvedPublic

Description

System Information
Windows 7 x64

Blender Version
Broken: 2.79 RC
Worked: 2.78c

Short description of error
Setting the origin to "Center of Mass" for mesh objects which are not closed and manifold now produces wrong and inconsistent results. Results even change on repetition.

Exact steps for others to reproduce the error

  1. Create a plane
  2. Set 3D cursor to any location but (0, 0, 0)
  3. Set origin of plane to cursor
  4. Set origin of plane to "Center of Mass" (change the type in the operator panel)

As a result the origin won't be set to the actual center of the plane. Repeating the last step will change the result even.

The .blend only requires step 4:

Martin Felke found this bug, thanks to him.

Event Timeline

Aaron Carlisle (Blendify) raised the priority of this task from Needs Triage by Developer to Unbreak Now!.

In 2.79 RC2, it appears that repeating step 4 causes the origin to asymptotically move closer towards the center.

So I really don't like this.
Setting the origin already has too many options, when is "Origin to Geometry" ever actually useful, especially since we have the "Center of Mass" option.
If anything we should remove the "Geometry" option.
This is not a trivial matter as well, in the past I had several users being confused by this.

If the new method is actually better for solid objects (I would like to believe it since it's the same shoelace algorithm working on tetrahedra but haven't seen the evidence for it) then we should make it work instead of adding another option.
IMO a proper fix would be to figure out why it fails and then either fix it or detect the failing cases and use the appropriate algorithm.