Changeset 31a02f1 in sasmodels


Ignore:
Timestamp:
Jan 24, 2018 4:16:14 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
0d5a655
Parents:
1258e32
Message:

draw one face of parallelepiped in different colour on jitter visualization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • explore/jitter.py

    r8cfb486 r31a02f1  
    124124def draw_parallelepiped(ax, size, view, jitter, steps=None, alpha=1): 
    125125    """Draw a parallelepiped.""" 
    126     a,b,c = size 
     126    a, b, c = size 
    127127    x = a*np.array([ 1,-1, 1,-1, 1,-1, 1,-1]) 
    128128    y = b*np.array([ 1, 1,-1,-1, 1, 1,-1,-1]) 
     
    141141    x, y, z = transform_xyz(view, jitter, x, y, z) 
    142142    ax.plot_trisurf(x, y, triangles=tri, Z=z, color='w', alpha=alpha) 
     143 
     144    # Draw pink face on box. 
     145    # Since I can't control face color, instead draw a thin box situated just 
     146    # in front of the "a+" face. 
     147    if 1: 
     148        x = a*np.array([ 1,-1, 1,-1, 1,-1, 1,-1]) 
     149        y = b*np.array([ 1, 1,-1,-1, 1, 1,-1,-1]) 
     150        z = c*np.array([ 1, 1, 1, 1,-1,-1,-1,-1]) 
     151        x, y, z = transform_xyz(view, jitter, abs(x)*1.05, y, z) 
     152        ax.plot_trisurf(x, y, triangles=tri, Z=z, color=[1,0.6,0.6], alpha=alpha) 
    143153 
    144154    draw_labels(ax, view, jitter, [ 
Note: See TracChangeset for help on using the changeset viewer.