Please help me,
I want to delete the sphere that is inside the cylinder. How can I do this?
This is my code.
import solids;
size(10cm,0);
currentprojection=perspective(camera=(5,-4,2));
viewportmargin=(.5cm,.5cm);
path3[] p=reverse(scale3(2)*unitcircle3)^^shift(.9999,0,0)*unitcircle3;
triple f(pair p){
real x=1+cos(p.x);
real y=sin(p.x);
real z=p.y*sqrt(4.0001-x^2-y^2);
return (x,y,z);
}
draw(surface(p,planar=true),lightcyan+opacity(0.6));
draw(surface(f,(0,0),(2pi+.0001,1),100,Spline),lightcyan+opacity(0.8));
triple fs(pair u){
real phi=u.x, theta=u.y;
real x=cos(theta)cos(phi);
real y=cos(theta)sin(phi);
real z=sin(theta);
return 2*(x,y,z);
}
surface s=surface(fs,(0,0),(pi+0.0001,pi),nu=8,nv=100,usplinetype=Spline);
draw(s,lightcyan+opacity(0.5),meshpen=nullpen);
real x(real t) {return 1+cos(t);}
real y(real t) {return sin(t);}
real z(real t) {return sqrt(4.0001-(1+cos(t))^2-(sin(t))^2);}
path3 pf=graph(x,y,z,0,2*pi,operator ..);
draw(pf,red);
