From e84b0f7afdcece65d767e2f1377e4836005bab80 Mon Sep 17 00:00:00 2001 From: Jonathan Neuhauser Date: Sun, 16 Jan 2022 17:44:47 +0100 Subject: [PATCH] fix #408 --- polyhedron_3d.py | 2 +- ...hedron_3d__--show__edg__--obj__methane__--cw_wound__True.out | 2 ++ tests/test_polyhedron_3d.py | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 tests/data/refs/polyhedron_3d__--show__edg__--obj__methane__--cw_wound__True.out diff --git a/polyhedron_3d.py b/polyhedron_3d.py index 68298e6c..f7281d65 100755 --- a/polyhedron_3d.py +++ b/polyhedron_3d.py @@ -224,7 +224,7 @@ class WavefrontObj(object): # we need at least 2 vertices to make an edge if len(vtxlist) > 1: # we can have more than one vertex per line - get adjacent pairs - self.edg.append(pairwise(vtxlist)) + self.edg.extend(pairwise(vtxlist, start=False)) def add_f(self, line): """Add face from parsed line""" diff --git a/tests/data/refs/polyhedron_3d__--show__edg__--obj__methane__--cw_wound__True.out b/tests/data/refs/polyhedron_3d__--show__edg__--obj__methane__--cw_wound__True.out new file mode 100644 index 00000000..9bd5bdef --- /dev/null +++ b/tests/data/refs/polyhedron_3d__--show__edg__--obj__methane__--cw_wound__True.out @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/tests/test_polyhedron_3d.py b/tests/test_polyhedron_3d.py index f4f810e1..4c26ace0 100644 --- a/tests/test_polyhedron_3d.py +++ b/tests/test_polyhedron_3d.py @@ -12,6 +12,7 @@ class Poly3DBasicTest(ComparisonMixin, TestCase): ('--show=fce', '--obj=cube', '--r1_ax=z', '--r1_ang=45', '--z_sort=max', '--cw_wound=True'), ('--show=edg', '--obj=oct', '--r1_ax=z', '--r1_ang=45', '--th=4', '--cw_wound=True'), ('--show=vtx', '--obj=methane', '--cw_wound=True'), + ('--show=edg', '--obj=methane', '--cw_wound=True'), ('--show=fce', '--obj=from_file', '--spec_file=great_stel_dodec.obj', '--cw_wound=True'), ] compare_file = 'svg/empty.svg' -- GitLab