CAD-Mesh3D
view release on metacpan or search on metacpan
t/STL-outputStl.t view on Meta::CPAN
# compare the expected values for the ascii tests
sub test_ascii {
my($ascii_string, $expect_aref, $test_name) = @_;
$test_name = "test_ascii::${test_name}";
note "\n", $test_name;
$ascii_string =~ s/\h+/ /gm; # normalize horizontal whitespace
$ascii_string =~ s/^\s+//gm; # trim leading whitespace on any line
$ascii_string =~ s/\s+$//gm; # trim trailing whitespace on any line
#note "-----\n", $ascii_string, "\n=====\n";
$ascii_string =~ m/^solid *(?<name>\V*?)$(?<content>.*)^endsolid *\g{name}*$/ms;
my $name = $+{name};
#note "\t", name => "\t", $name;
my $content = $+{content};
#note "\t", content => "\t", $content;
ok $content, "${test_name}: solid/endsolid has content";
my @facets = $content =~ m/^facet *(.*?)\R+^endfacet$/gms;
my $n = scalar @facets;
is $n, 4, "${test_name}: has 4 facets";
my @vectors;
foreach my $facet ( @facets ) {
( run in 0.732 second using v1.01-cache-2.11-cpan-87723dcf8b7 )