mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-01 13:12:38 -06:00
Parse and write multi-material AMF files. Convert multiple STL files into a single multi-material AMF
This commit is contained in:
parent
aa98a9deb2
commit
b6bffacb9d
5 changed files with 97 additions and 33 deletions
|
|
@ -126,7 +126,7 @@ sub _read_ascii {
|
|||
|
||||
my $facet;
|
||||
seek $fh, 0, 0;
|
||||
while (<$fh>) {
|
||||
while (my $_ = <$fh>) {
|
||||
s/\R+$//;
|
||||
if (!$facet) {
|
||||
/^\s*facet\s+normal\s+$point_re/ or next;
|
||||
|
|
@ -153,7 +153,7 @@ sub _read_binary {
|
|||
|
||||
binmode $fh;
|
||||
seek $fh, 80 + 4, 0;
|
||||
while (read $fh, $_, 4*4*3+2) {
|
||||
while (read $fh, my $_, 4*4*3+2) {
|
||||
my @v = unpack '(f<3)4';
|
||||
push @$facets, [ [@v[0..2]], [@v[3..5]], [@v[6..8]], [@v[9..11]] ];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue