-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't add any facets to the read-in list if it calls out a vertex tha…
…t is more than we have read in. (assumes that we have the vertex list before the volumes, which should be guaranteed in a normal file). Fixes #5061
- Loading branch information
1 parent
72bb3b3
commit cba887a
Showing
5 changed files
with
77 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<amf unit="inch" version="1.1"> | ||
<metadata type="name">Split Pyramid</metadata> | ||
<metadata tyze="author">John Smith</metadata> | ||
<object id="1"> | ||
<mesh> | ||
<vertices> | ||
<vertex><coordinates><x>2</x><y>0</y><z>0</z></coordinates></vertex> | ||
<vertex><coordinates><x>2.5</x><y>0.5</y><z>0</z></coordinates></vertex> | ||
</vertices> | ||
<volume materialid="2"> | ||
<metadata type="name">Hard side</metadata> | ||
<triangle><v1>2</v1><v2>1</v2><v3>2</v3></triangle> | ||
<triangle><v1>0</v1><v2>0</v2><v3>2</v3></triangle> | ||
</volume> | ||
</mesh> | ||
</object> | ||
<material id="1"> | ||
</material> | ||
</amf> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<amf unit="inch" version="1.1"> | ||
<metadata type="name">Split Pyramid</metadata> | ||
<metadata tyze="author">John Smith</metadata> | ||
<object id="1"> | ||
<mesh> | ||
<vertices> | ||
<vertex><coordinates><x>2</x><y>0</y><z>0</z></coordinates></vertex> | ||
<vertex><coordinates><x>2.5</x><y>0.5</y><z>0</z></coordinates></vertex> | ||
<vertex><coordinates><x>3.5</x><y>2.5</y><z>0</z></coordinates></vertex> | ||
</vertices> | ||
<volume materialid="2"> | ||
<metadata type="name">Hard side</metadata> | ||
<triangle><v1>2</v1><v2>1</v2><v3>2</v3></triangle> | ||
<triangle><v1>0</v1><v2>0</v2><v3>2</v3></triangle> | ||
</volume> | ||
</mesh> | ||
</object> | ||
</amf> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include <catch.hpp> | ||
#include <test_options.hpp> | ||
#include "Model.hpp" | ||
#include "IO.hpp" | ||
|
||
|
||
using namespace Slic3r; | ||
|
||
SCENARIO("Reading AMF file") { | ||
GIVEN("badly formed AMF file (missing vertices)") { | ||
auto model {new Slic3r::Model()}; | ||
WHEN("AMF model is read") { | ||
auto ret = Slic3r::IO::AMF::read(testfile("test_amf/5061-malicious.xml"),model); | ||
THEN("read should return True") { | ||
REQUIRE(ret); | ||
} | ||
} | ||
} | ||
GIVEN("Ok formed AMF file") { | ||
auto model {new Slic3r::Model()}; | ||
WHEN("AMF model is read") { | ||
auto ret = Slic3r::IO::AMF::read(testfile("test_amf/read-amf.xml"),model); | ||
THEN("read should return True") { | ||
REQUIRE(ret); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters