Skip to content

Commit

Permalink
Merge branch 'master' of github.com:pygae/clifford
Browse files Browse the repository at this point in the history
  • Loading branch information
hugohadfield committed Nov 22, 2018
2 parents 9f61260 + 5000d49 commit 94b1fac
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions clifford/tools/g3c/GAOnline.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def save_to_file(self, filename):
print(self, file=fobj)


def draw_objects_ganja(objects, color=int('AA000000', 16)):
def draw_objects_ganja(objects, color=int('AA000000', 16), print_scene=True):
"""
Takes a list of multivectors or a .ga file name and draws the multivectors
By default attempts to interpret the type of object unless a mv_type is specified
Expand All @@ -244,18 +244,20 @@ def draw_objects_ganja(objects, color=int('AA000000', 16)):
mv_list = [layout.MultiVector(value=data_array[i, :]) for i in range(data_array.shape[0])]
sc = GanjaScene()
sc.add_objects(mv_list, color=color)
print(sc)
if print_scene:
print(sc)
return sc
elif isinstance(objects, list) or isinstance(objects, MVArray):
sc = GanjaScene()
sc.add_objects(objects, color=color)
print(sc)
if print_scene:
print(sc)
return sc
else:
raise ValueError('The input is not a string or a list of objects')


def draw_objects(objects, mv_type='interp', color='rgb(0,0,0)'):
def draw_objects(objects, mv_type='interp', color='rgb(0,0,0)', print_scene=True):
"""
Takes a list of multivectors or a .ga file name and draws the multivectors
By default attempts to interpret the type of object unless a mv_type is specified
Expand All @@ -265,12 +267,14 @@ def draw_objects(objects, mv_type='interp', color='rgb(0,0,0)'):
mv_list = [layout.MultiVector(value=data_array[i,:]) for i in range(data_array.shape[0])]
sc = GAScene()
sc.add_object_array(mv_list, mv_type, color=color)
print(sc)
if print_scene:
print(sc)
return sc
elif isinstance(objects, list) or isinstance(objects, MVArray):
sc = GAScene()
sc.add_object_array(objects, mv_type, color=color)
print(sc)
if print_scene:
print(sc)
return sc
else:
raise ValueError('The input is not a string or a list of objects')
Expand Down

0 comments on commit 94b1fac

Please sign in to comment.