More work to avoid working with vertices outside XS

This commit is contained in:
Alessandro Ranellucci 2013-09-11 11:55:08 +02:00
parent 11e18f681d
commit a821eb7f3c
9 changed files with 61 additions and 35 deletions

View file

@ -144,15 +144,13 @@ sub slice {
# process facets
for my $region_id (0 .. $#{$self->meshes}) {
my $mesh = $self->meshes->[$region_id] // next; # ignore undef meshes
$mesh->repair;
{
my $m = Slic3r::TriangleMesh->new;
$m->ReadFromPerl($mesh->vertices, $mesh->facets);
$m->repair;
my $lines = $m->slice([ map $_->slice_z, @{$self->layers} ]);
for my $layer_id (0..$#$lines) {
my $loops = $mesh->slice([ map $_->slice_z, @{$self->layers} ]);
for my $layer_id (0..$#$loops) {
my $layerm = $self->layers->[$layer_id]->regions->[$region_id];
$layerm->make_surfaces($lines->[$layer_id]);
$layerm->make_surfaces($loops->[$layer_id]);
}
# TODO: read slicing_errors
}