Skip to content

Commit

Permalink
better no light
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmshn-ms committed Jan 22, 2025
1 parent c51ea91 commit 620c07d
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions crystal_toolkit/helpers/asymptote_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,17 @@
}
// Draw a sphere without light
void drawSpheres_nolight(triple[] C, real R, pen p=currentpen){
material nlpen = material(diffusepen=opacity(1.0), emissivepen=p, shininess=0);
for(int i=0;i<C.length;++i){
revolution s_rev = sphere(C[i],R);
surface s_surf = surface(s_rev);
draw(s_surf, nlpen);
draw(s_rev.silhouette(100), black+linewidth(3));
}
void drawSpheres_nolight(triple[] C, real R, pen p=currentpen) {
material nlpen = material(diffusepen=opacity(1.0), emissivepen=p, shininess=0);
for(int i=0; i < C.length; ++i) {
revolution s_rev = sphere(C[i], R);
surface s_surf = surface(s_rev);
draw(s_surf, nlpen);
triple normal = -currentprojection.normal; // viewing direction
triple center = C[i];
path3 outline = Circle(center, R, normal);
draw(outline, black+linewidth(3));
}
}
// Draw a cylinder
Expand Down Expand Up @@ -559,7 +562,6 @@ def asy_write_data(
"""
scene_obj_type = input_scene_comp.type
if ASY_OBJS.get(scene_obj_type) is None:
print(scene_obj_type)
return

asy_obj = ASY_OBJS[scene_obj_type]
Expand Down

0 comments on commit 620c07d

Please sign in to comment.