<s> import numpy as np <EOL> from menpo . image import Image <EOL> from menpo . shape import PointCloud , TriMesh , TexturedTriMesh , ColouredTriMesh <EOL> from menpo . testing import is_same_array <EOL> def test_trimesh_copy ( ) : <EOL> points = np . ones ( [ <NUM_LIT:10> , <NUM_LIT:3> ] ) <EOL> trilist = np . ones ( [ <NUM_LIT:10> , <NUM_LIT:3> ] ) <EOL> landmarks = PointCloud ( np . ones ( [ <NUM_LIT:3> , <NUM_LIT:3> ] ) , copy = False ) <EOL> tmesh = TriMesh ( points , trilist = trilist , copy = False ) <EOL> tmesh . landmarks [ '<STR_LIT:test>' ] = landmarks <EOL> tmesh_copy = tmesh . copy ( ) <EOL> assert ( not is_same_array ( tmesh_copy . points , tmesh . points ) ) <EOL> assert ( not is_same_array ( tmesh_copy . trilist , tmesh . trilist ) ) <EOL> assert ( not is_same_array ( tmesh_copy . landmarks [ '<STR_LIT:test>' ] . lms . points , <EOL> tmesh . landmarks [ '<STR_LIT:test>' ] . lms . points ) ) <EOL> def test_colouredtrimesh_copy ( ) : <EOL> points = np . ones ( [ <NUM_LIT:10> , <NUM_LIT:3> ] ) <EOL> colours = np . ones ( [ <NUM_LIT:10> , <NUM_LIT:3> ] ) <EOL> trilist = np . ones ( [ <NUM_LIT:10> , <NUM_LIT:3> ] ) <EOL> landmarks = PointCloud ( np . ones ( [ <NUM_LIT:3> , <NUM_LIT:3> ] ) , copy = False ) <EOL> ctmesh = ColouredTriMesh ( points , trilist = trilist , colours = colours , <EOL> copy = False ) <EOL> ctmesh . landmarks [ '<STR_LIT:test>' ] = landmarks <EOL> ctmesh_copy = ctmesh . copy ( ) <EOL> assert ( not is_same_array ( ctmesh_copy . points , ctmesh . points ) ) <EOL> assert ( not is_same_array ( ctmesh_copy . trilist , ctmesh . trilist ) ) <EOL> assert ( not is_same_array ( ctmesh_copy . colours , ctmesh . colours ) ) <EOL> assert ( not is_same_array ( ctmesh_copy . landmarks [ '<STR_LIT:test>' ] . lms . points , <EOL> ctmesh . landmarks [ '<STR_LIT:test>' ] . lms . points ) ) <EOL> def test_texturedtrimesh_copy ( ) : <EOL> points = np . ones ( [ <NUM_LIT:10> , <NUM_LIT:3> ] ) <EOL> tcoords = np . ones ( [ <NUM_LIT:10> , <NUM_LIT:3> ] ) <EOL> trilist = np . ones ( [ <NUM_LIT:10> , <NUM_LIT:3> ] ) <EOL> landmarks = PointCloud ( np . ones ( [ <NUM_LIT:3> , <NUM_LIT:3> ] ) , copy = False ) <EOL> landmarks_im = PointCloud ( np . ones ( [ <NUM_LIT:3> , <NUM_LIT:2> ] ) , copy = False ) <EOL> pixels = np . ones ( [ <NUM_LIT:10> , <NUM_LIT:10> , <NUM_LIT:1> ] ) <EOL> texture = Image ( pixels , copy = False ) <EOL> texture . landmarks [ '<STR_LIT>' ] = landmarks_im <EOL> ttmesh = TexturedTriMesh ( points , tcoords , texture , trilist = trilist , <EOL> copy = False ) <EOL> ttmesh . landmarks [ '<STR_LIT:test>' ] = landmarks <EOL> ttmesh_copy = ttmesh . copy ( ) <EOL> assert ( not is_same_array ( ttmesh_copy . points , ttmesh . points ) ) <EOL> assert ( not is_same_array ( ttmesh_copy . trilist , ttmesh . trilist ) ) <EOL> assert ( not is_same_array ( ttmesh_copy . tcoords . points , <EOL> ttmesh . tcoords . points ) ) <EOL> assert ( not is_same_array ( ttmesh_copy . texture . pixels , <EOL> ttmesh . texture . pixels ) ) <EOL> assert ( not is_same_array ( <EOL> ttmesh_copy . texture . landmarks [ '<STR_LIT>' ] . lms . points , <EOL> ttmesh . texture . landmarks [ '<STR_LIT>' ] . lms . points ) ) <EOL> assert ( not is_same_array ( ttmesh_copy . landmarks [ '<STR_LIT:test>' ] . lms . points , <EOL> ttmesh . landmarks [ '<STR_LIT:test>' ] . lms . points ) ) </s>
