catenate commited on
Commit
53d0143
·
verified ·
1 Parent(s): f322f95

visualize.py: opaque mesh (0.55) + opaque beads + white wireframe + xyz axis labels

Browse files
Files changed (1) hide show
  1. visualize.py +19 -4
visualize.py CHANGED
@@ -532,7 +532,7 @@ def create_3d_visualization(
532
  'vertexArr': vertex_arr,
533
  'faceArr': face_arr,
534
  'color': '#fbbf24', # warm Mercury-style yellow
535
- 'opacity': 0.25,
536
  })
537
  except Exception:
538
  # Mesh shape construction failed (e.g. py3Dmol API mismatch on
@@ -568,12 +568,27 @@ def create_3d_visualization(
568
  'z': float(centre[2])},
569
  'radius': float(bead_radius),
570
  'color': color,
571
- 'opacity': 0.95,
572
  })
573
  shown += 1
574
 
575
- # Unit cell wireframe (light grey so it stays visible on black bg)
576
- view.addUnitCell({'box': {'color': 'rgba(255,255,255,0.45)'}})
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
577
 
578
  # Compute attribution scale so the hover label can de-scale B-factor back to
579
  # the original signed attribution value the user understands.
 
532
  'vertexArr': vertex_arr,
533
  'faceArr': face_arr,
534
  'color': '#fbbf24', # warm Mercury-style yellow
535
+ 'opacity': 0.55,
536
  })
537
  except Exception:
538
  # Mesh shape construction failed (e.g. py3Dmol API mismatch on
 
568
  'z': float(centre[2])},
569
  'radius': float(bead_radius),
570
  'color': color,
571
+ 'opacity': 1.0,
572
  })
573
  shown += 1
574
 
575
+ # Unit cell: white wireframe so the crystal lattice boundary is visible
576
+ # on the black background. The default red/green/blue axis arrows are
577
+ # hidden and replaced with simple x/y/z labels at the axis tips.
578
+ label_style = {'fontColor': 'white', 'fontSize': 14,
579
+ 'showBackground': False}
580
+ view.addUnitCell({
581
+ 'box': {'color': 'rgba(255,255,255,0.7)'},
582
+ 'astyle': {'hidden': True},
583
+ 'bstyle': {'hidden': True},
584
+ 'cstyle': {'hidden': True},
585
+ 'alabel': 'x',
586
+ 'blabel': 'y',
587
+ 'clabel': 'z',
588
+ 'alabelstyle': label_style,
589
+ 'blabelstyle': label_style,
590
+ 'clabelstyle': label_style,
591
+ })
592
 
593
  # Compute attribution scale so the hover label can de-scale B-factor back to
594
  # the original signed attribution value the user understands.