Skip to content

Commit ce2e2ea

Browse files
committed
Fix extremum for Polygon
1 parent 3436c02 commit ce2e2ea

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • src/ConstructiveSolidGeometry/SurfacePrimitives

src/ConstructiveSolidGeometry/SurfacePrimitives/Polygon.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ function sample(p::Polygon{N,T}, spacing::T)::Vector{CartesianPoint{T}} where {N
5555
end
5656

5757
function extremum(p::Polygon{N,T})::T where {N,T}
58-
c = sum(p.points)/N
58+
c = cartesian_zero + mean(reinterpret(CartesianVector{T}, p.points))
59+
# c = mean(p.points)
5960
m = maximum([norm(point - c) for point in p.points])
6061
end
6162

0 commit comments

Comments
 (0)