#NEWLINE# def __new__( cls , p1 , pt = None , direction_ratio = [ ] , **kwargs ) : #NEWLINE# #INDENT# if isinstance ( p1 , LinearEntity3D ) : #NEWLINE# #INDENT# ( p1 , pt ) = p1 . args #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# p1 = Point3D ( p1 ) #NEWLINE# #UNINDENT# if ( ( pt is not None ) and ( len ( direction_ratio ) == 0 ) ) : #NEWLINE# #INDENT# pt = Point3D ( pt ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( len ( direction_ratio ) == 3 ) and ( pt is None ) ) : #NEWLINE# #INDENT# pt = Point3D ( ( p1 . x + direction_ratio [ 0 ] ) , ( p1 . y + direction_ratio [ 1 ] ) , ( p1 . z + direction_ratio [ 2 ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'A 2nd Point or keyword "direction_ratio" mustbe used.' ) #NEWLINE# #UNINDENT# #UNINDENT# return LinearEntity3D . __new__ ( cls , p1 , pt , ** kwargs )