mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-26 17:44:33 +02:00
correction of centroid
This commit is contained in:
@@ -904,11 +904,11 @@ module test_noncollinear_triple() {
|
||||
}
|
||||
*test_noncollinear_triple();
|
||||
|
||||
|
||||
|
||||
module test_centroid() {
|
||||
$fn = 24;
|
||||
assert_approx(centroid(circle(d=100)), [0,0]);
|
||||
assert_approx(centroid(rect([40,60],rounding=10,anchor=LEFT)), [-20,0]);
|
||||
assert_approx(centroid(rect([40,60],rounding=10,anchor=LEFT)), [-20,0]);
|
||||
assert_approx(centroid(rect([40,60],rounding=10,anchor=FWD)), [0,30]);
|
||||
poly = move([1,2.5,3.1],p=rot([12,49,24], p=path3d(circle(10,$fn=33))));
|
||||
assert_approx(centroid(poly), [1,2.5,3.1]);
|
||||
|
Reference in New Issue
Block a user