<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , division , print_function , unicode_literals <EOL> import numpy as np <EOL> from . vector import * <EOL> def create ( x = <NUM_LIT:0.> , y = <NUM_LIT:0.> , z = <NUM_LIT:0.> , dtype = None ) : <EOL> if isinstance ( x , ( list , np . ndarray ) ) : <EOL> raise ValueError ( '<STR_LIT>' ) <EOL> return np . array ( [ x , y , z ] , dtype = dtype ) <EOL> def create_unit_length_x ( dtype = None ) : <EOL> return np . array ( [ <NUM_LIT:1.0> , <NUM_LIT:0.0> , <NUM_LIT:0.0> ] , dtype = dtype ) <EOL> def create_unit_length_y ( dtype = None ) : <EOL> return np . array ( [ <NUM_LIT:0.0> , <NUM_LIT:1.0> , <NUM_LIT:0.0> ] , dtype = dtype ) <EOL> def create_unit_length_z ( dtype = None ) : <EOL> return np . array ( [ <NUM_LIT:0.0> , <NUM_LIT:0.0> , <NUM_LIT:1.0> ] , dtype = dtype ) <EOL> @ parameters_as_numpy_arrays ( '<STR_LIT>' ) <EOL> def create_from_vector4 ( vector , dtype = None ) : <EOL> """<STR_LIT>""" <EOL> dtype = dtype or vector . dtype <EOL> return ( np . array ( [ vector [ <NUM_LIT:0> ] , vector [ <NUM_LIT:1> ] , vector [ <NUM_LIT:2> ] ] , dtype = dtype ) , vector [ <NUM_LIT:3> ] ) <EOL> @ parameters_as_numpy_arrays ( '<STR_LIT>' ) <EOL> def create_from_matrix44_translation ( mat , dtype = None ) : <EOL> return np . array ( mat [ <NUM_LIT:3> , : <NUM_LIT:3> ] , dtype = dtype ) <EOL> def cross ( v1 , v2 ) : <EOL> """<STR_LIT>""" <EOL> return np . cross ( v1 , v2 ) <EOL> def generate_normals ( v1 , v2 , v3 , normalise_result = True ) : <EOL> """<STR_LIT>""" <EOL> a = v1 - v2 <EOL> b = v3 - v2 <EOL> n = cross ( b , a ) <EOL> if normalise_result : <EOL> normalise ( n ) <EOL> return n <EOL> class index : <EOL> x = <NUM_LIT:0> <EOL> y = <NUM_LIT:1> <EOL> z = <NUM_LIT:2> <EOL> class unit : <EOL> x = create_unit_length_x ( ) <EOL> y = create_unit_length_y ( ) <EOL> z = create_unit_length_z ( ) </s>
