Skip to content

Conversation

@DTCurrie
Copy link
Member

for discussion

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Nov 12, 2025
// calculate the spatial average center of a given point cloud
n := float64(cloud.Size())
mean := r3.Vector{meta.TotalX() / n, meta.TotalY() / n, meta.TotalZ() / n}
mean := r3.Vector{dims.X / 2, dims.Y / 2, dims.Z / 2}
Copy link
Member

@bhaney bhaney Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you shouldn't use dims, as that is an the absolute value of the distance between the max and min. What you are looking for is the point inbetween the max and min, which would be

center := r3.Vector{(meta.MaxX + meta.MinX)/2.0, (meta.MaxY + meta.MinY)/2.0, (meta.MaxZ + meta.MinZ)/2.0}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for example, if MaxX was -2, and MinX was -5,
dim/2 = 1.5 (half of the length of X)
center = -3.5 (the center point between -2 and -5)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just put this up for @micheal-parks to discuss with you, but happy to make that change if we think that's more accurate!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test This pull request is marked safe to test from a trusted zone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants