Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading