File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
tests/compas/datastructures Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,23 @@ def triangleboundarychain():
8181# constructors
8282# --------------------------------------------------------------------------
8383
84+ def test_constructor ():
85+ mesh = Mesh ()
86+ a = mesh .add_vertex ()
87+ b = mesh .add_vertex (x = 1.0 )
88+ c = mesh .add_vertex (x = 1.0 , y = 1.0 )
89+ d = mesh .add_vertex (y = 1.0 )
90+ mesh .add_face ([a , b , c , d ])
91+ assert mesh .vertex_coordinates (a ) == [0.0 , 0.0 , 0.0 ]
92+ assert mesh .vertex_coordinates (b ) == [1.0 , 0.0 , 0.0 ]
93+ assert mesh .vertex_coordinates (c ) == [1.0 , 1.0 , 0.0 ]
94+ assert mesh .vertex_coordinates (d ) == [0.0 , 1.0 , 0.0 ]
95+ assert mesh .vertex_coordinates (a ) == mesh .vertex_attributes (a , 'xyz' )
96+ assert mesh .vertex_coordinates (b ) == mesh .vertex_attributes (b , 'xyz' )
97+ assert mesh .vertex_coordinates (c ) == mesh .vertex_attributes (c , 'xyz' )
98+ assert mesh .vertex_coordinates (d ) == mesh .vertex_attributes (d , 'xyz' )
99+
100+
84101def test_from_obj ():
85102 mesh = Mesh .from_obj (compas .get ('faces.obj' ))
86103 assert mesh .number_of_faces () == 25
You can’t perform that action at this time.
0 commit comments