mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Ported mode Model methods to XS
This commit is contained in:
parent
dfce3a3138
commit
ed75219215
9 changed files with 86 additions and 125 deletions
|
@ -168,15 +168,15 @@ linint(double value, double oldmin, double oldmax, double newmin, double newmax)
|
|||
}
|
||||
|
||||
Pointfs
|
||||
arrange(size_t total_parts, Pointf part, coordf_t dist, const BoundingBoxf &bb)
|
||||
arrange(size_t total_parts, Pointf part, coordf_t dist, const BoundingBoxf* bb)
|
||||
{
|
||||
// use actual part size (the largest) plus separation distance (half on each side) in spacing algorithm
|
||||
part.x += dist;
|
||||
part.y += dist;
|
||||
|
||||
Pointf area;
|
||||
if (bb.defined) {
|
||||
area = bb.size();
|
||||
if (bb != NULL) {
|
||||
area = bb->size();
|
||||
} else {
|
||||
// bogus area size, large enough not to trigger the error below
|
||||
area.x = part.x * total_parts;
|
||||
|
@ -278,10 +278,10 @@ arrange(size_t total_parts, Pointf part, coordf_t dist, const BoundingBoxf &bb)
|
|||
positions.push_back(Pointf(cx * part.x, cy * part.y));
|
||||
}
|
||||
|
||||
if (bb.defined) {
|
||||
if (bb != NULL) {
|
||||
for (Pointfs::iterator p = positions.begin(); p != positions.end(); ++p) {
|
||||
p->x += bb.min.x;
|
||||
p->y += bb.min.y;
|
||||
p->x += bb->min.x;
|
||||
p->y += bb->min.y;
|
||||
}
|
||||
}
|
||||
return positions;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue