mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-28 06:02:00 +08:00
Add two more repair actions and add volume to stats
This commit is contained in:
parent
b709acf10f
commit
00683195c8
@ -88,6 +88,12 @@ TriangleMesh::Repair() {
|
|||||||
|
|
||||||
// normal_values
|
// normal_values
|
||||||
stl_fix_normal_values(&stl);
|
stl_fix_normal_values(&stl);
|
||||||
|
|
||||||
|
// always calculate the volume and reverse all normals if volume is negative
|
||||||
|
stl_calculate_volume(&stl);
|
||||||
|
|
||||||
|
// neighbors
|
||||||
|
stl_verify_neighbors(&stl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -4,7 +4,7 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
use Slic3r::XS;
|
use Slic3r::XS;
|
||||||
use Test::More tests => 4;
|
use Test::More tests => 5;
|
||||||
|
|
||||||
is Slic3r::TriangleMesh::XS::hello_world(), 'Hello world!',
|
is Slic3r::TriangleMesh::XS::hello_world(), 'Hello world!',
|
||||||
'hello world';
|
'hello world';
|
||||||
@ -24,6 +24,7 @@ my $cube = {
|
|||||||
|
|
||||||
my $stats = $m->stats;
|
my $stats = $m->stats;
|
||||||
is $stats->{number_of_facets}, scalar(@{ $cube->{facets} }), 'stats.number_of_facets';
|
is $stats->{number_of_facets}, scalar(@{ $cube->{facets} }), 'stats.number_of_facets';
|
||||||
|
ok abs($stats->{volume} - 20*20*20) < 1E-3, 'stats.volume';
|
||||||
}
|
}
|
||||||
|
|
||||||
__END__
|
__END__
|
||||||
|
@ -21,6 +21,7 @@ TriangleMesh::stats()
|
|||||||
HV* hv = newHV();
|
HV* hv = newHV();
|
||||||
(void)hv_stores( hv, "number_of_facets", newSViv(THIS->stl.stats.number_of_facets) );
|
(void)hv_stores( hv, "number_of_facets", newSViv(THIS->stl.stats.number_of_facets) );
|
||||||
(void)hv_stores( hv, "number_of_parts", newSViv(THIS->stl.stats.number_of_parts) );
|
(void)hv_stores( hv, "number_of_parts", newSViv(THIS->stl.stats.number_of_parts) );
|
||||||
|
(void)hv_stores( hv, "volume", newSVnv(THIS->stl.stats.volume) );
|
||||||
(void)hv_stores( hv, "degenerate_facets", newSViv(THIS->stl.stats.degenerate_facets) );
|
(void)hv_stores( hv, "degenerate_facets", newSViv(THIS->stl.stats.degenerate_facets) );
|
||||||
(void)hv_stores( hv, "edges_fixed", newSViv(THIS->stl.stats.edges_fixed) );
|
(void)hv_stores( hv, "edges_fixed", newSViv(THIS->stl.stats.edges_fixed) );
|
||||||
(void)hv_stores( hv, "facets_removed", newSViv(THIS->stl.stats.facets_removed) );
|
(void)hv_stores( hv, "facets_removed", newSViv(THIS->stl.stats.facets_removed) );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user