Comment out code that builds @vertices_facets data structure.
Saves memory and speeds up reading large models.
This commit is contained in:
parent
fb96cdec76
commit
2e1649e6b5
1 changed files with 4 additions and 2 deletions
|
@ -47,11 +47,11 @@ sub read_file {
|
||||||
my $point_id = join ',', @{$facets->[$f][$_]};
|
my $point_id = join ',', @{$facets->[$f][$_]};
|
||||||
if (exists $vertices_map{$point_id}) {
|
if (exists $vertices_map{$point_id}) {
|
||||||
$facets->[$f][$_] = $vertices_map{$point_id};
|
$facets->[$f][$_] = $vertices_map{$point_id};
|
||||||
push @{$vertices_facets[$facets->[$f][$_]]}, $f;
|
### push @{$vertices_facets[$facets->[$f][$_]]}, $f;
|
||||||
} else {
|
} else {
|
||||||
push @$vertices, $facets->[$f][$_];
|
push @$vertices, $facets->[$f][$_];
|
||||||
$facets->[$f][$_] = $vertices_map{$point_id} = $#$vertices;
|
$facets->[$f][$_] = $vertices_map{$point_id} = $#$vertices;
|
||||||
$vertices_facets[$#$vertices] = [$f];
|
### $vertices_facets[$#$vertices] = [$f];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,6 +62,8 @@ sub read_file {
|
||||||
# point in space. It enforces topological correctness which is needed by
|
# point in space. It enforces topological correctness which is needed by
|
||||||
# the slicing algorithm.
|
# the slicing algorithm.
|
||||||
# I'm keeping it disabled until I find a good test case.
|
# I'm keeping it disabled until I find a good test case.
|
||||||
|
# The two lines above commented out with '###' need to be
|
||||||
|
# uncommented for this to work.
|
||||||
if (0) {
|
if (0) {
|
||||||
my $vertices_count = $#$vertices; # store it to avoid processing newly created vertices
|
my $vertices_count = $#$vertices; # store it to avoid processing newly created vertices
|
||||||
for (my $v = 0; $v <= $vertices_count; $v++) {
|
for (my $v = 0; $v <= $vertices_count; $v++) {
|
||||||
|
|
Loading…
Reference in a new issue