mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-05 15:00:42 +08:00
Add static method to create scaled Polygons from Pointf arrays.
This commit is contained in:
parent
2b91524619
commit
4860d63b01
@ -293,4 +293,15 @@ Polygon::convex_points(double angle) const
|
||||
return convex;
|
||||
}
|
||||
|
||||
Polygon Polygon::new_scale(const Pointfs& p) {
|
||||
Points scaled_p;
|
||||
for (auto i : p) {
|
||||
// scale each individual point and append to a new array
|
||||
scaled_p.push_back(scale_(i.x), scale_(i.y));
|
||||
}
|
||||
return Slic3r::Polygon(scaled_p);
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -48,6 +48,8 @@ class Polygon : public MultiPoint {
|
||||
std::string wkt() const;
|
||||
Points concave_points(double angle = PI) const;
|
||||
Points convex_points(double angle = PI) const;
|
||||
|
||||
static Polygon new_scale(const Pointfs& p);
|
||||
};
|
||||
|
||||
inline Polygons
|
||||
|
Loading…
x
Reference in New Issue
Block a user