mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 16:29:40 +00:00
parent
f54be54379
commit
097c18b804
1 changed files with 2 additions and 0 deletions
|
@ -1854,6 +1854,8 @@ function centroid(poly) =
|
|||
let(segment=select(poly,i,i+1))
|
||||
det2(segment)*sum(segment)
|
||||
]) / 6 / polygon_area(poly,signed=true)
|
||||
// polygon_area(concat([[0,0]],segment),signed=true)*sum(segment)
|
||||
// ]) / 3 / polygon_area(poly,signed=true)
|
||||
: let( plane = plane_from_points(poly, fast=true) )
|
||||
assert( !is_undef(plane), "The polygon must be planar." )
|
||||
let(
|
||||
|
|
Loading…
Reference in a new issue