mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-20 23:31:13 -06:00
Some initial work for porting slice()
This commit is contained in:
parent
8607c559c7
commit
346c17d483
6 changed files with 126 additions and 1 deletions
|
@ -92,6 +92,28 @@ TriangleMesh::size()
|
|||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
SV*
|
||||
TriangleMesh::slice(z)
|
||||
std::vector<double>* z
|
||||
CODE:
|
||||
std::vector<Polygons>* layers = THIS->slice(*z);
|
||||
|
||||
AV* layers_av = newAV();
|
||||
av_extend(layers_av, layers->size()-1);
|
||||
for (unsigned int i = 0; i < layers->size(); i++) {
|
||||
AV* polygons_av = newAV();
|
||||
av_extend(polygons_av, (*layers)[i].size()-1);
|
||||
unsigned int j = 0;
|
||||
for (Polygons::iterator it = (*layers)[i].begin(); it != (*layers)[i].end(); ++it) {
|
||||
av_store(polygons_av, j++, (*it).to_SV_clone_ref());
|
||||
}
|
||||
av_store(layers_av, i, newRV_noinc((SV*)polygons_av));
|
||||
}
|
||||
delete layers;
|
||||
RETVAL = (SV*)newRV_noinc((SV*)layers_av);
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
%}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
%typemap{bool}{simple};
|
||||
%typemap{std::string};
|
||||
%typemap{std::vector<unsigned int>*};
|
||||
%typemap{std::vector<double>*};
|
||||
%typemap{SV*};
|
||||
%typemap{AV*};
|
||||
%typemap{Point*};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue