mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-21 07:41:09 -06:00
Merge branch 'master' into xsdata
Conflicts: xs/xsp/ExPolygon.xsp
This commit is contained in:
commit
21816acbd7
4 changed files with 12 additions and 9 deletions
|
@ -21,21 +21,20 @@ class ExPolygon
|
|||
SV* arrayref();
|
||||
};
|
||||
|
||||
Polygon*
|
||||
perl2polygon(SV* poly_sv)
|
||||
void
|
||||
perl2polygon(SV* poly_sv, Polygon& poly)
|
||||
{
|
||||
AV* poly_av = (AV*)SvRV(poly_sv);
|
||||
const unsigned int num_points = av_len(poly_av)+1;
|
||||
Polygon* retval = new Polygon(num_points);
|
||||
poly.resize(num_points);
|
||||
|
||||
for (unsigned int i = 0; i < num_points; i++) {
|
||||
SV** point_sv = av_fetch(poly_av, i, 0);
|
||||
AV* point_av = (AV*)SvRV(*point_sv);
|
||||
Point& p = (*retval)[i];
|
||||
Point& p = poly[i];
|
||||
p.x = (unsigned long)SvIV(*av_fetch(point_av, 0, 0));
|
||||
p.y = (unsigned long)SvIV(*av_fetch(point_av, 1, 0));
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
SV*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue